/* ==========================================================================
   WHICH ŠKODA ARE YOU ? — Styles
   Unité de design : --u = 1px de la maquette 1440×810 (paysage)
                            ou 810×1440 (portrait), mise à l'échelle écran.
   ========================================================================== */

@font-face { font-family: 'Skoda Next'; font-weight: 300; font-display: block; src: url('../assets/fonts/SKODANextW05-Light.woff2') format('woff2'); }
@font-face { font-family: 'Skoda Next'; font-weight: 400; font-display: block; src: url('../assets/fonts/SKODANextW05-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Skoda Next'; font-weight: 700; font-display: block; src: url('../assets/fonts/SKODANextW05-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Skoda Next'; font-weight: 900; font-display: block; src: url('../assets/fonts/SKODANextW05-Black.woff2') format('woff2'); }

:root {
  --emerald: #0e3a2f;
  --electric: #78faae;
  --electric-deep: #4fd08a;
  --white: #ffffff;
  --bar-on-dark: rgba(120, 250, 174, 0.13);
  --bar-on-light: rgba(14, 58, 47, 0.09);
  --pill-on-dark: rgba(120, 250, 174, 0.42);
  --pill-on-light: rgba(255, 255, 255, 0.72);

  --vw: 100vw; --vh: 100vh;           /* surchargés par JS (figés quand le clavier s'ouvre) */
  --u: min(calc(var(--vw) / 1440), calc(var(--vh) / 810));
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}
html.is-portrait { --u: min(calc(var(--vw) / 810), calc(var(--vh) / 1440)); }

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--electric);
  color: var(--white);
  font-family: 'Skoda Next', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
/* Borne tactile : aucun contour de focus sur les éléments d'interaction (les champs de saisie gardent le leur) */
button:focus, button:focus-visible, a:focus, a:focus-visible, [tabindex]:focus { outline: none; box-shadow: none; }
img { display: block; -webkit-user-drag: none; }
input { -webkit-user-select: text; user-select: text; }

#app { position: fixed; inset: 0; overflow: hidden; overflow: clip; }

/* Fond commun à tous les écrans : une seule forme vert foncé qui se transforme
   (clip-path à 6 points) d'une étape à l'autre → aucune coupure pendant les transitions */
#bg-shape {
  position: absolute; inset: 0; background: var(--emerald);
  clip-path: polygon(100% 0, 100% 0, 100% 0, 100% 100%, 100% 100%, 100% 100%);
}
#bg-shape.no-anim, .no-anim, .no-anim * { transition: none !important; }

.screen {
  position: absolute; inset: 0; overflow: hidden; overflow: clip;
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .35s ease, visibility 0s linear .35s;
}
.screen.is-active {
  visibility: visible; opacity: 1; pointer-events: auto;
  transition: opacity .45s ease, visibility 0s;
}

.wordmark { display: inline-block; height: .74em; width: auto; vertical-align: baseline; }

/* ---------- Decorative bars (equalizer pills) ----------------------------- */
.bars { position: absolute; pointer-events: none; display: flex; align-items: flex-end; gap: calc(22 * var(--u)); }
.bars i {
  display: block; width: calc(var(--w, 44) * var(--u)); height: calc(var(--h) * var(--u));
  border-radius: 999px; background: var(--bar-on-dark);
  transform-origin: 50% 100%;
  animation: barPulse var(--d, 3.2s) ease-in-out var(--delay, 0s) infinite alternate;
}
.bars--top i, .bars.from-top i { transform-origin: 50% 0; }
@keyframes barPulse { from { transform: scaleY(1); } to { transform: scaleY(var(--s, .82)); } }

/* ---------- Chevrons ------------------------------------------------------ */
.chevrons { position: absolute; width: calc(150 * var(--u)); height: calc(100 * var(--u)); pointer-events: none; }
.chevrons--tr { top: calc(-2 * var(--u)); right: calc(0 * var(--u)); fill: rgba(14, 58, 47, .14); }
.chevrons--bl { bottom: calc(40 * var(--u)); left: calc(-10 * var(--u)); fill: rgba(120, 250, 174, .2); transform: scaleX(-1); }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 999px; font-weight: 700; letter-spacing: .01em;
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.btn:active { transform: translate(calc(3 * var(--u)), calc(3 * var(--u))); }

/* ---------- Waveform + player -------------------------------------------- */
.wave { display: flex; align-items: center; gap: calc(5 * var(--u)); height: calc(46 * var(--u)); }
.wave i {
  display: block; flex: none; width: calc(4.5 * var(--u)); height: calc(var(--h) * 1%); min-height: calc(4 * var(--u));
  border-radius: 99px; background: currentColor; transform-origin: 50% 50%;
}
@keyframes waveBeat { from { transform: scaleY(.35); } to { transform: scaleY(1); } }

.player {
  --pill: var(--pill-on-dark); --fg: var(--electric); --btn-bg: var(--electric); --btn-fg: var(--emerald);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: calc(14 * var(--u));
  align-items: center;
  width: calc(420 * var(--u)); height: calc(84 * var(--u));
  padding: calc(12 * var(--u)) calc(26 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u));
  border-radius: 999px; background: var(--pill); color: var(--fg);
  transition: height .35s var(--ease-out);
}
.player--light { --pill: var(--pill-on-light); --fg: var(--emerald); --btn-bg: var(--emerald); --btn-fg: var(--white); }
.player__btn {
  grid-row: 1 / 3; width: calc(58 * var(--u)); height: calc(58 * var(--u)); border-radius: 50%;
  display: grid; place-items: center; background: var(--btn-bg); color: var(--btn-fg);
  transition: transform .15s;
}
.player__btn:active { transform: scale(.9); }
.player__btn svg { width: 46%; height: 46%; fill: currentColor; }
.player__btn .ic-pause { display: none; }
.player.is-playing .player__btn .ic-play { display: none; }
.player.is-playing .player__btn .ic-pause { display: block; }
.player .wave { grid-row: 1 / 3; grid-column: 2; height: calc(40 * var(--u)); overflow: hidden; }
.player.is-playing .wave i { animation: waveBeat .55s ease-in-out calc(var(--i) * -0.05s) infinite alternate; }
.player__progress {
  display: none; grid-column: 2; grid-row: 2; align-items: center; gap: calc(10 * var(--u));
  font-size: calc(12 * var(--u)); font-weight: 400; letter-spacing: .08em; opacity: .9;
}
.player__bar { flex: 1; height: calc(3 * var(--u)); border-radius: 9px; background: color-mix(in srgb, currentColor 25%, transparent); overflow: hidden; }
.player__bar b { display: block; height: 100%; width: 0; background: currentColor; border-radius: inherit; }
.player.is-playing .wave { grid-row: 1; height: calc(34 * var(--u)); }
.player.is-playing .player__progress { display: flex; }

