/* ============================================================================
   NEVERHACK · Serious Game
   Palette : Blanc majoritaire · Purple · Magenta · Mauve
   ============================================================================ */

:root {
  /* Palette officielle NEVERHACK */
  --purple: #562BFF;
  --purple-soft: rgba(86, 43, 255, 0.08);
  --purple-mid: rgba(86, 43, 255, 0.16);
  --magenta: #FC53C0;
  --magenta-soft: rgba(252, 83, 192, 0.08);
  --mauve: #AFA9FD;
  --mauve-soft: rgba(175, 169, 253, 0.18);
  --cyan: #28D3FE;
  --grey-100: #FAFAFA;
  --grey-200: #F4F4F5;
  --grey-300: #E3E3E3;
  --grey-400: #D4D4D8;
  --grey-500: #71717A;
  --grey-700: #3F3F46;
  --black: #000000;
  --white: #FFFFFF;

  /* Sémantiques */
  --bg: var(--white);
  --bg-1: var(--white);
  --bg-2: var(--grey-100);
  --bg-3: var(--grey-200);
  --border: var(--grey-300);
  --border-strong: var(--grey-400);

  --text: var(--black);
  --text-muted: var(--grey-700);
  --text-dim: var(--grey-500);

  --accent: var(--purple);
  --accent-2: var(--magenta);
  --accent-3: var(--mauve);
  --accent-bg: var(--purple-soft);
  --accent-bg-strong: var(--purple-mid);

  --success: #16A34A;
  --danger: #DC2626;
  --warn: #D97706;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;

  /* Layout */
  --radius: 6px;
  --radius-lg: 12px;
  --container: 1280px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(86, 43, 255, 0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-purple: 0 8px 24px rgba(86, 43, 255, 0.24);

  --transition: 180ms cubic-bezier(0.2, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
}

button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }

/* ============================================================================
   TOPBAR
   ============================================================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-mark {
  color: var(--accent);
  font-size: 14px;
  transform: translateY(1px);
}
.brand-name {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 14px;
  color: var(--black);
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  font-weight: 500;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ============================================================================
   MODE SOLO
   ============================================================================ */

.solo-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--accent-2);
  background: var(--magenta-soft);
  border: 1px solid var(--accent-2);
  padding: 3px 9px;
  border-radius: 100px;
  margin-right: 4px;
}

.card-action-solo {
  grid-column: 1 / -1;          /* bandeau pleine largeur sous les deux cartes */
  border-color: var(--accent-2);
  background: linear-gradient(135deg, var(--white) 0%, var(--magenta-soft) 100%);
  padding: 22px 28px;
}
.card-action-solo .card-action-label { margin-bottom: 8px; }
.card-action-solo .card-action-title { font-size: 19px; margin-bottom: 4px; }
.card-action-solo .card-action-arrow { bottom: auto; top: 50%; transform: translateY(-50%); }
.card-action-solo:hover .card-action-arrow { transform: translateY(-50%) translateX(4px); }
.card-action-solo .card-action-label { color: var(--accent-2); }
.card-action-solo:hover { border-color: var(--accent-2); }
.card-action-solo:hover .card-action-arrow { color: var(--accent-2); }

/* Page de résultat solo : médaille + score à gauche, classement à droite */
.solo-top {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 32px;
}
.solo-top-left,
.solo-top-right { flex: 1 1 440px; min-width: 0; }
.solo-top-right .section-h { margin-bottom: 14px; }

/* Le classement peut être long : on le borne et on le rend défilant pour
   qu'il reste aligné avec la colonne de gauche. */
.lb-table-scroll {
  max-height: 420px;
  overflow-y: auto;
}
@media (max-width: 900px) {
  .lb-table-scroll { max-height: none; }
}

