*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #ECF0F4;
  --bg-dk:   #D8E2EA;
  --rnb:     #5BB8E8;
  --rnb-dk:  #2A8FC0;
  --ink:     #0F1C28;
  --mid:     #2A4255;
  --soft:    #4A6E85;
  --sh-l:    rgba(255, 255, 255, 0.88);
  --sh-d:    rgba(160, 185, 205, 0.9);
  --red:     #C94040;
  --green:   #2E7D32;
  --r:       12px;
  --r-pill:  100px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* ─────────────────────────────────────────
   LOGIN
───────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: var(--bg);
  box-shadow: 10px 10px 28px var(--sh-d), -10px -10px 28px var(--sh-l);
  border-radius: 20px;
  padding: 48px 40px;
  width: 360px;
  text-align: center;
}

.login-logo {
  background: var(--rnb);
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  display: inline-block;
  margin-bottom: 24px;
}

.login-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.login-sub {
  font-size: 13px;
  color: var(--soft);
  margin-bottom: 32px;
  font-weight: 300;
}

.login-input {
  width: 100%;
  padding: 13px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  background: var(--bg-dk);
  box-shadow: inset 4px 4px 10px var(--sh-d), inset -4px -4px 10px var(--sh-l);
  border: none;
  border-radius: var(--r);
  outline: none;
  color: var(--ink);
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 3px;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--rnb);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  box-shadow: 4px 4px 12px rgba(91, 184, 232, 0.4), -2px -2px 8px rgba(255, 255, 255, 0.6);
}

.login-btn:hover { background: var(--rnb-dk); }

.login-error {
  font-size: 13px;
  color: var(--red);
  margin-top: 12px;
  min-height: 20px;
}

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
#admin-screen { display: none; }

header {
  background: var(--bg);
  box-shadow: 0 4px 16px var(--sh-d);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.h-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.h-pill {
  background: var(--rnb);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--r-pill);
}

.h-name {
  font-size: 13px;
  color: var(--soft);
  font-weight: 300;
}

.h-logout {
  font-size: 13px;
  color: var(--soft);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
}

.h-logout:hover {
  color: var(--ink);
  background: var(--bg-dk);
}

/* ─────────────────────────────────────────
   TABS
───────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 20px 40px 0;
  border-bottom: 1px solid rgba(140, 165, 185, 0.2);
  margin-bottom: 0;
}

.tab {
  font-size: 13px;
  font-weight: 400;
  color: var(--soft);
  padding: 10px 20px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  background: var(--bg-dk);
  border: none;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.2s;
}

.tab.active {
  background: var(--bg);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 3px 3px 8px var(--sh-d), -3px -3px 8px var(--sh-l);
}

.tab:hover:not(.active) { color: var(--ink); }

/* ─────────────────────────────────────────
   MAIN & TAB CONTENT
───────────────────────────────────────── */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 40px 60px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─────────────────────────────────────────
   PANELS
───────────────────────────────────────── */
.panel {
  background: var(--bg);
  box-shadow: 7px 7px 18px var(--sh-d), -7px -7px 18px var(--sh-l);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}

.panel-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--soft);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ─────────────────────────────────────────
   FORMS
───────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 6px;
  font-weight: 400;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: var(--bg-dk);
  box-shadow: inset 3px 3px 8px var(--sh-d), inset -3px -3px 8px var(--sh-l);
  border: none;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
}

.field textarea { resize: vertical; }

.field input:focus,
.field textarea:focus {
  box-shadow: inset 3px 3px 8px var(--sh-d), inset -3px -3px 8px var(--sh-l),
    0 0 0 2px rgba(91, 184, 232, 0.3);
}

.field-full { grid-column: 1 / -1; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.checkbox-row input[type=checkbox] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--rnb);
}

.checkbox-row label {
  font-size: 13px;
  color: var(--mid);
  cursor: pointer;
}

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn {
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.15s;
}

.btn-blue {
  background: var(--rnb);
  color: white;
  box-shadow: 3px 3px 10px rgba(91, 184, 232, 0.4);
}
.btn-blue:hover { background: var(--rnb-dk); }

