/* ============================================================
   the stained hanes show — 24/7 unstoppable stream
   retrato primeiro; paisagem vira duas colunas
   ============================================================ */

:root {
  --ink: #f4f1ea;
  --ink-dim: #b9b3a7;
  --night: #0b0a0f;
  --panel: rgba(12, 10, 18, 0.78);
  --line: rgba(244, 241, 234, 0.22);
  --accent: #ff3b6b;
  --accent-2: #7cf3ff;
  --mono: "Courier Prime", "Courier New", ui-monospace, monospace;
  --street-fade: 10s; /* calçada → fundo psicodélico */
  --tv-w: min(78vw, 440px, 50svh); /* home: TV pequena na calçada */
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100svh;
  background: var(--night);
  color: var(--ink);
  font: 16px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-2); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- fundos ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.bg-street {
  background: #8c8a84 center 64% / cover no-repeat;
  background-image: url("../assets/img/sidewalk-600.jpg");
  background-image: image-set(url("../assets/img/sidewalk-600.webp") type("image/webp"), url("../assets/img/sidewalk-600.jpg") type("image/jpeg"));
  transition: opacity var(--street-fade) ease, filter var(--street-fade) ease;
}
@media (min-width: 701px) {
  .bg-street { background-image: url("../assets/img/sidewalk.webp"); }
}
/* vinheta pra TV e o logo destacarem da parede */
.bg-street::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
}

.bg-psych {
  opacity: 0;
  overflow: hidden;
  /* --tv-cx/--tv-cy: centro da TV, medido pelo app.js */
  background: radial-gradient(circle at var(--tv-cx, 50%) var(--tv-cy, 50%), #1b0b2e 0%, #07060c 70%);
  transition: opacity var(--street-fade) ease;
}
.is-tv .bg-street { opacity: 0; filter: blur(6px); }
.is-tv .bg-psych { opacity: 1; animation: hue 36s linear infinite; }

/* as animações só rodam depois do "watch now" (economiza bateria no início) */
.nebula, .kaleido { position: absolute; left: var(--tv-cx, 50%); top: var(--tv-cy, 50%); animation-play-state: paused; }
.is-tv .nebula, .is-tv .kaleido { animation-play-state: running; }
.bg-still .bg-psych, .bg-still .nebula, .bg-still .kaleido { animation-play-state: paused !important; } /* botão "bg anim: off" */

.nebula {
  width: 160vmax; height: 160vmax;
  margin: -80vmax 0 0 -80vmax;
  border-radius: 50%;
  filter: blur(40px);
  mix-blend-mode: screen;
  opacity: 0.75;
}
.n1 {
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 59, 107, 0.55), transparent 32%),
    radial-gradient(circle at 70% 60%, rgba(124, 243, 255, 0.35), transparent 30%),
    radial-gradient(circle at 45% 75%, rgba(140, 60, 255, 0.45), transparent 35%);
  animation: drift 38s ease-in-out infinite alternate;
}
.n2 {
  background:
    radial-gradient(circle at 60% 30%, rgba(255, 200, 60, 0.35), transparent 28%),
    radial-gradient(circle at 25% 65%, rgba(0, 255, 170, 0.25), transparent 30%),
    radial-gradient(circle at 75% 80%, rgba(255, 80, 200, 0.4), transparent 32%);
  animation: drift 52s ease-in-out -12s infinite alternate-reverse;
}
.n3 {
  width: 120vmax; height: 120vmax;
  margin: -60vmax 0 0 -60vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, transparent 45%);
  filter: blur(60px);
  animation: breathe 9s ease-in-out infinite;
}
.kaleido {
  width: 150vmax; height: 150vmax;
  margin: -75vmax 0 0 -75vmax;
  background:
    repeating-conic-gradient(from 0deg,
      rgba(255, 59, 107, 0.28) 0deg 7.5deg,
      rgba(124, 243, 255, 0.18) 7.5deg 15deg,
      rgba(140, 60, 255, 0.24) 15deg 22.5deg,
      rgba(255, 200, 60, 0.14) 22.5deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 68%);
          mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 68%);
  mix-blend-mode: screen;
  filter: blur(14px) saturate(1.4);
  animation: spin 90s linear infinite, breathe 14s ease-in-out infinite;
}