/* ----------------------------------------- Progression solo (révélation) */
.solo-progress {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.solo-progress-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}
.solo-progress-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 12px;
}
.solo-progress-score > span:first-child {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.solo-progress-max {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}
.solo-progress-track {
  height: 8px;
  background: var(--grey-200);
  border-radius: 100px;
  overflow: hidden;
}
.solo-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.solo-progress-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.solo-progress-totalval {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.solo-progress-hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ---------------------------------------------------------------- Médailles */
.medal-block {
  display: flex;
  align-items: center;
  margin: 0 0 20px;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}
.medal-block > .medal-text { flex: 1 1 auto; min-width: 0; }
@media (max-width: 560px) {
  .medal-block { flex-direction: column; text-align: center; }
  .medal-block > .medal-disc { margin: 0 0 16px; }
}

.medal-disc {
  flex: 0 0 104px;      /* ne doit jamais être comprimé par le flex */
  margin-right: 24px;   /* marge plutôt que gap : rendu identique partout */
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 3px solid var(--border-strong);
  background: var(--grey-100);
  margin: 0 auto;
  animation: medalIn 700ms cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards;
}
@keyframes medalIn {
  from { opacity: 0; transform: scale(0.5) rotate(-25deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
.medal-icon { font-size: 38px; line-height: 1; }
.medal-short {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

/* Déclinaisons par médaille */
.medal-block.is-gold   { border-color: #E8B923; background: linear-gradient(135deg, #FFFDF3 0%, var(--white) 60%); }
.medal-block.is-gold   .medal-disc { border-color: #E8B923; background: linear-gradient(145deg, #FFF4CC 0%, #FDE9A5 100%); box-shadow: 0 6px 20px rgba(232,185,35,0.3); }
.medal-block.is-gold   .medal-short { color: #9A7707; }

.medal-block.is-silver { border-color: #A8B0BC; background: linear-gradient(135deg, #FBFCFD 0%, var(--white) 60%); }
.medal-block.is-silver .medal-disc { border-color: #A8B0BC; background: linear-gradient(145deg, #EDF1F5 0%, #D7DDE5 100%); box-shadow: 0 6px 20px rgba(130,140,155,0.22); }
.medal-block.is-silver .medal-short { color: #69727F; }

.medal-block.is-bronze { border-color: #C58150; background: linear-gradient(135deg, #FEF9F5 0%, var(--white) 60%); }
.medal-block.is-bronze .medal-disc { border-color: #C58150; background: linear-gradient(145deg, #F7E2D2 0%, #E8C3A5 100%); box-shadow: 0 6px 20px rgba(197,129,80,0.25); }
.medal-block.is-bronze .medal-short { color: #8B5530; }

.medal-block.is-none   { border-color: var(--border-strong); }
.medal-block.is-none   .medal-disc { filter: grayscale(1); opacity: 0.8; }

.medal-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--black);
}
.medal-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}
.medal-rank {
  margin-top: 12px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  padding: 5px 12px;
  border-radius: 100px;
}

/* ------------------------------------------------------------- Classement */
.card-action-lb {
  grid-column: 1 / -1;          /* bandeau pleine largeur, sous la carte solo */
  border-color: var(--mauve);
  background: linear-gradient(135deg, var(--white) 0%, var(--mauve-soft) 100%);
  padding: 22px 28px;
}
.card-action-lb .card-action-label { color: var(--accent); margin-bottom: 8px; }
.card-action-lb .card-action-title { font-size: 19px; margin-bottom: 4px; }
.card-action-lb .card-action-arrow { bottom: auto; top: 50%; transform: translateY(-50%); }
.card-action-lb:hover .card-action-arrow { transform: translateY(-50%) translateX(4px); }

.lb-head { margin-bottom: 28px; }

.lb-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.lb-stat {
  flex: 1 1 128px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.lb-stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.lb-stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.lb-stat-medals {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.lb-table {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.lb-row > .lb-rank  { flex: 0 0 48px; }
.lb-row > .lb-medal { flex: 0 0 28px; }
.lb-row > .lb-name  { flex: 1 1 auto; min-width: 0; }
.lb-row > .lb-date  { flex: 0 0 76px; text-align: right; }
.lb-row > .lb-score { flex: 0 0 64px; }
.lb-row:last-child { border-bottom: 0; }
.lb-row.lb-header {
  background: var(--grey-100);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}
.lb-row.is-me { background: var(--accent-bg); }
.lb-rank {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
}
.lb-row:nth-child(2) .lb-rank { color: #E8B923; font-size: 17px; }
.lb-row:nth-child(3) .lb-rank { color: #8B93A0; }
.lb-row:nth-child(4) .lb-rank { color: #C58150; }
.lb-medal { font-size: 19px; text-align: center; }
.lb-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-you {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--white);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 100px;
  margin-left: 8px;
  text-transform: uppercase;
}
.lb-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}
.lb-score {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  min-width: 56px;
  text-align: right;
}
@media (max-width: 620px) {
  .lb-row > .lb-date { display: none; }
}

/* Carte de score solo */
.solo-score-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}

.solo-gauge { margin-bottom: 24px; }
.solo-gauge-track {
  height: 12px;
  background: var(--grey-200);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 16px;
}
.solo-gauge-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.solo-gauge-values {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.solo-gauge-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.solo-gauge-score {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.solo-gauge-max { text-align: right; }
.solo-gauge-maxval {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1;
}

.solo-rank {
  padding: 20px;
  background: linear-gradient(135deg, var(--mauve-soft) 0%, var(--white) 100%);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  margin-bottom: 20px;
}
.solo-rank-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--black);
}
.solo-rank-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.solo-days {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.solo-day {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.solo-day-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}
.solo-day-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

/* Sélecteur de langue */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
  background: var(--white);
  margin-right: 6px;
}
.lang-btn {
  background: transparent;
  border: 0;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.6;
}
.lang-btn:hover { color: var(--accent); background: var(--accent-bg); }
.lang-btn.is-active {
  background: var(--accent);
  color: var(--white);
}
.lang-btn.is-active:hover { background: var(--accent); color: var(--white); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.dot-live {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px var(--magenta-soft);
  animation: pulse 2s ease-in-out infinite;
}
.dot-off { background: var(--danger); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

#app {
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px 28px 96px;
}

.screen { animation: fadeIn 320ms ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   HOME (HERO)
   ============================================================================ */

.hero { max-width: 880px; margin: 32px auto 0; }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 32px;
  background: var(--accent-bg);
}
.hero-tag::before { content: "●"; color: var(--accent-2); font-size: 8px; }

.hero-title {
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  color: var(--black);
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 0 56px;
  font-weight: 400;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 720px) { .cta-grid { grid-template-columns: 1fr; } }

.card-action {
  position: relative;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 28px 28px 80px;
  border-radius: var(--radius-lg);
  transition: var(--transition);
  font-family: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-action:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.card-action-primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--white) 0%, var(--mauve-soft) 100%);
}
.card-action-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}
.card-action-primary .card-action-label { color: var(--accent-2); }
.card-action-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--black);
}
.card-action-desc { color: var(--text-muted); font-size: 14px; }
.card-action-arrow {
  position: absolute;
  right: 28px;
  bottom: 24px;
  font-size: 26px;
  color: var(--text-dim);
  transition: var(--transition);
}
.card-action:hover .card-action-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ============================================================================
   PANEL
   ============================================================================ */

.panel {
  max-width: 520px;
  margin: 48px auto 0;
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel-centered { text-align: center; }
.panel-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--black);
}
.panel-sub { color: var(--text-muted); margin: 0 0 32px; }

.back-link {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
  padding: 0 0 24px;
  cursor: pointer;
  font-family: inherit;
}
.back-link:hover { color: var(--accent); }

.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.field-hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.45;
}

.input {
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: var(--transition);
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
}
.input-code {
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 22px;
  text-align: center;
  font-weight: 600;
  color: var(--accent);
}

.form-error {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: var(--transition);
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: #4520e0;
  box-shadow: var(--shadow-purple);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  background: var(--grey-300);
  color: var(--text-dim);
  border-color: var(--grey-300);
}
.btn-ghost {
  background: var(--white);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}
.btn-large { padding: 16px 32px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============================================================================
   ADMIN LOBBY
   ============================================================================ */

.lobby {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 880px) { .lobby { grid-template-columns: 1fr; } }

.lobby-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 12px;
}
.lobby-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--black);
}
.lobby-sub { color: var(--text-muted); margin: 0 0 32px; font-size: 16px; }

.code-display {
  background: linear-gradient(135deg, var(--white) 0%, var(--mauve-soft) 100%);
  border: 1px solid var(--mauve);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: var(--shadow);
}
.code-display-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}
.code-display-value {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.3em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#copyCodeBtn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--white);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}
#copyCodeBtn:hover {
  color: var(--white);
  background: var(--accent);
  border-color: var(--accent);
}

.admin-actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }

.players-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.players-card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 700;
}
.badge {
  background: var(--accent);
  color: var(--white);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.players-list { max-height: 480px; overflow-y: auto; }
.player-row {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 240ms ease-out;
}
.player-row:last-child { border-bottom: 0; }
.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.player-name { flex: 1; font-weight: 500; }
.player-status {
  font-size: 11px;
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.player-row.is-offline .player-avatar {
  background: var(--grey-300);
  color: var(--text-dim);
}
.player-row.is-offline .player-name { color: var(--text-dim); }
.player-row.is-offline .player-status { color: var(--warn); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ============================================================================
   PLAYER LOBBY
   ============================================================================ */

.pulse-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  margin: 0 auto 24px;
  position: relative;
  background: var(--accent-bg);
  animation: pulseRing 2.4s ease-out infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(86, 43, 255, 0.4); }
  70% { box-shadow: 0 0 0 24px rgba(86, 43, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(86, 43, 255, 0); }
}

.player-lobby-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
}

/* ============================================================================
   BRIEFING SCREEN
   ============================================================================ */

.briefing-head {
  text-align: center;
  margin-bottom: 40px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.briefing-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.briefing-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.briefing-section-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  background: var(--accent);
  padding: 4px 10px;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
}
.briefing-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--black);
}

.briefing-section p {
  color: var(--text-muted);
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.65;
}
.briefing-section p:last-child { margin-bottom: 0; }
.briefing-section strong { color: var(--black); font-weight: 600; }

.briefing-company {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, var(--mauve-soft) 0%, var(--white) 100%);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.briefing-company-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 28px;
  font-weight: 800;
  box-shadow: var(--shadow-purple);
}
.briefing-company-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.briefing-company-tag {
  font-size: 13px;
  color: var(--text-muted);
}

.briefing-activities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 640px) { .briefing-activities { grid-template-columns: 1fr; } }
.briefing-activity {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  background: var(--grey-100);
}
.briefing-activity-icon { font-size: 22px; margin-bottom: 8px; }
.briefing-activity-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.briefing-regions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 640px) { .briefing-regions { grid-template-columns: 1fr; } }
.briefing-region {
  background: var(--grey-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.briefing-region-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.briefing-region-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.briefing-alerts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 800px) { .briefing-alerts { grid-template-columns: 1fr; } }
.briefing-alert {
  background: linear-gradient(135deg, var(--white) 0%, var(--magenta-soft) 100%);
  border: 1px solid var(--magenta);
  border-radius: var(--radius);
  padding: 18px;
}
.briefing-alert-icon { font-size: 24px; margin-bottom: 10px; }
.briefing-alert-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 6px;
}
.briefing-alert-value {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  color: var(--black);
}
.briefing-alert-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.briefing-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 700px) { .briefing-rules-grid { grid-template-columns: 1fr; } }
.briefing-rule {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
}
.briefing-rule-day {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}
.briefing-rule.day-1 { border-color: var(--accent); background: var(--accent-bg); }
.briefing-rule.day-1 .briefing-rule-day { background: var(--accent); color: var(--white); }
.briefing-rule.day-2 { border-color: var(--accent-2); background: var(--magenta-soft); }
.briefing-rule.day-2 .briefing-rule-day { background: var(--accent-2); color: var(--white); }
.briefing-rule-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  color: var(--black);
}
.briefing-rule-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.briefing-rule strong { color: var(--accent); font-weight: 700; }
.briefing-rule.day-2 strong { color: var(--accent-2); }

