/* Le plateau en direct occupe la place de la navigation du salon. */
.on-air > header,
.on-air > footer,
.on-air > .skip {
  display: none;
}
.on-air {
  background: radial-gradient(ellipse at 75% -20%, #2b2345, transparent 58%), #10101b;
}
.on-air main {
  padding-block: clamp(16px, 4vh, 42px);
  min-height: 100svh;
}
.broadcast-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.on-air .room-head h1 {
  font-size: clamp(19px, 2.1vw, 36px);
  color: #e1dbeb;
}
.round-mode,
.theme-label,
.power,
.power-emblem {
  color: var(--accent);
}
.round-mode {
  font:
    750 0.88rem Bricolage,
    system-ui;
  border-left: 1px solid #6c6283;
  padding-left: 14px;
}
.solo-stage {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1000px;
  margin: auto;
}
.on-air:not(.tv) .room-head {
  max-width: 1000px;
  margin-inline: auto;
}
.time-track {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.time-track .meter {
  flex: 1;
  margin: 0;
}
.time-track .timer {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.glyph,
.theme-icon,
.landscape {
  width: 1.55em;
  height: 1.55em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(158px, 100%), 1fr));
  gap: 10px;
}
.theme-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  isolation: isolate;
  display: grid;
  align-content: end;
  gap: 2px;
  min-height: 133px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #353144);
  border-radius: 15px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 22%, #191728), #1a1728 87%);
  color: #fff;
}
.theme-card:disabled {
  opacity: 1;
}
.theme-card .landscape {
  position: absolute;
  z-index: -1;
  right: -5%;
  top: -1%;
  width: 81%;
  height: 66%;
  color: var(--accent);
  opacity: 0.43;
  stroke-width: 2;
}
.theme-icon {
  padding: 6px;
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: #1a162cdd;
  color: var(--accent);
  margin-bottom: 5px;
}
.theme-card strong {
  line-height: 1.13;
  font-size: 1.02rem;
  max-width: 23ch;
  text-wrap: balance;
}
.theme-card small {
  font-size: 0.76rem;
  color: var(--accent);
}
button.theme-card:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.theme-card.taken {
  background: #23212e;
  border-style: dashed;
}
.theme-card.taken .landscape {
  opacity: 0.13;
}
.theme-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  font-size: 0.92em;
}
.question-sheet > h2 {
  max-width: 34ch;
}
.watch-title {
  font:
    700 clamp(1.6rem, 4vw, 3rem) / 1.1 Bricolage,
    system-ui;
  letter-spacing: -0.03em;
  margin: 12px 0 24px;
}
.watch-sheet {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.watch-sheet h2 {
  font-size: clamp(1.13rem, 2.1vw, 1.55rem);
  max-width: 60ch;
}
.watch-sheet .answer {
  font-size: 0.92rem;
  min-height: 40px;
  padding: 8px 11px;
  background: #252233;
}
.signal-card {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: clamp(270px, 52vh, 620px);
  text-align: center;
  gap: 8px;
}
.signal-orb {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 34% 26%, #fbffbf, #d0f66d 55%, #a4c557);
  box-shadow:
    0 6px 0 #53663a,
    0 12px 36px #a9ff4f22;
  color: #343922;
  border-radius: 50%;
  width: 68px;
  height: 62px;
  font:
    800 40px/1 Bricolage,
    system-ui;
  margin-bottom: 18px;
}
.signal-card .eyebrow,
.signal-card h2 {
  margin: 0;
}
.signal-card .signal-go {
  margin-top: 14px;
  min-height: 53px;
  padding: 12px 30px;
}
.waiting {
  color: var(--soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}
.waiting i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbbaff;
  animation: pulse 1.4s ease-in-out infinite alternate;
}
@keyframes pulse {
  to {
    opacity: 0.35;
  }
}
.power-slot {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}
.power,
.power-emblem {
  background: color-mix(in srgb, var(--accent) 12%, #171423);
  border: 1px solid var(--accent);
  border-radius: 15px;
}
.power {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 9px;
  padding: 9px 16px;
  font-weight: 750;
}
.power small,
.power-flash small {
  display: block;
  letter-spacing: 0.13em;
  font-size: 0.68em;
}
.power-emblem {
  display: inline-grid;
  place-items: center;
  padding: 10px;
  margin-bottom: 10px;
}
.board .rank li {
  position: relative;
  gap: 8px;
  padding: 7px 6px;
  border-left: 3px solid transparent;
}
.board .medal {
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 3.1em;
  font-size: 0.88em;
  font-weight: 800;
}
.medal .glyph {
  width: 1.55em;
}
.place-1 .medal {
  color: #ffd76b;
}
.place-2 .medal {
  color: #d9e3f0;
}
.place-3 .medal {
  color: #eaaa86;
}
.board .tail {
  border-left-color: #ff797f !important;
  background: #ff697910;
}
.board .near-tail {
  border-left-color: #ffac6a !important;
  background: #ff994510;
}
.board li.tail:not(.place-2, .place-3) .medal {
  color: #ff929a;
}
.board li.near-tail:not(.place-1, .place-2, .place-3) .medal {
  color: #ffb179;
}
.board .movement {
  font-size: 0.78em;
  font-weight: 800;
  animation: score-in 0.45s ease-out;
}
.up {
  color: #bcf386;
}
.down {
  color: #ffa3a7;
}
.board .value small {
  display: inline;
  color: var(--soft);
}
.stage .board {
  margin-top: 15px;
  padding: 12px 16px;
}
.stage .board h2 {
  font-size: 1rem;
  margin: 0;
}
.stage .board li {
  font-size: 0.85rem;
  padding: 3px 4px;
}
@keyframes score-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.ident {
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 80% 6%, color-mix(in srgb, var(--accent) 25%, #151122), transparent 64%),
    #141021;
}
.ident:before,
.ident:after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -70% -30%;
  transform: rotate(-25deg);
  background: repeating-linear-gradient(90deg, transparent 0 9%, #ffffff0d 9.1% 9.24%, transparent 9.3% 12%);
  animation: sweep var(--intro-duration, 5s) ease-out both;
  animation-delay: var(--elapsed);
}
.ident:after {
  inset: auto -12% 12%;
  height: 22%;
  background: var(--accent);
  opacity: 0.07;
  transform: skewY(-12deg);
}
.ident-beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 5vw;
  gap: 1rem;
  opacity: 0;
  animation-duration: var(--intro-duration, 5s);
  animation-delay: var(--elapsed);
  animation-fill-mode: both;
}
.ident-beat strong {
  font:
    850 italic clamp(3rem, 10vw, 11rem) / 0.97 Bricolage,
    system-ui;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.ident-beat small {
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.ident-beat p {
  font-size: clamp(1rem, 2.2vw, 2.1rem);
  max-width: 39ch;
  color: #f5eefc;
}
.round-ident {
  --intro-duration: 8s;
}
#tv-sound[hidden] {
  display: none;
}
#tv-sound {
  position: fixed;
  z-index: 20;
  right: max(.75rem, env(safe-area-inset-right));
  bottom: max(.5rem, env(safe-area-inset-bottom));
  max-width: calc(100% - 1.5rem);
  padding: .2em .5em;
  color: #edeaff;
  background: #100d25ec;
  font-size: .85rem;
  pointer-events: none;
}
.beat-one {
  animation-name: number-beat;
  color: var(--accent);
}
.beat-two {
  animation-name: type-beat;
}
.beat-three {
  animation-name: player-beat;
}
.turn-ident .beat-three {
  animation-name: turn-beat;
}
@keyframes sweep {
  from {
    translate: -4%;
  }
  to {
    translate: 4%;
  }
}
@keyframes number-beat {
  0% {
    opacity: 0;
    transform: scale(1.09);
  }
  2.5%,
  14.375% {
    opacity: 1;
    transform: none;
  }
  18.125%,
  100% {
    opacity: 0;
  }
}
@keyframes type-beat {
  0%,
  16.25% {
    opacity: 0;
    transform: translateY(14px);
  }
  19.375%,
  82.5% {
    opacity: 1;
    transform: none;
  }
  85%,
  100% {
    opacity: 0;
  }
}
@keyframes player-beat {
  0%,
  84.375% {
    opacity: 0;
    transform: translateY(12px);
  }
  88.125%,
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes turn-beat {
  0% {
    opacity: 0;
    transform: translateX(-22px);
  }
  9%,
  100% {
    opacity: 1;
    transform: none;
  }
}
#power-event {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: transparent;
  color: inherit;
  border: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  z-index: 90;
  overflow: hidden;
  padding: 0;
}
#power-event:not([hidden]) {
  display: grid;
  align-items: start;
  justify-items: center;
  padding-top: clamp(22px, 10vh, 110px);
}
#power-event::backdrop {
  background: transparent;
  pointer-events: none;
}
.power-flash {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 92vw;
  padding: 14px clamp(20px, 5vw, 70px);
  transform: rotate(-4deg);
  background: var(--accent);
  color: #171023;
  border: 3px solid #21192f;
  box-shadow: 7px 6px 0 #100c19;
  animation: power-in 2s both;
}
.power-flash .glyph {
  width: 3.2em;
  height: 3.2em;
}
.power-flash strong {
  display: block;
  text-transform: uppercase;
  font:
    italic 850 clamp(1.5rem, 5vw, 3.8rem) / 1 Bricolage,
    system-ui;
}
.power-flash span {
  display: block;
  font-weight: 700;
}
@keyframes power-in {
  0% {
    opacity: 0;
    transform: translateX(-45vw) rotate(-8deg);
  }
  14%,
  85% {
    opacity: 1;
    transform: rotate(-4deg);
  }
  100% {
    opacity: 0;
    transform: translateX(26vw) rotate(-2deg);
  }
}
@media (min-width: 850px) {
  .tv.on-air .board {
    position: sticky;
    top: 12px;
  }
  .tv.on-air .theme-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .tv.on-air .theme-card {
    min-height: clamp(88px, 11vh, 125px);
  }
}
@media (max-width: 640px) {
  .theme-grid {
    grid-template-columns: 1fr 1fr;
  }
  .theme-card {
    min-height: 110px;
  }
  .on-air .room-head {
    margin-bottom: 12px;
  }
  .tv.on-air aside {
    position: sticky;
    bottom: 0;
    z-index: 2;
  }
  .tv.on-air .board {
    max-height: 34svh;
    overflow: auto;
    background: #201e2f;
  }
  .tv .board .rank {
    columns: 2;
  }
  .tv.on-air main {
    padding-bottom: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ident-beat {
    animation-duration: var(--intro-duration, 5s) !important;
    transform: none !important;
  }
  .ident:before,
  .ident:after,
  .power-flash,
  .movement,
  .waiting i {
    animation: none !important;
  }
}

.award {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
  color: var(--accent);
}
@media (max-width: 640px) {
  .tv.on-air:has(.grid aside) main {
    height: 100svh;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .tv.on-air .grid:has(aside) {
    flex: 1;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
  }
  .tv.on-air .grid:has(aside) .stage {
    overflow: auto;
  }
}

.up-next {
  color: var(--soft);
  font-size: 0.8rem;
}
@media (min-width: 1000px) {
  .tv .board .rank {
    font-size: clamp(1rem, 1.35vw, 1.6rem);
  }
}
@media (max-width: 640px) {
  .up-next {
    margin-left: auto;
    font-size: 0.7rem;
  }
  .broadcast-line {
    gap: 8px;
  }
}

.rules-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: #e6dcff;
  background: #272336;
}
.rules-toggle span {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}
.tv .rules-toggle,
.on-air header .brand,
.on-air header [data-ui="screen"] {
  display: none;
}
.on-air:not(.tv) > header,
.on-air:not(.tv) header :is(.bar, nav) {
  display: contents;
}
.on-air .rules-toggle {
  position: fixed;
  z-index: 5;
  top: max(8px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  border: 1px solid #62566f;
}
.on-air:not(.tv) .broadcast-line {
  padding-right: 45px;
}
.ident-icon {
  width: clamp(42px, 7vmin, 100px);
  height: auto;
  aspect-ratio: 1;
  color: var(--accent);
}
.ident-beat strong {
  width: calc(100% + 10vw);
  padding: .16em 5vw .2em;
  color: #151122;
  background: var(--accent);
}
.theme-grid.theme-reveal {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.theme-reveal .theme-card:not(.chosen) {
  display: none;
}
.theme-grid .theme-card.chosen {
  grid-column: 1 / -1;
  min-height: clamp(190px, 36svh, 390px);
  padding: clamp(18px, 4vw, 48px);
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 60px color-mix(in srgb, var(--accent) 15%, transparent);
  animation: theme-selected .48s ease-out both;
}
.theme-card.chosen strong {
  max-width: 24ch;
  font-size: clamp(1.6rem, 3.5vw, 4rem);
}
.theme-card.chosen .theme-icon {
  width: clamp(32px, 5vw, 68px);
  height: auto;
  aspect-ratio: 1;
}
@keyframes theme-selected {
  from { opacity: .5; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.board .who .theme-label {
  display: flex;
  font-size: .73em;
  line-height: 1.2;
  margin-top: 2px;
  gap: 5px;
  white-space: normal;
}
.answer {
  -webkit-tap-highlight-color: transparent;
}
button.answer:not(:disabled):active {
  background: #453b58;
}
.answer.reveal-good {
  background: #254c36;
  border-color: #9af4ae;
  animation: right-answer .8s ease-in-out 2;
}
.answer.reveal-bad {
  background: #592a38;
  border-color: #ffa2a8;
  animation: wrong-answer .85s both;
}
.cash-reveal {
  margin-top: 12px;
}
@keyframes right-answer {
  50% { background: #377047; box-shadow: inset 0 0 0 2px #9af4ae; }
}
@keyframes wrong-answer {
  0%, 25% { background: #254c36; border-color: #9af4ae; }
  100% { background: #592a38; border-color: #ffa2a8; }
}
.reconnect {
  max-width: 760px;
  margin: clamp(50px, 16svh, 180px) auto;
  text-align: center;
  border-radius: 20px;
}
.reconnect-time {
  display: block;
  margin-top: 18px;
  color: var(--lime);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1450px) {
  .tv main { width: min(94vw, 2200px); }
  .tv .theme-card strong { font-size: clamp(1.05rem, 1.25vw, 1.8rem); }
  .tv .theme-card.chosen strong { font-size: clamp(2rem, 3.5vw, 4rem); }
  .tv .theme-icon { width: 2vw; height: 2vw; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-card.chosen, .answer.reveal-good, .answer.reveal-bad { animation: none; }
}
.round-mode {
  display: inline-flex;
  align-items: center;
  gap: .55em;
}
.round-mode i {
  display: grid;
  place-items: center;
  width: 1.65em;
  aspect-ratio: 1;
  border-radius: .45em;
  background: color-mix(in srgb, var(--accent) 15%, var(--panel));
  font-style: normal;
}
@media (min-width: 1000px) {
  .tv .round-mode, .tv .result, .tv .question-sheet > p {
    font-size: clamp(1rem, 1.2vw, 1.8rem);
  }
  .tv .theme-label { font-size: clamp(1rem, 1.1vw, 1.5rem); }
  .tv .theme-card small { font-size: clamp(.85rem, 1vw, 1.4rem); }
}
@media (max-width: 360px) {
  .bar .screen-label { display: none; }
  .bar [data-ui="screen"] { width: 40px; }
}

/* Le lien de présentation peut être ouvert avant la première réponse du salon. */
.presentation :is(body > header, body > footer, body > .skip, #modal, .hero, .formats) {
  display: none;
}
:root {
  --accept: #9de7b7;
  --accept-ink: #10321f;
  --reject: #ffb1b8;
  --reject-fill: #49232e;
}
button.positive {
  background: var(--accept);
  color: var(--accept-ink);
  border-color: var(--accept);
}
button.positive:not(:disabled):hover { background: #b6f3c9; }
button.negative {
  background: var(--reject-fill);
  color: var(--reject);
  border: 1px solid #aa5a69;
}
button.negative:hover { background: #602e3d; }
:is(.primary, .secondary, .quiet, .link, .outline, .swatch, .pick) .glyph {
  width: 1.15em;
  height: 1.15em;
}
.pick {
  display: flex;
  align-items: center;
  gap: .6em;
}
.swatch {
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #171323;
}
.swatch .glyph { visibility: hidden; }
.swatch[aria-pressed="true"] .glyph { visibility: visible; }
.answer.good {
  background: #254c36;
  border-color: var(--accept);
}
.answer i {
  position: relative;
}
.answer i::after {
  content: '';
  position: absolute;
  left: 5px;
  bottom: -3px;
  border: 4px solid transparent;
  border-left-color: #514264;
}
.tv .choices :is(.pick, .answer) {
  border-radius: 0;
  border-width: 0 0 1px;
}
.tv .choices .pick, .tv .choices .answer:not(.good, .reveal-bad) {
  background: transparent;
  border-color: var(--line);
}

.final-duo, .final-legend, .final-themes { display: grid; gap: .55rem; margin: .8rem 0; }
.final-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.final-duo > div, .final-legend > div { background: #262236; border-radius: .75rem; padding: .65rem; }
.final-duo strong { white-space: nowrap; }
.final-duo .final-theme, .final-legend small, .final-theme small { display: block; }
.final-themes, .final-legend { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.final-theme { color: var(--accent); font-weight: 750; }
.final-theme i { font-style: normal; margin-right: .4em; }
.final-theme small, .final-legend small { color: #ddd6ea; font-size: .8em; }
.final-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(4px, .7vw, 10px); }
.final-tile { position: relative; display: grid; place-items: center; min-height: clamp(48px, 7vh, 85px); padding: .35rem; background: #302940; border: 2px solid var(--accent, #8b809e); color: var(--accent, #fff); border-radius: .6rem; }
.final-tile span { font-size: clamp(1.25rem, 3vw, 2.2rem); }
.final-tile:has(span) b { position: absolute; top: .1rem; left: .25rem; font-size: .72rem; }
.final-tile:disabled { opacity: 1; }
.final-tile.used { opacity: .48; }
.final-tile:not(:disabled):hover { background: #514466; }

@media (prefers-reduced-motion: no-preference) {
  .final-flip .final-tile { animation: final-flip .45s ease-out var(--elapsed, 0ms) both; }
  @keyframes final-flip {
    from { transform: perspective(350px) rotateY(-86deg); }
    to { transform: perspective(350px) rotateY(0); }
  }
}

/* Éclairage et habillage du plateau de présentation. */
body.tv {
  --studio-cyan: #3ceaff;
  --studio-pink: #ff51c8;
  --studio-violet: #9364ff;
  min-height: 100svh;
  background:
    linear-gradient(119deg, transparent 70%, #9349ff12 70.2% 74%, transparent 74.2%),
    radial-gradient(ellipse at 2% 0, #00495e 0, transparent 45%),
    radial-gradient(ellipse at 100% 2%, #631156 0, transparent 46%),
    #100d25;
}
.tv .room-head h1 {
  padding-left: .5em;
  border-left: .16em solid var(--studio-cyan);
  color: #fff;
}
.tv .stage, .tv .panel {
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, #221b43, #111528 75%) padding-box,
    linear-gradient(115deg, var(--studio-cyan), #584391 45%, var(--studio-pink)) border-box;
  box-shadow: 0 12px 35px #06071b80, 0 0 16px #ab4cff1c;
}
.tv .board h2 {
  width: fit-content;
  max-width: 100%;
  padding: .18em 1.15em .24em .55em;
  background: linear-gradient(105deg, var(--studio-cyan), #a1a0ff);
  color: #11152b;
  clip-path: polygon(0 0, 100% 0, calc(100% - .55em) 100%, 0 100%);
}
.tv .stage .timer, .tv .code { color: var(--studio-cyan); }
.tv .meter i {
  background: linear-gradient(90deg, var(--studio-cyan), var(--studio-violet) 65%, var(--studio-pink));
  box-shadow: 0 0 8px #926aff80;
}
.tv .theme-card:not(.taken) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 38%, #17132d), #15152c 86%);
  border-color: color-mix(in srgb, var(--accent) 70%, #342547);
}
.tv .ident {
  background:
    radial-gradient(ellipse at 0 100%, #0088aa67, transparent 60%),
    radial-gradient(ellipse at 100% 0, #d72eae79, transparent 63%),
    #17112c;
}
.tv .ident-beat strong {
  background: linear-gradient(110deg, var(--studio-cyan), var(--accent) 47%, #f8a2eb);
}
.tv .board .rank-rise { --rank-color: #52ffc1; }
.tv .board .rank-fall { --rank-color: #ff8497; }
.tv .board li:is(.rank-rise, .rank-fall) {
  background: linear-gradient(95deg, color-mix(in srgb, var(--rank-color) 25%, #171629), #19182c);
  border-left-color: var(--rank-color) !important;
  animation: rank-light .95s ease-out var(--rank-delay) both;
}
.tv .board .movement {
  padding: .12em .45em;
  border-radius: .4em;
  color: #131526;
  background: var(--rank-color);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  animation-delay: var(--rank-delay);
}
@keyframes rank-light {
  from { box-shadow: inset 0 0 16px color-mix(in srgb, var(--rank-color) 60%, transparent); }
  to { box-shadow: inset 0 0 0 transparent; }
}
@media (max-width: 640px) {
  .tv .board .rank { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tv .board li:is(.rank-rise, .rank-fall) { animation: none; }
}

.tv .grid.final-stage { grid-template-columns: minmax(0, 1fr); }
.final-option { display: grid; align-content: center; gap: .15em; }
.final-duo .owner-0, .final-option.owner-0 { --owner: #8ddfff; }
.final-duo .owner-1, .final-option.owner-1 { --owner: #ffb68f; }
.final-option.common { --owner: #b7ee98; }
.final-option:is(.owner-0,.owner-1,.common) {
  border: 2px solid var(--owner); background: color-mix(in srgb,var(--owner) 18%,#201c2b); opacity: 1;
}
.final-option strong { color: var(--owner); font-size: .85em; }
.tv .final-themes { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .6vh; }
.tv .final-themes .pick { min-height: 0; padding: .6vh .7vw; font-size: clamp(.85rem,2.1vh,1.8rem); }
.tv .final-stage .final-duo { margin: .4vh 0; }
.tv .final-stage .stage h2 { margin: .7vh 0; }
@media (min-aspect-ratio: 17/10) {
  .tv .final-themes { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .final-shuffle .final-tile { animation: distribute-tiles 2s ease-in-out var(--elapsed) both; }
  @keyframes distribute-tiles {
    0%,35% { transform: translate(var(--x),var(--y)) scale(.72) rotate(-8deg); }
    65% { transform: translateY(var(--y)) rotate(5deg); }
    100% { transform: none; }
  }
  .tv .final-option:is(.owner-0,.owner-1,.common), .tv .final-stage .result, .tv .final-stage [data-phase="question"] .question-sheet { animation: final-reveal .4s ease-out var(--phase-delay, 0ms) both; }
  @keyframes final-reveal { from { opacity: .5; transform: translateY(.35rem); } }
}

.final-duo > div { border-inline-start: .32rem solid var(--owner); }

.tv-create { margin-top: 1rem; }
.tv-invite {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 30%);
  align-items: center;
  gap: clamp(14px, 2.4vw, 48px);
}
.tv-invite strong { overflow-wrap: anywhere; }
.tv .tv-invite h2 { margin: .2em 0; font-size: clamp(2rem, 3.8vw, 5rem); }
.join-code {
  display: block;
  margin-top: .2em;
  font: 800 clamp(2.4rem, 5.4vw, 8rem)/1.15 Bricolage, system-ui;
  letter-spacing: .075em;
  color: #a7f9e3;
}
.join-qr { background: white; border-radius: 12px; overflow: hidden; }
.join-qr svg { display: block; width: 100%; height: auto; }
.lobby-tip, .watch-tv, .power-preview {
  background: linear-gradient(120deg, #34264d, #202439);
  border: 1px solid #675482;
  border-radius: 18px;
  padding: clamp(16px, 2.2vw, 32px);
}
.lobby-tip { display: flex; align-items: center; gap: 16px; margin-top: 2rem; }
.lobby-tip .glyph, .lobby-tip small { color: #d3b2ff; }
.lobby-tip p { margin: .35em 0 0; min-height: 2.6em; }
.watch-tv { text-align: center; padding-block: clamp(32px, 7vh, 85px); }
.watch-hint { display: flex; align-items: center; gap: .55em; color: #a5e8ff; }
.watch-tv > .glyph { color: #93e8ee; width: 3em; height: 3em; }
.watch-tv h2 { margin: .45em 0; }
.stage .power-preview .award small { display: block; }
.lobby-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  padding-block: 1.1rem;
  margin-block: 1rem;
  border-block: 1px solid var(--line);
}
.lobby-tools button {
  display: inline-flex; gap: .5em; align-items: center; justify-content: center;
  border: 1px solid currentColor; padding: .78rem 1rem; border-radius: 12px;
}
.profile-control { color: #a5e8ff; background: #193644; }
.settings-control { color: #dabfff; background: #352746; }
.ready-control { margin-left: auto; color: #143427; background: #a3edbd; }
.ready-control[aria-pressed=true] { color: #b7f5cb; background: #234333; }
.verdict {
  display: inline-grid; place-items: center; flex: none;
  width: 1.65em; height: 1.65em; border-radius: 50%;
  color: #10321f; background: #9de7b7;
}
.verdict.faux { background: #ffabb7; color: #50172e; }
.verdict.temps { background: #ffd68f; color: #49320b; }
.verdict .glyph { width: 1em; height: 1em; stroke-width: 3; }
.answer .verdict { margin-inline-start: auto; }
.answer.reveal-bad { background-color: #512735; border-color: #ffabb7; }
.expired-players { display: flex; gap: .55em; align-items: center; flex-wrap: wrap; }
@media (max-width: 560px) {
  .ready-control { flex-basis: 100%; }
  .tv-invite { grid-template-columns: 1fr; }
  .join-qr { width: min(52vw, 200px); }
}
@media (prefers-reduced-motion: no-preference) {
  .lobby-tools button { transition: transform .16s ease, box-shadow .16s ease; }
  .lobby-tools button:is(:hover, :focus-visible) { transform: translateY(-2px); box-shadow: 0 3px 0 currentColor; }
}

.final-intro { --accent: #ffda84; }
.final-intro.eliminesFinale { --accent: #ff929a; }
.final-intro.finalistes { --accent: #93ebd5; }
.final-band {
  width: 100%; max-height: 100svh; overflow: auto; box-sizing: border-box;
  padding: clamp(12px, 4vh, 60px) 5vw; text-align: center;
  border-block: 2px solid var(--accent);
  background: linear-gradient(110deg, #20182d, color-mix(in srgb,var(--accent) 17%,#20182d), #20182d);
}
.final-band h2 { margin: 0; color: var(--accent); font: italic 850 clamp(2rem,7vw,8rem)/1.05 Bricolage,system-ui; }
.final-band ul { list-style: none; padding: 0; margin: 2vh auto 0; max-width: 90vw; display: flex; flex-wrap: wrap; gap: .45em; justify-content: center; }
.final-band li { min-width: 0; overflow-wrap: anywhere; color: var(--accent); font-size: clamp(1rem, 2.4vw, 3rem); font-weight: 750; padding: .2em .55em; background: #171322; border-radius: .3em; }
@media (prefers-reduced-motion: no-preference) {
  .final-band { animation: final-band-in var(--duration) ease-in-out var(--elapsed) both; }
  @keyframes final-band-in {
    0% { opacity: 0; transform: translateX(-6%); }
    10%,90% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateX(4%); }
  }
}

.victoireFinale .final-band h2 { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .victoireFinale .final-band { animation-name: victoire-finale; }
  @keyframes victoire-finale {
    0% { opacity: 0; transform: scale(.94); }
    12%,92% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(.99); }
  }
}

.format-salon { margin-bottom: 1.2rem; padding: 1rem 1.2rem; border-inline-start: 4px solid #86e4bd; background: #20342f; }
.format-salon p { margin: .4em 0 0; }
.format-select select { display: block; width: min(100%, 24rem); margin-top: .35rem; }
#outils-course:not([hidden]) { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: center; align-items: center; gap: 1rem; padding: .6rem max(1rem,env(safe-area-inset-right)) max(.6rem,env(safe-area-inset-bottom)); background: #20192f; border-top: 1px solid #856c40; color: #ffda84; }
.shop-list { display: grid; gap: .55rem; }
.shop-list button { width: 100%; text-align: left; }
.shop-list small { display: block; }
.shop-list strong { margin-inline-start: auto; white-space: nowrap; color: #ffda84; }
.word-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-block: 1rem; }
.word-list span { padding: .2rem .55rem; background: #263d38; border-radius: .45rem; color: #a6f1cf; }
.word-count { display: block; margin: .5em 0; font-size: clamp(1.6rem,3vw,4rem); color: #86e4f0; }
.tv [data-phase="rafale"] .timer { font-size: clamp(3rem,8vw,9rem); line-height: 1; }
#mot-form input[aria-invalid="true"] { border-color: #ff879a; background: #572533; }
@media (prefers-reduced-motion: no-preference) {
  .invalid-word { animation: word-shake .24s ease; }
  @keyframes word-shake { 25%,75% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
}
