/* ============================================================
   Road to Boom — dark festival aesthetic
   Base: near-black zinc. Single accent family: amber/gold.
   Display: Outfit. Body: system stack.

   Scales (do not improvise outside these):
   - spacing: 4 / 8 / 12 / 16 / 20 / 28 / 40
   - radius:  --r-xs 8, --r-sm 12, --r-md 16, --r-lg 20, --r-pill 999
     (concentric rule: outer = inner + padding)
   - shadows: --ring (hairline), --shadow-card, --shadow-float
   ============================================================ */

:root {
  /* palette */
  --bg: #0a0a0c;
  --bg-page: #070708;
  --surface: #141418;
  --surface-2: #1b1b21;
  --surface-3: #24242c;
  --border: #2a2a33;
  --border-strong: #3a3a45;
  --text: #f4f4f5;
  --muted: #9a9aa6;
  --faint: #6b6b76;
  --accent: #f0b232;
  --accent-strong: #ffc94d;
  --accent-deep: #b07f14;
  --accent-glow: rgba(240, 178, 50, 0.16);
  --danger: #e5534b;
  --ok: #58c26e;

  /* step-type ramp (warm family + one neutral — no rainbow) */
  --type-blind: #f0b232;
  --type-plusmoins: #e0863c;
  --type-scene: #d9c06b;
  --type-pochette: #f6d478;
  --type-portrait: #c1874e;
  --type-timeline: #a8a8b4;
  --type-tmlquiz: #de6b4e;

  /* radius scale */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* shadow scale (dark mode: hairline ring + tinted ambient depth) */
  --ring: 0 0 0 1px rgba(255, 255, 255, 0.07);
  --ring-strong: 0 0 0 1px rgba(255, 255, 255, 0.13);
  --ring-accent: 0 0 0 1px rgba(240, 178, 50, 0.55);
  --shadow-card:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 12px 32px -18px rgba(0, 0, 0, 0.7);
  --shadow-float:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 6px 16px -6px rgba(0, 0, 0, 0.55),
    0 24px 48px -16px rgba(0, 0, 0, 0.6);
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.22);

  /* motion */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-swift: cubic-bezier(0.2, 0, 0, 1);

  --font-head: 'Outfit', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body { overflow-x: clip; }

body {
  background:
    radial-gradient(900px 480px at 18% -160px, rgba(240, 178, 50, 0.10), transparent 62%),
    radial-gradient(1100px 700px at 108% 12%, rgba(240, 178, 50, 0.05), transparent 55%),
    linear-gradient(180deg, #0b0b0e 0%, var(--bg-page) 46%, #050506 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
}

/* Oversized ambience — fixed, cheap, non-interactive */
.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 340px at 50% -220px, rgba(240, 178, 50, 0.13), transparent 70%);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

img { max-width: 100%; }