.briefing-tips {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--mauve-soft);
  border-radius: var(--radius);
  border-left: 3px solid var(--mauve);
}
.briefing-tips-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.briefing-tips-text {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.briefing-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding: 24px 0;
  flex-wrap: wrap;
}
.briefing-foot-info {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ============================================================================
   INTERLUDE — Briefing entre Jour 1 et Jour 2
   ============================================================================ */

.interlude-pill {
  background: linear-gradient(90deg, var(--accent-bg) 0%, var(--magenta-soft) 100%);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.briefing-section-num.interlude-num {
  background: var(--accent-2);
}

.interlude-list {
  margin: 0;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}
.interlude-list > li { margin-bottom: 12px; }
.interlude-list > li::marker { color: var(--accent-2); font-weight: 700; }
.interlude-list strong { color: var(--black); font-weight: 600; }
.interlude-sublist {
  margin: 8px 0 0;
  padding-left: 22px;
}
.interlude-sublist li { margin-bottom: 4px; }
.interlude-sublist li::marker { color: var(--accent); }

.interlude-alerts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 800px) { .interlude-alerts { grid-template-columns: 1fr; } }

.interlude-alert {
  background: linear-gradient(160deg, var(--white) 0%, var(--magenta-soft) 100%);
  border: 1px solid var(--magenta);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(252, 83, 192, 0.04);
}
.interlude-alert-icon { font-size: 28px; margin-bottom: 10px; }
.interlude-alert-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--magenta);
}
.interlude-alert-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.interlude-alert-text strong { color: var(--black); font-weight: 600; }

