:root {
  color-scheme: light;
  --ink: #342044; --muted: #72557f; --purple: #7752b5; --pink: #f3a7cd;
  --yellow: #fce6a2; --cyan: #bceef0; --green: #a4dfb9;
  font-family: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); min-height: 100vh; background: radial-gradient(circle at 8% 10%, #fce6f2, transparent 45%), radial-gradient(circle at 90% 15%, #d9f5fa, transparent 45%), linear-gradient(135deg, #eee0ff, #fff4ed); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3 { font-family: 'Baloo 2', sans-serif; margin: 0; line-height: 1.08; }
h1 { font-size: clamp(2.7rem, 5.5vw, 5.2rem); letter-spacing: -.04em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }
p { color: var(--muted); line-height: 1.5; }
.shell { min-height: 100vh; padding: clamp(1rem, 2.5vw, 2rem); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: 1320px; margin: 0 auto 1.25rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; font: 800 clamp(1.1rem, 2vw, 1.7rem)/1 'Baloo 2'; }
.logo-mark { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 1rem; font-size: 2rem; background: linear-gradient(135deg, #f5bfdc, #d7c6fa, #c6f2f2); box-shadow: 0 4px 0 #c1a0d4; }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.tv-host-meta { display: flex; align-items: center; gap: .8rem; }
.tv-host-meta > div:first-child { display: grid; justify-items: end; }
.tv-host-meta small { color: var(--purple); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.tv-host-meta strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'Baloo 2', sans-serif; font-size: 1.25rem; }
.tv-host-meta span { color: var(--muted); font-size: .8rem; }
.top-qr { width: 104px; height: 104px; padding: 4px; display: grid; place-items: center; background: #fff; border-radius: .7rem; }
.top-qr img, .top-qr canvas { width: 96px !important; height: 96px !important; }
.tv-lobby-players { max-width: 750px; max-height: 130px; overflow-y: auto; margin: 1rem auto 0; text-align: left; }
.page { width: min(1100px, 100%); margin: auto; }
.host-page .moderator-play { width: min(560px, 100%); margin: 0 auto 1rem; }
.host-page .moderator-play[hidden] { display: none; }
.play-label { text-align: center; color: var(--purple); font-size: .75rem; font-weight: 900; letter-spacing: .14em; margin: 1rem 0 .6rem; }
.host-welcome { padding: .5rem 0 1rem; }
.host-page .host-menu { padding: 0; overflow: hidden; }
.host-page .host-menu > summary { min-height: 4.4rem; padding: 1rem 1.15rem; display: flex; align-items: center; }
.host-page .host-menu-body { padding: .5rem 1.15rem 1.15rem; border-top: 1px solid #ddc7eb; }
.host-page .dragon-game-card, .host-page #start-dragon { max-width: 800px; margin-left: auto; margin-right: auto; }
@media (min-width: 851px) { .tv-shell.has-moderator .tv-grid { grid-template-columns: minmax(0, 1fr); } .tv-shell.has-moderator .side-stack { display: none; } }
@media (min-width: 851px) and (max-height: 850px) {
  .tv-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; padding: .65rem 1rem; }
  .tv-shell .topbar { height: 2.9rem; margin-bottom: .55rem; }
  .tv-shell .tv-grid { height: calc(100vh - 4.2rem); height: calc(100dvh - 4.2rem); grid-template-columns: minmax(0, 1fr) 18rem; gap: .7rem; }
  .tv-shell .stage { height: 100%; min-height: 0; padding: 1rem 1.5rem; }
  .tv-shell .side-stack { min-height: 0; grid-template-rows: auto auto minmax(0, 1fr); gap: .55rem; }
  .tv-shell .side-card { min-height: 0; padding: .75rem; overflow: hidden; }
  .tv-shell .side-card .player-cloud { max-height: 150px; overflow-y: auto; }
  .tv-shell.has-moderator .topbar { height: 6.6rem; margin-bottom: .45rem; }
  .tv-shell.has-moderator .tv-grid { height: calc(100vh - 7.75rem); height: calc(100dvh - 7.75rem); grid-template-columns: minmax(0, 1fr); }
  .tv-shell.has-moderator .stage { padding: .8rem 1.25rem; }
  .tv-shell .dragon-round, .tv-shell .dragon-summary { max-width: 1160px; margin: auto; }
}
.install-app { display: inline-flex; align-items: center; min-height: 44px; padding: .6rem .85rem; background: #ffffffb0; border: 1px solid #d9c5e8; border-radius: .8rem; text-decoration: none; font-size: .85rem; font-weight: 900; white-space: nowrap; }
.install-app:hover { background: #fff; }
.room-pill { display: inline-flex; align-items: center; gap: .5rem; background: #ffffffb0; border: 1px solid #d9c5e8; border-radius: 999px; padding: .6rem .9rem; font-size: .85rem; font-weight: 900; white-space: nowrap; }
.room-pill strong { letter-spacing: .12em; }
.tv-grid { max-width: 1320px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.2rem; }
.stage, .panel, .side-card { background: #ffffffb8; border: 1px solid #fff; border-radius: 1.5rem; box-shadow: 0 12px 35px #765a9320; }
.stage { min-height: calc(100dvh - 7.5rem); display: grid; place-content: center; padding: 2rem; position: relative; overflow: hidden; text-align: center; }
.stage::before { content: '✦'; position: absolute; top: 1.5rem; left: 2rem; color: #bb87d8; font-size: 3rem; }
.stage::after { content: '✧'; position: absolute; bottom: 1.5rem; right: 2rem; color: #cf8ab0; font-size: 4rem; }
.stage > div { position: relative; z-index: 1; }
.unicorn-hero { font-size: clamp(3rem, 6vw, 5rem); margin: .3rem 0 .8rem; line-height: 1.1; }
.eyebrow { color: var(--purple); font-weight: 900; letter-spacing: .11em; text-transform: uppercase; font-size: .85rem; margin: 0 0 .75rem; }
.highlight { color: var(--purple); }
.lede { font-size: clamp(1rem, 1.8vw, 1.4rem); max-width: 38rem; margin: 1rem auto; }
.side-stack { display: grid; align-content: start; gap: .8rem; }
.side-card, .panel { padding: 1.25rem; }
.qr-card { text-align: center; background: #fff; }
.qr-card p { margin: .3rem 0; overflow-wrap: anywhere; }
.qr-frame { margin: .8rem auto 0; width: 184px; height: 184px; display: grid; place-items: center; padding: 12px; background: white; border-radius: 1rem; border: 1px solid #e5d7ed; }
.qr-frame img, .qr-frame canvas { width: 160px !important; height: 160px !important; }
.session-code { font-weight: 900; letter-spacing: .17em; font-size: 1.3rem; }
.player-cloud { display: grid; grid-template-columns: repeat(auto-fit, minmax(95px, 1fr)); gap: .6rem; }
.player-chip { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .45rem; background: #f0e7f9; border-radius: .9rem; }
.player-chip strong { overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; flex-shrink: 0; background: var(--cyan); border-radius: .8rem; font-weight: 900; }
.player-chip:nth-child(3n+2) .avatar { background: var(--pink); }
.player-chip:nth-child(3n+3) .avatar { background: var(--yellow); }
.empty { padding: 1rem; border: 2px dashed #d8bde5; border-radius: 1rem; color: var(--muted); }
.phone-page { max-width: 560px; margin: auto; }
.phone-wait { text-align: center; }
.foundation-card { margin-top: 1rem; }
.field { display: grid; gap: .5rem; margin-top: 1.2rem; }
.field label { font-weight: 900; }
.input { width: 100%; min-height: 3.5rem; padding: .8rem 1rem; border: 2px solid #ddc7eb; border-radius: 1rem; background: #fff; color: var(--ink); }
.input:focus { outline: 3px solid #aaceeb; outline-offset: 2px; }
.button { min-height: 3.3rem; display: inline-flex; justify-content: center; align-items: center; padding: .8rem 1rem; border: 0; border-radius: 1rem; background: #e4c5f4; color: var(--ink); font-weight: 900; text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 #b999cd; }
.button.secondary { background: var(--cyan); box-shadow: 0 4px 0 #90bfc8; }
.button:disabled { opacity: .5; cursor: wait; }
.button-row { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.2rem; }
.button-row > * { flex: 1; }
.player-name-edit { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid #d7bbe7; border-radius: .8rem; background: #ffffffb0; color: var(--ink); font-size: 1.5rem; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 1.5rem; text-align: center; }
.toast-region { position: fixed; bottom: 1rem; right: 1rem; z-index: 20; }
.toast { max-width: 24rem; margin-top: .5rem; padding: 1rem; background: #fff; color: var(--ink); border-radius: 1rem; box-shadow: 0 8px 30px #765a9330; }
.setup-preview { max-width: 1320px; margin: auto; }
.setup-note { padding: 1rem; margin: 1.5rem auto 0; max-width: 32rem; color: var(--muted); background: #f1e8fa; border-radius: 1rem; font-weight: 700; }
.dragon-active .stage { display: block; padding: 1.4rem 2rem; }
.dragon-active .qr-frame { width: 150px; height: 150px; padding: 8px; }
.dragon-active .qr-frame img, .dragon-active .qr-frame canvas { width: 132px !important; height: 132px !important; }
.dragon-active .side-stack .player-cloud { max-height: 150px; overflow-y: auto; }
.dragon-round, .dragon-summary { width: 100%; }
.dragon-round-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.dragon-round-top .eyebrow { margin: 0; }
.dragon-timer { min-width: 3.8rem; padding: .55rem .8rem; background: #e4c5f4; border-radius: 1rem; font-weight: 900; font-size: 1.4rem; }
.dragon-timer.urgent { background: #ffe1b3; }
.dragon-character { font-size: clamp(5rem, 9vw, 8rem); line-height: 1.2; margin: .5rem auto; }
.dragon-character.happy { animation: dragon-bounce .6s ease-out; }
.dragon-character.sneeze { animation: dragon-sneeze .5s ease-out; }
.dragon-recipe { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 1rem 0; flex-wrap: wrap; }
.recipe-food, .recipe-empty { display: inline-grid; place-items: center; min-width: 72px; min-height: 72px; padding: .4rem; font-size: 3.3rem; line-height: 1.15; background: #fff; border: 2px solid #e0c7ef; border-radius: 1.2rem; }
.small .recipe-food { min-width: 54px; min-height: 54px; font-size: 2.4rem; }
.answers-in { font-size: 1.25rem; font-weight: 900; }
.dragon-instruction { margin: .4rem 0; font-size: 1.1rem; }
.dragon-round-headline { font-size: 1.25rem; font-weight: 900; color: var(--purple); margin: .5rem 0; }
.dragon-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; max-height: 25vh; overflow-y: auto; }
.dragon-result { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem; padding: .6rem; border-radius: 1rem; background: #f3e8fa; }
.dragon-result.right { background: #d8f0df; }
.dragon-result > strong { width: 100%; }
.dragon-result .recipe-food { min-width: 30px; min-height: 30px; font-size: 1.6rem; padding: .15rem; border: 0; }
.dragon-leaderboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin: 1rem 0; max-height: 30vh; overflow-y: auto; }
.dragon-leaderboard > div { display: flex; align-items: center; gap: .65rem; background: #eee0fa; border-radius: .9rem; padding: .85rem; }
.dragon-leaderboard strong { flex: 1; overflow-wrap: anywhere; }
.dragon-leaderboard b { color: var(--purple); }
.team-celebration { padding: 1.2rem; font-size: 1.6rem; font-weight: 900; background: linear-gradient(100deg, #fce6a2, #f4d5f7, #bceef0); border-radius: 1.2rem; margin: 1rem 0; }
.food-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0; }
.food-button { display: grid; justify-items: center; gap: .3rem; min-height: 88px; padding: .5rem; border: 2px solid #dec8eb; border-radius: 1rem; background: #fff; color: var(--ink); cursor: pointer; }
.food-button span { font-size: 2.7rem; line-height: 1.2; }
.food-button small { font-size: .8rem; font-weight: 800; }
.food-button:active { background: #e9dbf8; transform: scale(.97); }
.food-button:disabled { opacity: .45; cursor: default; }
.feeding-tray { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; min-height: 64px; }
.feeding-tray .recipe-food, .recipe-empty { min-width: 56px; min-height: 56px; font-size: 2.4rem; }
.recipe-empty { color: #b091c7; background: #f3eaf9; border-style: dashed; }
.feed-help { font-size: .85rem; }
.button.ghost { background: #fff; box-shadow: none; border: 1px solid #ddc7eb; min-height: 44px; }
.host-menu { margin-bottom: 1rem; }
.host-menu summary { font-weight: 900; cursor: pointer; padding: .4rem 0; }
.host-menu-body { padding-top: .8rem; }
.dragon-game-card { display: flex; align-items: center; gap: .8rem; background: linear-gradient(110deg, #e9d8fa, #dcf3eb); border-radius: 1rem; padding: 1rem; }
.dragon-game-card > span { font-size: 3rem; }
.dragon-game-card { width: 100%; border: 2px solid transparent; color: var(--ink); text-align: left; cursor: pointer; }
.dragon-game-card.selected { border-color: var(--purple); }
.game-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 0 0 1rem; }
.game-pick { display: grid; justify-items: center; gap: .5rem; padding: 1rem; border: 2px solid #ddc7eb; border-radius: 1rem; background: linear-gradient(120deg, #f3e2fa, #dff5ee); color: var(--ink); cursor: pointer; }
.game-pick.selected { border-color: var(--purple); background: #e8d5f8; }
.game-pick > span { font-size: 2.7rem; }
.game-pick small { color: var(--muted); }
.sound-round { width: min(100%, 1160px); margin: auto; }
.sound-options, .sound-phone-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.sound-tv-option, .sound-answer { position: relative; display: grid; justify-items: center; align-content: center; gap: .4rem; padding: .75rem; min-height: 135px; border: 2px solid #ddc7eb; border-radius: 1.2rem; background: #fff; color: var(--ink); }
.sound-answer { cursor: pointer; min-height: 130px; }
.sound-answer.selected { border-color: #9b4dcc; background: #f0ddff; box-shadow: inset 0 0 0 2px #9b4dcc; }
.sound-answer:disabled { cursor: default; opacity: .55; }
.sound-picture { font-size: clamp(2.5rem, 4vw, 3.6rem); line-height: 1.2; }
.sound-option-key { position: absolute; top: .6rem; left: .7rem; color: var(--purple); font-weight: 900; }
.sound-tv-option.correct { border-color: #63aa76; background: #dcf3e3; }
.sound-tv-option strong { font-size: 1.2rem; }
.sound-voters { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; max-height: 48px; overflow-y: auto; }
.sound-voters span { padding: .2rem .4rem; background: #e9d8f5; border-radius: .5rem; font-size: .8rem; }
.sound-voters em { font-size: .8rem; color: var(--muted); }
.sound-reveal-picture { display: grid; justify-items: center; gap: .5rem; padding: 1rem; }
#sound-playback-status { min-height: 1.5em; margin: .5rem 0; }
@media (min-width: 851px) and (max-height: 850px) { .sound-options { margin: .7rem 0; } .sound-tv-option { min-height: 125px; padding: .5rem; } .sound-picture { font-size: 3rem; } .sound-round h2 { font-size: 2.6rem; } .sound-round .answers-in { margin: .5rem 0; } }
.dragon-game-card p { margin: .4rem 0 0; }
.dragon-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.dragon-settings label { display: grid; gap: .4rem; font-weight: 800; font-size: .9rem; }
.dragon-settings select, .dragon-settings input { min-height: 44px; width: 100%; padding: .65rem; background: #fff; border: 1px solid #d8bde6; border-radius: .7rem; color: var(--ink); font: inherit; }
.sound-setting { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-weight: 800; }
.sound-setting input { width: 22px; height: 22px; accent-color: var(--purple); }
@keyframes dragon-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px) rotate(-4deg); } 70% { transform: rotate(4deg); } }
@keyframes dragon-sneeze { 20% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } 80% { transform: rotate(-3deg); } }
/* Aariz's answer feedback: animate the receiving tile, never the full stage. */
.sound-tv-option.vote-wiggle, .dragon-character.vote-wiggle { animation: vote-wiggle .42s cubic-bezier(.36,.07,.19,.97); }
@keyframes vote-wiggle { 20% { transform: rotate(-1.2deg) scale(1.018); } 45% { transform: rotate(1.2deg) scale(1.018); } 70% { transform: rotate(-.6deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 900px) and (max-height: 800px) { .dragon-character { font-size: 5.5rem; margin: .25rem auto; } .dragon-round h2 { font-size: 2.6rem; } .dragon-recipe { margin: .65rem 0; } .dragon-active .stage { padding: 1rem 1.5rem; } .dragon-summary h1 { font-size: 3rem; } }
@media (min-width: 900px) and (max-height: 800px) { .shell { padding: 1rem 1.5rem; } .topbar { margin-bottom: .75rem; } .stage { min-height: calc(100dvh - 6rem); } .side-card { padding: .9rem; } .unicorn-hero { font-size: 3.5rem; } }
@media (max-width: 800px) { .tv-grid { grid-template-columns: 1fr; } .stage { min-height: 55vh; padding: 2rem 1rem; } .side-stack { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
@media (max-width: 560px) { .brand > span:last-child { display: none; } .install-app { display: none; } .shell { padding: 1rem; } .side-stack { grid-template-columns: 1fr; } .stage::before, .stage::after { opacity: .4; } .tv-host-meta > div:first-child { display: none; } .top-qr { width: 56px; height: 56px; } .top-qr img, .top-qr canvas { width: 48px !important; height: 48px !important; } }

/* Keep TV layout rules last: generic short-screen rules must not enlarge the stage.
   vh is the fallback for Android TV browsers without dynamic viewport units. */
@media (orientation: landscape) {
  .tv-shell { height: var(--tv-height, 100vh); min-height: 0; overflow: hidden; padding: .65rem 1rem; display: flex; flex-direction: column; gap: 8px; }
  .tv-shell .topbar { height: 48px; margin-bottom: 8px; }
  .tv-shell .topbar { width: 100%; flex: 0 0 auto; margin-bottom: 0; }
  .tv-shell .tv-grid { width: 100%; height: auto; flex: 1 1 0; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(180px, 25%); grid-template-rows: minmax(0, 1fr); gap: .7rem; }
  .tv-shell .side-stack { min-height: 0; grid-template-rows: auto auto minmax(0, 1fr); gap: .55rem; }
  .tv-shell .side-card { min-height: 0; padding: .75rem; overflow: hidden; }
  .tv-shell .side-card .player-cloud { max-height: 150px; overflow-y: auto; }
  .tv-shell.has-moderator .topbar { height: 88px; margin-bottom: 8px; }
  .tv-shell.has-moderator .tv-grid { height: auto; grid-template-columns: minmax(0, 1fr); }
  .tv-shell.has-moderator .side-stack { display: none; }
  .tv-shell .stage { min-height: 0; height: 100%; padding: .75rem 1.25rem; display: block; }
  .tv-stage-content { position: absolute !important; top: 50%; left: 50%; width: var(--stage-width, 100%); transform: translate(-50%, -50%) scale(var(--stage-scale, 1)); transform-origin: center; }
  .tv-shell .dragon-active .stage { display: block; }
  .tv-shell .top-qr { width: 88px; height: 88px; padding: 4px; }
  .tv-shell .top-qr img, .tv-shell .top-qr canvas { width: 80px !important; height: 80px !important; }
  .tv-shell .stage::before, .tv-shell .stage::after { opacity: .25; font-size: 2rem; }
  .tv-shell .sound-round { width: 100%; max-width: 1160px; height: auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto auto; gap: .4rem .75rem; }
  .tv-shell .sound-round .dragon-round-top, .tv-shell .sound-round h2, .tv-shell .sound-options, .tv-shell .sound-round .answers-in { grid-column: 1 / -1; margin: 0; }
  .tv-shell .sound-round h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
  .tv-shell #sound-playback-status { margin: 0; min-height: 0; align-self: center; text-align: left; font-size: 1rem; line-height: 1.2; }
  .tv-shell #play-question-sound { min-height: 40px; padding: .4rem .8rem; font-size: .9rem; }
  .tv-shell .sound-options { min-height: 0; grid-template-rows: auto auto; gap: .55rem; }
  .tv-shell .sound-tv-option { min-height: 4.7rem; padding: .65rem .75rem; gap: .4rem .65rem; overflow: hidden; grid-template-columns: 2.25rem 3.2rem minmax(0, 1fr); justify-items: start; align-items: center; align-content: center; border-radius: .9rem; text-align: left; }
  .tv-shell .sound-option-key { position: static; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .6rem; background: #e4c5f4; }
  .tv-shell .sound-picture { font-size: 2.7rem; line-height: 1; }
  .tv-shell .sound-tv-option strong { font-size: 1.2rem; overflow-wrap: anywhere; }
  .tv-shell .sound-voters { grid-column: 2 / -1; justify-content: flex-start; min-height: 1.55rem; max-height: 2.9rem; }
  .tv-shell .sound-round .answers-in { font-size: 1.05rem; line-height: 1.2; }
  .tv-shell .dragon-character { font-size: 4rem; margin: .2rem auto; }
  .tv-shell .dragon-round h2 { font-size: 2.3rem; }
  .tv-shell .dragon-recipe { margin: .5rem 0; gap: .5rem; }
  .tv-shell .recipe-food { min-width: 54px; min-height: 54px; font-size: 2.5rem; }
  .tv-shell .dragon-round p { margin: .5rem 0; }
  .tv-shell .dragon-results, .tv-shell .dragon-leaderboard { max-height: 26vh; overflow-y: auto; }
  .tv-shell .unicorn-hero { font-size: 3rem; margin: .25rem 0; }
  .tv-shell .stage h1 { font-size: clamp(2.4rem, 4.5vw, 3.8rem); }
  .tv-shell .lede { margin: .65rem auto; }
}
@media (orientation: landscape) and (max-width: 850px) {
  .tv-shell .brand { font-size: 1rem; }
  .tv-shell .install-app { display: none; }
  .tv-shell .header-actions { gap: .4rem; }
  .tv-shell .room-pill { padding: .4rem; font-size: .7rem; }
  .tv-shell .tv-host-meta { gap: .4rem; }
  .tv-shell .tv-host-meta strong { max-width: 100px; }
  .tv-shell .side-stack { display: block; }
  .tv-shell .side-stack > .side-card:not(.qr-card) { display: none; }
  .tv-shell .qr-card h3 { font-size: 1rem; }
  .tv-shell .qr-card p { font-size: .75rem; }
  .tv-shell .qr-frame { width: 144px; height: 144px; margin: .35rem auto; padding: 12px; }
  .tv-shell .qr-frame img, .tv-shell .qr-frame canvas { width: 120px !important; height: 120px !important; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .tv-shell { padding: .4rem .75rem; gap: 5px; }
  .tv-shell.has-moderator .topbar { height: 64px; }
  .tv-shell .top-qr { width: 64px; height: 64px; }
  .tv-shell .top-qr img, .tv-shell .top-qr canvas { width: 56px !important; height: 56px !important; }
  .tv-shell .stage { padding: .5rem .75rem; }
  .tv-shell .sound-round { gap: .25rem .5rem; }
  .tv-shell .sound-round h2 { font-size: 1.5rem; }
  .tv-shell .dragon-timer { min-width: 2rem; padding: .25rem .5rem; font-size: 1rem; }
  .tv-shell #sound-playback-status { font-size: .8rem; }
  .tv-shell #play-question-sound { min-height: 30px; font-size: .75rem; padding: .25rem .5rem; }
  .tv-shell .sound-tv-option { min-height: 3rem; padding: .3rem .5rem; gap: .2rem .4rem; grid-template-columns: 1.5rem 2rem minmax(0, 1fr); }
  .tv-shell .sound-option-key { width: 1.5rem; height: 1.5rem; }
  .tv-shell .sound-picture { font-size: 2rem; }
  .tv-shell .sound-tv-option strong { font-size: 1rem; }
  .tv-shell .sound-voters { min-height: 1.2rem; max-height: 1.5rem; }
  .tv-shell .sound-voters span { font-size: .65rem; padding: .15rem .25rem; }
  .tv-shell .sound-round .answers-in { font-size: .85rem; }
}
@media (orientation: landscape) {
  .tv-shell:not(.has-moderator) .side-stack { height: 100%; display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto; }
  .tv-shell .qr-card { height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .tv-shell .qr-frame { flex: 0 0 auto; margin: .35rem auto; border-radius: .5rem; }
  .tv-shell .qr-frame img, .tv-shell .qr-frame canvas { image-rendering: pixelated; }
  .tv-shell.tv-short-viewport .side-stack { grid-template-rows: minmax(0, 1fr); }
  .tv-shell.tv-short-viewport .side-stack > .side-card:not(.qr-card) { display: none; }
  .tv-shell.tv-short-viewport .qr-card h3 { font-size: 1rem; }
  .tv-shell.tv-short-viewport .qr-card p { font-size: .7rem; }
  .tv-shell.tv-short-viewport .session-code { font-size: 1rem; }
}