/* Every artwork/photo gets the neutral hairline (pure white, never tinted) */
.reveal-cover, .track-cover, .duel-cover, .scene-photo, .blur-img, .pixel-canvas {
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tabular numerals wherever a number can change */
.num, .time, .pts, .points, .score, .duel-rank, .pill,
.recap-score .big, .share-block {
  font-variant-numeric: tabular-nums;
}

/* ---------- Layout: mobile-first column, framed on desktop ---------- */

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.view {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: 32px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Staggered entrance: each semantic block rises in sequence */
.view > * {
  animation: rise-in 0.5s var(--ease-out) backwards;
}

.view > *:nth-child(1) { animation-delay: 0ms; }
.view > *:nth-child(2) { animation-delay: 60ms; }
.view > *:nth-child(3) { animation-delay: 120ms; }
.view > *:nth-child(4) { animation-delay: 180ms; }
.view > *:nth-child(5) { animation-delay: 230ms; }
.view > *:nth-child(n+6) { animation-delay: 280ms; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Leaderboard & playlist breathe wider on desktop */
@media (min-width: 720px) {
  .view { padding-top: 48px; padding-bottom: 132px; }
  .view.view-wide { max-width: 656px; }
}

/* ---------- Bottom navigation ---------- */

.bottom-nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(18, 18, 22, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px 10px;
  min-height: 56px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.25s var(--ease-out), transform 0.35s var(--spring), background-color 0.2s;
}

.nav-item.active { color: var(--accent); }
.nav-item:hover { color: var(--muted); }
.nav-item.active:hover { color: var(--accent-strong); }
.nav-item:active { transform: scale(0.96); }

/* Desktop: nav becomes a floating pill under the game surface */
@media (min-width: 720px) {
  .bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 4px;
  }
  .nav-item { border-radius: var(--r-pill); min-height: 52px; padding: 8px; }
  .nav-item.active { background: rgba(240, 178, 50, 0.1); }
}

/* ---------- Shared components ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.brand {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
}

.page-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.12;
}

.subtitle { color: var(--muted); font-size: 14px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border-radius: var(--r-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  transition:
    transform 0.15s var(--ease-out),
    box-shadow 0.25s var(--ease-out),
    background-color 0.2s var(--ease-out),
    filter 0.2s var(--ease-out),
    opacity 0.2s var(--ease-out);
}

/* Optical alignment: a leading icon sits 2px into the text side */
.btn > svg:first-child { margin-left: -2px; }

.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn-primary {
  background: linear-gradient(160deg, var(--accent-strong), var(--accent) 55%, var(--accent-deep));
  color: #17120a;
  box-shadow: var(--edge-light), 0 8px 24px -10px rgba(240, 178, 50, 0.45);
}

.btn-primary:hover {
  box-shadow: var(--edge-light), 0 10px 28px -8px rgba(240, 178, 50, 0.55);
  filter: brightness(1.05);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--ring);
}

.btn-ghost:hover { box-shadow: var(--ring-strong); background: var(--surface-3); }

.btn-subtle {
  background: none;
  color: var(--muted);
  font-size: 14px;
  min-height: 44px;
  font-weight: 600;
  transition: color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.btn-subtle:hover { color: var(--text); }
.btn-subtle:active { transform: scale(0.96); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: var(--ring);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pill-accent {
  background: var(--accent-glow);
  box-shadow: 0 0 0 1px rgba(240, 178, 50, 0.3);
  color: var(--accent-strong);
}

/* Header pill must never push a 360px layout sideways */
.quiz-top .pill { max-width: 52%; overflow: hidden; text-overflow: ellipsis; display: block; }

/* ---------- Loading skeletons / error / empty states ---------- */

.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.skeleton {
  border-radius: var(--r-md);
  background:
    linear-gradient(100deg,
      var(--surface) 40%,
      var(--surface-2) 50%,
      var(--surface) 60%) var(--surface);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  box-shadow: var(--ring);
}

@keyframes shimmer {
  from { background-position: 130% 0; }
  to { background-position: -90% 0; }
}

.sk-header { height: 52px; width: 62%; }
.sk-hero { height: 148px; }
.sk-line { height: 20px; width: 84%; }
.sk-card { height: 96px; }
.sk-card.short { height: 72px; width: 90%; }

.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--surface-3);
  box-shadow: var(--shadow-float);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out), transform 0.4s var(--spring);
  pointer-events: none;
  max-width: 88vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 720px) {
  .toast { bottom: 100px; }
}

/* ---------- Login (landing) ---------- */

.login-hero {
  text-align: center;
  padding: 30px 0 4px;
}

.login-hero .page-title { font-size: 40px; letter-spacing: -0.02em; }

.login-hero .tagline {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
  max-width: 34ch;
  margin-inline: auto;
}

.login-countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  background: var(--accent-glow);
  box-shadow: 0 0 0 1px rgba(240, 178, 50, 0.3), var(--edge-light);
}