.player--lg { width: calc(520 * var(--u)); height: calc(104 * var(--u)); }
.player--lg .player__btn { width: calc(72 * var(--u)); height: calc(72 * var(--u)); }
.player--mini {
  --pill: transparent; --fg: var(--emerald); --btn-bg: var(--emerald); --btn-fg: var(--electric);
  width: auto; height: calc(44 * var(--u)); padding: 0;
}
.player--mini .player__btn { width: calc(36 * var(--u)); height: calc(36 * var(--u)); }
.player--mini .wave { height: calc(26 * var(--u)); gap: calc(4 * var(--u)); }
.player--mini .wave i { width: calc(3 * var(--u)); }
.player--mini .player__progress { display: none !important; }
.player--mini.is-playing .wave { grid-row: 1 / 3; height: calc(26 * var(--u)); }

/* ==========================================================================
   1. INTRO / VEILLE — kinetic typography
   ========================================================================== */

.kinetic { position: absolute; inset: 0; color: var(--emerald); pointer-events: none; }
.kw {
  position: absolute; margin: 0; font-weight: 700; line-height: .9; letter-spacing: -.005em;
  font-size: calc(var(--fs, 150) * var(--u)); white-space: nowrap;
  will-change: transform;
}
.kw.in  { animation: kwIn .65s var(--ease-out) both; }
.kw.out { animation: kwOut .55s var(--ease-in) both; }
@keyframes kwIn  { from { transform: translate(var(--fx, 60vw), var(--fy, 0)); } to { transform: none; } }
@keyframes kwOut { from { transform: none; } to { transform: translate(var(--tx, -70vw), var(--ty, 30vh)); } }
.btn--start {
  margin-top: calc(42 * var(--u)); width: calc(360 * var(--u)); height: calc(92 * var(--u));
  background: var(--white); color: #000; font-size: calc(34 * var(--u));
  box-shadow: calc(5 * var(--u)) calc(6 * var(--u)) 0 #000;
  animation: pulseBtn 2.4s ease-in-out infinite;
}
@keyframes pulseBtn { 0%, 100% { scale: 1; } 50% { scale: 1.05; } }


/* Car parade */
.home__bg { position: absolute; inset: 0; overflow: hidden; }

.parade { position: absolute; left: 0; right: 0; bottom: calc(8 * var(--u)); height: calc(120 * var(--u)); overflow: hidden; pointer-events: none; }
.parade__track { display: flex; gap: calc(22 * var(--u)); width: max-content; animation: parade 53s linear infinite; }
.parade__track img { height: calc(120 * var(--u)); width: auto; filter: drop-shadow(0 calc(6 * var(--u)) calc(6 * var(--u)) rgba(0,0,0,.18)); }
@keyframes parade { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.admin-hotspot { position: absolute; top: 0; left: 0; width: calc(120 * var(--u)); height: calc(120 * var(--u)); z-index: 5; }

/* ==========================================================================
   2. BATTLE
   ========================================================================== */
.battle__bg { position: absolute; inset: 0; }

.bars--battle-left { left: calc(0 * var(--u)); top: calc(110 * var(--u)); align-items: center; gap: calc(16 * var(--u)); }
.bars--battle-left i { --w: 26; }
.bars--battle-right { right: calc(10 * var(--u)); bottom: calc(-20 * var(--u)); gap: calc(16 * var(--u)); }
.bars--battle-right i { --w: 26; background: var(--bar-on-light); }

.round { position: absolute; top: calc(30 * var(--u)); left: calc(98 * var(--u)); z-index: 4; }
.round__label { margin: 0; font-size: calc(28 * var(--u)); font-weight: 700; line-height: 1.1; letter-spacing: .01em; }
.round__num { color: var(--electric); margin-left: .45em; display: inline-block; }
.round__num.bump { animation: bump .5s var(--ease-back); }
@keyframes bump { from { transform: scale(1.8); } }
.round__dots { display: flex; gap: calc(6 * var(--u)); margin-top: calc(10 * var(--u)); }
.back-btn {
  display: grid; place-items: center; margin-top: calc(16 * var(--u));
  width: calc(60 * var(--u)); height: calc(60 * var(--u)); border-radius: 50%;
  border: calc(2.5 * var(--u)) solid rgba(255, 255, 255, .75); color: var(--white);
  opacity: 0; pointer-events: none; transform: translateX(calc(-20 * var(--u)));
  transition: opacity .3s, transform .3s var(--ease-out), background .2s;
}
.back-btn svg { width: 56%; height: 56%; margin-left: -8%; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.screen--battle.can-back .back-btn { opacity: 1; pointer-events: auto; transform: none; }
.back-btn:active { background: rgba(255, 255, 255, .15); }
.round__dots i {
  width: calc(28 * var(--u)); height: calc(28 * var(--u)); border-radius: 50%;
  background: rgba(120, 250, 174, .18); transition: background .4s, box-shadow .4s;
}
.round__dots i.done { background: var(--electric); }
.round__dots i.current { background: rgba(120, 250, 174, .5); box-shadow: inset 0 0 0 calc(2 * var(--u)) var(--electric); }

.slot {
  position: absolute; top: 0; bottom: 0; width: 50%; transition: transform .6s var(--ease-out);
  display: grid; place-items: center; z-index: 2;
}
.slot--a { left: 0; }
.slot--b { right: 0; }

.card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding-top: calc(56 * var(--u));
  /* grossissement centré sur la pochette (padding 56 + demi-pochette 164) → elle ne bouge pas */
  transform-origin: 50% calc(220 * var(--u));
  transition: transform .5s var(--ease-out), opacity .4s;
  will-change: transform;
}
.card__cover {
  position: relative; width: calc(328 * var(--u)); aspect-ratio: 1; padding: 0;
  transition: padding .35s var(--ease-out), background .35s, box-shadow .35s, border-radius .35s;
  border-radius: calc(4 * var(--u));
}
.card__cover img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(2 * var(--u)); background: rgba(0,0,0,.15); }
/* La hauteur de la carte ne change jamais (sinon elle se recentre et la pochette saute) :
   le lecteur se rapproche par un simple décalage visuel. */
