/* Vidro jateado e fundo liso das abas Futebol, Notícias, Locais e Favoritos (12/11, protótipo aprovado pelo Léo).
   Escuro = :root · Claro = :root[data-app='light'] (core/appearance.js). A aba Rádios e a TV não mudam.
   Uso: class="glass" num cartão. Com o fundo liso não há nada atrás para desfocar, então o vidro NÃO usa
   backdrop-filter (pesaria no celular à toa); o efeito vem do cinza translúcido, do brilho de cima e do granulado. */

:root {
  --g: rgb(205 205 220 / .16); --g2: rgb(215 215 230 / .24); --g-line: rgb(255 255 255 / .16); --g-hi: rgb(255 255 255 / .2);
  --sheen: rgb(255 255 255 / .08); --grain: .07;
  --g-sh: 0 14px 34px -18px rgb(0 0 0 / .7);
  --chip: rgb(255 255 255 / .09); --chip-line: rgb(255 255 255 / .10);
  --btn: #fff; --btn-ink: #141416;
  --faint: #9a9aa5;
  --title: 'Poppins', 'Inter', system-ui, sans-serif;
  --sheet-tint: rgb(22 22 27); --scrim: rgb(0 0 0 / .55);
}
:root[data-app='light'] {
  --g: rgb(250 250 252 / .62); --g2: rgb(255 255 255 / .8); --g-line: rgb(255 255 255 / .85); --g-hi: rgb(255 255 255 / .95);
  --sheen: rgb(255 255 255 / .45); --grain: .05;
  --g-sh: 0 1px 2px rgb(0 0 0 / .05), 0 12px 30px -16px rgb(30 30 60 / .25);
  --chip: rgb(118 118 128 / .09); --chip-line: rgb(0 0 0 / .05);
  --btn: #141416; --btn-ink: #fff;
  --faint: #85858f;
  --sheet-tint: rgb(247 247 250); --scrim: rgb(0 0 0 / .3);
}

/* ---------- fundo liso: preto no Escuro (o mesmo do app), cinza-claro da Apple no Claro ---------- */
:root[data-app='light'] body:is([data-view='football'], [data-view='news'], [data-view='bars'], [data-view='favs']) {
  --bg: #f2f2f7; --bg-rgb: 242 242 247;
  background: var(--bg);
}
:root[data-app='light']:has(> body:is([data-view='football'], [data-view='news'], [data-view='bars'], [data-view='favs'])) { background: #f2f2f7; }

/* ---------- o vidro ---------- */
.glass {
  position: relative; isolation: isolate;
  background-color: var(--g);
  background-image: linear-gradient(180deg, var(--sheen), transparent 55%), linear-gradient(90deg, transparent 8%, var(--g-hi) 50%, transparent 92%);
  background-size: 100% 100%, 100% 1px; background-repeat: no-repeat; background-position: 0 0, 0 0;
  border: 1px solid var(--g-line);
  box-shadow: inset 0 1px 0 var(--g-hi), var(--g-sh);
}
/* granulado bem fino = vidro jateado */
.glass::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  opacity: calc(var(--grain) * 1.4); background: url(../../icons/pecas/granulado.webp) 0 0 / 128px 128px repeat;
}
.glass.no-grain::after { display: none; }

/* botão principal do vidro (branco no Escuro, preto no Claro) e botão secundário de vidro */
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink); font: 600 14.5px/1 var(--ui); border: 0; }
.g-btn2 { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--chip); color: var(--text); font: 600 14px/1 var(--ui); border: 1px solid var(--chip-line); }
.g-btn:active, .g-btn2:active { transform: scale(.97); }

/* ícone 3D (peças em icons/pecas/) com pulinho ao tocar */
.ic3d { display: block; object-fit: contain; filter: drop-shadow(0 4px 8px rgb(0 0 0 / .25)); }
:active > .ic3d { transform: scale(.92) translateY(1px); transition: transform .12s; }
@media (prefers-reduced-motion: reduce) { :active > .ic3d { transform: none; } }

/* ---------- janelas compartilhadas: Onde assistir / Onde ouvir e Pré-jogo (components/where-sheet.js e pregame-sheet.js) ---------- */