.login-countdown .jday {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.login-countdown .jlabel {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--ring);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  text-align: left;
  transition: transform 0.3s var(--spring), box-shadow 0.2s var(--ease-out), background-color 0.2s;
}

.player-chip:hover { box-shadow: var(--ring-strong); }
.player-chip:active { transform: scale(0.96); }

.player-chip.selected {
  box-shadow: var(--ring-accent), 0 6px 18px -8px rgba(240, 178, 50, 0.4);
  background: var(--accent-glow);
  color: var(--accent-strong);
}

.chip-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  box-shadow: var(--ring), var(--edge-light);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}

.player-chip.selected .chip-avatar {
  background: var(--accent);
  color: #17120a;
}

.pin-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 2px;
}

.pin-row.shake { animation: shake 0.4s var(--ease-swift); }

@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.pin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--border-strong);
  transition: background-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), transform 0.3s var(--spring);
}

.pin-dot.filled {
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 12px rgba(240, 178, 50, 0.35);
  transform: scale(1.15);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 320px;
  width: 100%;
  margin-inline: auto;
}

.pin-key {
  min-height: 58px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--ring);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s var(--spring), background-color 0.12s, box-shadow 0.2s var(--ease-out);
}

.pin-key:hover { box-shadow: var(--ring-strong); }
.pin-key:active { transform: scale(0.94); background: var(--surface-3); }

.first-login-note {
  text-align: center;
  font-size: 13px;
  color: var(--accent-strong);
  background: var(--accent-glow);
  box-shadow: 0 0 0 1px rgba(240, 178, 50, 0.28);
  border-radius: var(--r-sm);
  padding: 10px 14px;
}

/* ---------- Home ---------- */

.home-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

/* Countdown: the signature element */
.countdown-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(440px 220px at 82% -70px, rgba(240, 178, 50, 0.17), transparent 70%),
    var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), var(--edge-light);
  padding: 22px 20px;
}

.countdown-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.countdown-cell {
  background: var(--surface-2);
  box-shadow: var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: var(--r-sm);
  padding: 13px 4px 10px;
  text-align: center;
}

.countdown-cell .num {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-strong);
  line-height: 1.05;
  text-shadow: 0 0 24px rgba(240, 178, 50, 0.35);
}

.countdown-cell .unit {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-top: 2px;
}

.countdown-footer {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.quiz-cta { display: flex; flex-direction: column; gap: 14px; }

.quiz-cta .cta-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Segmented parcours progress: one cell per step, type-colored when done */
.seg-bar {
  display: flex;
  gap: 3px;
  height: 8px;
}

.seg {
  flex: 1;
  border-radius: 2px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: background-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.seg.current { animation: seg-breathe 1.8s ease-in-out infinite; }

@keyframes seg-breathe {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(240, 178, 50, 0.65); }
  50% { box-shadow: inset 0 0 0 1px rgba(240, 178, 50, 0.2); }
}

.seg.done.type-blind { background: var(--type-blind); }
.seg.done.type-plusmoins { background: var(--type-plusmoins); }
.seg.done.type-scene { background: var(--type-scene); }
.seg.done.type-pochette { background: var(--type-pochette); }
.seg.done.type-portrait { background: var(--type-portrait); }
.seg.done.type-timeline { background: var(--type-timeline); }
.seg.done.type-tmlquiz { background: var(--type-tmlquiz); }

.mini-board { display: flex; flex-direction: column; }

.mini-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.mini-row:last-child { border-bottom: none; }
.mini-row .who { display: flex; gap: 10px; align-items: center; }
.mini-row .rank { color: var(--faint); font-weight: 700; font-family: var(--font-head); width: 18px; font-variant-numeric: tabular-nums; }
.mini-row .pts { font-family: var(--font-head); font-weight: 700; color: var(--accent-strong); }

/* ---------- Parcours step header ---------- */

.quiz-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bet-title { font-size: 24px; font-weight: 800; }

/* ---------- Blind test: bet + listening (the emotional core) ---------- */

.bet-grid { display: grid; gap: 12px; }

.bet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--ring);
  transition:
    transform 0.3s var(--spring),
    box-shadow 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out);
  animation: pop-in 0.5s var(--spring) backwards;
}

