/* Player identity is public only after selection; anonymous ballots omit it. */
.icon-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  color: #fff3d8;
  font: 14px/1.5 sans-serif;
}
.icon-navigation .secondary {
  color: #fff3d8;
  background: #203c56;
  border-color: #8298ac;
}
.icon-navigation .button {
  min-width: 0;
  padding: 12px;
}
.finished-tabs .button {
  color: #fff3d8;
  border-color: #8298ac;
  background: #203c56;
}
.finished-tabs .button:disabled {
  opacity: 1;
  color: #10243c;
  background: #e3bd6d;
}
.finished-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}
.game-results {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
.result-awards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.result-award {
  background: #fff8e8;
  color: #293e4c;
  border-radius: 8px;
  padding: 20px;
  min-width: 0;
}
.result-award:first-child {
  border: 2px solid #e3bd6d;
}
.result-award h2 {
  font: 600 14px/1.4 sans-serif;
  margin: 0 0 12px;
}
.result-award p {
  font:
    28px/1.25 Georgia,
    serif;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
}
.result-award small {
  font: 14px/1.4 sans-serif;
  color: #536853;
}
.standings-wrap {
  background: #fff8e8;
  color: #293e4c;
  border-radius: 8px;
  padding: 12px 20px;
}
.standings {
  width: 100%;
  border-collapse: collapse;
  font: 18px/1.4 sans-serif;
}
.standings caption {
  text-align: left;
  padding: 8px 0 12px;
  font-weight: 600;
}
.standings th,
.standings td {
  padding: 9px 12px;
  border-bottom: 1px solid #d6c7a5;
  text-align: center;
}
.standings th:first-child {
  text-align: left;
}
.standings thead {
  font-size: 14px;
}
.standings tr:last-child > * {
  border-bottom: 0;
}
.standings tbody th {
  font-weight: 400;
}
.standing-player {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-wrap: anywhere;
}
.standing-player > span:last-child {
  min-width: 0;
}
.results-rule {
  color: #c3d2e1;
  font: 14px/1.5 sans-serif;
  text-align: center;
  margin: 12px 0;
}
.tv-stage .finished-tabs {
  flex: 0 0 auto;
  margin: 0;
}
.tv-stage .finished-tabs .button {
  min-height: 44px;
  padding: 10px 24px;
  font-size: 20px;
}
.tv-stage .game-results {
  flex: 1;
  min-height: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
}
.tv-stage .result-awards {
  flex: 0 0 auto;
  gap: 24px;
  margin-bottom: 14px;
}
.tv-stage .result-award {
  padding: 18px 24px;
}
.tv-stage .result-award h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.tv-stage .result-award p {
  font-size: 30px;
}
.tv-stage .result-award small {
  font-size: 18px;
}
.tv-stage .standings-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 8px 24px;
}
.tv-stage .standings {
  font-size: 24px;
}
.tv-stage .standings caption {
  display: none;
}
.tv-stage .standings thead {
  font-size: 20px;
}
.tv-stage .standings th,
.tv-stage .standings td {
  padding: 5px 12px;
}
.tv-stage .standing-player .player-icon,
.tv-stage .standing-player .avatar {
  width: 36px;
  height: 36px;
  font-size: 20px;
}
.tv-stage .results-rule {
  flex: 0 0 auto;
  font-size: 18px;
  margin: 8px 0 0;
}
@media (max-width: 760px) {
  .result-awards {
    grid-template-columns: 1fr;
  }
  .standings-wrap {
    padding: 8px;
  }
  .standings {
    font-size: 15px;
    table-layout: fixed;
  }
  .standings th,
  .standings td {
    padding: 8px 4px;
  }
  .standings th:first-child {
    width: 40%;
  }
  .standings thead {
    font-size: 12px;
  }
  .standing-player {
    gap: 6px;
  }
  .standing-player .player-icon,
  .standing-player .avatar {
    width: 28px;
    height: 28px;
  }
}
.player-icon {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #203c56;
  border: 1px solid #c9bc98;
}
.writer .player-icon {
  width: 34px;
  height: 34px;
}
.credit {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
}
.credit .player-icon {
  width: 54px;
  height: 54px;
}
.page-credits .credit-person {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.page-credits .credit-person .player-icon {
  width: 40px;
  height: 40px;
}
.icon-studio {
  max-width: 960px;
  margin: 0 auto;
}
.icon-compose {
  max-width: none;
}
.icon-compose textarea {
  min-height: 125px;
}
.icon-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 15px;
}
.icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 18px 12px;
  min-height: 170px;
  border: 1px solid #dfcca2;
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}
.icon-option .player-icon {
  width: 92px;
  height: 92px;
}
.icon-choice:not(:disabled):hover {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.icon-option p {
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.icon-option small {
  font-size: 10px;
}
.icon-candidates {
  margin: 30px 0;
}
.icon-candidates h2,
.saved-icons h2 {
  color: var(--moon);
  margin-bottom: 18px;
  font-size: 29px;
}
.saved-icons > .writing-hint,
.icon-status {
  color: var(--sky-muted);
}
.icon-status {
  text-align: center;
  margin: 20px;
}
.icon-selected > .player-icon {
  width: 130px;
  height: 130px;
  margin: 0 auto 25px;
}
.icon-host-stage {
  margin: 25px 0;
}
.icon-roster {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.icon-writer {
  background: #fff8e8;
  padding: 25px;
  border-radius: 8px;
  display: flex;
  gap: 18px;
  align-items: center;
}
.icon-writer h2 {
  font-size: 24px;
  overflow-wrap: anywhere;
}
.icon-writer p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.ballot-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  color: var(--sky-muted);
}
.ballot-navigation > span {
  font-size: 12px;
  text-align: center;
}

/* A genuine 16:9 canvas, scaled to fit browser chrome rather than cropped. */
.tv-viewport {
  width: 100%;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tv-window {
  position: relative;
  overflow: hidden;
}
.tv-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
}
.tv-stage .host-room {
  width: 1920px;
  height: 1080px;
  min-height: 0;
  overflow: hidden;
}
.tv-stage .room-header {
  flex: 0 0 76px;
  min-height: 0;
  margin: 0 48px;
}
.tv-stage .wordmark {
  font-size: 40px;
}
.tv-stage .book-symbol {
  width: 50px;
  height: 50px;
}
.tv-stage .room-header-middle,
.tv-stage .text-button {
  font-size: 18px;
}
.tv-stage .room-code {
  font-size: 16px;
}
.tv-stage .room-code b {
  font-size: 36px;
}
.tv-stage .demo-banner {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 5px 20px;
}
.tv-stage .connection-banner {
  flex: 0 0 auto;
  font-size: 20px;
}
.tv-stage .room-main {
  width: 1824px;
  max-width: none;
  min-height: 0;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tv-stage .chapter-bar {
  flex: 0 0 48px;
  min-height: 0;
}
.tv-stage .chapter-bar > span {
  font-size: 16px;
}
.tv-stage .chapter-bar > span b {
  font-size: 28px;
}
.tv-stage .steps {
  font-size: 19px;
}
.tv-stage .timer {
  font-size: 32px;
}
.tv-stage .phase-intro {
  flex: 0 0 auto;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 26px;
  max-width: none;
  margin: 0;
}
.tv-stage .narrator-portrait img {
  width: 96px;
  height: 96px;
}
.tv-stage .narrator-portrait > span {
  display: none;
}
.tv-stage .phase-intro .eyebrow {
  font-size: 12px;
  margin-bottom: 5px;
}
.tv-stage .phase-intro h1 {
  font-size: 48px;
  line-height: 1.08;
}
.tv-stage .narrator-line {
  display: none;
}
.tv-stage .action-cue {
  margin-top: 9px;
  padding: 8px 15px;
}
.tv-stage .action-cue > span {
  font-size: 11px;
}
.tv-stage .action-cue > p {
  font-size: 22px;
  line-height: 1.35;
  margin-top: 3px;
}
.tv-stage .lobby-layout {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
}
.tv-stage .join-card {
  padding: 38px;
}
.tv-stage .join-card .eyebrow {
  font-size: 14px;
}
.tv-stage .join-card h2 {
  font-size: 58px;
}
.tv-stage .join-card p {
  font-size: 25px;
}
.tv-stage .big-room-code {
  font-size: 70px;
  letter-spacing: 16px;
}
.tv-stage .qr {
  width: 245px;
  border-width: 14px;
}
.tv-stage .writers-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
}
.tv-stage .panel-heading,
.tv-stage .panel-heading .eyebrow {
  font-size: 19px;
}
.tv-stage .writers {
  flex: 1;
  min-height: 0;
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px 24px;
  margin: 15px 0;
}
.tv-stage .writer {
  gap: 14px;
  font-size: 26px;
  line-height: 1.2;
}
.tv-stage .writer .player-icon,
.tv-stage .writer .avatar {
  width: 62px;
  height: 62px;
  font-size: 26px;
}
.tv-stage .online-dot {
  width: 9px;
  height: 9px;
}
.tv-stage .writers-panel > .button {
  font-size: 24px;
  min-height: 60px;
}
.tv-stage .form-hint {
  font-size: 16px;
}
.tv-stage .empty-note {
  font-size: 30px;
}
.tv-stage .icon-host-stage {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
  gap: 20px;
}
.tv-stage .icon-roster {
  flex: 1;
  min-height: 0;
  grid-auto-rows: minmax(0, 1fr);
}
.tv-stage .icon-writer {
  min-width: 0;
  padding: 24px;
}
.tv-stage .icon-writer .player-icon,
.tv-stage .icon-writer .avatar {
  width: 100px;
  height: 100px;
  font-size: 40px;
}
.tv-stage .icon-writer h2 {
  font-size: 30px;
}
.tv-stage .icon-writer p {
  font-size: 22px;
}
.tv-stage .ballot-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.tv-stage .ballot {
  flex: 1;
  min-height: 0;
  margin: 0;
  max-width: none;
  gap: 24px;
}
.tv-stage .candidate {
  min-height: 0;
  padding: 24px;
}
.tv-stage .candidate-label {
  flex: 0 0 auto;
  font-size: 20px;
  margin-bottom: 14px;
}
.tv-stage .candidate > p {
  font-size: 32px;
  line-height: 1.32;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.tv-stage .candidate > img {
  flex: 1;
  height: 0;
  min-height: 0;
  object-fit: contain;
  aspect-ratio: auto;
}
.tv-stage .image-ballot {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tv-stage .image-ballot:not(:has(> .candidate:nth-child(2))) {
  grid-template-columns: 1fr;
}
.tv-stage .image-ballot:has(> .candidate:nth-child(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tv-stage .image-ballot:has(> .candidate:nth-child(4)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tv-stage .failed-image {
  padding: 12px;
  font-size: 18px;
}
.tv-stage .ballot-navigation {
  flex: 0 0 auto;
  margin-top: 14px;
}
.tv-stage .ballot-navigation .button {
  font-size: 21px;
  min-height: 52px;
}
.tv-stage .ballot-navigation > span {
  font-size: 18px;
}
.tv-stage .ballot-navigation .secondary {
  color: var(--moon);
  background: #92b1d012;
  border-color: #b9cadb77;
}
.tv-stage .host-writing {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
}
.tv-stage .writing-illustration {
  display: none;
}
.tv-stage .host-writing h2 {
  font-size: 42px;
}
.tv-stage .host-writing p {
  font-size: 26px;
}
.tv-stage .phase-prompt-writing .host-writing,
.tv-stage .phase-generating .scene-card {
  display: none;
}
.tv-stage .scene-card {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.tv-stage .scene-card > p {
  font-size: 42px;
  line-height: 1.3;
  max-height: calc(100% - 100px);
  overflow: hidden;
}
.tv-stage .credit {
  flex: 0 0 auto;
  font-size: 18px;
  margin-top: 24px;
}
.tv-stage .credit b {
  font-size: 30px;
}
.tv-stage .credit .player-icon {
  width: 64px;
  height: 64px;
}
.tv-stage .round-progress {
  flex: 0 0 auto;
  margin: 0;
  gap: 6px;
}
.tv-stage .progress-pips > span {
  width: 42px;
  height: 42px;
  font-size: 18px;
}
.tv-stage .round-progress > span {
  font-size: 20px;
}
.tv-stage .host-controls {
  flex: 0 0 auto;
  margin: 0;
  padding-top: 12px;
}
.tv-stage .host-controls > span {
  font-size: 18px;
  max-width: 1080px;
}
.tv-stage .host-controls .button {
  font-size: 22px;
  min-height: 52px;
}
.tv-stage .story-so-far {
  flex: 0 1 auto;
  max-width: none;
  margin: 0;
  max-height: 280px;
  overflow: auto;
  font-size: 22px;
}
.tv-stage .generating {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}
.tv-stage .generating p {
  font-size: 32px;
}
.tv-stage .generating small {
  max-width: 1100px;
  font-size: 22px;
}
.tv-stage .book-page {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}
.tv-stage .page-picture {
  min-height: 0;
}
.tv-stage .page-picture > img {
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}
.tv-stage .page-words {
  min-height: 0;
  padding: 20px 28px;
}
.tv-stage .page-words > .eyebrow {
  flex: 0 0 auto;
  font-size: 14px;
}
.tv-stage .page-story {
  min-height: 0;
  overflow: hidden;
  font-size: 32px;
  line-height: 1.3;
  margin: 14px 0;
}
.tv-stage .page-credits {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 12px;
}
.tv-stage .page-credits .credit-person {
  font-size: 22px;
  line-height: 1.35;
  gap: 14px;
  margin: 0;
}
.tv-stage .page-credits .credit-person > span {
  display: flex;
  flex-direction: column;
}
.tv-stage .page-credits .credit-person b {
  font-size: 27px;
}
.tv-stage .page-credits .player-icon {
  width: 60px;
  height: 60px;
}
.tv-stage .page-credits details {
  display: none;
}
.tv-stage .page-number {
  flex: 0 0 auto;
  margin-top: 12px;
  font-size: 16px;
}
.tv-stage .missing-art {
  min-height: 0;
  font-size: 26px;
}
.tv-stage .missing-art small {
  font-size: 20px;
}
.tv-stage .book-navigation {
  flex: 0 0 auto;
  margin: 0;
}
.tv-stage .book-navigation .button {
  font-size: 22px;
  min-height: 50px;
}
.tv-stage .book-navigation > span {
  font-size: 20px;
}
.tv-stage .ending {
  flex: 0 0 auto;
  max-width: none;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
}
.tv-stage .ending h2 {
  font-size: 26px;
  margin: 0;
  max-width: 650px;
}
.tv-stage .ending > p,
.tv-stage .ending-flourish {
  display: none;
}
.tv-stage .ending > .button {
  min-height: 54px;
  font-size: 22px;
}
.tv-stage .ending .text-link {
  font-size: 20px;
  margin: 0;
}
.tv-stage .room-footer {
  flex: 0 0 32px;
  margin: 0 48px;
  padding: 6px 0;
  font-size: 12px;
}
.tv-stage .room-footer > span:nth-child(2) {
  font-size: 17px;
}
@media (max-width: 760px) {
  .icon-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .icon-writer {
    padding: 16px;
    flex-direction: column;
    text-align: center;
  }
  .icon-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
