/* NEXA TV · app do espectador
   Sala de controle de broadcast em modo escuro: âmbar = sinal no ar, vermelho = ao vivo. */
:root {
  --bg: #0a0b0e;
  --panel: #13151a;
  --panel-2: #1a1d24;
  --line: #262a33;
  --fg: #ece9e3;
  --dim: #8b909b;
  --amber: #ffb224;
  --live: #ff3b30;
  --cyan: #4cc9e0;
  --violet: #b49bff;
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* sem isto, "display: grid/inline-flex" das classes vence o atributo hidden: o "Carregando…" e o "Toque para ativar o som"
   ficavam na tela para sempre (o JS escondia, o CSS mostrava) e a camada do "Carregando…" bloqueava os toques no vídeo */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f-body);
  background-image: radial-gradient(1100px 500px at 15% -10%, rgba(255,178,36,.07), transparent 60%),
                    radial-gradient(900px 500px at 100% 0%, rgba(76,201,224,.05), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
h2 { font-size: .74rem; font: 600 .72rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; align-content: center; gap: 48px;
  transition: opacity .6s ease, visibility .6s;
}
#splash.out { opacity: 0; visibility: hidden; }
.splash-logo { display: grid; justify-items: center; gap: 10px; }
.splash-logo svg { overflow: visible; }
/* logo do canal dentro do anel menor (brand.js), no lugar do traço do "N" */
.splash-mark { position: relative; width: 120px; height: 120px; }
.splash-mark svg { display: block; }
.splash-img { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; object-fit: contain; animation: rise .5s both; }
.ring { fill: none; stroke: var(--amber); stroke-width: 2; opacity: 0; transform-origin: 60px 60px; animation: ring 2.2s ease-out infinite; }
.r2 { animation-delay: .35s; stroke: var(--cyan); }
.mark { fill: none; stroke: var(--amber); stroke-width: 9; stroke-linejoin: miter; stroke-dasharray: 190; stroke-dashoffset: 190; animation: draw 1.1s .15s cubic-bezier(.6,0,.2,1) forwards; }
.splash-name { font: 800 2.6rem var(--f-display); letter-spacing: .28em; margin-right: -.28em; opacity: 0; animation: rise .7s .7s forwards; }
.splash-tag { font: 500 .8rem var(--f-mono); letter-spacing: .3em; text-transform: uppercase; color: var(--dim); opacity: 0; animation: rise .7s 1s forwards; }
.splash-bar { width: 160px; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.splash-bar span { display: block; height: 100%; width: 40%; background: var(--amber); animation: slide 1.2s ease-in-out infinite; }
@keyframes ring { 0% { opacity: .7; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ---------- topo ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px;
  padding: 0 max(20px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line);
  background: rgba(10,11,14,.8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--fg); text-decoration: none; font: 800 1.25rem var(--f-display); letter-spacing: .14em; }
/* logo do canal (brand.js): a altura do "N" (o topo não muda de altura na troca), larga até o teto, sem distorcer */
.brand-icon, .brand-logo { flex: none; }
.brand-logo { display: block; height: 30px; width: auto; max-width: 160px; object-fit: contain; object-position: left center; }
html[dir="rtl"] .brand-logo { object-position: right center; } /* árabe: a logo encostada no nome */
/* com a logo, o nome fica numa linha e termina em reticências quando não cabe (celular); sem logo, quebra como antes */
.brand-logo:not([hidden]) + #brandName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 18px; }
.meta { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: .85rem; }
.meta b { color: var(--fg); font-weight: 500; font-family: var(--f-mono); }
.pill { display: inline-flex; align-items: center; gap: 8px; font: 600 .72rem var(--f-mono); letter-spacing: .12em; padding: 5px 10px; border-radius: 4px; }
.pill.live { background: var(--live); color: #fff; }
.pill.live i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.4s infinite; }
.pill.soft { background: var(--panel-2); color: var(--dim); text-transform: uppercase; }
.pill.soft.on { color: #6fe39b; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; padding: 24px max(20px, env(safe-area-inset-left)) 48px; max-width: 1600px; margin: 0 auto; align-items: start; }
.stage { display: grid; gap: 24px; min-width: 0; }

/* ---------- player ---------- */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(0,0,0,.55); text-align: center; padding: 20px; }
.overlay p { margin: 0; color: #d6d3cc; font-size: .95rem; }
/* aviso urgente do operador: aparece na própria janela do vídeo, inclusive quando o chat está fechado */
.notice-toast { position: absolute; z-index: 7; inset: 18px 18px auto; display: flex; align-items: center; gap: 10px; max-width: min(680px, calc(100% - 36px));
  margin: 0 auto; padding: 11px 12px 11px 14px; border: 1px solid rgba(255,178,36,.72); border-radius: 10px; background: rgba(18,14,7,.94); color: #fff; box-shadow: 0 16px 44px rgba(0,0,0,.55); }
.notice-tag { flex: none; color: var(--amber); font: 800 .66rem var(--f-mono); letter-spacing: .14em; }
.notice-body { min-width: 0; flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.notice-open, .notice-close { flex: none; border: 0; border-radius: 6px; cursor: pointer; }
.notice-open { padding: 6px 9px; background: var(--amber); color: #1b1300; font-weight: 700; }
.notice-close { padding: 2px 7px; background: transparent; color: #d5d1ca; font-size: 1.35rem; line-height: 1; }
.notice-close:hover { color: #fff; background: rgba(255,255,255,.12); }
/* motor desligado pelo operador: tela de "canal fora do ar" (a das operadoras de TV), na escala do player */
.offair-slate { position: absolute; inset: 0; z-index: 7; container-type: inline-size; display: grid; place-content: center; justify-items: center; padding: 0 6% 6%; text-align: center; color: #fff;
  background: radial-gradient(ellipse at 50% 42%, #3248e4 0%, #2335cc 55%, #1b2ab6 100%); font-family: Arial, "Helvetica Neue", Helvetica, "Liberation Sans", sans-serif; }
.offair-slate p { margin: 0; max-width: 16.2em; font-size: clamp(13px, 3.4vw, 34px); font-size: 4.4cqw; line-height: 1.2; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.offair-slate p + p { margin-top: 1.6em; max-width: none; color: #ffa552; font-weight: 700; font-size: clamp(12px, 3vw, 30px); font-size: 3.7cqw; }
/* a tela de fora do ar do canal (Gráficos → Tela de fora do ar): a imagem que também vai ao HLS, no lugar da tela azul */
.offair-slate.custom { background: #000 center / contain no-repeat; }
.offair-slate.custom p { display: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--amber); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.unmute { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; border: 0; background: var(--amber); color: #15110a; font-weight: 600; padding: 10px 16px; border-radius: 99px; box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: pop .5s; }
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }
.controls { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; gap: 10px; padding: 36px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transition: opacity .2s; }
.player:hover .controls, .player:focus-within .controls, .player.touch .controls { opacity: 1; }
.controls button { background: none; border: 0; padding: 6px; border-radius: 6px; display: grid; place-items: center; color: #fff; }
.controls button:hover { background: rgba(255,255,255,.14); }
.controls input[type=range] { width: 90px; accent-color: var(--amber); }
.spacer { flex: 1; }
.btn-live { font: 600 .72rem var(--f-mono); letter-spacing: .12em; padding: 6px 10px !important; }
.btn-live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 8px; }

/* ---------- agora ---------- */
.kind { font: 600 .7rem var(--f-mono); letter-spacing: .14em; padding: 4px 8px; border-radius: 4px; background: var(--cyan); color: #06222a; text-transform: uppercase; }
.kind.ad { background: var(--amber); color: #2a1c00; }
.kind.bumper { background: var(--violet); color: #1d1240; }
.progress { height: 6px; background: var(--panel-2); border-radius: 6px; overflow: visible; position: relative; }
.progress span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--amber); border-radius: 6px; box-shadow: 0 0 14px rgba(255,178,36,.55); }
.progress span::after { content: ""; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,178,36,.35); }

/* ---------- guia ---------- */
.guide { display: grid; gap: 12px; }
.upnext { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 62px 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 8px 12px; transition: border-color .2s, transform .2s; }
.item:hover { border-color: #3a3f4b; transform: translateX(2px); }
.item .at { font: 500 .95rem var(--f-mono); color: var(--amber); }
.item .thumb { aspect-ratio: 16/9; border-radius: 6px; background: var(--panel-2) center/cover; }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font: 400 .72rem var(--f-mono); color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.item .dur { font: 400 .82rem var(--f-mono); color: var(--dim); }
.item.is-ad { opacity: .6; }
.item.is-ad .at { color: var(--dim); }
.empty { color: var(--dim); padding: 20px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }

/* ---------- chat ---------- */
.chat { position: sticky; top: 86px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; height: calc(100vh - 110px); min-height: 420px; max-height: 760px; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
/* só a lista rola: o embrulho ocupa o que sobra entre o topo do chat e o campo ("Novas mensagens" boia no pé dele) */
.msgs-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { list-style: none; margin: 0; padding: 12px 16px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.messages li { overflow-wrap: anywhere; animation: rise .3s; font-size: .93rem; }
.messages .who { font-weight: 600; margin-right: 8px; }
/* ícone da origem do comentário (NEXA, YouTube, Twitch, Facebook): docs/COMENTARIOS.md */
.messages .plat { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; flex: none; }
.messages .when { font: 400 .68rem var(--f-mono); color: var(--dim); margin-left: 6px; }
.messages .sys { color: var(--dim); font-size: .82rem; text-align: center; }
.chat-paused { flex: 1; display: grid; place-items: center; margin: 0; padding: 24px 16px; color: var(--dim); text-align: center; font-size: .93rem; }
.chat-paused[hidden], .messages[hidden] { display: none; }
.chat-form input:disabled, .chat-form textarea:disabled, .chat-form button:disabled { opacity: .55; cursor: not-allowed; }
.jump { position: absolute; z-index: 3; left: 50%; bottom: 10px; transform: translateX(-50%); border: 0; border-radius: 99px; background: var(--amber); color: #1b1300; font: 700 .82rem var(--f-body); padding: 8px 14px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.chat-form { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel-2); }
.chat-form .row { display: flex; gap: 8px; }
.chat-form input { flex: 1; min-width: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
.chat-form input:focus { border-color: var(--amber); outline: 0; }
.chat-form button { background: var(--amber); color: #1b1300; border: 0; font-weight: 600; padding: 0 18px; border-radius: 8px; }
.chat-form button:hover { filter: brightness(1.08); }

/* ---------- responsivo ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .chat { position: static; height: 460px; max-height: none; }
}
@media (max-width: 560px) {
  .top { height: 54px; }
  .brand span { font-size: 1.05rem; }
  .brand { gap: 10px; }
  .brand-logo { max-width: 72px; } /* celular (375 px): a logo larga não empurra o nome para fora */
  .top-right { gap: 10px; }
  #clock { display: none; }
  .layout { padding-top: 14px; gap: 16px; }
  .player { border-radius: 0; margin-inline: -20px; border-inline: 0; }
  .item { grid-template-columns: 48px 84px minmax(0, 1fr); }
  .item .dur { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- rádios e widgets (extras.js): lista suspensa com ícone ou logo, mini player e cartões ---------- */
.extras { display: grid; gap: 12px; }
.ex-pick { position: relative; }
.ex-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; text-align: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s; }
.ex-btn:hover, .extras.open .ex-btn { border-color: var(--amber); }
.ex-sel { flex: 1; min-width: 0; font: 600 1rem var(--f-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-chev { width: 20px; height: 20px; color: var(--dim); transition: transform .2s; flex: none; }
.ex-chev svg { width: 100%; height: 100%; }
.extras.open .ex-chev { transform: rotate(180deg); }
/* ícone de cada item: o desenho do widget, a logo da rádio no fundo dela ou as iniciais */
.ex-ico { width: 40px; height: 40px; flex: none; border-radius: 9px; display: grid; place-items: center; overflow: hidden; }
.ex-svg { background: var(--panel-2); color: var(--amber); }
.ex-svg svg { width: 24px; height: 24px; }
.ex-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.ex-mono { color: #fff; font: 800 .95rem var(--f-display); letter-spacing: .02em; }
.ex-pop { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 30; background: var(--panel); border: 1px solid #3a3f4b; border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.55); padding: 8px; display: grid; gap: 6px; }
.ex-q { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; }
.ex-q:focus { outline: 2px solid var(--amber); outline-offset: 0; }
.ex-list { list-style: none; margin: 0; padding: 0; max-height: min(52vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.ex-gh { padding: 10px 8px 4px; font: 600 .7rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ex-gl { list-style: none; margin: 0; padding: 0; }
.ex-opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px; border-radius: 9px; cursor: pointer; }
.ex-opt.act { background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(255,178,36,.45); }
.ex-opt[aria-selected="true"] .ex-l { color: var(--amber); }
.ex-opt.off .ex-m { color: var(--live); }
.ex-tx { display: grid; min-width: 0; }
.ex-l { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-m { color: var(--dim); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-hint { margin: 0; padding: 4px 8px 2px; font-size: .85rem; }
/* nomes das rádios e das câmeras (do dado): a direção vem do próprio texto ("89 A Radio Rock" não vira "A Radio Rock 89"
   na página em árabe) */
.ex-l, .ex-m, .ex-rn, .ex-sel { unicode-bidi: plaintext; }
.ex-panel:empty { display: none; }
/* Câmeras, rádios e widgets abrem dentro da janela principal. O seletor continua abaixo para não cobrir o vídeo ao navegar. */
.ex-stage { position: absolute; inset: 0; z-index: 6; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 16px; background: rgba(7,8,11,.94); }
.ex-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.ex-stage-title { font: 700 1rem var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-stage-close { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); padding: 7px 10px; font-weight: 600; }
.ex-stage-close:hover { border-color: var(--amber); }
.ex-stage-body { min-height: 0; overflow: auto; display: grid; place-items: center; }
.ex-stage .ex-card { width: min(100%, 780px); max-height: 100%; }
.ex-stage .ex-camc { align-self: stretch; }
.ex-stage .ex-vid { max-height: calc(100vh - 210px); }
.ex-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 12px; }
.ex-msg { margin: 0; color: var(--dim); }
.ex-foot { margin: 0; color: var(--dim); font-size: .78rem; }
.ex-ch { display: flex; align-items: center; gap: 10px; }
.ex-hi { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ex-hi svg { width: 20px; height: 20px; }
/* mini player da rádio: logo, nome e estado, tocar/pausar e volume */
.ex-radio { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.ex-big { width: 64px; height: 64px; border-radius: 12px; }
.ex-big.ex-mono { font-size: 1.3rem; }
.ex-ri { display: grid; min-width: 0; gap: 2px; }
.ex-rn { font: 700 1.05rem var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-rs { font-size: .8rem; color: var(--dim); min-height: 1.2em; }
.ex-rs.live { color: var(--live); font: 700 .72rem var(--f-mono); letter-spacing: .14em; }
.ex-rs.bad { color: #ff8a80; }
.ex-rc { display: flex; align-items: center; gap: 10px; }
.ex-play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--amber); color: #0a0b0e; display: grid; place-items: center; flex: none; }
.ex-play svg { width: 22px; height: 22px; }
.ex-vol { width: 110px; accent-color: var(--amber); }
/* clima */
.ex-wm { display: flex; align-items: center; gap: 16px; }
.ex-wi { width: 64px; height: 64px; color: var(--amber); flex: none; }
.ex-wi svg { width: 100%; height: 100%; }
.ex-wc { display: grid; gap: 2px; min-width: 0; }
.ex-wb { font: 800 2rem/1.1 var(--f-display); }
.ex-wt { font-weight: 600; }
.ex-wd { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ex-wd li { background: var(--panel-2); border-radius: 10px; padding: 8px 10px; display: grid; justify-items: center; gap: 2px; text-align: center; }
.ex-dn { font-size: .8rem; color: var(--dim); }
.ex-di { width: 28px; height: 28px; color: var(--amber); }
.ex-di svg { width: 100%; height: 100%; }
.ex-dt { font-weight: 600; font-variant-numeric: tabular-nums; }
/* trânsito */
.ex-tr { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ex-tr li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: var(--panel-2); }
.ex-tr .ex-tx { flex: 1; }
.ex-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #c9ced8; }
.lv-livre .ex-dot { background: #7ee2a3; } .lv-lento .ex-dot { background: #ffb37a; } .lv-parado .ex-dot { background: #ff8a80; }
.ex-tu { color: var(--dim); font-size: .8rem; white-space: nowrap; }
/* câmera ao vivo (muda) */
.ex-vid { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.ex-vid video { width: 100%; height: 100%; object-fit: contain; display: block; }
.ex-vid-off { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #1d222b, #0a0b0e); }
.ex-watch { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--amber); color: #0a0b0e; font: 700 .95rem var(--f-body); }
.ex-watch svg { width: 18px; height: 18px; }
.ex-live { position: absolute; inset-inline-start: 10px; top: 10px; padding: 3px 8px; border-radius: 4px; background: var(--live); color: #fff; font: 700 .68rem var(--f-mono); letter-spacing: .14em; }
@media (max-width: 560px) {
  .notice-toast { inset: 10px 10px auto; max-width: calc(100% - 20px); padding: 9px 10px; gap: 7px; font-size: .84rem; }
  .notice-tag { display: none; }
  .ex-stage { padding: 10px; }
  .ex-stage .ex-vid { max-height: none; }
  .ex-radio { grid-template-columns: auto minmax(0, 1fr); }
  .ex-rc { grid-column: 1 / -1; }
  .ex-vol { flex: 1; width: auto; }
  .ex-wb { font-size: 1.7rem; }
}

/* ---------- canais ---------- */
.kind.live { background: var(--live); color: #fff; }
.airtag { position: absolute; left: 16px; top: 14px; font: 700 .72rem var(--f-mono); letter-spacing: .14em; padding: 5px 10px; border-radius: 4px; background: rgba(0,0,0,.7); color: var(--amber); border: 1px solid rgba(255,178,36,.5); }
.channels { display: grid; gap: 12px; }
.chanlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.chan { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; transition: border-color .2s, transform .2s; }
.chan:hover { border-color: #3a3f4b; transform: translateY(-1px); }
.chan.on { border-color: var(--amber); box-shadow: inset 3px 0 var(--amber); }
.chan .num { font: 800 1.5rem var(--f-display); color: var(--amber); text-align: center; }
.chan .nm { font: 700 .95rem var(--f-display); letter-spacing: .04em; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chan .nm .st { font: 600 .6rem var(--f-mono); letter-spacing: .12em; color: #fff; background: var(--live); padding: 2px 6px; border-radius: 3px; }
.chan .nm .st.sb { background: #5a5f6b; }
.chan .nw { color: var(--dim); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .mp { height: 3px; background: var(--panel-2); border-radius: 3px; margin-top: 6px; position: relative; }
.chan .mp b { position: absolute; inset: 0 auto 0 0; background: var(--amber); border-radius: 3px; }

/* ---------- vitrine: janelas sobre o vídeo e cartões no chat ---------- */
/* Vitrine queimada na imagem: só a área clicável sobre o cartão do vídeo (a camada acompanha a área da imagem) */
.vhot { position: absolute; z-index: 6; pointer-events: none; }
.vhot-a { position: absolute; pointer-events: auto; padding: 0; border: 0; border-radius: 1.6%/5%; background: transparent; cursor: pointer; transition: box-shadow .15s; }
.vhot-a:hover, .vhot-a:focus-visible { box-shadow: 0 0 0 2px rgba(255, 178, 36, .85); outline: none; }
.pslot { position: absolute; z-index: 6; display: grid; gap: 10px; max-width: min(320px, 70%); pointer-events: none; }
.pslot.tl { left: 14px; top: 14px; } .pslot.tr { right: 14px; top: 44px; }
.pslot.bl { left: 14px; bottom: 64px; } .pslot.br { right: 14px; bottom: 64px; }
.pwin { pointer-events: auto; position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px 34px 14px 10px; background: rgba(12,13,16,.9); border: 1px solid rgba(255,178,36,.55); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.6); backdrop-filter: blur(8px); animation: pin .45s cubic-bezier(.2,.9,.3,1.2); overflow: hidden; }
.pslot.tl .pwin, .pslot.bl .pwin { animation-name: pinl; }
@keyframes pin { from { transform: translateX(30px) scale(.94); opacity: 0; } }
@keyframes pinl { from { transform: translateX(-30px) scale(.94); opacity: 0; } }
.pimg { width: 64px; height: 64px; border-radius: 8px; background: var(--panel-2) center/cover; }
.pbody { min-width: 0; display: grid; gap: 3px; align-content: center; }
.pname { font: 700 .92rem var(--f-display); line-height: 1.15; overflow-wrap: anywhere; }
.pprice { font: 500 .86rem var(--f-mono); color: var(--amber); }
.pcta { justify-self: start; margin-top: 4px; background: var(--amber); color: #1b1300; border: 0; font-weight: 700; font-size: .78rem; padding: 6px 12px; border-radius: 99px; }
.pcta:hover { filter: brightness(1.08); }
.pclose { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: #9aa0ab; font-size: 1.2rem; line-height: 1; padding: 2px 6px; }
.pclose:hover { color: #fff; }
.pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.12); }
.pbar b { display: block; height: 100%; width: 100%; background: var(--amber); transition: width .25s linear; }
.messages .pmsg { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; padding: 10px; background: linear-gradient(135deg, rgba(255,178,36,.12), rgba(255,178,36,.04)); border: 1px solid rgba(255,178,36,.4); border-radius: 10px; }
.pmsg .pimg { width: 54px; height: 54px; }
.ptag { font: 700 .58rem var(--f-mono); letter-spacing: .16em; color: var(--amber); }
@media (max-width: 560px) { .pslot { max-width: 78%; } .pwin { grid-template-columns: 48px minmax(0, 1fr); } .pimg { width: 48px; height: 48px; } }

/* ---------- reações (barra sob o player; emojis sobem pelo canto direito do vídeo) ---------- */
/* bandeja de reações: abre pelo botão ❤ do campo do chat */
.reactions { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 5; display: flex; gap: 6px; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.55); animation: gm-in .14s ease-out; }
.react, .chat-form .react { color: inherit; padding: 0; font-weight: 400; font-size: 1.35rem; line-height: 1; width: 48px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: transform .12s, border-color .2s, background .2s; }
.react:hover, .chat-form .react:hover { border-color: #3a3f4b; background: var(--panel-2); }
.react:active { transform: scale(.88); }
.react-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.floaty { position: absolute; bottom: 8%; font-size: 1.9rem; will-change: transform, opacity; animation: floaty 2.8s cubic-bezier(.2,.7,.3,1) forwards; filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); }
.floaty.own { font-size: 2.2rem; }
@keyframes floaty {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  12% { opacity: 1; transform: translate(calc(var(--drift) * .2), -20px) scale(1); }
  100% { transform: translate(var(--drift), -260px) scale(1.05); opacity: 0; }
}

/* ---------- aviso do canal e enquete ---------- */
.channel-notice { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px 16px; border: 1px solid rgba(76,201,224,.48); border-radius: 12px; background: linear-gradient(120deg, rgba(76,201,224,.14), var(--panel) 58%); }
.channel-notice-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #06222a; background: var(--cyan); font: 800 1rem var(--f-mono); }
.channel-notice-copy { min-width: 0; display: grid; gap: 3px; }
.channel-notice-copy b { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.channel-notice-copy span { overflow-wrap: anywhere; }
.channel-notice-actions { display: inline-flex; align-items: center; gap: 8px; }
.channel-notice-actions a { color: var(--cyan); font: 700 .8rem var(--f-body); text-decoration: none; }
.channel-notice-actions a:hover { text-decoration: underline; }
.channel-notice-actions button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--dim); font-size: 1.25rem; line-height: 1; }
.channel-notice-actions button:hover { color: var(--fg); background: rgba(255,255,255,.08); }
.channel-notice[hidden] { display: none; }
.poll { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; }
.poll[hidden] { display: none; }
/* enquete com layout escolhido no painel (interact.js drawLayout, ../shared/poll-layouts.css): o layout desenha a própria caixa;
   a linha de cima e a pergunta do cartão de sempre só voltam com o chat aberto no celular (mais abaixo), para recolher */
.poll.vt-host { --accent: var(--amber); padding: 0; border: 0; background: none; gap: 0; }
.poll.vt-host > .poll-head, .poll.vt-host > .poll-q { display: none; }
.poll-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.poll-q { font: 700 1.15rem var(--f-display); line-height: 1.25; margin: 0; }
.poll-opts { display: grid; gap: 8px; }
.poll .opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 500 .95rem var(--f-body); text-align: left; overflow: hidden; }
.poll button.opt { cursor: pointer; transition: border-color .2s, background .2s; }
.poll button.opt:hover:not(:disabled) { border-color: var(--amber); background: var(--panel-2); }
.poll button.opt:disabled { opacity: .6; cursor: progress; }
.poll .opt .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,178,36,.14); transition: width .6s cubic-bezier(.2,.7,.3,1); }
.poll .opt.mine { border-color: var(--amber); }
.poll .opt.mine .bar { background: rgba(255,178,36,.26); }
.poll .opt .label, .poll .opt .pct { position: relative; }
.poll .opt .pct { font-size: .9rem; color: var(--fg); }
.poll-foot { margin: 0; font-size: .78rem; color: var(--dim); }
@media (max-width: 560px) { .react { width: 44px; height: 42px; } .poll { padding: 16px; } }
@media (prefers-reduced-motion: reduce) { .poll .opt .bar { transition: none; } }

/* ---------- engrenagem do player: botão CC, menu de configurações, legendas e estatísticas para nerds ---------- */
.player.menu-open .controls { opacity: 1; }
.controls { z-index: 8; } /* acima das estatísticas e das janelas da vitrine: a engrenagem fica sempre ao alcance */
.controls .btn-cc { font: 700 .72rem/1 var(--f-mono); letter-spacing: .04em; min-width: 34px; height: 24px; padding: 0 6px !important; border: 1.5px solid currentColor !important; border-radius: 5px; opacity: .85; }
.controls .btn-cc.on { opacity: 1; background: #fff; color: #0a0b0e; border-color: #fff !important; box-shadow: inset 0 -3px var(--amber); }
.controls .btn-cc.on:hover { background: #fff; }
#btnGear svg { transition: transform .3s ease; }
#btnGear[aria-expanded="true"] svg { transform: rotate(45deg); }

.gear-menu {
  position: absolute; right: 12px; bottom: 58px; z-index: 9; width: min(330px, calc(100% - 24px)); max-height: calc(100% - 70px); overflow-y: auto;
  padding: 8px 0; border-radius: 12px; background: rgba(18,19,24,.9); border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 50px rgba(0,0,0,.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: gm-in .16s ease-out; scrollbar-width: thin; overscroll-behavior: contain;
}
@keyframes gm-in { from { opacity: 0; transform: translateY(6px); } }
.gm-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 8px 14px; border: 0; background: none; color: #f1eee8; text-align: left; font: 500 .9rem var(--f-body); }
.gm-row:hover, .gm-row:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.gm-row:focus-visible { box-shadow: inset 2px 0 var(--amber); }
.gm-row.off { cursor: default; }
.gm-row.off .gm-label { color: #b9b6af; }
.gm-label { flex: 1; min-width: 0; display: grid; gap: 2px; }
.gm-label small { font-size: .74rem; line-height: 1.3; color: #a3a7b0; font-weight: 400; }
.gm-value { color: #b9bcc4; font-size: .78rem; white-space: nowrap; }
.gm-row svg { flex: none; color: #b9bcc4; }
.gm-back { border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 4px; font-weight: 600; }
.gm-check { flex: none; width: 18px; height: 18px; color: var(--amber); }
.gm-row[role="menuitemradio"] { align-items: flex-start; }
.gm-row[role="menuitemradio"] .gm-check { margin-top: 1px; }
/* Denunciar e Enviar feedback: avisos (190, Disque 100), a confirmação e o obrigado, sem foco */
.gm-note { padding: 8px 14px; color: #e3e0da; font: 400 .84rem/1.4 var(--f-body); }
.gm-note.warn { color: #ffcf7a; }
.gm-note.ok { color: #9be3a6; font-weight: 600; }
.gm-note.small { font-size: .74rem; color: #a3a7b0; }
.gm-switch { flex: none; position: relative; width: 34px; height: 14px; border-radius: 99px; background: rgba(255,255,255,.3); transition: background .2s; }
.gm-switch i { position: absolute; left: -2px; top: -3px; width: 20px; height: 20px; border-radius: 50%; background: #e8e6e1; box-shadow: 0 1px 4px rgba(0,0,0,.5); transition: transform .2s, background .2s; }
.gm-switch.on { background: rgba(255,178,36,.55); }
.gm-switch.on i { transform: translateX(18px); background: var(--amber); }

/* legenda: texto branco em fundo preto translúcido, proporcional à largura do player; sobe quando os controles aparecem */
/* com a faixa do alerta de emergência embaixo, a legenda fica acima dela: --cc-eas (px) vem do player-ui.js (docs/EAS.md) */
.cc-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; container-type: inline-size; display: flex; align-items: flex-end; justify-content: center; padding: 0 6% max(4.5%, var(--cc-eas, 0px)); transition: padding .2s; }
.player:hover .cc-layer, .player:focus-within .cc-layer, .player.touch .cc-layer, .player.menu-open .cc-layer { padding-bottom: max(4.5%, 58px, var(--cc-eas, 0px)); }
.cc-box { max-width: 100%; white-space: pre-line; text-align: center; color: #fff; background: rgba(8,8,8,.75); padding: .1em .45em; border-radius: 3px;
  font: 500 clamp(13px, 2.8cqw, 46px)/1.35 var(--f-body); letter-spacing: .01em; text-shadow: 0 1px 2px rgba(0,0,0,.6); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
video::cue { color: #fff; background: rgba(8,8,8,.75); font-family: var(--f-body); }

/* estatísticas para nerds (como o "Stats for nerds" do YouTube) */
.nerd { position: absolute; left: 10px; top: 10px; z-index: 7; width: min(470px, calc(100% - 20px)); max-height: calc(100% - 66px); overflow: auto;
  padding: 8px 10px 10px; border-radius: 8px; background: rgba(10,11,14,.78); border: 1px solid rgba(255,255,255,.08); color: #e9e6df;
  font: 400 .72rem/1.45 var(--f-mono); font-variant-numeric: tabular-nums; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); scrollbar-width: thin; }
.nerd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.nerd-head b { flex: 1; font-weight: 500; color: var(--amber); letter-spacing: .06em; text-transform: uppercase; font-size: .68rem; }
.nerd-copy, .nerd-x { background: none; border: 1px solid rgba(255,255,255,.18); color: #d6d3cc; border-radius: 5px; font: 500 .68rem var(--f-mono); padding: 2px 8px; }
.nerd-x { border: 0; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.nerd-copy:hover, .nerd-x:hover { color: #fff; background: rgba(255,255,255,.1); }
.nerd-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 1px 12px; margin: 0; }
.nerd-grid dt { color: #a3a7b0; text-align: right; white-space: nowrap; }
.nerd-grid dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.nerd-grid .nv { overflow-wrap: anywhere; }
.nerd-grid .spark { width: 120px; height: 16px; flex: none; }
.nerd-grid [hidden] { display: none; }
/* o bloco do áudio (17/10): um respiro em cima e a bolinha do sinal antes do valor */
.nerd-grid .nerd-sec { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.1); }
.nerd-grid .gm-dot { width: 8px; height: 8px; box-shadow: none; }
/* a bolinha do sinal de cada trilha de áudio (página Áudio da engrenagem): verde chegando, vermelha não chega, cinza ainda não se sabe */
.gm-dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #7d828c; align-self: center; }
.gm-dot.ok { background: #3ad37a; box-shadow: 0 0 6px rgba(58,211,122,.55); }
.gm-dot.bad { background: #ff4f4f; box-shadow: 0 0 6px rgba(255,79,79,.5); }
.gm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 14px 4px; color: #a3a7b0; font: 400 .74rem/1.4 var(--f-body); }
.gm-leg { display: inline-flex; align-items: center; gap: 6px; }
.gm-leg .gm-dot { width: 8px; height: 8px; box-shadow: none; }

@media (max-width: 560px) {
  .controls { gap: 4px; padding: 30px 8px 8px; }
  .controls input[type=range] { display: none; }
  .nerd { font-size: .62rem; left: 6px; top: 6px; width: calc(100% - 12px); max-height: calc(100% - 52px); padding: 6px 8px; }
  .nerd-grid .spark { width: 64px; }
  .gear-menu { right: 8px; bottom: 50px; max-height: calc(100% - 58px); padding: 4px 0; }
  .gm-row { min-height: 36px; padding: 6px 12px; font-size: .84rem; }
  .gm-label small { font-size: .7rem; }
}

/* ---------- curtir / descurtir e compartilhar (abaixo do player) ---------- */
.watchbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -10px; }
/* classificação indicativa do programa na tela (docs/CLASSIFICACAO.md): símbolo de 70 px (guia, item O.2), cor e borda pela
   tabela única (app.js, badgeStyle); sem classificação, o aviso em caixa alta e condensada */
.ci-site { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.ci-site[hidden] { display: none; }
.ci-sym { display: inline-grid; place-items: center; width: 70px; height: 70px; flex: none; box-sizing: border-box; font-size: 34px; line-height: 1; letter-spacing: -.02em; }
.ci-txt { display: grid; gap: 2px; min-width: 0; font-size: .82rem; }
.ci-txt b { text-transform: uppercase; font-family: 'Roboto Condensed', 'Barlow Condensed', 'Arial Narrow', sans-serif; }
.ci-txt small { color: var(--dim, #9aa0aa); }
.ci-verify { font: 700 1rem/1.2 'Roboto Condensed', 'Barlow Condensed', 'Arial Narrow', sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.likes { display: inline-flex; align-items: center; height: 40px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.lk { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 14px; border: 0; background: none; color: var(--fg); font: 600 .9rem var(--f-body); }
.lk:hover:not(:disabled) { background: rgba(255,255,255,.07); }
.lk:disabled { cursor: default; }
/* entre dois programas (comercial solto, cartão, fora do ar): nada a avaliar até o próximo programa (social.js) */
.likes.off .lk { opacity: .45; }
.lk[aria-pressed="true"] { color: var(--amber); }
.lk[aria-pressed="true"] svg path { fill: currentColor; }
.lk-sep { width: 1px; height: 22px; background: var(--line); }
.share-wrap { position: relative; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); font: 600 .9rem var(--f-body); }
.share-btn:hover, .share-btn[aria-expanded="true"] { background: #232731; }
.share-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px 0; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.6); animation: gm-in .14s ease-out; }
.sh-item { display: block; width: 100%; padding: 10px 16px; border: 0; background: none; color: var(--fg); text-align: left; text-decoration: none; font: 500 .9rem var(--f-body); }
.sh-item:hover, .sh-item:focus-visible { background: rgba(255,255,255,.08); outline: none; }

/* ---------- chat no estilo do YouTube ao vivo ---------- */
.chat-head { gap: 10px; }
.xp-me.ranked { background: var(--amber); color: #1b1300; }
.chat-filter { flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23ece9e3' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 2px center / 18px; border: 0; color: var(--fg); font: 700 .88rem var(--f-display); padding: 4px 22px 4px 0; cursor: pointer; text-overflow: ellipsis; }
.chat-filter:focus-visible { outline: 2px solid var(--amber); border-radius: 4px; }
.chat-filter option { background: var(--panel); color: var(--fg); }
.xp-me { font-size: .72rem; color: var(--amber); background: rgba(255,178,36,.1); border: 1px solid rgba(255,178,36,.3); padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.chat-top { list-style: none; margin: 0; padding: 8px 16px; display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.chat-top li { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; padding: 3px 8px 3px 4px; border-radius: 99px; background: rgba(255,255,255,.05); max-width: 100%; }
.chat-top .rk { font-size: .68rem; padding: 2px 6px; border-radius: 99px; background: #3a3f4b; color: #fff; }
.chat-top .r1 .rk { background: var(--amber); color: #1b1300; }
.chat-top .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.chat-top .xp { color: var(--dim); font-size: .7rem; }
.chat-pin { margin: 0; padding: 9px 16px; font-size: .8rem; color: #c9c6bf; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(255,178,36,.08), transparent); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--amber); font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.messages li.msg { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.messages .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 .78rem var(--f-body); color: #fff; margin-top: 1px; }
.messages .mb { min-width: 0; }
.messages .badge { display: inline-block; font-size: .64rem; padding: 1px 6px; border-radius: 99px; margin-right: 6px; background: #3a3f4b; color: #fff; vertical-align: 1px; }
.messages .badge.r1 { background: var(--amber); color: #1b1300; }
.messages .txt { overflow-wrap: anywhere; }
.messages.top-only li[data-top="0"] { display: none; }
.chat-form .row { position: relative; align-items: flex-end; }
.chat-form .row > button[type=submit] { min-height: 44px; }
.msgbox { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.msgbox:focus-within { border-color: var(--amber); }
.chat-form { grid-template-columns: minmax(0, 1fr); }
/* campo de escrever: uma linha que cresce até 4 (a altura vem do chat-tela.js); com mais texto, rola dentro dele */
.chat-form .msgbox textarea { display: block; flex: 1; width: 0; min-width: 0; height: 42px; max-height: calc(4 * 1.5em + 20px); margin: 0; border: 0; background: transparent; color: var(--fg); font: inherit; line-height: 1.5; padding: 10px 4px; resize: none; overflow-x: hidden; overflow-y: hidden; overscroll-behavior: contain; }
.chat-form .msgbox textarea.scroll { overflow-y: auto; }
.chat-form .msgbox textarea:focus { outline: 0; }
.chat-form .msgbox textarea::placeholder { white-space: nowrap; }
.chat-form .ib { flex: none; background: none; color: var(--dim); padding: 0 8px; height: 38px; margin-bottom: 2px; font-size: 1.05rem; border-radius: 8px; }
.chat-form .ib:hover, .chat-form .ib[aria-expanded="true"] { color: var(--fg); filter: none; }
.chat-form .ib.heart { color: #ff5d7a; }
.emoji-picker { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5; width: min(304px, calc(100vw - 48px)); max-height: 220px; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.55); animation: gm-in .14s ease-out; }
.chat-form .ep { background: none; color: inherit; font-weight: 400; border: 0; font-size: 1.25rem; line-height: 1; padding: 6px 0; border-radius: 6px; }
.chat-form .ep:hover, .chat-form .ep:focus-visible { background: var(--panel-2); }
.rules { max-width: min(440px, calc(100vw - 32px)); background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.rules::backdrop { background: rgba(0,0,0,.6); }
.rules h3 { margin: 0 0 10px; font: 700 1.1rem var(--f-display); }
.rules ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
.rules p { font-size: .82rem; margin: 0 0 14px; }
.dlg-close { background: var(--amber); color: #1b1300; border: 0; font-weight: 700; padding: 8px 18px; border-radius: 8px; }
@media (max-width: 560px) {
  .watchbar { margin-top: -6px; }
  .lk, .share-btn { font-size: .85rem; }
  .chat-filter { font-size: .86rem; }
  .chat-head #chatState { display: none; }
}
.chat-form .reactions .react { width: 40px; height: 40px; font-size: 1.2rem; }

/* Árabe (docs/I18N.md): <html dir="rtl"> espelha a página (o chat vai para a esquerda, os textos correm da direita). O player
   (vídeo, controles, progresso) fica da esquerda para a direita, como em todo player de vídeo; menus e avisos dentro dele
   seguem o idioma */
html[dir="rtl"] .player { direction: ltr; }
html[dir="rtl"] .player .gear-menu, html[dir="rtl"] .player .nerd, html[dir="rtl"] .player .overlay,
html[dir="rtl"] .player .offair-slate, html[dir="rtl"] .player .unmute, html[dir="rtl"] .player .cc-layer { direction: rtl; }
html[dir="rtl"] .gm-row, html[dir="rtl"] .poll .opt, html[dir="rtl"] .chan, html[dir="rtl"] .sh-item { text-align: right; }
/* rádios e widgets: o nome do dado corre na direção dele (unicode-bidi: plaintext), mas fica encostado do lado do ícone */
html[dir="rtl"] .ex-sel, html[dir="rtl"] .ex-l, html[dir="rtl"] .ex-m, html[dir="rtl"] .ex-rn { text-align: right; }
html[dir="rtl"] .gm-row[aria-haspopup="menu"] svg, html[dir="rtl"] .gm-back svg { transform: scaleX(-1); }
html[dir="rtl"] .gm-row:focus-visible { box-shadow: inset -2px 0 var(--amber); }
html[dir="rtl"] .gm-switch i { left: auto; right: -2px; }
html[dir="rtl"] .gm-switch.on i { transform: translateX(-18px); }
html[dir="rtl"] .nerd-grid dt { text-align: left; }
html[dir="rtl"] .messages .who { margin-right: 0; margin-left: 8px; }
html[dir="rtl"] .messages .plat { margin-right: 0; margin-left: 5px; }
html[dir="rtl"] .messages .when { margin-left: 0; margin-right: 6px; }
html[dir="rtl"] .messages .badge { margin-right: 0; margin-left: 6px; }
html[dir="rtl"] .share-menu, html[dir="rtl"] .emoji-picker { left: auto; right: 0; }
html[dir="rtl"] .reactions { right: auto; left: 0; }
html[dir="rtl"] .rules ol { padding-left: 0; padding-right: 20px; }
html[dir="rtl"] .item { padding: 8px 12px 8px 14px; }
html[dir="rtl"] .item:hover { transform: translateX(-2px); }
html[dir="rtl"] .splash-name { margin-right: 0; margin-left: -.28em; }
html[dir="rtl"] .mono { direction: ltr; unicode-bidi: isolate; } /* horários e contadores na ordem de sempre */
/* árabe é escrita cursiva: espaço entre letras separa as letras ligadas; só a marca NEXA fica espaçada */
html[lang="ar"] body * { letter-spacing: normal !important; }
html[lang="ar"] .splash-name { letter-spacing: .28em !important; } html[lang="ar"] .brand { letter-spacing: .14em !important; }
/* em árabe, sem o "monospace" genérico (Courier New estica as letras árabes); números seguem monoespaçados */
html[lang="ar"] { --f-mono: "JetBrains Mono", Consolas, system-ui, sans-serif; }

/* ---------- idioma no topo (lang-pick.js): bandeira + código; a lista abre embaixo, alinhada ao fim do cabeçalho ---------- */
.lang-pick { position: relative; }
.lp-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 9px 0 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); font: 600 .74rem var(--f-mono); letter-spacing: .06em;
}
.lp-btn:hover, .lp-btn[aria-expanded="true"] { border-color: #3a3f4b; background: var(--panel-2); }
.lp-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.lp-btn svg { color: var(--dim); flex: none; }
.lp-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.lp-flag { display: block; flex: none; width: 24px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.lp-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 236px; max-height: min(72vh, 540px); overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.6); animation: gm-in .14s ease-out;
}
.lp-list:focus { outline: none; }
.lp-list:focus-visible li.active { box-shadow: inset 0 0 0 2px var(--amber); }
.lp-list li[role="option"] { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 8px; cursor: pointer; font: 500 .92rem var(--f-body); }
.lp-list li.active { background: rgba(255,255,255,.08); }
.lp-list li[aria-selected="true"] { color: var(--amber); font-weight: 600; }
.lp-list li[aria-selected="true"]::after { content: ""; margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.lp-fail { margin: 6px 8px 4px; font-size: .8rem; line-height: 1.35; color: #ff8f86; }
html[dir="rtl"] .lp-list { right: auto; left: 0; }
@media (max-width: 560px) {
  .lp-code, .lp-btn svg { display: none; } /* celular: só a bandeira */
  .lp-btn { height: 34px; padding: 0 7px; }
}

/* ---------- celular e tablet (uma coluna): o chat numa tela só (chat-tela.js; pedido do usuário, 14/10) ----------
   O chat sai do pé da página (era preciso descer ~1.000 px até o campo) e abre pela barra "Chat ao vivo" embaixo do
   vídeo, por cima da página: cabeçalho, vídeo, enquete recolhível, as mensagens (só elas rolam) e o campo sempre
   embaixo, acima do teclado (--vv-h/--vv-top da visualViewport) e da barra de gestos. No computador nada disso aparece. */
.chat-bar, .chat-close, .poll-fold, .nick-btn { display: none; }
@media (max-width: 1020px) {
  .layout > .chat { display: none; }
  .chat-bar { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; margin-top: -8px; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(255,178,36,.38); background: linear-gradient(120deg, rgba(255,178,36,.13), var(--panel) 70%); color: var(--fg); text-align: start; font: inherit; }
  .chat-bar:active { background: var(--panel-2); }
  .chat-bar > svg:first-child { flex: none; color: var(--amber); }
  .cb-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
  .cb-text b { font: 700 .98rem var(--f-display); }
  .cb-peek { color: var(--dim); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cb-chev { flex: none; color: var(--dim); }
  html[dir="rtl"] .cb-chev { transform: scaleX(-1); }
  /* 16 px: o Safari do iPhone não amplia a página ao tocar no campo */
  .chat-form input, .chat-form .msgbox textarea { font-size: 16px; }

  /* chat aberto: a página vira uma coluna do tamanho da área visível; o resto da página fica por baixo, parado */
  body.chat-open { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100dvh); margin: 0; overflow: hidden; display: flex; flex-direction: column; }
  body.chat-open .top { flex: none; position: static; }
  body.chat-open .layout { flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
  body.chat-open .stage { display: contents; }
  body.chat-open .stage > :not(.player):not(.poll) { display: none !important; }
  body.chat-open .player { flex: none; width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  body.chat-open .poll { flex: none; max-height: 30%; overflow-y: auto; overscroll-behavior: contain; gap: 10px; padding: 10px 16px; border-width: 0 0 1px; border-radius: 0; }
  body.chat-open .poll-head { gap: 8px; }
  body.chat-open .poll-head .pill { margin-inline-start: auto; }
  body.chat-open .poll-fold { display: grid; place-items: center; flex: none; width: 40px; height: 32px; margin-block: -4px; margin-inline-end: -8px; border: 0; border-radius: 8px; background: none; color: var(--fg); transition: transform .2s; }
  body.chat-open .poll-fold[aria-expanded="true"] { transform: rotate(180deg); }
  body.chat-open .poll.folded .poll-q { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.chat-open .poll.folded .poll-opts, body.chat-open .poll.folded .poll-foot { display: none; }
  body.chat-open .poll.vt-host { gap: 8px; padding: 10px 16px; border-width: 0 0 1px; background: var(--panel); }
  body.chat-open .poll.vt-host > .poll-head { display: flex; }
  body.chat-open .poll.vt-host.folded > .poll-q { display: block; }
  body.chat-open .layout > .chat { display: flex; flex: 1; min-height: 0; position: relative; top: auto; height: auto; max-height: none; border-width: 0; border-radius: 0; }
  body.chat-open .chat-close { display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin-block: -6px; margin-inline-start: -8px; border: 0; border-radius: 50%; background: none; color: var(--fg); }
  body.chat-open .chat-close:active { background: var(--panel-2); }
  body.chat-open .chat-head { padding: 10px 14px; }
  body.chat-open .chat-top { padding: 6px 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } /* o ranking numa linha só */
  body.chat-open .chat-top li { flex: none; }
  body.chat-open .chat-pin { padding: 6px 14px; font-size: .76rem; }
  .chat-form .row > button[type=submit] { padding: 0 14px; }
  body.chat-open .chat-form { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  /* teclado na tela: o vídeo encolhe e o que não é conversa sai, para sobrar espaço às mensagens */
  html[data-kb] body.chat-open .chat-form { padding-bottom: 10px; }
  html[data-kb] body.chat-open .top, html[data-kb] body.chat-open .poll,
  html[data-kb] body.chat-open .chat-pin, html[data-kb] body.chat-open .chat-top { display: none; }
  html[data-kb] body.chat-open .player { aspect-ratio: auto; height: min(56.25vw, calc(var(--vv-h, 100dvh) * .3)); }

  /* nome: pedido uma vez e guardado; depois vira o avatar no começo da linha (toque para trocar) */
  .chat-form.has-nick:not(.edit-nick) #nick { display: none; }
  .chat-form.has-nick .nick-btn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin-bottom: 4px; padding: 0; border: 0; border-radius: 50%; color: #fff; font: 700 .9rem var(--f-body); }
  .chat-form.edit-nick .nick-btn { box-shadow: 0 0 0 2px var(--amber); }
}
/* celular deitado: vídeo à esquerda, enquete e chat à direita (sem o cabeçalho, para caber na altura) */
@media (max-width: 1020px) and (orientation: landscape) {
  body.chat-open .top { display: none; }
  body.chat-open .layout { display: grid; grid-template-columns: minmax(0, 1fr) min(380px, 46%); grid-template-rows: auto minmax(0, 1fr); }
  body.chat-open .player { grid-column: 1; grid-row: 1 / -1; align-self: center; width: 100%; max-height: 100%; }
  html[data-kb] body.chat-open .player { aspect-ratio: 16 / 9; height: auto; }
  body.chat-open .poll { grid-column: 2; grid-row: 1; max-height: 45vh; border-inline-start-width: 1px; }
  body.chat-open .layout > .chat { grid-column: 2; grid-row: 2; border-inline-start-width: 1px; }
}