@keyframes drift {
  0%   { transform: rotate(0deg) scale(1) translate(0, 0); }
  50%  { transform: rotate(120deg) scale(1.15) translate(4%, -3%); }
  100% { transform: rotate(260deg) scale(0.95) translate(-3%, 4%); }
}
@keyframes spin { to { rotate: 360deg; } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes breathe { 50% { scale: 1.12; opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  .nebula, .kaleido, .bg-psych { animation: none !important; }
  :root { --street-fade: 0.01s; }
}

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; }

.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* home: logo + TV no meio da tela */
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  gap: 10px;
}

/* header e slot da TV só viram caixas no stream em retrato; no resto não mexem no layout */
.site-header, .tv-slot { display: contents; }

/* ---------- logo ---------- */
.logo {
  margin: 0;
  font: 400 clamp(18px, 5.4vw, 34px)/1 var(--mono);
  letter-spacing: 0.01em;
  text-align: center;
}
.logo span, .logo-box {
  display: inline-block;
  /* como nas thumbnails: contorno branco fino, justo no texto */
  padding: 0.24em 0.32em 0.14em;
  background: #000;
  color: #fff;
  font-weight: 400;
  border: 0.07em solid #fff;
  border-radius: 4px;
  box-shadow: 5px 7px 16px rgba(0, 0, 0, 0.5); /* suave, pra baixo e pra direita */
  white-space: nowrap;
}
.tagline {
  margin: -2px 0 4px;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

/* ---------- TV ---------- */
.tv {
  position: relative;
  width: var(--tv-w);
  aspect-ratio: 944 / 890;
}
.tv-3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; display: none; }
.has-3d .tv-3d { display: block; }
/* com o 3D, a tela fica na frente do modelo (cobre as peças internas atrás do vidro) */
.has-3d .screen { z-index: 4; border-radius: 2% / 3%; }

/* a tela (o JS do 3D reposiciona via style quando o modelo carrega) */
.screen {
  position: absolute;
  left: 12.3%; top: 11.4%; width: 75.4%; height: 61%;
  z-index: 2;
  overflow: hidden;
  border-radius: 3% / 4%;
  background: #4b4f4c;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.85);
  display: grid; place-items: center;
  container-type: inline-size; /* o "watch now" mede a fonte pela largura da tela */
}
.yt-wrap, .yt-wrap iframe, #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-wrap { opacity: 0; transition: opacity 0.6s ease; }
.is-playing .yt-wrap { opacity: 1; }
.static { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.35; mix-blend-mode: screen; pointer-events: none; transition: opacity 0.3s; }
.is-street .static { opacity: 0.16; }
.is-playing .static { opacity: 0; }
.static.burst { opacity: 0.9 !important; }
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.12), transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.55) 100%);
}
.is-playing .scanlines { opacity: 0.55; }

.bumper {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-content: center; gap: 0.6em; text-align: center;
  background: #000; font-size: clamp(10px, 3.2vw, 18px);
}
.bumper-tagline { margin-top: -0.3em; font-size: 0.6em; letter-spacing: 0.3em; text-transform: uppercase; }
.bumper small { letter-spacing: 0.25em; text-transform: uppercase; color: var(--ink-dim); }
.bumper .logo-box { box-shadow: none; }

