/* Take A Mic TV kiosk + /tv entry screen. Late-90s LA gig-poster look.
   Rule: nothing is ever drawn over the YouTube player; the strip sits BELOW the 16:9 frame. */

body[data-screen="tvhome"] {
  --paper: #efe6cf; --yel: #f2c230; --red: #ff2a4a; --red-dk: #b3001e; --xerox: #141210; --cream: #f3ead6;
  --wood: "Anton", "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --slab: "Alfa Slab One", Rockwell, "Courier New", serif;
  --mono: "Rubik Mono One", "Arial Black", sans-serif;
  --type: "Courier Prime", "Courier New", Courier, monospace;
  min-height: 100vh; margin: 0; color: var(--cream); font-family: var(--type);
  background: #15120f url("/img/wall.svg");
}

/* ---------- Kiosk video mode ---------- */
body.tv-kiosk[data-screen="now"] { --strip: clamp(54px, 12vh, 150px); overflow: hidden; background: #000; }
body.tv-kiosk[data-screen="now"]::before,
body.tv-kiosk[data-screen="now"]::after { display: none; }
body.tv-kiosk[data-screen="now"] .display-conn { position: fixed; right: 8px; top: 4px; margin: 0; z-index: 3; font-size: 12px; }
body[data-screen="now"] .wrap.display.tv-video {
  position: fixed; inset: 0; z-index: 1; margin: 0; padding: 0; min-height: 0; width: auto; max-width: none;
  display: grid; grid-template-rows: minmax(0, 1fr) var(--strip, 120px); grid-template-columns: 100%;
  justify-content: stretch; align-content: stretch; gap: 0;
  background: #000; color: var(--cream); box-shadow: none; transform: none;
}
body[data-screen="now"] .wrap.display.tv-video::before,
body[data-screen="now"] .wrap.display.tv-video::after { display: none; }
.tv-video .tv-stage { display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; background: #000; }
body[data-screen="now"] .tv-video .tv-frame {
  position: relative; aspect-ratio: 16 / 9; border: 0; box-shadow: none; background: #000;
  width: min(100vw, calc((100vh - var(--strip, 120px)) * 16 / 9));
  width: min(100vw, calc((100dvh - var(--strip, 120px)) * 16 / 9));
}
.tv-video .tv-slot, .tv-video .tv-slot iframe { display: block; width: 100%; height: 100%; border: 0; }

.tv-video .tv-strip {
  height: var(--strip, 120px); box-sizing: border-box; grid-template-rows: minmax(0, 1fr);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, 0.8fr) auto auto;
  align-items: center; gap: clamp(8px, 1.4vw, 28px); min-height: 0; overflow: hidden;
  padding: 0 clamp(8px, 1.6vw, 32px) 0 0;
  background: var(--xerox); border-top: clamp(3px, 0.5vh, 6px) solid var(--red);
}
.tv-video .tv-strip p { margin: 0; }
.tv-video .tv-info { align-self: stretch; box-sizing: border-box; height: 100%; overflow: hidden; display: flex; flex-direction: column; justify-content: center; min-width: 0;
  padding: 0 clamp(8px, 1.4vw, 28px); background: var(--yel); color: var(--xerox); }
.tv-video .tv-eyebrow { display: inline-block; align-self: flex-start; padding: 0.1em 0.45em; background: var(--red); color: var(--xerox);
  font: 400 clamp(8px, 1.5vh, 18px)/1.1 var(--mono); text-transform: uppercase; transform: rotate(-1.5deg); }
.tv-video .tv-name { font: 400 clamp(16px, 4.6vh, 58px)/0.95 var(--wood); text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: none; }
.tv-video .tv-name .type-badge { font-size: 0.4em; vertical-align: middle; }
.tv-video .tv-song { font: 400 clamp(10px, 2.1vh, 26px)/1.1 var(--slab); color: var(--red-dk);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-video .tv-song span { font: 700 0.8em/1 var(--type); color: var(--xerox); text-transform: uppercase; }
.tv-video .tv-up { min-width: 0; max-height: 100%; overflow: hidden; padding: 0; background: none; border: 0; box-shadow: none; }
.tv-video .tv-up-kicker { font: 400 clamp(8px, 1.5vh, 18px)/1.2 var(--mono); color: var(--yel); text-transform: uppercase; }
.tv-video .tv-up-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cream);
  font: 700 clamp(10px, 2.1vh, 26px)/1.25 var(--type); text-transform: uppercase; }