.card .player { margin-top: calc(86 * var(--u)); transition: translate .35s var(--ease-out); }
.card .card__meta { transition: translate .35s var(--ease-out); }
.card__meta { margin-top: calc(14 * var(--u)); text-align: center; }
.card__title { margin: 0; font-weight: 700; font-size: calc(30 * var(--u)); line-height: 1.15; }
.card__artist { margin: 0; font-weight: 400; font-size: calc(30 * var(--u)); line-height: 1.15; }

/* Couleur selon le côté (fond sombre / fond clair) */
.card--dark { color: var(--electric); }
.card--light { color: var(--emerald); }
.card--light .card__title { color: var(--emerald); }

/* Écoute en cours : la carte grossit + cadre */
.card.is-playing { transform: scale(1.12); }
.card.is-playing .card__cover { padding: calc(14 * var(--u)); border-radius: calc(20 * var(--u)); }
.card--dark.is-playing .card__cover  { background: var(--electric); box-shadow: calc(14 * var(--u)) calc(14 * var(--u)) 0 rgba(120, 250, 174, .45); }
.card--light.is-playing .card__cover { background: var(--white);    box-shadow: calc(14 * var(--u)) calc(14 * var(--u)) 0 rgba(255, 255, 255, .5); }
.card.is-playing .player, .card.is-playing .card__meta { translate: 0 calc(-30 * var(--u)); }
.card.is-dimmed { transform: scale(.86); }

/* Morceau choisi */
.card.is-chosen { transform: scale(1.22); z-index: 3; }
.card.is-chosen .card__cover { padding: calc(14 * var(--u)); border-radius: calc(20 * var(--u)); animation: chosenGlow 1s ease-in-out infinite alternate; }
.card--dark.is-chosen .card__cover  { background: var(--electric); }
.card--light.is-chosen .card__cover { background: var(--white); }
.card.is-chosen .player, .card.is-chosen .card__meta { translate: 0 calc(-34 * var(--u)); }
@keyframes chosenGlow {
  from { box-shadow: 0 0 0 0 rgba(120, 250, 174, .0), calc(14 * var(--u)) calc(14 * var(--u)) 0 rgba(120, 250, 174, .45); }
  to   { box-shadow: 0 0 calc(60 * var(--u)) calc(10 * var(--u)) rgba(120, 250, 174, .55), calc(14 * var(--u)) calc(14 * var(--u)) 0 rgba(120, 250, 174, .45); }
}
.card.is-chosen::after {
  content: '✓'; position: absolute; top: calc(34 * var(--u)); left: calc(50% + 104 * var(--u));
  width: calc(78 * var(--u)); height: calc(78 * var(--u)); border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; font-size: calc(42 * var(--u));
  background: var(--emerald); color: var(--electric); box-shadow: 0 0 0 calc(4 * var(--u)) var(--electric);
  animation: pop .45s var(--ease-back) both;
}
@keyframes pop { from { transform: scale(0); } }
.card.is-lost { transform: scale(.8); opacity: .45; filter: grayscale(.6); transition: transform .5s var(--ease-out), opacity .4s, filter .4s; }

/* Entrée / sortie des cartes */
.card.enter-left   { animation: cardInL .8s var(--ease-out) both; }
.card.enter-right  { animation: cardInR .8s var(--ease-out) both; }
.card.exit-left    { animation: cardOutL .6s var(--ease-in) both; }
.card.exit-right   { animation: cardOutR .6s var(--ease-in) both; }
@keyframes cardInL  { from { translate: -120vw 0; rotate: -14deg; } }
@keyframes cardInR  { from { translate: 120vw 0; rotate: 14deg; } }
@keyframes cardOutL { to   { translate: -120vw 0; rotate: -18deg; opacity: .6; } }
@keyframes cardOutR { to   { translate: 120vw 0; rotate: 18deg; opacity: .6; } }

.vs {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  width: calc(186 * var(--u)); height: calc(186 * var(--u)); margin: calc(-93 * var(--u)) 0 0 calc(-93 * var(--u));
  border-radius: 50%; display: grid; place-items: center;
  background: rgba(45, 116, 87, .55); /* vert intermédiaire translucide : visible sur les deux fonds (maquette) */
  font-weight: 700; font-size: calc(86 * var(--u)); letter-spacing: -.02em;
  transition: transform .6s var(--ease-out), opacity .4s;
}
.vs span { transform: translateY(4%); }
.screen--battle.is-entering .vs { transform: scale(0) rotate(-90deg); }
.screen--battle.is-deciding .vs { transform: scale(.7); opacity: .5; }
.vs.hit { animation: vsHit .6s var(--ease-back); }
@keyframes vsHit { 0% { transform: scale(1.4) rotate(-8deg); } 100% { transform: none; } }