.bet-option:nth-child(1) { animation-delay: 0.05s; }
.bet-option:nth-child(2) { animation-delay: 0.12s; }
.bet-option:nth-child(3) { animation-delay: 0.19s; }

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.bet-option:hover { box-shadow: var(--ring-strong); }
.bet-option:active { transform: scale(0.96); }

.bet-option.selected {
  box-shadow: var(--ring-accent), 0 10px 30px -12px rgba(240, 178, 50, 0.45), var(--edge-light);
  background: linear-gradient(160deg, rgba(240, 178, 50, 0.14), rgba(240, 178, 50, 0.05));
}

.bet-option .dur {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bet-option .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

.bet-option .mult {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.listen-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 26px 0 8px;
}

.ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  transition: transform 0.4s var(--spring), filter 0.4s var(--ease-out);
}

.ring-wrap svg { transform: rotate(-90deg); display: block; }

.ring-track { stroke: var(--surface-3); }

.ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  filter: drop-shadow(0 0 12px rgba(240, 178, 50, 0.4));
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ring-center .time {
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.ring-center .hint {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.pulse { animation: pulse 0.96s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.035); filter: brightness(1.12); }
}

/* ---------- Answer phases ---------- */

.mode-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.mode-card {
  padding: 20px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--ring);
  text-align: center;
  transition: transform 0.3s var(--spring), box-shadow 0.25s var(--ease-out);
}

.mode-card:hover { box-shadow: var(--ring-strong); }
.mode-card:active { transform: scale(0.96); }

.mode-card .mode-name { font-family: var(--font-head); font-size: 20px; font-weight: 800; }
.mode-card .mode-mult { color: var(--accent-strong); font-family: var(--font-head); font-weight: 700; font-size: 15px; margin-top: 2px; }
.mode-card .mode-desc { font-size: 12px; color: var(--muted); margin-top: 6px; }

.answer-input-wrap { position: relative; }

.answer-input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 17px;
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.answer-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 178, 50, 0.15);
}

.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  z-index: 10;
  box-shadow: var(--shadow-float);
}

.suggestion {
  display: block;
  width: 100%;
  min-height: 46px;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  transition: background-color 0.12s var(--ease-out);
}

.suggestion:last-child { border-bottom: none; }
.suggestion:hover, .suggestion:active { background: var(--surface-3); }

.choice-grid { display: grid; gap: 10px; }

.choice-btn {
  min-height: 56px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--ring);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  text-align: left;
  transition:
    transform 0.3s var(--spring),
    box-shadow 0.2s var(--ease-out),
    background-color 0.2s var(--ease-out);
  animation: pop-in 0.45s var(--spring) backwards;
}

.choice-btn:nth-child(1) { animation-delay: 0.03s; }
.choice-btn:nth-child(2) { animation-delay: 0.08s; }
.choice-btn:nth-child(3) { animation-delay: 0.13s; }
.choice-btn:nth-child(4) { animation-delay: 0.18s; }

.choice-btn:hover { box-shadow: var(--ring-strong); }
.choice-btn:active { transform: scale(0.96); }

.choice-btn.choice-correct {
  box-shadow: 0 0 0 1px rgba(88, 194, 110, 0.6), 0 6px 18px -8px rgba(88, 194, 110, 0.35);
  background: rgba(88, 194, 110, 0.1);
}

.choice-btn.choice-wrong {
  box-shadow: 0 0 0 1px rgba(229, 83, 75, 0.6);
  background: rgba(229, 83, 75, 0.1);
}

/* ---------- Reveal ---------- */

.reveal-flip { perspective: 1100px; }