.tv-video .tv-up-row b { color: var(--red); font-family: var(--wood); font-weight: 400; }
.tv-video .tv-up-row strong { font: 400 1.15em/1 var(--wood); }
.tv-video .tv-up-row em { font-style: normal; opacity: 0.8; }
.tv-video .tv-up-row span { color: var(--yel); }
.tv-video .tv-up-row:nth-of-type(3) { opacity: 0.75; }
.tv-video .tv-status { min-height: 0; font: 700 clamp(9px, 1.8vh, 22px)/1.2 var(--type); text-transform: uppercase; color: var(--yel); overflow: hidden; }
.tv-video .tv-status:not(:empty)::before { content: "★ "; color: var(--red); }
.tv-video .tv-status.is-bad { color: var(--red); }
.tv-video .tv-qr { display: flex; align-items: center; gap: 0.6em; min-width: 0; height: 100%; padding: 0; background: none; border: 0; }
.tv-video .tv-qr .qr-svg { flex: 0 0 auto; width: calc(var(--strip, 120px) - 16px); height: calc(var(--strip, 120px) - 16px); background: #fff; }
.tv-video .tv-qr .qr-svg svg { display: block; width: 100%; height: 100%; }
.tv-video .tv-qr p { display: flex; flex-direction: column; font: 700 clamp(8px, 1.5vh, 18px)/1.2 var(--type); text-transform: uppercase; color: var(--cream); }
.tv-video .tv-qr b { font: 400 clamp(10px, 2.2vh, 28px)/1.1 var(--wood); color: var(--yel); }
.tv-video .tv-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; height: 100%; padding: 6%; text-align: center; background: var(--xerox); color: var(--cream); }