.watch-now {
  position: relative; z-index: 2;
  padding: 0.55em 1.45em 0.6em; /* respiro pro cursor não encostar no contorno */
  border: 0;
  background: #000;
  color: #fff;
  font: 700 clamp(11px, 8.5cqw, 24px)/1 var(--mono); /* acompanha a tela, pra caber numa linha */
  white-space: nowrap;
  letter-spacing: 0.04em;
  outline: 3px solid #fff;
  outline-offset: -7px;
  box-shadow: 0 0 0 1px #000, 0 0 24px rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* cursor desenhado (o caractere ▍ ocupa a linha toda e encostava no contorno) */
.watch-now::after { content: ""; display: inline-block; width: 0.45em; height: 0.95em; margin-left: 0.2em; vertical-align: -0.12em; background: #fff; animation: blink 1s steps(1) infinite; }
.watch-now:hover, .watch-now:focus-visible { transform: scale(1.05); box-shadow: 0 0 0 1px #000, 0 0 34px rgba(255, 255, 255, 0.5); }
.watch-now:disabled { opacity: 0.6; cursor: progress; }
.watch-now:disabled::after { content: "…"; width: auto; height: auto; background: none; animation: none; }
.is-tv .watch-now { display: none; }
.is-street .tv { cursor: pointer; }
/* TV 3D: dá pra arrastar e girar, na title screen e no stream (sem rolar a página no celular) */
.has-3d .tv { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.has-3d .screen { transition: opacity 0.15s; }
/* sombra da TV 3D no chão (posicionada pelo tv3d.js); some no stream */
.tv-shadow {
  position: absolute; z-index: 1; height: 9%; transform: translateY(-55%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3) 45%, transparent 70%);
  filter: blur(3px); pointer-events: none;
}
.is-tv .tv-shadow { display: none; }
.has-3d .screen.turned { opacity: 0; }
.has-3d .tv.dragging { cursor: grabbing; }
.has-3d .tv.dragging .watch-now, .has-3d .tv.dragging .yt-wrap { pointer-events: none; }
@keyframes blink { 50% { opacity: 0; } }

/* mesmas cores do logo: preto, texto branco, contorno branco arredondado */
.chip.about-open { margin-top: 4px; background: #000; color: #fff; border: 2px solid #fff; border-radius: 4px; box-shadow: 5px 7px 16px rgba(0, 0, 0, 0.5); }
.chip.about-open:hover { border-color: #fff; }
.is-tv .about-open { display: none; }
/* selo brchad (80x15 em pixel art, no tamanho original, discreto): abaixo do about na title screen e no rodapé do about */
.brchad { display: block; width: max-content; margin: 0 auto; line-height: 0; }
.brchad img { display: block; image-rendering: pixelated; }
.stage > .brchad { margin-top: 4px; }
.panel .brchad, .about-dialog .brchad { margin: 20px auto 0; }
.is-tv .stage > .brchad { display: none; }
.about-dialog { max-height: calc(100svh - 32px); }
.about-dialog h2 { margin: 0 0 4px; font-size: 22px; }
.about-dialog h3 { margin: 20px 0 6px; font-size: 15px; color: var(--ink-dim); }
.about-dialog p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; }

/* tudo alinhado pelo topo; o resync fica embaixo do indicador de sincronia */
.tv-actions { display: flex; gap: 10px; align-items: flex-start; justify-content: center; }
.sync-box { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.on-air {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--line); color: var(--ink-dim);
}
.on-air.synced { color: #fff; border-color: var(--accent); background: var(--accent); }
/* "in sync" menor e sempre numa linha; "out of sync" pode quebrar se faltar espaço */
.tv-actions .on-air { white-space: normal; }
/* "in sync" com metade da altura dos outros botões, alinhado pelo topo (33.5px → 17px) */
.tv-actions .on-air.synced { font-size: 10px; white-space: nowrap; height: 17px; padding-block: 0; line-height: 1; }
/* em sincronia não há o que ressincronizar: o resync some, mas guarda o lugar pros outros botões não pularem */
.tv-actions:has(.on-air.synced) #resync { visibility: hidden; }

.chip, .button {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}
.chip:hover, .button:hover { border-color: var(--ink); }
.button { padding: 10px 16px; background: #000; outline: 2px solid #fff; outline-offset: -5px; font-weight: 700; }
/* botões do resync com as cores das abas: fundo escuro e texto apagado; toggle desligado em cinza
   bem escuro; o in sync mantém o rosa da emissora */
.tv-actions .chip, .tv-actions .on-air { background: rgba(0, 0, 0, 0.85); border-color: var(--line); color: var(--ink-dim); }
.tv-actions .chip:hover { color: var(--ink); }
.tv-actions [aria-pressed="false"], .tv-actions .on-air:not(.synced) { background: #1c1c1e; border-color: #2c2c2f; color: #8a857c; }
.tv-actions .on-air.synced { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- depois do "watch now" ---------- */
.is-tv .stage {
  min-height: 0;
  justify-content: flex-start;
  padding-bottom: 12px;
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(7, 6, 12, 0.75), rgba(7, 6, 12, 0.0));
}
.is-tv { --tv-w: min(100vw - 24px, 50svh); } /* stream em retrato: largura toda, menos 12px de cada lado */
.is-tv .logo { font-size: clamp(14px, 4vw, 22px); }

.panels {
  position: relative; z-index: 1;
  margin: 0 auto;
  max-width: 720px;
  padding: 0 12px max(24px, env(safe-area-inset-bottom));
  animation: rise 0.8s ease both 0.6s;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.tabs {
  position: sticky; top: 0; z-index: 1;
  display: flex; gap: 2px; overflow-x: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs button {
  flex: 1 0 auto; padding: 10px 12px;
  border: 0; background: none; color: var(--ink-dim);
  font-size: 14px;
}
.tabs button[aria-selected="true"] { color: #000; background: var(--ink); font-weight: 700; }

.panel {
  background: var(--panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 18px 16px 24px;
}
.panel h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; }
.panel h3 { margin: 22px 0 8px; font-size: 15px; text-transform: lowercase; color: var(--ink-dim); }
.panel h3 span { color: var(--ink); }
.kicker { margin: 0; font-size: 12px; letter-spacing: 0.2em; color: var(--accent); }
.meta { margin: 4px 0 0; font-size: 13px; color: var(--ink-dim); }

.progress { height: 3px; background: var(--line); margin-top: 12px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }

.now-showing { margin: 0; font-size: 17px; font-weight: 700; }
.now-showing .ep-tag { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 400; vertical-align: 1px; }
.people-chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }

.guide { list-style: none; padding: 0; margin: 0; }
.guide li { display: grid; grid-template-columns: max-content 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.guide time { color: var(--ink-dim); white-space: nowrap; }
.guide .guide-episode span { font-weight: 700; }
.guide li:not(.guide-episode) + .guide-episode { margin-top: 10px; border-top: 1px solid var(--line); }

/* ---------- citações ---------- */
.quote-group h3 { margin-top: 26px; }
.quote-group h4 { margin: 14px 0 6px; font-size: 13px; font-weight: 400; color: var(--ink-dim); }
.quote {
  display: block; width: 100%;
  margin: 0 0 8px; padding: 12px 14px;
  text-align: left;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
}
.quote:hover, .quote:focus-visible { border-color: var(--ink); }
.quote q { display: block; font-size: 15px; quotes: "“" "”"; }
.quote cite { display: block; margin-top: 6px; font-style: normal; font-size: 12px; color: var(--ink-dim); }
.quote.live { border-left-color: var(--accent); }

/* ---------- director's statement ---------- */
.statement { margin: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--ink); }
.statement p { margin: 0 0 10px; }
.statement footer { color: var(--ink-dim); font-size: 13px; }
.about-dialog .statement { font-size: 15px; line-height: 1.55; }
.about-dialog .statement::before, .about-dialog .statement::after { content: none; } /* sem as aspas do diálogo de compartilhar */

/* ---------- poemas ---------- */
.poems { margin-top: 14px; display: grid; gap: 8px; }
.poem { border: 1px solid var(--line); background: rgba(0, 0, 0, 0.45); }
.poem.live { border-left: 3px solid var(--accent); }
.poem summary { padding: 12px 14px; cursor: pointer; list-style: none; }
.poem summary::-webkit-details-marker { display: none; }
.poem summary::before { content: "+ "; color: var(--ink-dim); }
.poem[open] summary::before { content: "– "; }
.poem-title { font-weight: 700; }
.ep-tag { margin-right: 8px; padding: 1px 6px; font-size: 12px; border: 1px solid var(--line); color: var(--ink-dim); }
.poem.live .ep-tag { background: var(--accent); border-color: var(--accent); color: #fff; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent-2); text-decoration: underline; text-align: left; }
.poem-text { padding: 0 14px 16px 30px; }
.poem-text p { margin: 0 0 4px; font-size: 16px; }
.poem-signature { margin-top: 14px !important; color: var(--ink-dim); text-align: right; }
.poem-text .chip { margin-top: 10px; }

/* ---------- sub-abas ---------- */
.subtabs { display: flex; gap: 6px; margin: 12px 0 4px; flex-wrap: wrap; }
.subtabs button { padding: 6px 12px; border: 1px solid var(--line); background: none; color: var(--ink-dim); font-size: 13px; }
.subtabs button[aria-selected="true"] { border-color: var(--ink); color: var(--ink); }

/* ---------- pessoas ---------- */
.people { display: grid; gap: 10px; margin-top: 14px; }
.person { padding: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.45); transition: border-color 1.2s ease, box-shadow 1.2s ease; }
/* destaque ao chegar pelo nome de alguém (some em 5s, com o fade do transition) */
.person.spotlight { border-color: #fff; box-shadow: 0 0 0 1px #fff, 0 0 18px 4px rgba(255, 255, 255, 0.55); transition: none; }
.person h3 { margin: 0; color: var(--ink); font-size: 17px; text-transform: none; }
.person p { margin: 6px 0 0; font-size: 14px; }
.person .links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.archive { padding-left: 0; list-style: none; }
.archive li { padding: 8px 0; border-bottom: 1px dashed var(--line); }

/* ---------- compartilhar ---------- */
.share {
  width: min(560px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid var(--ink);
  background: #000;
  color: var(--ink);
}
.share::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.share-inner { position: relative; padding: 26px 18px 18px; }
.share blockquote { margin: 0; font-size: 19px; line-height: 1.4; }
.share blockquote::before { content: "“"; }
.share blockquote::after { content: "”"; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.share .close { position: absolute; top: 4px; right: 8px; border: 0; background: none; font-size: 28px; line-height: 1; }

.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 10;
  transform: translate(-50%, 40px);
  padding: 8px 14px;
  background: var(--ink); color: #000; font-size: 14px;
  opacity: 0; transition: 0.25s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- paisagem: TV à esquerda, painéis à direita (retrato: TV em cima, painéis embaixo) ---------- */
@media (orientation: landscape) {
  .is-tv .app {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
    align-items: start;
  }
  .is-tv .stage { height: 100svh; justify-content: center; background: none; }
  /* depois do "watch now": o mais larga possível, sem empurrar o título nem os botões pra fora
     (1.06 = 944/890, a proporção da TV; os 150px são o que fica acima e abaixo dela) */
  .is-tv { --tv-w: min(52vw, calc((100svh - 150px) * 1.06)); }
  .is-tv .tv { width: min(var(--tv-w), 100%); }
  /* coluna dos painéis ocupa a altura toda, menos as margens de cima e de baixo */
  .is-tv .panels { margin: 0; max-width: none; padding: 24px 24px 24px 0; min-height: 100svh; display: flex; flex-direction: column; }
  .is-tv .panels .panel:not([hidden]) { flex: 1; }
}

/* ---------- stream em retrato: tela dividida, nada rola por trás da TV ----------
   40% em cima (header preto com logo e tagline, TV, botões) e 60% embaixo (abas);
   a página não rola, só o conteúdo da aba aberta */
@media (orientation: portrait) {
  body.is-tv { height: 100svh; overflow: clip; }
  /* o fundo fica parado: um arraste na TV (ou no vídeo, que repassa o gesto pra página) não pode
     esticar/quicar a página nem esconder a barra do navegador */
  html:has(> body.is-tv), body.is-tv { overscroll-behavior: none; }
  .is-tv .stage { touch-action: none; }
  .is-tv .stage {
    height: 40svh;
    position: relative;
    padding: 0 12px 8px;
    gap: 6px;
    background: none;
  }
  .is-tv .site-header {
    display: block; align-self: stretch;
    margin: 0 -12px; /* preto de ponta a ponta, colado no topo */
    padding: max(8px, env(safe-area-inset-top)) 12px 6px;
    background: #000;
    text-align: center;
  }
  .is-tv .tagline { margin: 4px 0 0; font-size: 9px; letter-spacing: 0.25em; }
  /* a TV ocupa o que sobra entre o header e os botões, no máximo com a largura do painel de abas
     (720px do .panels menos os 12px de cada lado) */
  .is-tv .tv-slot { display: grid; place-items: center; flex: 1; min-height: 0; width: 100%; max-width: 696px; container-type: size; }
  .is-tv .tv { width: min(100cqw, 100cqh * 944 / 890); }
  .is-tv.tv-bare .tv { width: min(100cqw, 100cqh * 16 / 9); }
  /* botões numa linha só, pra sobrar altura pra TV */
  .is-tv .tv-actions { gap: 6px; }
  .is-tv .tv-actions .chip, .is-tv .tv-actions .on-air { padding: 3px 7px; font-size: 11px; letter-spacing: 0.05em; white-space: nowrap; }
  .is-tv .tv-actions .on-air { white-space: normal; }
  .is-tv .tv-actions .on-air.synced { font-size: 9px; white-space: nowrap; height: 12px; padding-block: 0; } /* 24.5px → 12px */

  .is-tv .panels {
    height: 60svh;
    display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .is-tv .tabs { flex: none; position: static; }
  .is-tv .panels .panel:not([hidden]) { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}

/* ---------- menu de debug (js/debug.js) ---------- */
.debug-panel {
  position: fixed; left: 12px; bottom: 12px; z-index: 20;
  width: 290px; max-height: calc(100svh - 24px); overflow: auto;
  padding: 8px 12px 10px;
  background: rgba(0, 0, 0, 0.88); color: #9dffb0;
  border: 1px solid #9dffb0; border-radius: 4px;
  font: 12px/1.45 var(--mono);
}
.debug-panel header { display: flex; justify-content: space-between; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; }
.debug-panel header button { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; }
.debug-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; margin: 4px 0 0; }
.debug-panel dt { color: #5fae6f; }
.debug-panel dd { margin: 0; text-align: right; }
.debug-panel .debug-section { grid-column: 1 / -1; margin-top: 6px; color: #fff; text-transform: uppercase; letter-spacing: 0.15em; }
.debug-lights { margin-top: 8px; border-top: 1px solid rgba(157, 255, 176, 0.3); }
.debug-lights .debug-section { margin: 6px 0 0; }
.debug-lights p { margin: 4px 0; }
.debug-lights .debug-sub { color: #5fae6f; margin-top: 8px; }
.debug-field { display: grid; grid-template-columns: 78px 1fr 40px; align-items: center; gap: 6px; margin: 2px 0; }
.debug-field input[type="range"] { width: 100%; accent-color: #9dffb0; }
.debug-field input[type="color"] { width: 100%; height: 20px; padding: 0; border: 1px solid #5fae6f; background: none; }
.debug-field output { text-align: right; font-size: 11px; }
.debug-actions { display: flex; gap: 6px; margin-top: 8px; }
.debug-actions button { flex: 1; padding: 4px; border: 1px solid #9dffb0; background: none; color: inherit; font: inherit; }

/* ---------- stream sem a TV 3D (botão "3D: off") ---------- */
/* só o player: 16:9, largura toda disponível, sem moldura nem quinas */
.is-tv.tv-bare { --tv-w: calc(100vw - 24px); }
.tv-bare .tv { aspect-ratio: 16 / 9; }
.tv-bare .tv-3d { display: none; }
.tv-bare .screen { left: 0; top: 0; width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.tv-bare .scanlines { display: none; }
@media (orientation: landscape) {
  /* 1.778 = 16/9; os 150px são o título em cima e os botões embaixo */
  .is-tv.tv-bare { --tv-w: min(100%, calc((100svh - 150px) * 1.778)); }
}
