:root {
  --tv-game-head-height: clamp(60px, 7vh, 76px);
}

.tv-head {
  height: var(--tv-game-head-height) !important;
  min-width: 0;
  padding-inline: clamp(14px, 2.4vw, 35px) !important;
}

.tv-head .tv-screen-navigation {
  min-width: 0;
}

.tv-main {
  width: 100%;
  height: calc(100dvh - var(--tv-game-head-height)) !important;
  min-width: 0;
  min-height: 0;
  gap: clamp(12px, 1.6vw, 24px) !important;
  padding: clamp(12px, 2.2vh, 28px) !important;
}

.tv-main > *,
.tv-main .panel,
.tv-stage-copy,
.tv-reveal,
.tv-reveal-copy {
  min-width: 0;
  min-height: 0;
}

.tv-answer,
.tv-game {
  overflow: hidden;
}

.tv-stage-copy {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(4px, 1.2vh, 16px);
  overflow: hidden;
}

.tv-stage-copy > * {
  max-width: 100%;
}

.tv-title,
.tv-reveal h2,
.tv-reveal p,
.game-results-stage .results-subtitle {
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  text-wrap: balance;
}

.tv-title {
  width: 100%;
  line-height: .9 !important;
}

.tv-round,
.tv-target {
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
  line-height: 1.25;
  text-wrap: balance;
}

.tv-timer {
  line-height: 1;
}

.tv-reveal {
  width: min(100%, 1400px);
  max-height: calc(100dvh - var(--tv-game-head-height) - 70px);
  grid-template-columns: minmax(150px, 36%) minmax(0, 1fr) !important;
  gap: clamp(16px, 2vw, 30px) !important;
}

.tv-reveal img {
  width: 100%;
  max-height: min(54vh, 540px);
}

.tv-reveal-copy {
  width: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: 100%;
  overflow: hidden;
  text-align: left;
}

.tv-reveal h2 {
  max-width: 100%;
  margin-block: clamp(5px, 1vh, 10px) !important;
}

.tv-reveal #artist,
.tv-reveal #source {
  max-width: 100%;
  margin-block: clamp(4px, .8vh, 10px);
  line-height: 1.2;
}

.tv-ranking-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(14px, 2.1vw, 36px) !important;
  overflow: hidden;
}

.tv-ranking-panel > h2,
.tv-ranking-panel > .eyebrow,
.tv-ranking-panel > .tv-join,
.tv-ranking-panel > .empty {
  flex: 0 0 auto;
}

.tv-ranking-panel > h2 {
  margin-block: clamp(5px, 1vh, 12px);
}

.tv-ranking-panel .ranking {
  min-height: 0;
  margin-top: clamp(5px, 1vh, 15px);
  gap: clamp(4px, .65vh, 7px);
  overflow: hidden;
}

.tv-ranking-panel .ranking li {
  min-height: 0;
  padding: clamp(5px, .8vh, 10px);
}

.tv-ranking-panel .ranking li b {
  min-width: 0;
}

.game-results-stage {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.game-finished .tv-answer .game-results-stage:has(.tv-final-layout) {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 0 clamp(8px, 1vw, 14px);
}

.game-finished .tv-answer .game-results-stage:has(.tv-final-layout) > h1 {
  font-size: clamp(42px, 4vw, 66px);
}

.game-finished .tv-answer .game-results-stage:has(.tv-final-layout) .results-subtitle {
  margin-bottom: 8px;
}

.game-finished .tv-answer .tv-final-layout {
  height: calc(100dvh - var(--tv-game-head-height) - 175px);
  min-height: 380px;
}

.tv-answer .game-results-stage,
.tv-game .game-results-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.game-results-stage > .eyebrow,
.game-results-stage > h1,
.game-results-stage > .results-subtitle {
  flex: 0 0 auto;
}

.game-results-stage .results-subtitle {
  max-width: min(96%, 1400px);
  line-height: 1.2;
}

.tv-answer .round-score-list,
.tv-game .round-score-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(56vh, 600px);
  overflow: hidden;
}

.tv-auto-scroll {
  scroll-behavior: auto;
  mask-image: linear-gradient(to bottom, transparent, #000 3%, #000 97%, transparent);
}

.geoloc-round-results-layout {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.geoloc-results-map,
.geoloc-round-results-list {
  height: 100%;
  min-height: 0;
  max-height: none;
  overscroll-behavior: contain;
}

@media (max-height: 760px) {
  .tv-head .game-brand small,
  .screen-qr span {
    display: none;
  }

  .tv-head .screen-qr img {
    width: 44px;
    height: 44px;
  }

  .tv-stage-copy {
    padding-block: 2px;
  }

  .pulse-bars {
    height: 42px;
    margin-block: 8px;
  }

  .pulse-bars i {
    max-height: 40px;
  }

  .tv-reveal {
    grid-template-columns: minmax(130px, 31%) minmax(0, 1fr) !important;
  }

  .tv-reveal img {
    max-height: 48vh;
    border-radius: 15px !important;
  }

  .tv-join {
    margin-bottom: 10px !important;
    padding: 8px !important;
  }

  .tv-join img {
    width: 88px !important;
    height: 88px !important;
  }

  .tv-join small {
    display: none !important;
  }

  .game-results-stage > h1 {
    margin-block: 3px !important;
  }

  .game-results-stage .results-subtitle {
    margin-bottom: 8px !important;
  }

  .round-score-list {
    gap: 5px !important;
    margin-top: 7px !important;
  }

  .round-score-list li {
    min-height: 0 !important;
    padding: 6px 9px !important;
  }

  .round-score-list .score-position {
    width: 29px !important;
    height: 29px !important;
  }

  .tv-final-layout {
    height: calc(100dvh - var(--tv-game-head-height) - 155px) !important;
    min-height: 340px !important;
  }
}

@media (max-width: 1100px) {
  .tv-main {
    grid-template-columns: minmax(0, 1fr) minmax(245px, .48fr) !important;
  }

  .tv-head .game-brand small,
  .screen-qr span {
    display: none;
  }

  .tv-reveal {
    grid-template-columns: minmax(130px, 30%) minmax(0, 1fr) !important;
  }
}

@media (max-width: 900px), (max-height: 620px) {
  .tv-main {
    grid-template-columns: minmax(0, 1fr) minmax(210px, .42fr) !important;
    gap: 9px !important;
    padding: 9px !important;
  }

  .tv-ranking-panel {
    padding: 10px !important;
  }

  .tv-ranking-panel .ranking li:nth-child(n + 9) {
    display: none;
  }

  .geoloc-round-results-layout {
    gap: 9px;
  }
}

@media (min-width: 2200px) and (min-height: 1200px) {
  .tv-main {
    max-width: 2400px;
    margin-inline: auto;
  }

  .tv-ranking-panel .ranking li {
    font-size: 1.15em;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-tv-fit] {
    transition: none !important;
  }
}
