[data-action="return-code"][hidden], [data-action="rejoin"][hidden] { display: none; }
[data-action="rejoin"]:not([hidden]) { margin-bottom: 12px; }
.tv-mode .tv-stage { max-width: 96rem; margin: 2vh auto; }
.tv-round, .tv-next { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.tv-round { min-height: 12vh; margin-bottom: 2vh; }
.tv-round h2 { font-size: clamp(28px,5vh,68px); margin: 0; line-height: 1.1; overflow-wrap: anywhere; }
.tv-clock { font-size: clamp(30px,6vh,80px); font-variant-numeric: tabular-nums; }
.final-seconds .tv-clock { color: #ffda50; font-size: clamp(44px,9vh,110px); }
.tv-mode .tv-scores, .tv-mode .showdown .leaderboard { display: grid; gap: 1.2vh; }
.tv-mode .tv-scores .leader-row { min-height: 9vh; }
.tv-mode .leader-row { grid-template-columns: auto auto minmax(0,1fr) auto; padding: 1vh 1.4vw; }
.tv-mode .leader-row .avatar { width: clamp(32px,6vh,84px); height: clamp(32px,6vh,84px); }
.tv-mode .leader-name { font-size: clamp(19px,3.6vh,52px); overflow-wrap: anywhere; line-height: 1.1; }
.tv-mode .leader-detail { font-size: clamp(13px,1.9vh,25px); }
.tv-mode .leader-score { font-size: clamp(30px,5.5vh,84px); }
.tv-mode .leader-row.new-lead { outline: 4px solid #ffbf25; outline-offset: -4px; }
.tv-next { justify-content: center; margin: 2vh 0; flex-wrap: wrap; }
.tv-next strong { font-size: clamp(21px,3.2vh,44px); }
.tv-mode .showdown { max-width: 96rem; }
.tv-mode .showdown .tally-layout { display: block; }
.tv-mode .showdown .showdown-words, .tv-mode .tv-words .tally-layout { display: none; }
.tv-mode .tv-words .tally-spotlight { flex-wrap: wrap; min-height: 32vh; align-content: center; font-size: clamp(24px,5vh,72px); }
.tv-mode .join-panel .qr svg { width: min(30vw,38vh); height: min(30vw,38vh); }
.tv-mode .join-code { font-size: clamp(36px,7vh,100px); }
.tv-mode .empty-player { display: none; }
.tv-mode .player-card strong { font-size: clamp(18px,3vh,42px); overflow-wrap: anywhere; }
@media (orientation: landscape) {
  .tv-mode .leaderboard:has(>.leader-row:nth-child(5)),
  .tv-mode .tv-scores:has(>.leader-row:nth-child(2):last-child) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tv-mode .tv-scores:has(>.leader-row:nth-child(2):last-child) .leader-row {
    grid-template-columns: 1fr; justify-items: center; align-content: center;
    min-height: 45vh; text-align: center; gap: 1vh;
  }
  .tv-mode .tv-scores:has(>.leader-row:nth-child(2):last-child) .avatar { width: 11vh; height: 11vh; }
  .tv-mode .tv-scores:has(>.leader-row:nth-child(2):last-child) .leader-score { font-size: 10vh; }
  .tv-mode .tv-scores:has(>.leader-row:nth-child(2):last-child) .rank { position: absolute; top: 1vh; left: 1vw; }
  .tv-mode .lobby-grid { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); }
  .tv-mode .player-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tv-mode[data-phase="playing"] .topbar { display: none; }
  .tv-mode .tv-stage { margin-top: 1vh; }
  .tv-mode .tv-round { min-height: 10vh; }
  .tv-mode .leader-row { padding-block: 0.6vh; }
}
