/*
 * Rádio Player — temas visuais.
 * O tema é escolhido no painel e aplicado em <html data-skin="...">.
 * "classico" segue o claro/escuro do aparelho; os demais têm visual próprio.
 */

:root {
  --bg: #f4f5f7;
  --bg-art: none;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: #eceef2;
  --text: #14161b;
  --muted: #646b78;
  --accent: #e5484d;
  --accent-text: #ffffff;
  --border: rgba(0, 0, 0, .08);
  --shadow: 0 8px 30px rgba(0, 0, 0, .12);
  --glow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent);
  --overlay: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), var(--bg) 92%);
  --photo-tint: linear-gradient(color-mix(in srgb, var(--bg) 78%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
  --ring: conic-gradient(from 0deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent), var(--accent));
  --ring-anim: none;
  --ring-width: 6px;
  --art-radius: 28px;
  --art-frame: 0 solid transparent;
  --tile-radius: 18px;
  --card-border: 1px solid var(--border);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);
  --display-transform: none;
  --display-spacing: 0;
  --radius: 16px;
  --mini-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-skin]), :root[data-skin="classico"] {
    --bg: #0f1115;
    --surface: rgba(24, 27, 33, .88);
    --surface-2: #22262e;
    --text: #f1f3f6;
    --muted: #9aa1ad;
    --border: rgba(255, 255, 255, .08);
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ---------- Gospel: céu claro, luz dourada ---------- */
:root[data-skin="gospel"] {
  --bg: #eef1fb;
  --bg-art:
    radial-gradient(110% 55% at 50% -12%, rgba(255, 213, 128, .7), transparent 62%),
    radial-gradient(70% 45% at 100% 100%, rgba(160, 182, 255, .45), transparent 70%),
    repeating-conic-gradient(from 180deg at 50% -25%, rgba(255, 255, 255, .45) 0 3deg, transparent 3deg 11deg);
  --surface: rgba(255, 255, 255, .62);
  --surface-2: rgba(255, 255, 255, .5);
  --text: #1c2142;
  --muted: #59618a;
  --accent: #9a6b14;
  --accent-text: #fffaf0;
  --border: rgba(28, 33, 66, .1);
  --shadow: 0 12px 34px rgba(60, 70, 140, .18);
  --ring: conic-gradient(from 0deg, #f6d77e, #b8862b, #fff4c9, #d9a640, #f6d77e);
  --ring-anim: spin;
  --ring-width: 7px;
  --art-radius: 50%;
  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* ---------- Sertanejo: pôr do sol, tons quentes ---------- */
:root[data-skin="sertanejo"] {
  --bg: #1c0d07;
  --bg-art:
    radial-gradient(95% 55% at 50% -5%, rgba(255, 138, 36, .6), transparent 64%),
    radial-gradient(60% 35% at 0% 100%, rgba(170, 60, 20, .45), transparent 70%),
    linear-gradient(180deg, #3d1708 0%, #1c0d07 62%);
  --surface: rgba(255, 236, 214, .08);
  --surface-2: rgba(255, 236, 214, .14);
  --text: #fff3e3;
  --muted: #e2bc98;
  --accent: #ff8a1f;
  --accent-text: #2a1206;
  --border: rgba(255, 200, 150, .16);
  --shadow: 0 14px 40px rgba(0, 0, 0, .5);
  --ring: linear-gradient(135deg, #ffc56b, #ff5e1a 60%, #a8320c);
  --art-radius: 30px;
  --font-display: "Oswald", "Arial Narrow", Arial, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display-transform: uppercase;
  --display-spacing: .02em;
  color-scheme: dark;
}

/* ---------- Pop Rock: neon roxo e magenta ---------- */
:root[data-skin="poprock"] {
  --bg: #0e0717;
  --bg-art:
    radial-gradient(75% 45% at 12% 8%, rgba(160, 40, 255, .5), transparent 70%),
    radial-gradient(65% 40% at 92% 88%, rgba(255, 40, 140, .38), transparent 70%),
    linear-gradient(160deg, #1b0b30, #0e0717 70%);
  --surface: rgba(255, 255, 255, .07);
  --surface-2: rgba(255, 255, 255, .12);
  --text: #ffffff;
  --muted: #c5b6df;
  --accent: #ff2e93;
  --accent-text: #ffffff;
  --border: rgba(255, 255, 255, .1);
  --shadow: 0 14px 40px rgba(0, 0, 0, .55);
  --glow: 0 0 34px rgba(255, 46, 147, .6);
  --ring: conic-gradient(from 0deg, #ff2e93, #8b3dff, #22d3ee, #ff2e93);
  --ring-anim: spin;
  --art-radius: 50%;
  --font-display: "Unbounded", system-ui, Arial, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

/* ---------- Sertanejo Raiz: madeira, couro e costura ---------- */
:root[data-skin="raiz"] {
  --bg: #2a1a0f;
  --bg-art:
    radial-gradient(80% 45% at 50% 0%, rgba(217, 164, 65, .22), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(0, 0, 0, .28) 58px 60px),
    repeating-linear-gradient(91deg, rgba(255, 255, 255, .025) 0 3px, transparent 3px 9px, rgba(0, 0, 0, .05) 9px 11px),
    linear-gradient(180deg, #4b2d18, #2a1a0f 75%);
  --surface: rgba(243, 230, 200, .07);
  --surface-2: rgba(243, 230, 200, .13);
  --text: #f3e6c8;
  --muted: #cdb48a;
  --accent: #d9a441;
  --accent-text: #2a1a0f;
  --border: rgba(243, 230, 200, .18);
  --card-border: 1.5px dashed rgba(243, 230, 200, .34);
  --shadow: 0 14px 34px rgba(0, 0, 0, .55);
  --ring: none;
  --ring-width: 0px;
  --art-radius: 4px;
  --art-frame: 10px solid #f3e6c8;
  --tile-radius: 10px;
  --font-display: "Rye", Georgia, serif;
  --font-body: "Lora", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

/* ---------- Forró: noite de São João, bandeirinhas ---------- */
:root[data-skin="forro"] {
  --bg: #0f1c48;
  --bg-art:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 46'%3E%3Cpath d='M0 4Q80 16 160 4' stroke='%23fff' stroke-opacity='.45' fill='none'/%3E%3Cpath d='M8 6L30 8.5L19 34Z' fill='%23ff4d4d'/%3E%3Cpath d='M48 9.5L70 10.5L59 38Z' fill='%23ffd23f'/%3E%3Cpath d='M89 10.5L111 9.5L100 38Z' fill='%232ec4b6'/%3E%3Cpath d='M130 8.5L152 6L141 34Z' fill='%23ff7ac6'/%3E%3C/svg%3E") repeat-x 0 0 / 160px 46px,
    radial-gradient(60% 40% at 50% 8%, rgba(255, 210, 63, .22), transparent 70%),
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, .7), transparent),
    radial-gradient(2px 2px at 70% 22%, rgba(255, 255, 255, .6), transparent),
    radial-gradient(1.5px 1.5px at 85% 55%, rgba(255, 255, 255, .5), transparent),
    linear-gradient(180deg, #1b2f74, #0f1c48 70%);
  --surface: rgba(255, 255, 255, .08);
  --surface-2: rgba(255, 255, 255, .14);
  --text: #ffffff;
  --muted: #c9d3f5;
  --accent: #ffd23f;
  --accent-text: #13235b;
  --border: rgba(255, 255, 255, .12);
  --shadow: 0 14px 40px rgba(0, 0, 0, .45);
  --ring: repeating-conic-gradient(from 0deg, #ff4d4d 0 30deg, #ffd23f 30deg 60deg, #2ec4b6 60deg 90deg, #ff7ac6 90deg 120deg);
  --ring-anim: spin;
  --ring-width: 8px;
  --art-radius: 50%;
  --font-display: "Baloo 2", system-ui, Arial, sans-serif;
  --font-body: "Baloo 2", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-art), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.4 var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
/* Imagem de fundo enviada no painel, com o tom do tema por cima. */
html.has-photo body { background: var(--photo-tint), var(--bg-photo) center / cover fixed no-repeat, var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.display { font-family: var(--font-display); text-transform: var(--display-transform); letter-spacing: var(--display-spacing); }

.app {
  max-width: 1040px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-t)) 16px calc(var(--mini-h) + 28px + var(--safe-b));
}

/* Topo */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { border-radius: 12px; object-fit: cover; box-shadow: var(--shadow); width: 42px; height: 42px; }
.brand h1 {
  font-family: var(--font-display); text-transform: var(--display-transform); letter-spacing: var(--display-spacing);
  font-size: clamp(1rem, 4.4vw, 1.3rem); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root[data-skin="forro"] .topbar { padding-top: 34px; }

.icon-btn {
  display: inline-grid; place-items: center;
  min-width: 44px; height: 44px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.glass { background: var(--surface); border: 1px solid var(--border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.icon-btn.lg svg { width: 30px; height: 30px; }
.install-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: .9rem; box-shadow: var(--glow);
}
.install-btn svg { width: 20px; height: 20px; }
@media (max-width: 440px) { .install-btn { font-size: 0; gap: 0; width: 42px; padding: 0; justify-content: center; } .install-btn svg { width: 22px; height: 22px; } }

/* Busca, abas e estilos */
.glass-box, .search, .tabs, .station, .mini, .about, .ad-slot a, .ad-slot .ad-box {
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: var(--card-border); border-radius: 14px;
  padding: 0 14px; color: var(--muted);
}
.search svg { width: 20px; height: 20px; }
.search input {
  flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit;
}
.search input::placeholder { color: var(--muted); }

.tabs { display: flex; gap: 4px; margin: 14px 0 8px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 14px; }
.tab { flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: .92rem; }
.tab.active { background: var(--accent); color: var(--accent-text); box-shadow: var(--glow); }

.genres { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 12px; scrollbar-width: none; }
.genres::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: var(--card-border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 8px 16px; font-size: .9rem; font-weight: 600;
}
.chip svg { width: 18px; height: 18px; }
.chip.active { background: var(--text); color: var(--bg); border-color: transparent; }

/* Grade de rádios (capas) */
.list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

.station {
  position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: var(--card-border); border-radius: var(--tile-radius);
  padding: 10px 10px 12px; transition: transform .15s ease, border-color .15s ease;
}
.station:hover { transform: translateY(-2px); }
.station:active { transform: scale(.98); }
.station.current { border-color: var(--accent); border-style: solid; }
.tile-art { position: relative; display: block; }
.tile-art .cover { width: 100%; aspect-ratio: 1; height: auto; border-radius: calc(var(--tile-radius) - 6px); }
.station .info { min-width: 0; padding: 0 2px; }
.station strong, .station small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station strong { font-size: .98rem; }
.station small { color: var(--muted); font-size: .82rem; }
.station .fav {
  position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; padding: 5px;
  color: #fff; background: rgba(0, 0, 0, .45); border-radius: 50%;
}
.playing-ind {
  position: absolute; left: 8px; bottom: 8px; display: none; align-items: flex-end; gap: 3px;
  height: 26px; padding: 6px 7px; border-radius: 9px; background: var(--accent);
}
.playing-ind i { width: 3px; height: 4px; border-radius: 2px; background: var(--accent-text); animation: eq 1s ease-in-out infinite; }
.playing-ind i:nth-child(2) { animation-delay: -.4s; }
.playing-ind i:nth-child(3) { animation-delay: -.7s; }
.station.current.is-playing .playing-ind { display: flex; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; grid-column: 1 / -1; }

.cover { object-fit: cover; background: var(--surface-2); flex: none; display: block; }
.cover.sm { width: 52px; height: 52px; border-radius: 12px; }

/* Mini player */
.mini {
  position: fixed; z-index: 10; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b));
  max-width: 1024px; margin: 0 auto; height: var(--mini-h);
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 8px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); border: var(--card-border); border-radius: 20px; box-shadow: var(--shadow);
}
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 0; text-align: left; }
.mini-text { min-width: 0; }
.mini-text strong, .mini-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text small { color: var(--muted); font-size: .84rem; }

.play {
  display: grid; place-items: center; border: var(--play-border, 0); border-radius: 999px;
  background: var(--play-bg, var(--accent)); color: var(--play-fg, var(--accent-text)); flex: none;
}
.play.sm { width: 50px; height: 50px; }
.play.lg { width: 80px; height: 80px; box-shadow: var(--play-shadow, var(--glow)); }
.play.lg svg { width: 36px; height: 36px; }
.play.loading svg { opacity: 0; }
.play.loading { position: relative; }
.play.loading::after {
  content: ""; position: absolute; width: 40%; height: 40%; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tela cheia do player */
.player {
  position: fixed; inset: 0; z-index: 20; overflow: hidden;
  background: var(--bg-art), var(--bg);
  transform: translateY(100%); transition: transform .34s cubic-bezier(.2, .8, .2, 1);
  visibility: hidden;
}
.player.open { transform: translateY(0); visibility: visible; }
.player-bg {
  position: absolute; inset: -40px; background-size: cover; background-position: center;
  filter: blur(42px) saturate(1.4); opacity: .4; transform: scale(1.2);
}
html.has-photo .player-bg { filter: none; opacity: 1; transform: none; inset: 0; }
.player-bg::after { content: ""; position: absolute; inset: 0; background: var(--overlay); }
.player-inner {
  position: relative; height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  padding: calc(12px + var(--safe-t)) 22px calc(18px + var(--safe-b));
}
:root[data-skin="forro"] .player-inner { padding-top: calc(36px + var(--safe-t)); }
.player-top { display: flex; align-items: center; justify-content: space-between; }
.status {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
}
.status.live { color: var(--accent-text); background: var(--accent); border-color: transparent; box-shadow: var(--glow); }
.status.live::before { content: "● "; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.art-wrap { display: grid; place-items: center; flex: 1; min-height: 120px; container-type: size; }
.art {
  --size: min(70vw, 310px, 36vh);
  --size: min(70vw, 310px, calc(100cqh - 24px));
  position: relative; width: var(--size); height: var(--size); max-width: 100%;
}
.art-ring {
  position: absolute; inset: calc(var(--ring-width) * -1 - 4px);
  border-radius: var(--art-radius); background: var(--ring);
  animation: var(--ring-anim) 9s linear infinite; animation-play-state: paused;
}
body.is-live .art-ring { animation-play-state: running; }
.art::after {
  content: ""; position: absolute; inset: -4px; border-radius: var(--art-radius); background: var(--bg);
}
:root[data-skin="raiz"] .art::after, :root[data-skin="raiz"] .art-ring { display: none; }
.cover.lg {
  position: relative; z-index: 1; width: 100%; height: 100%;
  border-radius: var(--art-radius); border: var(--art-frame); box-shadow: var(--shadow);
}
:root[data-skin="raiz"] .cover.lg { transform: rotate(-2deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .6); }
:root[data-skin="poprock"] body.is-live .cover.lg { box-shadow: var(--glow); }

.meta { text-align: center; min-width: 0; }
.meta h2 {
  margin: 0; font-size: 1.55rem; line-height: 1.15;
  font-family: var(--font-display); text-transform: var(--display-transform); letter-spacing: var(--display-spacing);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta p { margin: 6px 0 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Equalizador */
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 40px; flex: none; }
.bars i {
  flex: 1; max-width: 6px; height: 100%; border-radius: 3px; background: var(--accent); opacity: .8;
  transform-origin: bottom; transform: scaleY(.1); transition: transform .5s ease;
}
.bars.on i { animation: bar var(--d, .9s) ease-in-out var(--delay, 0s) infinite alternate; }
@keyframes bar { from { transform: scaleY(.12); } to { transform: scaleY(var(--h, .8)); } }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.controls .side { position: relative; color: var(--muted); }
.controls .side small {
  position: absolute; top: -4px; right: -6px; font-size: .64rem; font-weight: 800; padding: 1px 5px; border-radius: 6px;
  background: var(--accent); color: var(--accent-text);
}
.controls .side small:empty { display: none; }
.fav-btn { color: var(--muted); }
.fav-btn[aria-pressed="true"] { color: var(--accent); }

.volume { display: flex; align-items: center; gap: 8px; }
.volume input { flex: 1; accent-color: var(--accent); height: 28px; }

.player-social { display: flex; justify-content: center; gap: 10px; }
.player-social a, .contacts a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.player-social svg { width: 20px; height: 20px; }
.player-social a:hover, .contacts a:hover { color: var(--accent); }

/* Telas baixas (celular deitado) */
@media (max-height: 560px) and (orientation: landscape) {
  .player-inner { max-width: 860px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto repeat(5, auto) 1fr; column-gap: 36px; align-content: start; }
  .player-top { grid-column: 1 / -1; }
  .art-wrap { grid-row: 2 / 8; }
  .art { --size: min(58vh, 250px); }
  .ad-player { display: none; }
}

/* Seletor Rádios | TV ao vivo */
.modes { display: flex; gap: 8px; margin: 0 0 12px; }
.mode {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px;
  border-radius: 14px; border: var(--card-border); background: var(--surface); color: var(--muted); font-weight: 800;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.mode svg { width: 22px; height: 22px; }
.mode.active { background: var(--accent); color: var(--accent-text); border-color: transparent; box-shadow: var(--glow); }

/* Canais de TV */
.list.tv-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .list.tv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .list.tv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tv-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: var(--card-border); border-radius: var(--tile-radius); padding: 10px 10px 12px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .15s ease;
}
.tv-card:hover { transform: translateY(-2px); }
.tv-card.current { border-color: var(--accent); border-style: solid; }
.tv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: calc(var(--tile-radius) - 6px); overflow: hidden; background: #000; }
.tv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-thumb img.logo { object-fit: contain; background: var(--surface-2); }
.live-badge {
  position: absolute; left: 8px; top: 8px; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: #e11d48; padding: 3px 8px; border-radius: 6px;
}
.live-badge::before { content: "● "; }
.tv-play {
  position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--accent-text); box-shadow: var(--glow);
}
.tv-card .info { min-width: 0; padding: 0 2px; }
.tv-card strong, .tv-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-card small { color: var(--muted); font-size: .82rem; }
.tv-card .fav { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; padding: 5px; color: #fff; background: rgba(0, 0, 0, .45); border-radius: 50%; }

/* Tela da TV */
.tvscreen {
  position: fixed; inset: 0; z-index: 22; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-art), var(--bg); background-attachment: fixed;
  transform: translateY(100%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
}
.tvscreen.open { transform: none; visibility: visible; }
.tv-inner { max-width: 980px; margin: 0 auto; display: grid; gap: 14px; padding: calc(12px + var(--safe-t)) 16px calc(24px + var(--safe-b)); }
:root[data-skin="forro"] .tv-inner { padding-top: calc(36px + var(--safe-t)); }
.tv-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.tv-frame video, .tv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.tv-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: #fff; text-align: center; padding: 16px; }
.tv-msg p { margin: 0; }
.tv-msg .btn-primary { width: auto; padding: 0 20px; }
.tv-info { display: flex; align-items: center; gap: 12px; }
.tv-text { flex: 1; min-width: 0; }
.tv-info h2 { margin: 0; font-size: 1.35rem; font-family: var(--font-display); text-transform: var(--display-transform); letter-spacing: var(--display-spacing); }
.tv-info p { margin: 4px 0 0; color: var(--muted); }
.tv-more-wrap h3 { margin: 8px 0 10px; font-size: 1rem; }
.tv-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .tv-more { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tv-more .tv-play { width: 34px; height: 34px; }
.tv-more .tv-play svg { width: 18px; height: 18px; }
/* Celular deitado: o vídeo ocupa a tela. */
@media (orientation: landscape) and (max-height: 500px) {
  .tv-frame { height: calc(100vh - 80px); aspect-ratio: auto; }
}

/* Interação: pedidos e chat */
.interact { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.interact.home { justify-content: flex-start; margin: 0 0 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 12px;
  border-radius: 999px; border: var(--card-border); background: var(--surface); color: var(--text); font-weight: 700; font-size: .88rem;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.pill svg { width: 19px; height: 19px; color: var(--accent); }
.pill:hover { border-color: var(--accent); }
.player-inner .pill { height: 36px; font-size: .82rem; }

.req-dialog { width: min(94vw, 440px); }
.req-dialog form { display: grid; gap: 12px; }
.req-dialog h3 { margin: 0; }
.req-dialog label { display: grid; gap: 5px; font-size: .86rem; font-weight: 700; }
.req-dialog input, .req-dialog textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
  font: inherit; font-weight: 400; padding: 11px 12px; resize: vertical;
}
.req-dialog input:focus, .req-dialog textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.req-dialog .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-msg { margin: 0; color: #e5484d; font-size: .88rem; min-height: 1em; }
.form-msg:empty { display: none; }
.dlg-actions { display: flex; gap: 8px; }
.dlg-actions .btn-primary { flex: 1; }
.btn-ghost { height: 46px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--border); background: transparent; color: var(--text); font-weight: 700; }
.btn-primary:disabled { opacity: .6; }
.my-reqs { border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 8px; max-height: 32vh; overflow-y: auto; }
.my-reqs h4 { margin: 0; font-size: .9rem; }
.my-req { padding: 10px; border-radius: 12px; background: var(--surface); font-size: .88rem; }
.my-req small { color: var(--muted); }
.my-req p { margin: 4px 0 0; }
.my-req .answer { color: var(--text); }
.my-req .answer b { color: var(--accent); }
.my-req .waiting { color: var(--muted); font-style: italic; }

.chatscreen {
  position: fixed; inset: 0; z-index: 24; background: var(--bg-art), var(--bg); background-attachment: fixed;
  transform: translateY(100%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
}
.chatscreen.open { transform: none; visibility: visible; }
.chat-inner {
  height: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px;
  padding: calc(12px + var(--safe-t)) 14px calc(12px + var(--safe-b));
}
:root[data-skin="forro"] .chat-inner { padding-top: calc(36px + var(--safe-t)); }
.chat-online { font-size: .78rem; font-weight: 800; color: var(--accent); min-width: 44px; text-align: right; }
.chat-online::before { content: "● "; }
.online-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: none; }
.online-list:empty { display: none; }
.who { flex: none; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.who.me { border-color: var(--accent); color: var(--accent); }
.chat-log {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border-radius: var(--radius); background: var(--surface); border: var(--card-border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.chat-empty { margin: auto; color: var(--muted); text-align: center; }
.cmsg { align-self: flex-start; max-width: 82%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); }
.cmsg b { display: block; font-size: .76rem; color: var(--accent); margin-bottom: 2px; }
.cmsg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmsg time { display: block; text-align: right; font-size: .66rem; color: var(--muted); margin-top: 2px; }
.cmsg.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--accent); color: var(--accent-text); }
.cmsg.mine time { color: inherit; opacity: .75; }
.cmsg.host { border: 1.5px solid var(--accent); }
.host-tag { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; padding: 1px 5px; border-radius: 5px; background: var(--accent); color: var(--accent-text); margin-left: 4px; }
.cmsg.system { align-self: center; display: flex; align-items: center; gap: 6px; background: transparent; color: var(--muted); font-size: .84rem; padding: 2px 8px; }
.cmsg.system svg { width: 16px; height: 16px; color: var(--accent); }
.cmsg.system b { display: inline; color: var(--text); font-size: inherit; }
.chat-join { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: var(--card-border); }
.chat-join p { margin: 0; color: var(--muted); font-size: .9rem; }
.chat-row { display: flex; gap: 8px; }
.chat-row input, .chat-form input {
  flex: 1; min-width: 0; height: 48px; border: 1px solid var(--border); border-radius: 999px; padding: 0 16px;
  background: var(--surface); color: var(--text); font: inherit;
}
.chat-row .btn-primary { width: auto; padding: 0 20px; border-radius: 999px; }
.chat-form { display: flex; gap: 8px; align-items: center; }

/* Publicidade */
.ad-slot { position: relative; margin: 4px 0 14px; }
.ad-slot a, .ad-slot .ad-box {
  display: block; position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); border: var(--card-border); text-decoration: none; color: inherit;
}
.ad-slot img { display: block; width: 100%; height: auto; }
.ad-top { max-width: 760px; margin-left: auto; margin-right: auto; }
.ad-top img { aspect-ratio: 4 / 1; object-fit: cover; }
.ad-player { margin: 0; }
.ad-player img { aspect-ratio: 6 / 1; object-fit: cover; }
.ad-text { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.ad-text div { flex: 1; min-width: 0; }
.ad-text strong { display: block; }
.ad-text span { color: var(--muted); font-size: .88rem; }
.ad-text .ad-cta { color: var(--accent); font-weight: 800; font-size: .88rem; white-space: nowrap; margin-bottom: 10px; }
.ad-label {
  position: absolute; bottom: 5px; right: 6px; font-size: .56rem; letter-spacing: .05em; text-transform: uppercase;
  background: rgba(0, 0, 0, .5); color: #fff; padding: 1px 5px; border-radius: 5px; pointer-events: none;
}
.ad-slot .fade { animation: fade .5s ease; }
@keyframes fade { from { opacity: 0; } }

.ad-popup { padding: 0; width: min(90vw, 420px); overflow: visible; background: transparent; box-shadow: none; border: 0; }
.ad-popup #adPopupBody > a, .ad-popup #adPopupBody > div { display: block; border-radius: 22px; overflow: hidden; background: var(--surface-2); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.ad-popup img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; }
.ad-popup .ad-text { padding: 22px; flex-direction: column; align-items: flex-start; }
.ad-popup .ad-label { top: 10px; left: 10px; right: auto; bottom: auto; font-size: .62rem; }
.popup-close {
  position: absolute; top: -14px; right: -10px; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
  border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow);
}

/* Sobre e contatos */
.about { margin: 28px 0 0; padding: 20px; text-align: center; border-radius: var(--radius); background: var(--surface); border: var(--card-border); }
.about p { margin: 0 0 14px; color: var(--muted); white-space: pre-line; }
.contacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* Diálogos */
dialog {
  border: 0; border-radius: 22px; padding: 22px; width: min(92vw, 360px);
  background: var(--bg); background-image: linear-gradient(var(--surface-2), var(--surface-2)); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog h3 { margin: 0 0 14px; font-size: 1.1rem; font-family: var(--font-display); text-transform: var(--display-transform); }
.timer-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.timer-options button { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px 0; font-weight: 700; }
#installSteps ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
#installSteps svg { width: 18px; height: 18px; vertical-align: -3px; }
.install-note { color: var(--muted); font-size: .88rem; margin: 14px 0; }
.btn-primary { width: 100%; height: 46px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-text); font-weight: 800; }

.unavailable { grid-column: 1 / -1; display: grid; justify-items: center; gap: 14px; text-align: center; padding: 64px 16px; color: var(--muted); }
.unavailable svg { width: 56px; height: 56px; color: var(--accent); }
.unavailable h2 { margin: 0; font-size: 1.2rem; color: var(--text); max-width: 32ch; }
.unavailable .btn-primary { display: grid; place-items: center; width: auto; padding: 0 22px; text-decoration: none; }

/* Toast */
.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(var(--mini-h) + 24px + var(--safe-b));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: .9rem; font-weight: 600;
  transition: opacity .2s, transform .2s; width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Celulares baixos: player mais compacto para caber tudo sem rolar. */
@media (max-height: 680px) and (orientation: portrait) {
  .player-inner { gap: 8px; padding-bottom: calc(12px + var(--safe-b)); }
  .bars { height: 26px; }
  .play.lg { width: 66px; height: 66px; }
  .meta h2 { font-size: 1.3rem; }
  .player-social a { width: 36px; height: 36px; }
  .ad-player .ad-text { padding: 8px 12px; }
}
@media (max-height: 600px) and (orientation: portrait) {
  .player-social { display: none; }
}