/* fundo e cabeçalho das duas janelas */
.ws .sheet-scrim, .pj .sheet-scrim, .pg .sheet-scrim { background: var(--scrim); }
.ws .sheet-panel, .pj .sheet-panel, .pg .sheet-panel { background: var(--sheet-tint); border-color: var(--g-line); }
.pg .sh-body > h2:first-of-type { margin: 2px 0 10px; font: 700 26px/1.1 var(--ui); letter-spacing: -.03em; }
.ws-head { padding: 0 16px 10px; }
.ws-head h3 { margin: 0; font: 600 20px/1.2 var(--title); }
.ws-head small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.ws-body { padding: 4px 16px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.ws-lb, .pj-lb { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ws-hint, .pj-hint { display: flex; gap: 7px; align-items: flex-start; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ws-hint svg, .pj-hint svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.ws-ad { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ws-ad .ax-card { flex: none; width: 100%; min-height: 150px; }

/* linhas de canal e de rádio */
.w-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--chip); border: 1px solid var(--chip-line); }
.w-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; background: #3a3a46; }
.w-ic.k-aberta { background: #18a058; } .w-ic.k-streaming { background: #5a2bd8; } .w-ic.k-fechada { background: #0a4ea1; } .w-ic.k-ppv { background: #c2610a; }
.w-cv { --s: 38px; width: 38px; height: 38px; flex: none; border-radius: 11px; }
.w-tx { flex: 1; min-width: 0; }
.w-tx b { display: block; font-size: 14px; }
.w-tx small { font-size: 12px; color: var(--muted); }
.ws-badge { font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.b-free { background: rgb(22 138 61 / .16); color: var(--win); }
.b-pay { background: rgb(255 179 0 / .2); color: #b07a00; }
:root:not([data-app='light']) .b-pay { color: #ffc547; }
.mini-play { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.mini-play svg { width: 18px; height: 18px; }
.ws-here { margin-top: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }

/* pré-jogo */
.pj-body { padding: 4px 16px calc(24px + var(--safe-b)); }
.pj-in { display: flex; flex-direction: column; gap: 10px; }
.pj-hero { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 170px; padding: 44px 10px 16px; border-radius: 22px; overflow: hidden; color: #fff;
  background: linear-gradient(180deg, rgb(0 0 0 / .05), rgb(0 0 0 / .5)), url(../../icons/pecas/prejogo-estadio.webp) center 35% / cover no-repeat; box-shadow: inset 0 1px 0 rgb(255 255 255 / .18); }
.pj-lg { position: absolute; left: 12px; top: 12px; max-width: 80%; height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .22); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pj-side { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.pj-side img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .45)); }
.pj-nologo { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .2); font: 700 14px var(--ui); }
.pj-side b { font: 600 15px/1.15 var(--title); text-shadow: 0 1px 8px rgb(0 0 0 / .45); }
.pj-side small { font-size: 11.5px; color: rgb(255 255 255 / .8); min-height: 14px; }
.pj-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pj-mid b { font: 800 30px/1 var(--display, var(--ui)); font-variant-numeric: tabular-nums; }
.pj-mid b i { font-style: normal; opacity: .5; margin: 0 2px; }
.pj-mid small { font-size: 12px; color: rgb(255 255 255 / .85); text-align: center; max-width: 110px; }
.pj-count { margin-top: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .22); }
.pj-count.live { background: var(--live); border-color: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mtabs { position: sticky; top: -4px; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 12px; background: var(--sheet-tint); border: 1px solid var(--chip-line); }
.mtabs button { position: relative; display: grid; place-items: center; text-align: center; height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.mtabs button::after { content: ""; position: absolute; inset: -4px 0; } /* área de toque de 44 px (o botão parece ter 36) */
.mtabs button[aria-selected='true'] { background: var(--btn); color: var(--btn-ink); }
.m-pane { display: flex; flex-direction: column; gap: 10px; }
.mblk { border-radius: 18px; padding: 14px; background: var(--chip); border: 1px solid var(--chip-line); display: flex; flex-direction: column; gap: 10px; }
.cmp-hd { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-hd button { display: grid; justify-items: center; gap: 4px; min-height: 44px; padding: 6px; border-radius: 12px; min-width: 0; }
.cmp-hd img { width: 34px; height: 34px; object-fit: contain; }
.cmp-hd b { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 30px; font-variant-numeric: tabular-nums; }
.cmp b { font: 600 15px var(--ui); color: var(--muted); }
.cmp b.best { color: var(--text); font-weight: 800; }
.cmp small { font-size: 12px; color: var(--muted); }
.cmp > :first-child { text-align: left; } .cmp > :last-child { text-align: right; }
.cmp-form { display: flex; justify-content: space-between; }
.form { display: flex; gap: 5px; }
.form i { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--faint); }
.form .V { background: var(--win); } .form .D { background: var(--loss); }
.h2h-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.h2h-bar .a { background: var(--accent); } .h2h-bar .e { background: var(--faint); } .h2h-bar .b { background: var(--text); }
.h2h-n { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.h2h-n b { display: block; font: 800 24px var(--ui); font-variant-numeric: tabular-nums; }
.h2h-n small { font-size: 11.5px; color: var(--muted); }
.l5 { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--chip-line); font-size: 13px; }
.l5-d { flex: none; width: 84px; font-size: 12px; color: var(--muted); }
.l5-d small { display: block; font-size: 11px; color: var(--faint); }
.l5-s { flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; min-width: 0; }
.l5-s > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.l5-s > span:first-child { text-align: right; }
.l5-s > span.w { color: var(--text); font-weight: 700; }
.pj-kv { list-style: none; margin: 0; padding: 0; display: grid; }
.pj-kv li { display: grid; grid-template-columns: 20px 92px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 44px; font-size: 13px; border-top: 1px solid var(--chip-line); }
.pj-kv li:first-child { border-top: 0; }
.pj-kv svg { width: 17px; height: 17px; color: var(--muted); }
.pj-kv span { color: var(--muted); }
.pj-kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Rádios que tocam só ao vivo (proposta aprovada em 21/11): grupo no fim da janela Onde ouvir, com linha e título próprios */
.sa-sep { display: grid; gap: 6px; margin: 12px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.sa-sep.first { margin-top: 0; padding-top: 0; border-top: 0; }