.reveal-card {
  position: relative;
  transform-style: preserve-3d;
  animation: flip-in 0.8s var(--spring) both;
}

@keyframes flip-in {
  from { transform: rotateY(-92deg); opacity: 0.3; }
  to { transform: rotateY(0deg); opacity: 1; }
}

.reveal-inner {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.reveal-verdict {
  padding: 13px 20px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: rise-in 0.4s var(--ease-out) backwards;
}

.reveal-verdict:nth-child(1) { animation-delay: 0.25s; }
.reveal-verdict:nth-child(2) { animation-delay: 0.35s; }

.reveal-verdict.good {
  background: rgba(88, 194, 110, 0.1);
  box-shadow: inset 0 1px 0 rgba(88, 194, 110, 0.25);
  color: var(--ok);
}

.reveal-verdict.bad {
  background: rgba(229, 83, 75, 0.1);
  color: var(--danger);
}

.reveal-verdict + .reveal-verdict { border-top: 1px solid var(--border); }

.reveal-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 16px; }

.reveal-track { display: flex; gap: 14px; align-items: center; }

.reveal-cover {
  width: 84px;
  height: 84px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

.reveal-artist { font-family: var(--font-head); font-size: 21px; font-weight: 800; line-height: 1.15; }
.reveal-title { color: var(--muted); font-size: 14px; margin-top: 3px; }

.reveal-lineup {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-weight: 700;
  margin-top: 7px;
}

.reveal-links { display: flex; flex-wrap: wrap; gap: 8px; }

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: var(--ring);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: transform 0.3s var(--spring), box-shadow 0.2s var(--ease-out);
}

.link-chip:hover { box-shadow: var(--ring-strong); }
.link-chip:active { transform: scale(0.96); }

.replay-row { display: flex; align-items: center; gap: 12px; }

.replay-progress {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}

.replay-progress .bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s linear;
}

/* ---------- Step feedback / banners ---------- */

.part-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
}

.part-banner.good { background: rgba(88, 194, 110, 0.1); color: var(--ok); box-shadow: 0 0 0 1px rgba(88, 194, 110, 0.28); }
.part-banner.bad { background: rgba(229, 83, 75, 0.1); color: var(--danger); box-shadow: 0 0 0 1px rgba(229, 83, 75, 0.28); }

.feedback-panel {
  padding: 14px 16px;
  border-radius: var(--r-sm);
  margin-top: 14px;
  animation: pop-in 0.45s var(--spring) backwards;
}

.feedback-panel.good {
  background: rgba(88, 194, 110, 0.1);
  box-shadow: 0 0 0 1px rgba(88, 194, 110, 0.28), inset 0 1px 0 rgba(88, 194, 110, 0.2);
}

.feedback-panel.bad {
  background: rgba(229, 83, 75, 0.1);
  box-shadow: 0 0 0 1px rgba(229, 83, 75, 0.28);
}

.feedback-title { font-family: var(--font-head); font-weight: 800; font-size: 16px; }
.feedback-panel.good .feedback-title { color: var(--ok); }
.feedback-panel.bad .feedback-title { color: var(--danger); }
.feedback-details { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Plus ou Moins ---------- */

.duel-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.duel-cover {
  width: 72px;
  height: 72px;
  border-radius: var(--r-xs);
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

.duel-info { min-width: 0; flex: 1; }

.duel-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-artist { color: var(--muted); font-size: 13px; margin-top: 2px; }

.duel-rank {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 15px;
  color: var(--accent-strong);
  margin-top: 6px;
  transition: color 0.3s var(--ease-out);
}

.duel-rank.unknown { color: var(--faint); }
.duel-rank.good { color: var(--ok); }
.duel-rank.bad { color: var(--danger); }

.duel-vs {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--faint);
}

.duel-vs::before, .duel-vs::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.plusminus-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- La Bonne Scene ---------- */

.scene-artist {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.scene-photo {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  box-shadow: var(--ring-strong), 0 16px 40px -18px rgba(0, 0, 0, 0.8);
}

/* ---------- Pochette floutee / Portrait mystere ---------- */

.blur-wrap {
  width: min(300px, 78vw);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-3);
  box-shadow: var(--shadow-card);
}

.blur-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15); /* hide blur edge bleed */
  transition: filter 0.7s var(--ease-swift), transform 0.7s var(--ease-swift);
}