.tv-fs-btn { width: clamp(34px, 6vh, 72px); height: clamp(34px, 6vh, 72px); padding: 0; border: 3px solid var(--cream, #f3ead6);
  background: var(--red, #ff2a4a); color: #141210; font: 700 clamp(18px, 3.4vh, 40px)/1 sans-serif; cursor: pointer; box-shadow: 4px 4px 0 #000; }
:fullscreen .tv-fs-btn { opacity: 0.35; }

/* Corner dock on the poster (between songs). Hidden in video mode so nothing touches the player. */
.tv-dock { position: fixed; z-index: 10; right: clamp(10px, 2vw, 40px); bottom: clamp(10px, 2.4vh, 40px);
  display: flex; align-items: center; gap: 0.7em; padding: 0.5em 0.7em; background: #141210; border: 3px solid #f2c230;
  box-shadow: 6px 6px 0 #ff2a4a; color: #f3ead6; transform: rotate(-1deg); }
.tv-dock-qr .qr-svg { width: clamp(64px, 10vh, 150px); background: #fff; }
.tv-dock-qr svg { display: block; width: 100%; height: auto; }
.tv-dock-txt { display: flex; flex-direction: column; margin: 0; font: 700 clamp(10px, 1.6vh, 20px)/1.2 "Courier Prime", monospace; text-transform: uppercase; }
.tv-dock-txt b { font: 400 clamp(14px, 3vh, 40px)/1 "Anton", Impact, sans-serif; color: #f2c230; }
body.tv-kiosk .tv-dock { display: none; }
.tv-hint { position: fixed; z-index: 70; left: 50%; top: 12px; transform: translateX(-50%); max-width: 90vw; margin: 0; padding: 0.5em 0.8em;
  background: #f2c230; color: #141210; border: 3px solid #141210; font: 700 14px/1.3 "Courier Prime", monospace; text-transform: uppercase; }
body.tv-kiosk .tv-hint { top: auto; bottom: calc(var(--strip, 120px) + 8px); }
body.tv-idle, body.tv-idle * { cursor: none !important; }

/* Short screens (iPhone landscape mirroring ~844x390). */
@media (max-height: 500px) {
  body.tv-kiosk[data-screen="now"] { --strip: 58px; }
  .tv-video .tv-strip { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) auto auto; }
  .tv-video .tv-status { display: none; }
  .tv-video .tv-up-row:nth-of-type(3) { display: none; }
  .tv-video .tv-name { font-size: 20px; }
  .tv-video .tv-song, .tv-video .tv-up-row { font-size: 11px; }
  .tv-video .tv-qr p { display: none; }
  .tv-fs-btn { width: 40px; height: 40px; font-size: 20px; }
  .tv-dock { padding: 0.3em 0.4em; gap: 0.4em; }
  .tv-dock-qr .qr-svg { width: 52px; }
  .tv-dock-txt { display: none; }
}
@media (max-width: 700px) and (min-height: 501px) {
  .tv-video .tv-strip { grid-template-columns: minmax(0, 1fr) auto; }
  .tv-video .tv-up, .tv-video .tv-status, .tv-video .tv-qr { display: none; }
}

/* ---------- /tv entry screen ---------- */
.tvh { min-height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 3vh, 40px);
  padding: clamp(16px, 4vh, 64px) clamp(16px, 4vw, 80px); }
.tvh-kicker { align-self: flex-start; margin: 0; padding: 0.2em 0.6em; background: var(--red); color: var(--xerox);
  font: 400 clamp(12px, 2vh, 26px)/1 var(--mono); text-transform: uppercase; transform: rotate(-1.5deg); }
.tvh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 56px); align-items: stretch; }
.tvh-card { position: relative; padding: clamp(18px, 3.4vh, 52px) clamp(18px, 2.6vw, 52px); background: var(--paper); color: var(--xerox);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); }
.tvh-room { transform: rotate(-0.6deg); }
.tvh-pair { transform: rotate(0.7deg); background: var(--yel); }
.tvh-card::before { content: ""; position: absolute; top: -14px; left: 50%; width: 120px; height: 30px; margin-left: -60px;
  background: rgba(232, 222, 190, 0.85); transform: rotate(-3deg); }
.tvh-title { margin: 0 0 0.4em; font: 400 clamp(28px, 6vh, 84px)/0.92 var(--wood); text-transform: uppercase; text-shadow: 3px 3px 0 var(--red); }
.tvh-form { display: grid; gap: 0.6em; }
.tvh-label { font: 700 clamp(12px, 1.8vh, 22px)/1.2 var(--type); text-transform: uppercase; }
.tvh-input { width: 100%; box-sizing: border-box; padding: 0.15em 0.3em; border: 5px solid var(--xerox); background: #fff; color: var(--xerox);
  font: 400 clamp(40px, 10vh, 140px)/1 var(--wood); letter-spacing: 0.2em; text-transform: uppercase; text-align: center; }
.tvh-input:focus { outline: 6px solid var(--red); outline-offset: 2px; }
.tvh-btn { display: inline-block; padding: 0.35em 0.8em; border: 4px solid var(--xerox); background: var(--red); color: var(--xerox);
  font: 400 clamp(22px, 4.4vh, 60px)/1 var(--wood); text-transform: uppercase; text-decoration: none; text-align: center; cursor: pointer; box-shadow: 6px 6px 0 var(--xerox); }
.tvh-btn:focus { outline: 6px solid var(--yel); outline-offset: 3px; }
.tvh-btn.ghost { background: transparent; font-size: clamp(16px, 2.6vh, 32px); }
.tvh-reopen { margin: 1em 0 0; }
.tvh-step { margin: 0; font: 700 clamp(14px, 2.4vh, 30px)/1.3 var(--type); text-transform: uppercase; }
.tvh-code { margin: 0.25em 0; padding: 0.1em 0.2em; background: var(--xerox); color: var(--yel); text-align: center;
  font: 400 clamp(56px, 15vh, 210px)/1 var(--wood); letter-spacing: 0.08em; }
.tvh-msg { min-height: 1.3em; margin: 0; font: 700 clamp(12px, 1.9vh, 24px)/1.3 var(--type); text-transform: uppercase; }
.tvh-foot { margin: 0; text-align: center; font: 700 clamp(12px, 2vh, 26px)/1.3 var(--type); text-transform: uppercase; color: var(--yel); }
@media (max-width: 760px), (max-height: 500px) {
  .tvh-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .tvh-title { font-size: 26px; }
  .tvh-input { font-size: 40px; }
  .tvh-code { font-size: 54px; }
  .tvh-btn { font-size: 22px; }
}
@media (max-width: 560px) { .tvh-grid { grid-template-columns: 1fr; } }

/* DJ "Pair a TV" box */
.pair-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0; }
.pair-input { flex: 1 1 8rem; text-transform: uppercase; letter-spacing: 0.15em; font-size: 1.1rem; }
.pair-box .lede, .pair-box .muted { color: #141210; opacity: 0.85; }
.pair-box .lede b { overflow-wrap: anywhere; }
.pair-box a { color: #b3001e; }