.swipe-banner {
  position: absolute; left: 50%; top: calc(30 * var(--u)); height: calc(30.8 * var(--u)); z-index: 4; translate: -50% 0;
  display: flex; align-items: center; gap: calc(24 * var(--u)); white-space: nowrap;
  font-weight: 700; font-size: calc(52 * var(--u)); line-height: 1; color: var(--white);
  opacity: 0; pointer-events: none;
}
.swipe-banner.show { animation: swipeShow 2.4s var(--ease-out) both; }
@keyframes swipeShow { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

.battle__hint {
  position: absolute; left: 50%; top: calc(30 * var(--u)); translate: -50% 0; margin: 0; z-index: 4;
  width: max-content; max-width: calc(760 * var(--u)); text-align: center;
  font-size: calc(28 * var(--u)); font-weight: 700; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em;
  color: var(--white); text-shadow: 0 calc(2 * var(--u)) calc(10 * var(--u)) rgba(14, 58, 47, .45);
  transition: opacity .35s, transform .35s var(--ease-out);
}
.screen--battle.is-active .battle__hint { animation: riseIn .7s var(--ease-out) .5s both; }
.screen--battle.is-deciding .battle__hint, .screen--battle.hint-off .battle__hint { opacity: 0; transform: translateY(calc(-20 * var(--u))); }

/* ==========================================================================
   2b. TUTO
   ========================================================================== */
.bars--tuto { bottom: calc(-40 * var(--u)); right: calc(50 * var(--u)); gap: calc(26 * var(--u)); }
.bars--tuto i { --w: 52; }
.tuto {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center;
  padding-top: calc(46 * var(--u)); text-align: center;
}
.tuto__title { margin: 0; font-weight: 700; font-size: calc(92 * var(--u)); line-height: 1.02; }
.tuto__title .line { display: block; }
.tuto__title .wordmark { height: .7em; margin-left: .12em; }
.tuto__title .line--waves { display: flex; align-items: center; justify-content: center; gap: calc(40 * var(--u)); }
.wave--tuto { color: var(--electric); height: calc(50 * var(--u)); gap: calc(6 * var(--u)); }
.wave--tuto i { width: calc(5 * var(--u)); animation: waveBeat 1.1s ease-in-out calc(var(--i) * -0.07s) infinite alternate; }
.tuto__steps {
  list-style: none; margin: calc(54 * var(--u)) 0 0; padding: 0; text-align: left;
  display: grid; grid-template-columns: repeat(2, calc(440 * var(--u))); column-gap: calc(90 * var(--u)); row-gap: calc(36 * var(--u));
}
.tuto__step { display: flex; align-items: center; gap: calc(14 * var(--u)); }
.tuto__num { flex: none; width: calc(76 * var(--u)); text-align: center; font-weight: 700; font-size: calc(124 * var(--u)); line-height: .8; }
.tuto__txt { font-weight: 700; font-size: calc(24 * var(--u)); line-height: 1.45; }
.tuto__txt em { font-style: normal; color: var(--electric); }
/* Légère ombre portée (maquette V2) */
.tuto__num, .tuto__txt { text-shadow: calc(2 * var(--u)) calc(2.5 * var(--u)) calc(1.5 * var(--u)) rgba(0, 0, 0, .3); }
.btn--tuto { margin-top: calc(48 * var(--u)); width: calc(300 * var(--u)); height: calc(80 * var(--u)); font-size: calc(40 * var(--u)); }

.screen--tuto.is-active .tuto__title { animation: riseIn .8s var(--ease-out) .15s both; }
.screen--tuto.is-active .tuto__step { animation: riseIn .7s var(--ease-out) both; }
.screen--tuto.is-active .tuto__step:nth-child(1) { animation-delay: .35s; }
.screen--tuto.is-active .tuto__step:nth-child(2) { animation-delay: .45s; }
.screen--tuto.is-active .tuto__step:nth-child(3) { animation-delay: .55s; }
.screen--tuto.is-active .tuto__step:nth-child(4) { animation-delay: .65s; }
.screen--tuto.is-active .btn--tuto { animation: riseIn .7s var(--ease-out) .85s both, pulseBtn 2.4s ease-in-out 1.6s infinite; }
.screen--tuto.is-active .parade { animation: paradeUp 1s var(--ease-out) .4s both; }
@keyframes paradeUp { from { transform: translateY(150%); } }
@keyframes slideInR { from { transform: translateX(calc(120 * var(--u))); opacity: 0; } }

/* ==========================================================================
   3b. FINAL ROUND — écran de transition festif (battles 5 → 6)
   ========================================================================== */
.screen--final { color: var(--white); }
.final {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding-bottom: calc(40 * var(--u));
}
.final__title {
  margin: 0; font-weight: 700; font-size: calc(118 * var(--u)); line-height: 1; letter-spacing: -.005em;
  text-shadow: calc(3 * var(--u)) calc(4 * var(--u)) calc(3 * var(--u)) rgba(0, 0, 0, .3);
}
.final__title span { display: inline-block; }
.final__a { color: var(--electric); }
.wave--final { color: var(--electric); height: calc(64 * var(--u)); gap: calc(7 * var(--u)); margin-top: calc(50 * var(--u)); }
.wave--final i { width: calc(6 * var(--u)); }
.final__sub { margin: calc(56 * var(--u)) 0 0; max-width: calc(700 * var(--u)); font-size: calc(32 * var(--u)); font-weight: 400; line-height: 1.3; }

.bars--final-l { left: calc(8 * var(--u)); top: calc(110 * var(--u)); align-items: center; gap: calc(30 * var(--u)); }
.bars--final-r { right: calc(10 * var(--u)); bottom: calc(-30 * var(--u)); gap: calc(30 * var(--u)); }
.bars--final-l i, .bars--final-r i { --w: 26; }
.chevrons--final-tr { top: calc(10 * var(--u)); right: calc(0 * var(--u)); fill: rgba(120, 250, 174, .25); }
.chevrons--final-bl { bottom: calc(30 * var(--u)); left: calc(-6 * var(--u)); fill: rgba(120, 250, 174, .25); transform: scaleX(-1); }

/* Entrées : les deux mots claquent depuis les côtés, puis vibrent et brillent */
.screen--final.is-playing .final__a { animation: finalInL .8s var(--ease-out) .15s both, finalGlow 1.2s ease-in-out 1s infinite alternate; }
.screen--final.is-playing .final__b { animation: finalInR .8s var(--ease-out) .3s both; }
.screen--final.is-playing .final__title { animation: finalZoom .7s ease-out .95s both, finalPush 4s ease-out 1.65s forwards; }
.screen--final.is-playing .wave--final { animation: riseIn .6s var(--ease-out) .7s both; }
.screen--final.is-playing .final__sub { animation: riseIn .7s var(--ease-out) 1.1s both; }
.screen--final.is-playing .bars--final-l i, .screen--final.is-playing .bars--final-r i { animation: barGrow .7s var(--ease-back) calc(.2s + var(--k, 0) * .08s) both, barPulse .9s ease-in-out 1s infinite alternate; }
.screen--final.is-playing .chevrons--final-tr { animation: chevIn .6s var(--ease-out) .4s both, chevBlink 1s ease-in-out 1s infinite alternate; }
.screen--final.is-playing .chevrons--final-bl { animation: chevInL .6s var(--ease-out) .4s both, chevBlink 1s ease-in-out 1.2s infinite alternate; }
@keyframes finalInL { from { transform: translateX(-70vw) scale(.6); opacity: 0; } }
@keyframes finalInR { from { transform: translateX(70vw) scale(.6); opacity: 0; } }
/* Zoom / dézoom (sans rotation) une fois les deux mots en place, puis respiration légère */
@keyframes finalZoom { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 65% { transform: scale(.96); } 100% { transform: scale(1); } }
/* Puis léger zoom avant continu qui ne s'inverse pas jusqu'à la fin de l'écran */
@keyframes finalPush { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes finalGlow { from { text-shadow: calc(3 * var(--u)) calc(4 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.3); } to { text-shadow: 0 0 calc(40 * var(--u)) rgba(120, 250, 174, .75), calc(3 * var(--u)) calc(4 * var(--u)) calc(3 * var(--u)) rgba(0,0,0,.3); } }
@keyframes barGrow { from { transform: scaleY(0); } }
@keyframes chevIn { from { transform: translateX(calc(160 * var(--u))); opacity: 0; } }
@keyframes chevInL { from { transform: scaleX(-1) translateX(calc(160 * var(--u))); opacity: 0; } to { transform: scaleX(-1); } }
@keyframes chevBlink { from { opacity: .5; } to { opacity: 1; } }

/* Explosion de la barre de son : les barres s'envolent, onde de choc, puis recomposition */
.final__boom { position: relative; }
.screen--final.is-playing .wave--final i {
  animation: waveBeat .45s ease-in-out calc(var(--i) * -0.06s) infinite alternate,
             waveBoom 2.6s cubic-bezier(.2, .8, .3, 1) calc(1.5s + var(--bd, 0s)) both;
}
@keyframes waveBoom {
  0%   { translate: 0 0; rotate: 0deg; opacity: 1; }
  8%   { translate: 0 0; rotate: 0deg; opacity: 1; scale: 1.6; }
  40%  { translate: var(--bx) var(--by); rotate: var(--br); opacity: 1; scale: 1.2; }
  55%  { translate: var(--bx) var(--by); rotate: var(--br); opacity: 0; }
  70%  { translate: 0 0; rotate: 0deg; opacity: 0; scale: .2; }
  100% { translate: 0 0; rotate: 0deg; opacity: 1; scale: 1; }
}
.final__shock {
  position: absolute; left: 50%; top: 50%; width: calc(120 * var(--u)); height: calc(120 * var(--u));
  margin: calc(-60 * var(--u)) 0 0 calc(-60 * var(--u)); border-radius: 50%;
  border: calc(6 * var(--u)) solid var(--electric); opacity: 0; pointer-events: none;
}
.screen--final.is-playing .final__shock { animation: shock 1.1s var(--ease-out) 1.6s forwards; } /* invisible avant son départ */
@keyframes shock { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(9); } }

html.is-portrait .final__title { font-size: calc(96 * var(--u)); }
html.is-portrait .final__sub { max-width: calc(640 * var(--u)); }

/* ==========================================================================
   4. FORM
   ========================================================================== */
.bars--form { top: calc(-40 * var(--u)); left: calc(30 * var(--u)); align-items: flex-start; gap: calc(22 * var(--u)); }
.bars--form i { --w: 64; transform-origin: 50% 0; }

.form-wrap {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding-top: calc(62 * var(--u)); text-align: center; z-index: 2;
}
.form__title { margin: 0; font-weight: 700; font-size: calc(58 * var(--u)); line-height: 1.05; }
.form__subtitle { margin: calc(12 * var(--u)) 0 0; max-width: calc(660 * var(--u)); white-space: pre-line; font-size: calc(24 * var(--u)); font-weight: 400; line-height: 1.3; }
.form {
  margin-top: calc(34 * var(--u)); width: calc(840 * var(--u));
  background: var(--white); color: #000; border-radius: calc(36 * var(--u));
  padding: calc(26 * var(--u)) calc(46 * var(--u)) calc(28 * var(--u));
  display: flex; flex-direction: column; gap: calc(14 * var(--u)); text-align: left; position: relative;
  box-shadow: 0 calc(20 * var(--u)) calc(60 * var(--u)) rgba(0,0,0,.2);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: calc(40 * var(--u)); }
.field { display: flex; flex-direction: column; gap: calc(8 * var(--u)); }
.field__label { font-weight: 700; font-size: calc(30 * var(--u)); padding-left: calc(8 * var(--u)); }
.field__input {
  height: calc(50 * var(--u)); border-radius: 999px; border: calc(2 * var(--u)) solid var(--emerald);
  background: var(--electric); padding: 0 calc(22 * var(--u)); font: inherit; font-size: calc(24 * var(--u)); color: var(--emerald);
  outline: none; transition: box-shadow .2s, background .2s;
}
.field__input:focus { box-shadow: 0 0 0 calc(4 * var(--u)) rgba(14, 58, 47, .25); background: #9bfcc3; }
.field__input.is-invalid { border-color: #d62d2d; box-shadow: 0 0 0 calc(4 * var(--u)) rgba(214, 45, 45, .2); animation: shake .4s; }
@keyframes shake { 25% { translate: calc(-8 * var(--u)) 0; } 75% { translate: calc(8 * var(--u)) 0; } }

.consent { display: flex; align-items: flex-start; gap: calc(12 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.35; cursor: pointer; padding-left: calc(8 * var(--u)); }
.consent input { position: absolute; opacity: 0; pointer-events: none; }
.consent__box {
  flex: none; width: calc(26 * var(--u)); height: calc(26 * var(--u)); border-radius: calc(6 * var(--u));
  border: calc(2 * var(--u)) solid var(--emerald); display: grid; place-items: center; transition: background .2s;
}
.consent input:checked + .consent__box { background: var(--emerald); }
.consent input:checked + .consent__box::after { content: '✓'; color: var(--electric); font-weight: 900; font-size: calc(18 * var(--u)); }
.consent.is-invalid .consent__box { border-color: #d62d2d; animation: shake .4s; }
.consent__text { color: #333; }
.form__error { margin: 0; min-height: calc(18 * var(--u)); color: #d62d2d; font-size: calc(16 * var(--u)); text-align: center; }
.btn--submit {
  align-self: center; min-width: calc(360 * var(--u)); padding: 0 calc(44 * var(--u)); height: calc(76 * var(--u)); line-height: 1.05;
  border: calc(2 * var(--u)) solid var(--emerald); background: var(--electric); color: #000;
  font-size: calc(24 * var(--u)); box-shadow: calc(5 * var(--u)) calc(6 * var(--u)) 0 var(--emerald);
}
.btn--submit .wordmark--btn { height: .66em; display: inline-block; vertical-align: baseline; }
.btn--submit[disabled] { opacity: .6; }
.btn--skip {
  position: absolute; right: calc(46 * var(--u)); bottom: calc(38 * var(--u));
  min-width: calc(130 * var(--u)); height: calc(56 * var(--u)); padding: 0 calc(32 * var(--u));
  border: calc(2 * var(--u)) solid var(--emerald); background: transparent; color: var(--emerald);
  font-size: calc(20 * var(--u)); letter-spacing: .08em;
}
.parade--form { bottom: calc(6 * var(--u)); height: calc(100 * var(--u)); }
.parade--form .parade__track img { height: calc(100 * var(--u)); }

.screen--form.is-active .form-wrap > * { animation: riseIn .8s var(--ease-out) both; }
.screen--form.is-active .form-wrap > :nth-child(2) { animation-delay: .1s; }
.screen--form.is-active .form-wrap > :nth-child(3) { animation-delay: .2s; }
@keyframes riseIn { from { transform: translateY(calc(60 * var(--u))); opacity: 0; } }


/* ==========================================================================
   5. VIDEO
   ========================================================================== */
.screen--video { background: #000; }
.screen--video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* ==========================================================================
   6. THANK YOU
   ========================================================================== */
.screen--thanks { color: var(--emerald); }
.bars--thanks-r { top: calc(-60 * var(--u)); right: calc(100 * var(--u)); align-items: flex-start; gap: calc(60 * var(--u)); }
.bars--thanks-r i, .bars--thanks-l i { --w: 84; background: var(--bar-on-light); transform-origin: 50% 0; }
.bars--thanks-l { bottom: calc(-60 * var(--u)); left: calc(0 * var(--u)); gap: calc(46 * var(--u)); }
.bars--thanks-l i { transform-origin: 50% 100%; }
.thanks__inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.thanks__title { margin: 0; font-weight: 700; font-size: calc(118 * var(--u)); line-height: 1.02; }
.thanks__title span { display: block; }
.thanks__sub { margin: calc(56 * var(--u)) 0 0; font-size: calc(36 * var(--u)); font-weight: 400; max-width: calc(1000 * var(--u)); line-height: 1.25; }
.screen--thanks.is-active .thanks__title span { animation: riseIn .7s var(--ease-out) both; }
.screen--thanks.is-active .thanks__title span:nth-child(2) { animation-delay: .08s; }
.screen--thanks.is-active .thanks__title span:nth-child(3) { animation-delay: .16s; }
.screen--thanks.is-active .thanks__sub { animation: riseIn .7s var(--ease-out) .3s both; }

/* ==========================================================================
   7. PROFILE
   ========================================================================== */

.profile__inner {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1fr calc(540 * var(--u)); align-items: center;
  padding: 0 calc(60 * var(--u)) 0 calc(30 * var(--u)); gap: calc(20 * var(--u));
}
.profile__car { display: flex; flex-direction: column; align-items: flex-start; }
.profile__heading { margin: 0 0 0 calc(10 * var(--u)); font-weight: 700; line-height: 1; }
.profile__heading .line { display: block; font-size: calc(98 * var(--u)); margin-left: calc(100 * var(--u)); }
.profile__heading .line--sm { font-size: calc(56 * var(--u)); margin-left: 0; margin-bottom: calc(10 * var(--u)); }
.profile__stage { position: relative; width: calc(800 * var(--u)); height: calc(480 * var(--u)); margin-top: calc(10 * var(--u)); }
.profile__circle {
  position: absolute; left: 50%; top: 52%; width: calc(440 * var(--u)); aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; background: var(--electric);
}
.bars--profile { left: calc(20 * var(--u)); right: calc(20 * var(--u)); top: calc(-90 * var(--u)); bottom: calc(150 * var(--u)); align-items: center; gap: calc(30 * var(--u)); justify-content: center; }
.bars--profile i { --w: 46; background: rgba(120, 250, 174, .2); }
.profile__car-img { position: absolute; left: 50%; bottom: calc(-40 * var(--u)); width: calc(930 * var(--u)); height: auto; translate: -50% 0; filter: drop-shadow(0 calc(20 * var(--u)) calc(20 * var(--u)) rgba(0,0,0,.35)); }

.profile__card {
  position: relative; background: var(--electric); color: var(--emerald);
  border-radius: calc(36 * var(--u)); padding: calc(26 * var(--u)) calc(38 * var(--u)) calc(22 * var(--u));
  border: calc(2 * var(--u)) solid var(--emerald);
}
.profile__name { margin: 0; text-align: center; font-weight: 700; font-size: calc(30 * var(--u)); line-height: 1.25; }

/* Scores en % : dominante + secondaire en foncé, les autres en vert intermédiaire */
.scores { margin: calc(16 * var(--u)) 0 0; display: grid; gap: calc(6 * var(--u)); }
.scores__row { display: grid; grid-template-columns: calc(130 * var(--u)) 1fr; align-items: center; column-gap: calc(12 * var(--u)); }
.scores__label { text-align: right; font-size: calc(17 * var(--u)); letter-spacing: .02em; }
.scores__track { height: calc(24 * var(--u)); }
.scores__bar {
  display: flex; align-items: center; justify-content: flex-end; height: 100%; width: var(--w);
  padding: 0 calc(8 * var(--u)); border-radius: calc(5 * var(--u));
  background: #4fc99a; color: var(--emerald); font-size: calc(16 * var(--u)); font-weight: 400;
  transform-origin: 0 50%;
}
.scores__row.is-top .scores__bar { background: var(--emerald); color: var(--white); }
.scores__bar b { font-weight: 400; }
.screen--profile.is-active .scores__bar { animation: barFill 1s var(--ease-out) both; }
.screen--profile.is-active .scores__row:nth-child(1) .scores__bar { animation-delay: .9s; }
.screen--profile.is-active .scores__row:nth-child(2) .scores__bar { animation-delay: 1s; }
.screen--profile.is-active .scores__row:nth-child(3) .scores__bar { animation-delay: 1.1s; }
.screen--profile.is-active .scores__row:nth-child(4) .scores__bar { animation-delay: 1.2s; }
.screen--profile.is-active .scores__row:nth-child(5) .scores__bar { animation-delay: 1.3s; }
@keyframes barFill { from { transform: scaleX(0); } }

.profile__desc { margin: calc(16 * var(--u)) 0 0; font-size: calc(16 * var(--u)); line-height: 1.45; }
.profile__desc strong { font-weight: 700; }
.profile__section {
  margin: calc(16 * var(--u)) 0 0; padding-bottom: calc(6 * var(--u));
  border-bottom: calc(2 * var(--u)) solid var(--emerald); font-weight: 700; font-size: calc(21 * var(--u));
}
.profile__track { display: flex; gap: calc(26 * var(--u)); align-items: center; }
.profile__cover { width: calc(92 * var(--u)); aspect-ratio: 1; object-fit: cover; }
.profile__track-info { flex: 1; min-width: 0; }
.profile__track-title { margin: calc(10 * var(--u)) 0 0; font-weight: 700; font-size: calc(19 * var(--u)); line-height: 1.25; }
.player--mini .wave { height: calc(40 * var(--u)); }
.profile__playlist { display: flex; align-items: flex-end; justify-content: flex-end; gap: calc(20 * var(--u)); margin-top: calc(8 * var(--u)); }
.profile__cta { margin: 0 0 calc(6 * var(--u)); text-align: right; font-size: calc(20 * var(--u)); line-height: 1.35; }
.profile__cta span { display: block; }
.qr { flex: none; width: calc(116 * var(--u)); height: calc(116 * var(--u)); }
.qr__code, .qr__code svg { display: block; width: 100%; height: 100%; }

.screen--profile.is-active .profile__heading { animation: slideInL .8s var(--ease-out) .1s both; }
.screen--profile.is-active .profile__circle { animation: circleIn .9s var(--ease-back) .2s both; }
.screen--profile.is-active .profile__car-img { animation: carIn 1.1s var(--ease-out) .35s both; }
.screen--profile.is-active .profile__card { animation: slideInR .9s var(--ease-out) .5s both; }
.screen--profile.is-active .qr { animation: pop .6s var(--ease-back) 1.4s both; }
@keyframes slideInL { from { transform: translateX(calc(-200 * var(--u))); opacity: 0; } }
@keyframes circleIn { from { scale: 0; } }
@keyframes carIn { from { transform: translateX(calc(-700 * var(--u))); opacity: 0; } }

.countdown { position: absolute; left: 0; bottom: 0; height: calc(9 * var(--u)); width: 100%; background: rgb(45, 116, 87); transform-origin: 0 50%; transform: scaleX(0); z-index: 3; }
.countdown.run { animation: countdown var(--dur, 10s) linear both; }
@keyframes countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ==========================================================================
   Wipe (écran vert de transition)
   ========================================================================== */
.wipe { position: fixed; inset: 0; background: var(--electric); z-index: 50; pointer-events: none; opacity: 0; }
.wipe.fade-in  { transition: opacity var(--dur, .8s) ease; opacity: 1; pointer-events: auto; }
.wipe.fade-out { transition: opacity var(--dur, .6s) ease; opacity: 0; }
.wipe.slide-in  { opacity: 1; animation: wipeIn .55s var(--ease-in) both; pointer-events: auto; }
.wipe.slide-out { opacity: 1; animation: wipeOut .6s var(--ease-out) both; }
@keyframes wipeIn  { from { transform: translateX(100%); } to { transform: none; } }
@keyframes wipeOut { from { transform: none; } to { transform: translateX(-100%); } }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.admin[hidden] { display: none; }
.admin__panel { background: #fff; color: #111; border-radius: 16px; padding: 28px; width: min(92vw, 520px); font-size: 16px; }
.admin__panel h3 { margin: 0 0 8px; }
.admin__error { color: #c62828; font-size: 14px; margin: 8px 0 0; word-break: break-word; }
.admin__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.admin__actions button { padding: 12px 18px; border-radius: 99px; background: var(--emerald); color: #fff; font-weight: 700; }
.admin__actions .danger { background: #c62828; }

/* ==========================================================================
   PORTRAIT — réorganisation verticale
   ========================================================================== */
/* PORTRAIT (classe posée par JS selon l'orientation) */

/* Tuto / veille */
html.is-portrait .parade { bottom: calc(60 * var(--u)); height: calc(150 * var(--u)); }
html.is-portrait .parade__track img { height: calc(150 * var(--u)); }

/* Battle */
html.is-portrait .slot { width: 100%; height: 50%; left: 0; right: 0; }
html.is-portrait .slot--a { top: 0; bottom: auto; padding-top: calc(190 * var(--u)); }
html.is-portrait .battle__hint { top: calc(130 * var(--u)); font-size: calc(32 * var(--u)); max-width: calc(700 * var(--u)); }
html.is-portrait .slot--b { top: auto; bottom: 0; padding-bottom: calc(30 * var(--u)); }
html.is-portrait .card { padding-top: 0; }
html.is-portrait .card__cover { width: calc(330 * var(--u)); }
html.is-portrait .card .player { margin-top: calc(34 * var(--u)); }
html.is-portrait .card { transform-origin: 50% calc(165 * var(--u)); }
html.is-portrait .card.is-playing :is(.player, .card__meta), html.is-portrait .card.is-chosen :is(.player, .card__meta) { translate: 0 calc(-6 * var(--u)); }
html.is-portrait .card.is-chosen::after { top: calc(-22 * var(--u)); left: calc(50% + 106 * var(--u)); }
html.is-portrait .vs { width: calc(150 * var(--u)); height: calc(150 * var(--u)); margin: calc(-75 * var(--u)) 0 0 calc(-75 * var(--u)); font-size: calc(70 * var(--u)); top: 51%; }
html.is-portrait .round { left: calc(50 * var(--u)); top: calc(40 * var(--u)); }
html.is-portrait .round { right: calc(50 * var(--u)); }
html.is-portrait .back-btn { position: absolute; right: 0; top: 0; margin: 0; }
html.is-portrait .swipe-banner { top: 50%; translate: -50% -50%; z-index: 6; }
@keyframes cardInLP  { from { translate: 0 -80vh; rotate: -10deg; } }
@keyframes cardInRP  { from { translate: 0 80vh; rotate: 10deg; } }
@keyframes cardOutLP { to   { translate: 0 -80vh; rotate: -14deg; opacity: .6; } }
@keyframes cardOutRP { to   { translate: 0 80vh; rotate: 14deg; opacity: .6; } }

/* Winner */

/* Form */
html.is-portrait .form-wrap { padding-top: calc(160 * var(--u)); }
html.is-portrait .form { width: calc(720 * var(--u)); }
html.is-portrait .form__row { grid-template-columns: 1fr; gap: calc(14 * var(--u)); }
html.is-portrait .form__title { font-size: calc(62 * var(--u)); max-width: calc(700 * var(--u)); }
html.is-portrait .parade--form { bottom: calc(60 * var(--u)); height: calc(130 * var(--u)); }
html.is-portrait .parade--form .parade__track img { height: calc(130 * var(--u)); }

/* Thanks */
html.is-portrait .thanks__title { font-size: calc(96 * var(--u)); }
html.is-portrait .thanks__sub { max-width: calc(680 * var(--u)); }

/* Profile */
html.is-portrait .profile__inner { grid-template-columns: 1fr; align-content: center; padding: calc(60 * var(--u)) calc(50 * var(--u)); gap: calc(10 * var(--u)); }
html.is-portrait .profile__car { align-items: center; }
html.is-portrait .profile__heading { text-align: center; margin: 0; }
html.is-portrait .profile__heading .line { margin-left: 0; }
html.is-portrait .tuto { padding-top: calc(150 * var(--u)); }
html.is-portrait .tuto__title { font-size: calc(80 * var(--u)); white-space: nowrap; }
html.is-portrait .tuto__title .line--waves { gap: calc(26 * var(--u)); }
html.is-portrait .wave--tuto { flex: none; width: calc(110 * var(--u)); overflow: hidden; }
html.is-portrait .tuto__steps { grid-template-columns: calc(640 * var(--u)); row-gap: calc(34 * var(--u)); margin-top: calc(80 * var(--u)); }
html.is-portrait .btn--tuto { margin-top: calc(80 * var(--u)); }
html.is-portrait .profile__stage { width: calc(710 * var(--u)); height: calc(440 * var(--u)); }
html.is-portrait .profile__car-img { width: calc(800 * var(--u)); }
html.is-portrait .profile__circle { width: calc(400 * var(--u)); }

html.is-portrait .card.enter-left  { animation-name: cardInLP; }
html.is-portrait .card.enter-right { animation-name: cardInRP; }
html.is-portrait .card.exit-left   { animation-name: cardOutLP; }
html.is-portrait .card.exit-right  { animation-name: cardOutRP; }


/* Petits écrans très larges/étroits : sécurité */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