/* Once answered, drop the anti-bleed zoom so the full artwork shows edge-to-edge */
.blur-img.revealed { transform: scale(1); }

.pixel-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  animation: fade-swap 0.45s var(--ease-out);
}

@keyframes fade-swap {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

/* ---------- Timeline ---------- */

.order-grid { display: grid; gap: 10px; }

.order-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  padding-right: 58px; /* keep text clear of the badge */
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--ring);
  text-align: left;
  transition: transform 0.3s var(--spring), box-shadow 0.2s var(--ease-out);
}

.order-card:hover { box-shadow: var(--ring-strong); }
.order-card:active { transform: scale(0.97); }

.order-badge {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--faint);
  transition:
    background-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out),
    transform 0.3s var(--spring),
    box-shadow 0.2s var(--ease-out);
}

.order-badge.set {
  background: var(--accent);
  box-shadow: var(--edge-light), 0 4px 12px -4px rgba(240, 178, 50, 0.5);
  color: #17120a;
  transform: translateY(-50%) scale(1.12);
}

/* ---------- Recap ---------- */

.recap-score { text-align: center; padding: 10px 0 4px; }

.recap-score .big {
  font-family: var(--font-head);
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-strong);
  line-height: 1;
  text-shadow: 0 0 40px rgba(240, 178, 50, 0.35);
}

.recap-score .label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 8px;
  font-weight: 600;
}

.recap-rounds { display: flex; flex-direction: column; gap: 8px; }

.recap-round {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--ring);
  font-size: 14px;
}

.recap-round .n { font-family: var(--font-head); font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; }
.recap-round .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-round .meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.recap-round .pts { font-family: var(--font-head); font-weight: 800; }
.recap-round .pts.good { color: var(--ok); }
.recap-round .pts.bad { color: var(--danger); }

/* Share block: a ticket you screenshot */
.share-block {
  position: relative;
  background: var(--surface-2);
  box-shadow: var(--ring-strong), var(--edge-light);
  border-radius: var(--r-md);
  border-top: 3px solid var(--accent);
  padding: 18px 20px 16px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: var(--text);
}

/* perforated ticket notches */
.share-block::before, .share-block::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-page);
  box-shadow: var(--ring);
}

.share-block::before { left: -9px; }
.share-block::after { right: -9px; }

/* ---------- Leaderboard ---------- */

.board-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface);
  box-shadow: var(--ring);
  border-radius: var(--r-md);
  padding: 5px;
}

.board-tab {
  padding: 11px;
  min-height: 44px;
  border-radius: 11px; /* concentric: 16 - 5 */
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  transition:
    background-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out),
    transform 0.15s var(--ease-out);
}

.board-tab:hover { color: var(--text); }
.board-tab:active { transform: scale(0.97); }
.board-tab.active { background: var(--surface-3); color: var(--accent-strong); box-shadow: var(--edge-light); }

.board-list { display: flex; flex-direction: column; gap: 8px; }

.board-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--ring);
  transition: box-shadow 0.2s var(--ease-out);
}

.board-row:hover { box-shadow: var(--ring-strong); }

.board-row.top1 {
  box-shadow: 0 0 0 1px rgba(240, 178, 50, 0.4), 0 10px 30px -14px rgba(240, 178, 50, 0.35);
  background: linear-gradient(160deg, rgba(240, 178, 50, 0.1), var(--surface) 60%);
}

.board-row .rank {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* Typographic podium medals */
.rank.medal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  color: #17120a;
}

