/* Cabine nova (modo jogo): a TV do jogo dentro da página da TV e o conteúdo embaixo dela.
   Código: src/js/player/jogo/. Liga com #player[data-mode='jogo']. A TV é sempre escura (ilha); o resto segue o tema do app. */

.jg-tv, .jg-body { display: none; }
[hidden].jg-body, .jg-body [hidden], .jg-tv [hidden] { display: none !important; }
#player[data-mode='jogo'] .jg-tv { display: block; }
#player[data-mode='jogo'] .jg-body { display: grid; gap: 12px; padding: 12px 16px 8px; max-width: 560px; margin: 0 auto; }
#player[data-mode='jogo'] #p-hero, #player[data-mode='jogo'] .p-under, #player[data-mode='jogo'] .p-body,
#player[data-mode='jogo'] .p-strip, #player[data-mode='jogo'] .tv-time, #player[data-mode='jogo'] #btn-prev,
#player[data-mode='jogo'] #btn-next, #player[data-mode='jogo'] .tv-seek { display: none !important; }

/* ---------- a TV do jogo ---------- */
.jg-tv { position: absolute; inset: 0; z-index: 1; overflow: hidden; container-type: inline-size; color: #fff; background: #0c0c10; pointer-events: none; }
.jg-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.jg-hud { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 3.4cqw 4cqw 3cqw; }
.jg-top { display: flex; align-items: center; justify-content: center; gap: 2cqw; font: 500 max(10px, 2.9cqw)/1.2 var(--ui); color: rgb(255 255 255 / .78); }
.jg-lg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60cqw; }
.jg-bdg { flex: none; display: inline-flex; align-items: center; gap: 5px; height: max(18px, 5.2cqw); padding: 0 2cqw; border-radius: 99px; font: 800 max(9px, 2.5cqw)/1 var(--ui); letter-spacing: .05em; background: rgb(255 255 255 / .16); color: #fff; }
.jg-bdg i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: jg-blink 1.4s ease-in-out infinite; }
.jg-bdg.live { background: #e0281e; } .jg-bdg.pre { background: #ffb340; color: #2a1800; } .jg-bdg.int { background: #fff; color: #141416; }
.jg-sb { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2cqw; align-self: center; margin-top: -2cqw; }
.jg-tm { display: grid; justify-items: center; gap: 1.2cqw; min-width: 0; }
.jg-cr { width: 15cqw; height: 15cqw; display: grid; place-items: center; font: italic 800 4cqw/1 var(--display); filter: drop-shadow(0 .6cqw 1.6cqw rgb(0 0 0 / .5)); }
.jg-cr img { width: 100%; height: 100%; object-fit: contain; }
.jg-tm b { font: 600 max(11px, 3.4cqw)/1.2 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.jg-mid { display: grid; justify-items: center; gap: 1.2cqw; }
.jg-sc { font: italic 800 13cqw/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 .6cqw 2.4cqw rgb(0 0 0 / .6); }
.jg-sc.hr { font-size: 10cqw; }
.jg-ck { display: inline-flex; align-items: center; height: max(17px, 5.6cqw); padding: 0 2.4cqw; border-radius: 99px; background: rgb(0 0 0 / .42); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); font: 600 max(10px, 2.9cqw)/1 var(--ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jg-bt { display: flex; align-items: flex-end; justify-content: space-between; gap: 3cqw; font: 500 max(10px, 2.8cqw)/1.25 var(--ui); }
.jg-ev { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgb(255 255 255 / .92); text-shadow: 0 1px 4px rgb(0 0 0 / .7); }
.jg-rdw { flex: none; display: inline-flex; align-items: center; gap: 1.6cqw; max-width: 38cqw; color: rgb(255 255 255 / .85); text-shadow: 0 1px 4px rgb(0 0 0 / .7); }
.jg-rd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jg-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; flex: none; }
.jg-eq i { width: 3px; border-radius: 1px; background: #ff4d5e; height: 30%; animation: jg-eq 1s ease-in-out infinite; }
.jg-eq i:nth-child(2) { animation-delay: -.35s; } .jg-eq i:nth-child(3) { animation-delay: -.7s; }
.jg-tv.paused .jg-eq i, .jg-tv.paused .jg-bdg i { animation-play-state: paused; }
@keyframes jg-eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@keyframes jg-blink { 50% { opacity: .3; } }
/* na janelinha só o essencial: placar e relógio */
.mini .jg-bt, .mini .jg-lg { display: none; }
.mini .jg-hud { padding: 5cqw 4cqw; grid-template-rows: auto 1fr; }
.mini .jg-sb { margin-top: 0; }

/* camadas por cima da TV */
.jg-layer { position: absolute; inset: 0; pointer-events: none; }
.jg-over { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 2cqw; text-align: center; padding: 5cqw; background: rgb(8 8 10 / .88); pointer-events: auto; }
.jg-over b { font: 600 5cqw/1.2 var(--title); text-wrap: balance; }
.jg-over span { font: 400 max(11px, 3.2cqw)/1.35 var(--ui); color: rgb(255 255 255 / .78); max-width: 82cqw; }
.jg-back { margin-top: 2cqw; height: 10cqw; min-height: 40px; padding: 0 6cqw; border-radius: 999px; background: #fff; color: #141416; font: 600 max(13px, 3.2cqw)/1 var(--ui); }
.jg-ad { position: absolute; inset: 0; z-index: 3; padding: 7cqw 6cqw; display: grid; align-content: center; gap: 1.4cqw; background: linear-gradient(120deg, #3a1206, #6a1a10 70%, #8a3a12); }
.jg-ad small { font: 500 max(9px, 2.6cqw)/1.2 var(--ui); opacity: .85; }
.jg-ad b { font: 600 6cqw/1.1 var(--title); max-width: 80%; }
.jg-ad p { font: 400 max(11px, 3.1cqw)/1.3 var(--ui); max-width: 78%; opacity: .9; }
.jg-goal { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 1cqw; animation: jg-goal 3.4s ease-out forwards; }
.jg-goal b { font: italic 900 19cqw/1 var(--display); letter-spacing: .02em; text-shadow: 0 0 6cqw var(--gc, #ff7a1a), 0 1cqw 3cqw rgb(0 0 0 / .6); animation: jg-goalb .9s cubic-bezier(.3, 1.6, .5, 1); }
.jg-goal span { font: 600 max(11px, 3.6cqw)/1.2 var(--ui); padding: 1.2cqw 3cqw; border-radius: 99px; background: rgb(0 0 0 / .55); }
@keyframes jg-goal { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes jg-goalb { from { transform: scale(.4); opacity: 0; } }

/* ---------- o conteúdo embaixo da TV ---------- */
.jg-meta { font: 500 12px/1.3 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.jg-strip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.jg-strip::-webkit-scrollbar { display: none; }
.jg-pb { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 999px; font: 500 13.5px/1 var(--ui); color: var(--text); background: var(--s2); box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; }
.jg-pb svg { width: 17px; height: 17px; }
.jg-pb em { font-style: normal; color: var(--muted); }
.jg-pb[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }
.jg-pb:active, .jg-stp:active, .jg-src:active { transform: scale(.96); }

/* sincronia em texto */
.jg-sy { padding: 14px; border-radius: 20px; display: grid; gap: 12px; }
.jg-sy > * { min-width: 0; }
.jg-sh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.jg-sh b { font: 600 17px/1.2 var(--title); }
.jg-sy-val { font: italic 800 22px/1 var(--display); color: var(--accent-text); font-variant-numeric: tabular-nums; }
.jg-sy-line { font: 500 14.5px/1.4 var(--ui); }
.jg-sy-note { font: 400 12px/1.4 var(--ui); color: var(--muted); }
.jg-srcs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jg-src { display: grid; justify-items: center; gap: 3px; min-height: 52px; padding: 9px 4px; border-radius: 16px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.jg-src b { font: 600 12.5px/1.2 var(--ui); } .jg-src small { font: 500 11px/1 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.jg-src[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); box-shadow: none; } .jg-src[aria-pressed='true'] small { color: inherit; opacity: .75; }
.jg-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.jg-stp { min-height: 46px; border-radius: 14px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font: 700 15px/1 var(--ui); font-variant-numeric: tabular-nums; }
.jg-live { min-height: 44px; border-radius: 999px; background: var(--s2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font: 600 13.5px/1 var(--ui); }
.jg-live[aria-pressed='true'] { background: var(--live); color: #fff; box-shadow: none; }

/* emoção da narração */
.jg-emo { padding: 14px 14px 12px; border-radius: 20px; display: grid; gap: 8px; }
.jg-emo-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.jg-emo-h b { font: 600 15px/1.2 var(--title); } .jg-emo-h small { font: 500 11.5px/1.2 var(--ui); color: var(--muted); }
.jg-bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.jg-bars i { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, #ff7a1a, var(--live)); transition: height .4s; }
.jg-bars i.z { background: var(--s3); } .jg-bars i.pk { background: linear-gradient(180deg, #f3c766, #ff7a1a); }
.jg-bars-x { display: flex; justify-content: space-between; font: 500 10.5px/1 var(--ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.jg-emo p { font: 400 12px/1.4 var(--ui); color: var(--muted); }

/* abas */
.jg-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; }
.jg-tabs button { flex: 1; min-height: 44px; border-radius: 12px; font: 600 13px/1 var(--ui); color: var(--muted); }
.jg-tabs button[aria-selected='true'] { background: var(--s1); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .18); }
.jg-pane { border-radius: 20px; padding: 12px; display: grid; gap: 10px; min-height: 110px; align-content: start; }
.jg-pane > .cp-tl { padding: 0; }
.jg-empty { padding: 22px 8px; text-align: center; display: grid; gap: 4px; justify-items: center; }
.jg-empty b { font: 600 15px/1.3 var(--title); } .jg-empty small { color: var(--muted); font: 400 13px/1.4 var(--ui); }
.jg-hint { font: 400 12px/1.4 var(--ui); color: var(--muted); }
.jg-rr { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 4px; text-align: left; width: 100%; color: var(--text); }
.jg-rr + .jg-rr { border-top: 1px solid var(--line); }
.jg-rr b { display: block; font: 600 14.5px/1.25 var(--ui); } .jg-rr small { display: block; font: 500 12px/1.3 var(--ui); color: var(--muted); }
.jg-tg { flex: none; height: 32px; padding: 0 14px; border-radius: 16px; display: inline-flex; align-items: center; font: 600 12px/1 var(--ui); background: var(--s2); box-shadow: inset 0 0 0 1px var(--line-2); }
.jg-rr.on .jg-tg { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .jg-eq i, .jg-bdg i, .jg-goal, .jg-goal b { animation: none; }
  .jg-bars i { transition: none; }
}

/* cabine fechada: só a camada de aviso, sem placar nem botões da TV */
.jg-tv[data-closed='true'] .jg-hud { visibility: hidden; }
.tv:has(.jg-tv[data-closed='true']) :is(.tv-ctrls, .tv-chip) { display: none; }

/* Rádio que toca só ao vivo: botões de atraso apagados, atalho para as rádios com atraso e o grupo na aba Rádios */
.jg-sy.is-off .jg-srcs, .jg-sy.is-off .jg-steps, .jg-sy.is-off .jg-live { opacity: .34; filter: saturate(.4); pointer-events: none; }
.jg-sy.is-off .jg-sy-note { font-size: 12.5px; }
.jg-sy-link { justify-self: start; min-height: 44px; padding: 0; background: none; border: 0; color: var(--accent-text); font: 600 14px/1.3 var(--ui); text-align: left; cursor: pointer; }
.jg-sep { padding: 14px 4px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.jg-sep span { font: 700 11.5px/1.3 var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.jg-sep + .jg-rr { border-top: 0; }
