/* ======================================================================
   Plateau « TV » : un canevas fixe 1920×1080 (ou 1080×1920 en portrait)
   mis à l'échelle en JS. Toutes les mesures ci-dessous sont en px canevas.
   ====================================================================== */
.tv-host {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.tv {
  --gold: #ffc53d;
  --gold-2: #ffdb7a;
  --v-200: #e0d2ff;
  --orange: #ff9a1f;
  --green: #2fd36b;
  --red: #ff4d6d;
  --loz-border: linear-gradient(180deg, #faf6ff 0%, #b79cff 42%, #6b2fd6 58%, #efe4ff 100%);
  --loz-fill: linear-gradient(180deg, #2c0b52 0%, #12021f 46%, #0b0114 54%, #2a0a4d 100%);
  --loz-selected: linear-gradient(180deg, #ffe39a 0%, #ffaa2b 44%, #ff8800 56%, #ffd06a 100%);
  --loz-correct: linear-gradient(180deg, #b6ffb0 0%, #39d96a 44%, #17a34a 56%, #8ff59a 100%);
  --loz-wrong: linear-gradient(180deg, #ffb3c0 0%, #ff4d6d 44%, #c81e45 56%, #ff9fb1 100%);
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  font-family: var(--font-board);
  color: #fff;
  user-select: none;
  overflow: hidden;
}
.tv.portrait {
  width: 1080px;
  height: 1920px;
}

/* ---------- Fond plateau violet ---------- */
.tv .bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 38% 32%, rgba(186, 120, 255, 0.55), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 120%, rgba(124, 58, 237, 0.55), transparent 70%),
    linear-gradient(180deg, #2b0757 0%, #17032f 55%, #0b0116 100%);
}
.tv .bg::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: repeating-conic-gradient(from 0deg at 38% 30%, rgba(255, 255, 255, 0.07) 0deg 3deg, transparent 3deg 11deg);
  mask-image: radial-gradient(circle at 38% 30%, #000 0%, transparent 62%);
  animation: rays 90s linear infinite;
}
.tv .bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
.tv.portrait .bg::before,
.tv.portrait .bg::after {
  background-position: 50% 25%;
}
@keyframes rays {
  to {
    transform: rotate(360deg);
  }
}
.tv.transparent .bg {
  display: none;
}

/* ---------- Logo central ---------- */
.tv .logo {
  position: absolute;
  left: 40px;
  right: 480px;
  top: 40px;
  height: 600px;
  display: grid;
  place-items: center;
  transition:
    opacity 0.5s,
    transform 0.5s;
}
.tv .logo svg {
  width: 1040px;
  max-width: 92%;
  height: auto;
  filter: drop-shadow(0 6px 30px rgba(20, 0, 40, 0.6));
  animation: logo-float 6s ease-in-out infinite;
}
.tv .logo .wait {
  position: absolute;
  bottom: -6px;
  font-size: 36px;
  color: var(--v-200);
  letter-spacing: 0.06em;
  text-shadow: 0 2px 8px #000;
}
.tv.no-tree .logo {
  right: 40px;
}
.tv .logo.dim {
  opacity: 0.22;
  transform: scale(0.82) translateY(-30px);
}
.tv .logo.dim .wait {
  display: none;
}
.tv .logo.off {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}
.tv.portrait .logo {
  left: 40px;
  right: 40px;
  top: 190px;
  bottom: 1050px;
  height: auto;
}
.tv.portrait .logo svg {
  width: 940px;
  height: auto;
}
@keyframes logo-float {
  50% {
    transform: translateY(-10px) scale(1.01);
  }
}

/* ---------- Losanges (question / réponses) ---------- */
.loz {
  --tip: 38px;
  --border: var(--loz-border);
  --fill: var(--loz-fill);
  position: relative;
  display: flex;
  align-items: center;
  z-index: 1;
  isolation: isolate;
}
.loz::before,
.loz::after {
  content: '';
  position: absolute;
  z-index: -1;
  clip-path: polygon(
    var(--tip) 0,
    calc(100% - var(--tip)) 0,
    100% 50%,
    calc(100% - var(--tip)) 100%,
    var(--tip) 100%,
    0 50%
  );
}
.loz::before {
  inset: 0;
  background: var(--border);
}
.loz::after {
  inset: 4px 3px;
  background: var(--fill);
  clip-path: polygon(
    calc(var(--tip) - 2px) 0,
    calc(100% - var(--tip) + 2px) 0,
    100% 50%,
    calc(100% - var(--tip) + 2px) 100%,
    calc(var(--tip) - 2px) 100%,
    0 50%
  );
}


.tv .qa {
  position: absolute;
  left: 40px;
  right: 480px;
  bottom: 34px;
  transition:
    opacity 0.45s,
    transform 0.45s;
}
.tv.no-tree .qa {
  right: 40px;
}
.tv .qa.off {
  opacity: 0;
  transform: translateY(40px);
  pointer-events: none;
}
.tv .rail {
  position: relative;
}
.tv .rail::before {
  content: '';
  position: absolute;
  left: -60px;
  right: -60px;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  background: linear-gradient(90deg, transparent, #cdb8ff 6%, #f6f0ff 50%, #cdb8ff 94%, transparent);
  box-shadow: 0 0 10px rgba(186, 150, 255, 0.7);
}
.tv.no-tree .rail::before,
.tv.transparent .rail::before {
  left: -40px;
  right: -40px;
}
.tv .question {
  --tip: 56px;
  height: 156px;
  padding: 0 96px;
  justify-content: center;
  text-align: center;
}
.tv .question .txt {
  width: 100%;
  max-height: 136px;
  font-size: 46px;
  font-weight: 600;
  line-height: 1.12;
  overflow: hidden;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.tv .answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 70px;
  margin-top: 28px;
}
.tv .answers .rail-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
}
.tv .answer {
  height: 88px;
  padding: 0 62px 0 64px;
  gap: 14px;
  cursor: default;
  transition: filter 0.15s;
}
.tv .answer .letter {
  color: var(--gold);
  font-size: 40px;
  font-weight: 700;
  flex: none;
}
.tv .answer .txt {
  flex: 1;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.05;
  max-height: 80px;
  overflow: hidden;
  white-space: normal;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.tv .answer .tag {
  position: absolute;
  right: 54px;
  top: -16px;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 700;
  background: #2fd36b;
  color: #04220e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.tv .answer.hide-text .txt,
.tv .answer.hide-text .letter {
  visibility: hidden;
}
.tv .answer.appear .txt,
.tv .answer.appear .letter {
  animation: appear 0.45s ease-out;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.tv.interactive .answer.clickable {
  cursor: pointer;
}
.tv.interactive .answer.clickable:hover {
  filter: brightness(1.35);
}
.tv .answer.selected {
  --fill: var(--loz-selected);
}
.tv .answer.selected .txt {
  color: #16032c;
  text-shadow: none;
}
.tv .answer.selected .letter {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.tv .answer.pending {
  --fill: linear-gradient(180deg, #5b2a9b 0%, #3b0f78 46%, #2c0a5c 54%, #6b33b3 100%);
  --border: linear-gradient(180deg, #fff 0%, #ffd27a 50%, #fff 100%);
}
.tv .answer.locked {
  animation: lock-pulse 1.4s ease-in-out infinite;
}
.tv .answer.correct {
  --fill: var(--loz-correct);
}
.tv .answer.correct::after {
  animation: correct-flash 0.34s steps(1) 0s 7;
}
.tv .answer.correct .txt {
  color: #fff;
  text-shadow:
    0 2px 3px rgba(0, 40, 10, 0.9),
    0 0 8px rgba(0, 40, 10, 0.6);
}
.tv .answer.correct .letter {
  color: #fff;
}
.tv .answer.wrong {
  --fill: var(--loz-wrong);
}
.tv .answer.wrong .txt {
  color: #2a0010;
  text-shadow: none;
}
.tv .answer.removed .txt,
.tv .answer.removed .letter {
  visibility: hidden;
}
.tv .answer.hint {
  --border: linear-gradient(180deg, #d9ffe4 0%, #2fd36b 50%, #d9ffe4 100%);
}
@keyframes correct-flash {
  50% {
    background: var(--loz-fill);
  }
}
@keyframes lock-pulse {
  50% {
    filter: brightness(1.25);
  }
}

/* ---------- Pyramide des gains ---------- */
.tv .tree {
  position: absolute;
  right: 40px;
  top: 178px;
  width: 404px;
  padding: 14px 18px;
  border-radius: 22px;
  border: 3px solid rgba(220, 200, 255, 0.75);
  background: linear-gradient(180deg, rgba(43, 8, 86, 0.94), rgba(14, 1, 28, 0.94));
  box-shadow:
    0 0 30px rgba(124, 58, 237, 0.45),
    inset 0 0 40px rgba(124, 58, 237, 0.25);
  transition:
    opacity 0.45s,
    transform 0.45s;
}
.tv .tree.off {
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
}
.tv .rung {
  display: flex;
  align-items: center;
  height: 55px;
  padding: 0 18px 0 8px;
  border-radius: 28px;
  font-size: 37px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.tv .rung .n {
  width: 50px;
  text-align: right;
  font-size: 30px;
  color: var(--gold-2);
}
.tv .rung .mark {
  width: 40px;
  text-align: center;
  font-size: 22px;
  color: var(--gold);
  opacity: 0;
}
.tv .rung .amt {
  flex: 1;
  text-align: left;
}
.tv .rung.safe {
  color: #fff;
}
.tv .rung.safe .n {
  color: #fff;
}
.tv .rung.done .mark {
  opacity: 1;
}
.tv .rung.current {
  background: linear-gradient(180deg, #ffd780, #ff9a1f 55%, #ff8400);
  color: #1b0532;
  box-shadow: 0 0 22px rgba(255, 154, 31, 0.7);
}
.tv .rung.current .n,
.tv .rung.current .mark {
  color: #1b0532;
}
.tv .rung.flash {
  animation: rung-flash 0.32s steps(1) 0s 6;
}
.tv .rung.lost {
  background: linear-gradient(180deg, #ff9fb1, #c81e45);
  color: #fff;
}
@keyframes rung-flash {
  50% {
    background: linear-gradient(180deg, #b6ffb0, #17a34a);
  }
}

/* ---------- Jokers ---------- */
.tv .jokers {
  position: absolute;
  right: 40px;
  top: 52px;
  width: 404px;
  display: flex;
  justify-content: space-between;
  transition:
    opacity 0.45s,
    transform 0.45s;
}
.tv .jokers.off {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}
.tv .joker {
  position: relative;
  width: 94px;
  height: 66px;
  border-radius: 50%;
  border: 3px solid rgba(230, 216, 255, 0.85);
  background: radial-gradient(ellipse at 50% 30%, #6a2bc0, #22054a 70%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 26px;
  box-shadow: 0 0 14px rgba(157, 107, 255, 0.55);
  transition:
    transform 0.15s,
    filter 0.15s;
}
.tv .joker svg {
  width: 40px;
  height: 40px;
  fill: #fff;
}
.tv.interactive .joker.usable {
  cursor: pointer;
}
.tv.interactive .joker.usable:hover {
  transform: scale(1.08);
  filter: brightness(1.25);
}
.tv .joker.used {
  opacity: 0.4;
}
.tv .joker.used::before,
.tv .joker.used::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 7px;
  margin: -3.5px 0 0 -42px;
  border-radius: 4px;
  background: #ff2d55;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  transform: rotate(32deg);
}
.tv .joker.used::after {
  transform: rotate(-32deg);
}
.tv .joker.active {
  border-color: var(--gold);
  box-shadow: 0 0 26px rgba(255, 197, 61, 0.9);
  animation: lock-pulse 1s infinite;
}

/* ---------- Panneaux (appel, public, info, bannière) ---------- */
.tv .panels {
  position: absolute;
  left: 40px;
  right: 480px;
  top: 40px;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tv.no-tree .panels {
  right: 40px;
}
.tv .panels-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 30px 40px;
  max-width: 100%;
  transform-origin: 50% 50%;
}
.tv.portrait .panels-inner {
  flex-direction: column;
  flex-wrap: nowrap;
}
.tv .panel {
  pointer-events: auto;
  border-radius: 26px;
  border: 3px solid rgba(220, 200, 255, 0.8);
  background: linear-gradient(180deg, rgba(58, 14, 116, 0.95), rgba(14, 1, 28, 0.95));
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.55);
  padding: 26px 34px;
  animation: pop 0.3s ease-out;
}
.tv .panel h3 {
  margin: 0 0 14px;
  font-size: 34px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.tv .phone {
  width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.tv .phone .friend {
  font-size: 32px;
  color: var(--v-200);
}
.tv .phone .clock {
  position: relative;
  width: 210px;
  height: 210px;
}
.tv .phone .clock svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.tv .phone .clock circle {
  fill: none;
  stroke-width: 14;
}
.tv .phone .clock .track {
  stroke: rgba(255, 255, 255, 0.15);
}
.tv .phone .clock .bar {
  stroke: var(--gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear;
}
.tv .phone .clock .secs {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 84px;
  font-weight: 700;
}
.tv .phone .msg {
  font-size: 34px;
  line-height: 1.2;
  text-align: center;
  min-height: 82px;
}
.tv .audience {
  width: 620px;
}
.tv .audience .bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  height: 290px;
  align-items: end;
  padding: 0 10px;
}
.tv .audience .bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.tv .audience .pct {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 8px;
}
.tv .audience .fill {
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #ffe39a, #ff9a1f);
  box-shadow: 0 0 16px rgba(255, 154, 31, 0.5);
  transition: height 1.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tv .audience .lbl {
  margin-top: 10px;
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
}
.tv .audience .voting {
  text-align: center;
  font-size: 34px;
  padding: 40px 0;
}
.tv .audience .voting b {
  display: block;
  font-size: 90px;
  color: var(--gold);
}
.tv .info {
  width: 900px;
  font-size: 34px;
  line-height: 1.25;
  text-align: center;
}
.tv .info h3 {
  font-size: 30px;
}
.tv .banner {
  --tip: 70px;
  min-width: 900px;
  height: 190px;
  padding: 0 120px;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  animation: pop 0.4s ease-out;
}
.tv .banner .big {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 76px;
  letter-spacing: -0.02em;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 197, 61, 0.55);
}
.tv .banner .sub {
  font-size: 36px;
  color: var(--v-200);
  margin-top: 8px;
  letter-spacing: 0.04em;
}
.tv .banner.won .big {
  color: #9ff5bd;
}

/* ---------- Zone de commandes intégrée ---------- */
.tv .controls {
  position: absolute;
  left: 40px;
  right: 480px;
  top: 556px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  z-index: 3;
}
.tv.no-tree .controls {
  right: 40px;
}
.tv .controls:empty {
  display: none;
}
.tv.has-controls .panels {
  height: 500px;
}
.tv .controls .status {
  font-size: 34px;
  color: var(--v-200);
  text-shadow: 0 2px 6px #000;
}
.tv-btn {
  --tip: 30px;
  --fill: linear-gradient(180deg, #5b22a6 0%, #2c0a5c 50%, #3b0f78 100%);
  height: 80px;
  padding: 0 58px;
  border: 0;
  background: none;
  color: #fff;
  font-family: var(--font-board);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  justify-content: center;
}
.tv-btn:hover {
  filter: brightness(1.25);
}
.tv-btn.gold {
  --fill: var(--loz-selected);
  color: #1b0532;
}
.tv-btn.green {
  --fill: var(--loz-correct);
  color: #04220e;
}
.tv-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* Bouton « gains » (portrait) */
.tv .amount-pill {
  display: none;
}

/* ======================= Portrait (mobile) ======================= */
.tv.portrait .qa {
  left: 34px;
  right: 34px;
  bottom: 40px;
}
.tv.portrait .rail::before {
  left: -40px;
  right: -40px;
}
.tv.portrait .question {
  --tip: 46px;
  height: 270px;
  padding: 0 74px;
}
.tv.portrait .question .txt {
  max-height: 250px;
  font-size: 54px;
}
.tv.portrait .answers {
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 34px;
}
.tv.portrait .answers .rail-row {
  display: contents;
}
.tv.portrait .answers .rail-row::before {
  display: none;
}
.tv.portrait .answer {
  height: 122px;
  padding: 0 70px;
}
.tv.portrait .answer .txt {
  font-size: 48px;
  max-height: 112px;
}
.tv.portrait .answer .letter {
  font-size: 50px;
}
.tv.portrait .jokers {
  left: 40px;
  right: auto;
  top: 44px;
  width: 540px;
}
.tv.portrait .joker {
  width: 118px;
  height: 84px;
  font-size: 32px;
}
.tv.portrait .joker svg {
  width: 52px;
  height: 52px;
}
.tv.portrait .amount-pill {
  position: absolute;
  right: 40px;
  top: 44px;
  height: 84px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 30px;
  border-radius: 42px;
  border: 3px solid rgba(220, 200, 255, 0.8);
  background: linear-gradient(180deg, #3d0f7a, #16032c);
  font-size: 40px;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
}
.tv.portrait .amount-pill small {
  font-size: 28px;
  color: var(--v-200);
}
.tv.portrait .tree {
  right: 40px;
  top: 160px;
  width: 620px;
  z-index: 5;
  padding: 18px 24px;
}
.tv.portrait .tree .rung {
  height: 56px;
}
.tv.portrait .tree.collapsed {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}
.tv.portrait .panels {
  left: 40px;
  right: 40px;
  top: 170px;
  bottom: 1040px;
  height: auto;
  flex-direction: column;
}
.tv.portrait.has-controls .panels {
  height: auto;
}
.tv.portrait .controls {
  left: 40px;
  right: 40px;
  top: auto;
  bottom: 906px;
  height: 120px;
}
.tv.portrait .tv-btn {
  height: 104px;
  font-size: 44px;
}
.tv.portrait .phone,
.tv.portrait .audience,
.tv.portrait .info {
  width: 900px;
}
.tv.portrait .banner {
  min-width: 0;
  width: 1000px;
}
.tv.portrait .banner .big {
  font-size: 68px;
}

@keyframes pop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
}