.rank.medal.m1 { background: linear-gradient(160deg, var(--accent-strong), var(--accent-deep)); box-shadow: var(--edge-light), 0 4px 12px -4px rgba(240, 178, 50, 0.5); }
.rank.medal.m2 { background: linear-gradient(160deg, #d6d6de, #8f8f9b); box-shadow: var(--edge-light); }
.rank.medal.m3 { background: linear-gradient(160deg, #d09a62, #8a5a2e); box-shadow: var(--edge-light); }

.board-row .name { font-weight: 600; font-size: 16px; }
.board-row .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

.board-row .score {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 19px;
  color: var(--accent-strong);
}

/* ---------- Playlist ---------- */

.playlist-day-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  padding: 8px 2px 0;
}

.track-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--ring);
  transition: box-shadow 0.2s var(--ease-out);
}

.track-card:hover { box-shadow: var(--ring-strong); }

.track-cover {
  width: 64px;
  height: 64px;
  border-radius: var(--r-xs);
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

.track-info { min-width: 0; flex: 1; }
.track-artist { font-family: var(--font-head); font-weight: 700; font-size: 16px; line-height: 1.2; }
.track-title { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-stage { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); font-weight: 700; margin-top: 5px; }
.track-links { display: flex; gap: 6px; margin-top: 8px; }

.track-links a {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 11px;
  min-height: 30px;
  box-shadow: var(--ring);
  border-radius: var(--r-pill);
  transition: color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.track-links a:hover { color: var(--text); box-shadow: var(--ring-strong); }

/* ---------- Help panel (per-épreuve onboarding) ---------- */

.help-panel {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  box-shadow: var(--ring);
  border-left: 3px solid var(--accent);
  overflow: hidden;
}

.help-panel.type-plusmoins { border-left-color: var(--type-plusmoins); }
.help-panel.type-scene { border-left-color: var(--type-scene); }
.help-panel.type-pochette { border-left-color: var(--type-pochette); }
.help-panel.type-portrait { border-left-color: var(--type-portrait); }
.help-panel.type-timeline { border-left-color: var(--type-timeline); }
.help-panel.type-tmlquiz { border-left-color: var(--type-tmlquiz); }

.help-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s var(--ease-out);
}

.help-toggle:hover { color: var(--text); }

.help-toggle-label { letter-spacing: 0.01em; }

.help-chevron {
  display: inline-flex;
  color: var(--faint);
  transition: transform 0.35s var(--spring);
}

.help-panel.open .help-chevron { transform: rotate(180deg); }

/* Height-agnostic expand/collapse via grid rows (spring easing) */
.help-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--spring);
}

.help-panel.open .help-body { grid-template-rows: 1fr; }

.help-body-inner {
  overflow: hidden;
  min-height: 0;
}

.help-panel.open .help-body-inner { padding: 0 14px 13px; }

.help-body-inner p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.help-body-inner p + p { margin-top: 4px; }

/* ---------- Rules screen ---------- */

.rules-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rule-section-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  padding: 8px 2px 0;
}

.rule-card p { font-size: 14px; color: var(--muted); line-height: 1.55; }

.rule-ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.rule-ul li { font-size: 14px; color: var(--muted); line-height: 1.5; }
.rule-ul b { color: var(--text); font-weight: 700; }

.rule-list { display: flex; flex-direction: column; gap: 10px; }

.rule-row {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--ring);
  border-left: 3px solid var(--rule-color, var(--accent));
  padding: 14px 16px;
}

.rule-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.rule-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rule-color, var(--accent));
  box-shadow: 0 0 10px -1px var(--rule-color, var(--accent));
  flex-shrink: 0;
}

.rule-label {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 16px;
  color: var(--rule-color, var(--accent));
}

.rule-copy p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.rule-copy p + p { margin-top: 3px; }

/* Rules read comfortably in two columns on the wide desktop surface */
@media (min-width: 720px) {
  .view-wide .rule-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