/* ============================================================================
   PLAY SCREEN
   ============================================================================ */

.play-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}
.play-day-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  margin-bottom: 12px;
  background: var(--accent-bg);
  font-weight: 700;
}
.play-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--black);
}
.play-sub { color: var(--text-muted); margin: 0; }

.selection-counter {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  line-height: 1;
}
.selection-counter .muted { color: var(--text-dim); }
.selection-counter-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 700;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 980px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   GAME CARD
   ============================================================================ */

.game-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.game-card.selected {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--accent-bg) 0%, var(--white) 60%);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-purple);
}
.game-card.disabled { opacity: 0.5; pointer-events: none; }

.game-card-num {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  font-weight: 600;
}
.game-card.selected .game-card-num { color: var(--accent); }

.game-card-icon { font-size: 32px; margin-bottom: 16px; }
.game-card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.25;
  color: var(--black);
}
.game-card-teaser { font-size: 13px; color: var(--text-muted); margin: 0; flex: 1; }

.game-card-sub {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.game-card-sub-empty { color: var(--text-dim); font-style: italic; font-weight: 400; }

.game-card-check {
  position: absolute;
  bottom: 18px;
  right: 18px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  transition: var(--transition);
}
.game-card.selected .game-card-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.game-card-check::after {
  content: "✓";
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: var(--transition);
}
.game-card.selected .game-card-check::after { opacity: 1; }

/* ============================================================================
   PLAY FOOT
   ============================================================================ */

.play-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.play-foot-status {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.play-foot-status.locked { color: var(--accent-2); font-weight: 600; }

/* ============================================================================
   ADMIN GAME
   ============================================================================ */

.admin-game-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.admin-progress {
  background: linear-gradient(135deg, var(--white) 0%, var(--mauve-soft) 100%);
  border: 1px solid var(--mauve);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  min-width: 280px;
}
.admin-progress-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}
.admin-progress-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.admin-progress-value .muted { color: var(--text-dim); font-size: 22px; }
.admin-progress-bar {
  margin-top: 12px;
  background: var(--white);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.admin-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  width: 0%;
  transition: width 400ms ease-out;
}

.admin-game-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.admin-game-panel h3 {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.admin-cards-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 720px) { .admin-cards-overview { grid-template-columns: repeat(2, 1fr); } }
.admin-card-mini {
  background: var(--grey-100);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
}
.admin-card-mini-num {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
}
.admin-card-mini-title {
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Statut nominatif des joueurs (vue admin) */
.admin-players-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-players-head h3 { margin: 0; }
.admin-players-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.legend-validated { background: var(--success); }
.legend-waiting { background: var(--accent-2); }
.legend-offline { background: var(--warn); }

.admin-players-status {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.admin-player-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--grey-100);
  transition: var(--transition);
}
.admin-player-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.admin-player-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-player-state {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.admin-player-status.is-validated {
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.06);
}
.admin-player-status.is-validated .admin-player-dot { background: var(--success); }
.admin-player-status.is-validated .admin-player-state { color: var(--success); }

.admin-player-status.is-waiting .admin-player-dot {
  background: var(--accent-2);
  animation: pulse 1.6s ease-in-out infinite;
}
.admin-player-status.is-waiting .admin-player-state { color: var(--accent-2); }

.admin-player-status.is-offline {
  opacity: 0.65;
  border-style: dashed;
}
.admin-player-status.is-offline .admin-player-dot { background: var(--warn); }
.admin-player-status.is-offline .admin-player-name { color: var(--text-dim); }
.admin-player-status.is-offline .admin-player-state { color: var(--warn); }

.admin-game-foot { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================================
   REVEAL
   ============================================================================ */

.reveal-head { margin-bottom: 32px; }
.reveal-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 900px) { .reveal-layout { grid-template-columns: 1fr; } }

.section-h {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 16px;
}

.decision-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 12px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  animation: flipIn 600ms cubic-bezier(0.2, 0.8, 0.2, 1.0) backwards;
}
.decision-card:nth-child(1) { animation-delay: 0ms; }
.decision-card:nth-child(2) { animation-delay: 120ms; }
.decision-card:nth-child(3) { animation-delay: 240ms; }
.decision-card:nth-child(4) { animation-delay: 360ms; }
.decision-card:nth-child(5) { animation-delay: 480ms; }
.decision-card:nth-child(6) { animation-delay: 600ms; }