.btn-red {
  background: var(--bg);
  color: var(--red);
  box-shadow: 3px 3px 8px var(--sh-d), -3px -3px 8px var(--sh-l);
}
.btn-red:hover { box-shadow: inset 3px 3px 8px var(--sh-d), inset -3px -3px 8px var(--sh-l); }

.btn-green {
  background: var(--bg);
  color: var(--green);
  box-shadow: 3px 3px 8px var(--sh-d), -3px -3px 8px var(--sh-l);
}
.btn-green:hover { box-shadow: inset 3px 3px 8px var(--sh-d), inset -3px -3px 8px var(--sh-l); }

.btn-ghost {
  background: var(--bg);
  color: var(--soft);
  box-shadow: 3px 3px 8px var(--sh-d), -3px -3px 8px var(--sh-l);
}
.btn-ghost:hover { color: var(--ink); }

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ─────────────────────────────────────────
   LISTES
───────────────────────────────────────── */
.list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  background: var(--bg-dk);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.list-item-info { flex: 1; }

.list-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
  line-height: 1.4;
}

.list-item-meta {
  font-size: 11px;
  color: var(--soft);
}

.del-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--soft);
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.del-btn:hover { color: var(--red); }

.empty {
  font-size: 13px;
  color: var(--soft);
  font-weight: 300;
  padding: 20px 0;
  text-align: center;
}

.status {
  font-size: 12px;
  color: var(--rnb-dk);
  margin-top: 10px;
  min-height: 18px;
  text-align: center;
}

/* ─────────────────────────────────────────
   JEUX
───────────────────────────────────────── */
.jeux-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jeu-item {
  background: var(--bg-dk);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-actif {
  font-size: 10px;
  font-weight: 500;
  color: white;
  background: var(--green);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-inactif {
  font-size: 10px;
  font-weight: 500;
  color: var(--soft);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 2px 2px 5px var(--sh-d), -2px -2px 5px var(--sh-l);
}

.jeu-info { flex: 1; }

.jeu-titre {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
}

.jeu-meta {
  font-size: 11px;
  color: var(--soft);
}

.jeu-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────
   INSCRITS
───────────────────────────────────────── */
.inscrits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.inscrits-count strong {
  font-size: 28px;
  font-weight: 300;
  color: var(--ink);
  margin-right: 4px;
  letter-spacing: -1px;
}

.inscrits-count span {
  font-size: 13px;
  color: var(--soft);
}

.select-jeu {
  width: 100%;
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: var(--bg-dk);
  box-shadow: inset 3px 3px 8px var(--sh-d), inset -3px -3px 8px var(--sh-l);
  border: none;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  margin-bottom: 20px;
  cursor: pointer;
}

.inscrits-table {
  width: 100%;
  border-collapse: collapse;
}

.inscrits-table th {
  font-size: 10px;
  font-weight: 500;
  color: var(--soft);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(140, 165, 185, 0.3);
}

.inscrits-table td {
  font-size: 13px;
  color: var(--mid);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(140, 165, 185, 0.15);
}

.inscrits-table tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────
   TIRAGE
───────────────────────────────────────── */
.tirage-result {
  display: none;
  background: var(--bg);
  box-shadow: 9px 9px 22px rgba(140, 170, 195, 0.95), -9px -9px 22px rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin-top: 20px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tirage-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--rnb-dk);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.tirage-nom {
  font-size: 32px;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.tirage-details {
  font-size: 13px;
  color: var(--soft);
  line-height: 1.8;
}

/* ─────────────────────────────────────────
   MODALE MODIFICATION JEU
───────────────────────────────────────── */
.modale-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 40, 0.5);
  z-index: 300;
  backdrop-filter: blur(4px);
}

.modale {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 400;
  background: var(--bg);
  box-shadow: 12px 12px 30px var(--sh-d), -12px -12px 30px var(--sh-l);
  border-radius: 20px;
  padding: 36px;
  width: 520px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modale-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 22px;
}

.modale-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--soft);
  cursor: pointer;
  line-height: 1;
}

.modale-close:hover { color: var(--ink); }

/* ─────────────────────────────────────────
   ONGLET SITE (placeholder)
───────────────────────────────────────── */
.site-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--soft);
}

.site-placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.site-placeholder-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--mid);
  margin-bottom: 8px;
}

.site-placeholder-text {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
}