@keyframes flipIn {
  from { opacity: 0; transform: perspective(800px) rotateY(-25deg) translateX(-30px); }
  to { opacity: 1; transform: perspective(800px) rotateY(0) translateX(0); }
}

.decision-card-body { flex: 1; min-width: 0; }
.decision-card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.decision-card-outcome {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.55;
}
.decision-card-bonus {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-weight: 600;
}

.decision-card-score {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  min-width: 80px;
  text-align: right;
  letter-spacing: -0.02em;
}
.score-positive { color: var(--success); }
.score-negative { color: var(--danger); }
.score-zero { color: var(--text-dim); }

/* ============================================================================
   SCOREBOARD
   ============================================================================ */

.scoreboard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.scoreboard-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.scoreboard-row:last-child { border-bottom: 0; }
.scoreboard-row.is-me { background: var(--accent-bg); }
.scoreboard-rank {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
}
.scoreboard-row:nth-child(1) .scoreboard-rank { color: var(--accent); font-size: 16px; }
.scoreboard-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scoreboard-total {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.scoreboard-large .scoreboard-row {
  padding: 18px 24px;
  grid-template-columns: 50px 1fr auto auto;
}
.scoreboard-large .scoreboard-rank { font-size: 18px; }
.scoreboard-large .scoreboard-name { font-size: 16px; }
.scoreboard-large .scoreboard-total { font-size: 20px; }
.scoreboard-large .scoreboard-detail {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-right: 16px;
  letter-spacing: 0.02em;
}

.reveal-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
  flex-wrap: wrap;
}
.reveal-foot-info {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ============================================================================
   FINAL — Podium
   ============================================================================ */

.final-head { text-align: center; margin-bottom: 48px; }
.final-head .play-day-pill {
  background: linear-gradient(90deg, var(--accent-bg) 0%, var(--magenta-soft) 100%);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
  align-items: end;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 640px) { .podium { grid-template-columns: 1fr; } }

.podium-slot {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 16px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.podium-slot.podium-1 {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-bg) 0%, var(--white) 100%);
  box-shadow: var(--shadow-purple);
  padding-top: 36px;
  padding-bottom: 28px;
}
.podium-rank {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1;
}
.podium-slot.podium-1 .podium-rank {
  font-size: 48px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.podium-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-score {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.final-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding: 24px 0;
  flex-wrap: wrap;
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn 200ms ease-out;
}
.modal {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.18);
  animation: modalIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1.0);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.modal-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.modal-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.modal-question { color: var(--text-muted); margin: 0 0 24px; }
.modal-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.modal-option {
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}
.modal-option:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
  transform: translateY(-1px);
}
.modal-option-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  font-weight: 700;
}
.modal-foot { display: flex; justify-content: flex-end; }

/* ============================================================================
   TOAST
   ============================================================================ */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 22px;
  font-size: 14px;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  animation: toastIn 280ms ease-out;
  font-weight: 500;
}
.toast.toast-success {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}
.toast.toast-error {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.06);
  color: var(--danger);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.muted { color: var(--text-muted); }
[hidden] { display: none !important; }
