/* ------------------------------------------------------------------
   Tokens. Cada cor de estado tem um "fill" (fundos, bordas) e um "ink"
   (texto): no tema claro o ink é escuro o bastante para 4,5:1.
------------------------------------------------------------------- */
:root {
  --bg: #0F2029; --panel: #1A333F; --panel-2: #21404D; --panel-3: #14262F;
  --line: #EFE9DA; --dim: #9DB0B8; --hairline: rgba(255,255,255,.07);
  --gold: #D9A441; --gold-ink: #D9A441;
  --prata: #B9C6CC; --prata-ink: #B9C6CC;
  --bronze: #B87A4B; --bronze-ink: #D09A6A;
  --win: #5FA777; --win-ink: #6DBB88;
  --out: #D6604D; --out-ink: #EE8A78;
  --live: #C42B31; --on-live: #FFFFFF;
  --on-gold: #241A05;
  --focus: #F2C265;
  --radius: 10px;
  --tint-win: color-mix(in srgb, var(--win) 22%, transparent);
  --tint-out: color-mix(in srgb, var(--out) 16%, transparent);
  --tint-gold: color-mix(in srgb, var(--gold) 20%, transparent);
  --tint-live: color-mix(in srgb, var(--live) 16%, transparent);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
/* O modo claro/escuro e as paletas vêm de /css/temas.css (config/themes.php); estes valores são o tema Quadra escuro, usado se a folha de temas não carregar. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--line); font: 400 15px/1.5 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; accent-color: var(--gold); caret-color: var(--gold); }
::selection { background: color-mix(in srgb, var(--gold) 40%, transparent); color: inherit; }
a { color: var(--gold-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
p a, .flash a { text-decoration: underline; }   /* links dentro de texto não dependem só da cor */
h1, h2, h3, .display { font-family: 'Oswald', sans-serif; font-weight: 700; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(24px, 6vw, 28px); } h2 { font-size: 19px; } h3 { font-size: 15px; }
.dim { color: var(--dim); } .small { font-size: 13px; } .center { text-align: center; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tnum-fig, .tbl td, .score-pill, .pts, .b-match .s { font-variant-numeric: tabular-nums; }

/* foco visível em tudo que é interativo */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-radius: 8px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: 8px; z-index: 10; font-weight: 700; }
.skip:focus { top: 8px; text-decoration: none; }

.wrap { max-width: 1840px; margin: 0 auto; padding: 24px clamp(16px, 2.4vw, 48px) 64px; }   /* ocupa a tela (até 1840px) com margem proporcional */
.narrow { max-width: 620px; }   /* só formulários e login */
.wrap.bare { max-width: none; margin: 0; padding: 0; }   /* página que desenha suas próprias faixas de largura total (ex.: home) */
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.court-rule { height: 3px; background: repeating-linear-gradient(90deg, var(--gold) 0 18px, transparent 18px 26px); border-radius: 2px; margin: 14px 0 0; opacity: .7; }

/* acesso rápido (programação, telão, mesa): mesma barra em toda página do torneio, sempre no topo do conteúdo */
/* fixa no topo ao rolar (no celular, logo abaixo da barra do menu) */
.quickbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; flex-wrap: wrap; margin: -24px calc(-1 * clamp(16px, 2.4vw, 48px)) 20px; padding: 10px clamp(16px, 2.4vw, 48px); background: var(--bg); border-bottom: 1px solid var(--hairline); }
@media (max-width: 900px) { .quickbar { top: 53px; margin-top: -24px; } }
.quickbar .ext { width: 12px; height: 12px; }

/* topo */
.topbar { background: var(--panel-3); border-bottom: 1px solid var(--hairline); }
.topbar .in { max-width: 1840px; margin: 0 auto; padding: 4px clamp(16px, 2.4vw, 48px); display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.brand { font-family: 'Oswald', sans-serif; font-size: 19px; font-weight: 700; color: var(--line); padding: 8px 0; }
.brand span { color: var(--gold-ink); }
.brand:hover { text-decoration: none; }
.topbar nav { margin-left: auto; display: flex; gap: 4px 6px; align-items: center; font-size: 14px; }
.topbar nav a, .linkbtn { color: var(--dim); background: none; border: none; font: inherit; cursor: pointer; padding: 10px 8px; }
.topbar nav a:hover, .linkbtn:hover { color: var(--line); text-decoration: none; }

/* cartões / formulários */
.card { background: var(--panel); border-radius: var(--radius); padding: 18px; }
.card h2 { margin-bottom: 4px; }
label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--panel-2); color: var(--line); border: 1.5px solid transparent; border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 16px; min-height: 44px;
}
input::placeholder, textarea::placeholder { color: var(--dim); opacity: .85; }
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.field { margin-bottom: 14px; }
.grid2, .grid3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--line); margin: 0; min-height: 44px; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--gold); color: var(--on-gold); font: 700 14.5px 'Inter', sans-serif; border: none; border-radius: 8px; padding: 11px 16px; min-height: 44px; cursor: pointer; text-align: center; text-decoration: none; transition: filter .15s, transform .15s var(--ease-out); }
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--panel-2); color: var(--line); }
.btn.danger { background: transparent; color: var(--out-ink); border: 1px solid var(--out); }
.btn.small { padding: 6px 12px; font-size: 13px; min-height: 36px; }
@media (pointer: coarse) { .btn.small { min-height: 44px; } }

/* avisos: fundo tingido + borda fina, sem barra lateral */
.errors, .flash { border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.errors { background: var(--tint-out); border-color: color-mix(in srgb, var(--out) 45%, transparent); }
.errors::before { content: 'Corrija: '; font-weight: 700; color: var(--out-ink); }
.errors div { display: inline; } .errors div + div::before { content: ' · '; }
.flash { background: var(--tint-win); border-color: color-mix(in srgb, var(--win) 45%, transparent); }
.flash.live { background: var(--tint-live); border-color: color-mix(in srgb, var(--live) 50%, transparent); }

.onboarding-banner, .trial-banner { background: var(--tint-gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.onboarding-banner .row.between, .trial-banner .row.between { align-items: center; }
.onboarding-banner .linkbtn.small, .trial-banner .linkbtn.small { padding: 6px 8px; font-size: 13px; }
.ob-steps { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.ob-steps li { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--panel-2); color: var(--dim); }
.ob-steps li.done { background: var(--tint-win); color: var(--win-ink); }
.ob-steps li.current { background: var(--gold); color: var(--on-gold); }
.ob-steps .ic { width: 13px; height: 13px; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--dim); }
.badge.live { background: var(--live); color: var(--on-live); letter-spacing: .04em; }
.badge.gold { background: var(--tint-gold); color: var(--gold-ink); }
.badge.win { background: var(--tint-win); color: var(--win-ink); }
@media (prefers-reduced-motion: no-preference) {
  .badge.live { animation: pulse 1.8s var(--ease-out) infinite; }
  @keyframes pulse { 50% { opacity: .6; } }
  .tcard { transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out); }
  .tcard:hover { transform: translateY(-2px); }
  .flash, .errors { animation: rise .35s var(--ease-out); }
  @keyframes rise { from { opacity: 0; transform: translateY(-4px); } }
  .b-match.just-changed, .game-row.just-changed { animation: settle .8s var(--ease-out); }
  @keyframes settle { from { box-shadow: 0 0 0 3px var(--gold); } }
}

/* abas */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 18px 0 16px; border-bottom: 1px solid var(--hairline); scrollbar-width: thin; }
.tabs a { padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--dim); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--line); text-decoration: none; }
.tabs a[aria-current=page] { color: var(--gold-ink); border-color: var(--gold); }

/* listas / tabelas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.list li:last-child { border-bottom: none; }
.tnum { font-family: 'Oswald', sans-serif; color: var(--dim); width: 30px; flex-shrink: 0; }
.team-edit { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; align-items: center; }
.team-edit .f-name { flex: 2 1 160px; } .team-edit .f-player { flex: 1 1 130px; } .team-edit .f-seed { flex: 0 0 84px; } .team-edit .f-serie { flex: 0 0 120px; }
.icon-btn { background: none; border: none; color: var(--out-ink); font-size: 22px; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 8px; }
.icon-btn:hover { background: var(--tint-out); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl caption { text-align: left; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--dim); padding: 6px 8px; }
.tbl td { padding: 9px 8px; border-top: 1px solid var(--hairline); vertical-align: middle; }
.tbl .num { text-align: right; }
.tbl tr.q td:first-child { box-shadow: inset 3px 0 0 var(--win); }
.tbl tr.q2 td:first-child { box-shadow: inset 3px 0 0 var(--prata); }
.tbl abbr { text-decoration: none; cursor: help; }
.tscroll { overflow-x: auto; }

/* jogos */
.game-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--hairline); }
.game-row:first-child { border-top: none; }
.game-row .teams { min-width: 0; }
.game-row .vs { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.game-row .w { font-weight: 700; color: var(--win-ink); }
.game-row .l { color: var(--dim); }
.game-row .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.score-pill { font-family: 'Oswald', sans-serif; font-size: 18px; letter-spacing: .02em; }
.round-title { font-family: 'Oswald', sans-serif; color: var(--gold-ink); font-size: 13px; margin: 18px 0 2px; }
@media (max-width: 560px) {
  .game-row { grid-template-columns: 34px 1fr; }
  .game-row .actions { grid-column: 2; justify-content: flex-start; }
}

/* "próximos imediatos": resumo fixo no topo (aba Jogos e Programação) com o que está ao vivo e o que vem a
   seguir, pra não precisar rolar a lista/tabela toda pra achar — clicar rola até a linha real, mais abaixo. */
.pinned-next { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.pin-row { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--panel-2); border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; transition: background .15s; }
.pin-row:hover, .pin-row:focus-visible { background: color-mix(in srgb, var(--gold) 14%, var(--panel-2)); }
.pin-row.is-live { box-shadow: inset 0 0 0 1.5px var(--live); }
.pin-num { font-family: 'Oswald', sans-serif; font-size: 13px; color: var(--dim); flex: none; font-variant-numeric: tabular-nums; }
.pin-vs { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.pin-tag { font-size: 12px; color: var(--dim); flex: none; }
.pin-go { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--dim); flex: none; }
.pin-go .ic { width: 13px; height: 13px; }
@media (max-width: 560px) { .pin-tag { display: none; } }

/* chave */
.tree-wrap { position: relative; height: clamp(480px, 84vh, 1200px); overflow: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: var(--radius); background: var(--panel); padding: 8px 18px 20px; scrollbar-color: var(--dim) transparent; scrollbar-width: thin; }
.tree-wrap:focus-visible { outline-offset: -2px; }
.tree-tools { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin: 0 0 8px; }
.tree-tools .zoom-val { min-width: 64px; font-variant-numeric: tabular-nums; }
.tree-inner { position: relative; width: max-content; color: var(--line); transform-origin: 0 0; user-select: none; }
.flow-link { z-index: 0; }
.jtk-connector path { stroke: var(--dim); opacity: .45; stroke-width: 2; fill: none; }
/* linhas de PERDEDOR (3º lugar e queda da Ouro para a Prata) cruzam por natureza: ficam ocultas e aparecem em destaque ao passar o mouse / focar */
.lose-link { visibility: hidden; }
.flow-link.hot { z-index: 1; visibility: visible; }
.flow-link.hot path { stroke: var(--gold); opacity: 1; stroke-width: 3; }
.lose-link.hot path { stroke-dasharray: 7 5; }
.b-match .r[data-team].hl { background: var(--tint-gold); }
.zones-row { display: flex; align-items: flex-start; gap: 34px; }
.zone.mirror .zone-label { text-align: right; }
.zone-label { font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 600; padding: 14px 4px 8px; }
.zone-gold .zone-label { color: var(--gold-ink); } .zone-silver .zone-label { color: var(--prata-ink); }
/* todas as colunas têm a mesma altura; em cada uma os jogos dividem a altura em fatias iguais e ficam no centro da fatia,
   o que coloca cada jogo exatamente no ponto médio dos dois que o alimentam (linhas de vencedor nunca se cruzam) */
.cols-row { display: flex; align-items: stretch; gap: 26px; }
.col-cell { display: flex; flex-direction: column; align-items: center; width: 184px; flex-shrink: 0; }
.col-head { font-family: 'Oswald', sans-serif; font-size: 10.5px; color: var(--dim); text-align: center; min-height: 14px; margin-bottom: 10px; }
.col-body { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-around; gap: 14px; }
.b-match { position: relative; display: block; width: 184px; height: 54px; background: var(--panel-2); border-radius: 8px; z-index: 2; color: var(--line); }
a.b-match:hover { text-decoration: none; box-shadow: 0 0 0 1.5px var(--dim); }
.b-match .r { display: flex; align-items: center; gap: 6px; height: 50%; padding: 0 8px; font-size: 11.5px; }
.b-match .r:first-of-type { border-radius: 8px 8px 0 0; border-bottom: 1px solid rgba(0,0,0,.18); }
.b-match .r:last-child { border-radius: 0 0 8px 8px; }
.b-match .r .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-match .r .s { font-family: 'Oswald', sans-serif; font-size: 14px; min-width: 16px; text-align: center; padding-left: 6px; border-left: 1px solid var(--hairline); }
.b-match .r .pts { display: flex; gap: 2px; flex: none; }
.b-match .r .pts i { font-style: normal; min-width: 17px; text-align: center; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.b-match .r .pts i.w { color: var(--line); font-weight: 700; }
.b-match .r .pts i.cur { color: var(--live-ink, var(--out-ink)); font-weight: 700; box-shadow: inset 0 -2px 0 var(--live); }
.b-match .r.loser .pts, .b-match .r.loser .s { opacity: 1; }
.b-match .r.pending, .b-match .r.bye { color: var(--dim); font-style: italic; }
.b-match .r.winner { background: var(--tint-win); font-weight: 600; }
.b-match .r.loser .n { color: var(--dim); text-decoration: line-through; }   /* cor (não opacidade): contraste de 4,5:1 */
.b-match.is-gold-final { box-shadow: 0 0 0 2px var(--gold); }
.b-match.is-silver-final { box-shadow: 0 0 0 2px var(--prata); }
.b-match.is-live { box-shadow: 0 0 0 2px var(--live); }
.b-match .num { position: absolute; top: -8px; left: 6px; font-size: 9.5px; background: var(--panel-3); color: var(--dim); border-radius: 4px; padding: 0 4px; }
.scroll-hint { font-size: 12px; color: var(--dim); text-align: center; margin-top: 8px; }

/* pódio */
.podiums { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.podium { flex: 1; min-width: 210px; background: linear-gradient(135deg, color-mix(in srgb, var(--win) 16%, var(--panel)), var(--panel)); border-radius: var(--radius); padding: 16px; }
.podium.silver { background: linear-gradient(135deg, color-mix(in srgb, var(--prata) 16%, var(--panel)), var(--panel)); }
.podium h2, .podium h3 { font-size: 13px; color: var(--win-ink); margin: 0 0 8px; }
.podium.silver h2, .podium.silver h3 { color: var(--prata-ink); }
.podium ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.podium li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.rank { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; font: 700 12px 'Oswald', sans-serif; color: var(--on-gold); background: var(--gold); }
.rank.r2 { background: var(--prata); } .rank.r3 { background: var(--bronze); color: var(--on-gold); }

/* placar ao vivo */
.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side { background: var(--panel); border-radius: var(--radius); padding: 16px 12px; text-align: center; }
.side .tname { font-family: 'Oswald', sans-serif; font-size: 18px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.side .pts { font-family: 'Oswald', sans-serif; font-size: clamp(64px, 22vw, 96px); line-height: 1; margin: 6px 0 12px; }
.side .setw { font-size: 13px; color: var(--dim); margin-bottom: 10px; }
.side .pts { display: block; width: 100%; min-height: clamp(150px, 30vh, 320px); margin: 6px 0 10px; padding: 0; border: 2px solid var(--gold); border-radius: var(--radius); background: color-mix(in srgb, var(--gold) 14%, var(--panel)); color: var(--line); font-size: clamp(88px, 30vw, 170px); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; transition: transform .08s ease-out, background .12s; }
.side .pts:active:not(:disabled) { transform: scale(.97); background: color-mix(in srgb, var(--gold) 30%, var(--panel)); }
.side .pts:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.side .pts:disabled { opacity: .55; cursor: not-allowed; border-color: var(--hairline); background: var(--panel); }
@media (prefers-reduced-motion: reduce) { .side .pts { transition: none; } }
.side .minus { margin-top: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.chip { background: var(--panel-2); border-radius: 6px; padding: 3px 9px; font-size: 13px; font-variant-numeric: tabular-nums; }
.chip.cur { box-shadow: inset 0 0 0 1.5px var(--gold); }
.sets-input { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.sets-input input { text-align: center; }

.hero { text-align: center; padding: 30px 0 10px; }
.tcard { display: block; background: var(--panel); border-radius: var(--radius); padding: 16px; color: var(--line); }
.tcard:hover { text-decoration: none; box-shadow: 0 0 0 1.5px var(--gold); }
.tgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }

/* ---------- quadro: tela cheia, grupos e editor de placar ---------- */
.board-shell { position: relative; }
.board-shell.is-max { position: fixed; inset: 0; z-index: 1000; background: var(--bg); padding: 12px 16px 8px; overflow: hidden; display: flex; flex-direction: column; }
.board-shell.is-max [data-swap=board] { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.board-shell.is-max .tree-wrap { height: auto; flex: 1; min-height: 0; }
.board-shell:fullscreen { background: var(--bg); }
html.has-max, html.has-max body { overflow: hidden; }
.tree-tools .grow { flex: 1; }
.tree-tools { justify-content: flex-start; }

.groups-grid { display: grid; gap: 24px; align-items: start; }
.group-card { background: var(--panel-2); border-radius: var(--radius); padding: 12px 10px 14px; }
.group-card h2, .group-card h3 { font-size: 15px; margin: 0 0 8px; color: var(--gold-ink); }
.group-games { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.group-card .b-match { background: var(--panel); }
.mini-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-tbl th, .mini-tbl td { padding: 4px 3px; text-align: left; font-weight: 400; border-top: 1px solid var(--hairline); }
.mini-tbl thead th { color: var(--dim); font-size: 10.5px; border-top: 0; font-weight: 600; }
.mini-tbl tbody th { font-weight: 600; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-tbl tr.q td:first-child { box-shadow: inset 3px 0 0 var(--win); }
.mini-tbl tr.q2 td:first-child { box-shadow: inset 3px 0 0 var(--prata); }

.b-match .r .s.edit-hint { border-left: 0; opacity: 0; font-size: 12px; color: var(--dim); transition: opacity .15s; }
a.b-match:hover .edit-hint, a.b-match:focus-visible .edit-hint { opacity: 1; }
a.b-match[data-edit] { cursor: pointer; }

.score-pop { position: fixed; z-index: 1100; width: max-content; max-width: min(94vw, 420px); background: var(--panel); color: var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 1px var(--hairline); }
.score-form h3 { font-size: 15px; margin: 0 0 10px; }
.sf-grid { display: grid; gap: 6px 8px; align-items: center; margin-bottom: 10px; }
.sf-h { font-size: 11px; color: var(--dim); text-align: center; }
.sf-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-grid input { text-align: center; min-height: 40px; padding: 6px 4px; font-size: 16px; }
.sf-err { background: var(--tint-out); border-radius: 6px; padding: 6px 10px; font-size: 13px; color: var(--out-ink); margin: 0 0 10px; }
.score-form .row { gap: 8px; }

/* ---------- aba Jogos: linha tocável + modal de horário e quadra ---------- */
.game-row.is-tappable { cursor: pointer; border-radius: 8px; transition: background .15s; }
.game-row.is-tappable:hover { background: color-mix(in srgb, var(--gold) 8%, transparent); }
.game-row .teams[data-open-info]:focus-visible { outline-offset: 4px; }
.hint-set { font-style: italic; }
.info-modal { border: 0; border-radius: var(--radius); padding: 20px; width: min(92vw, 380px); background: var(--panel); color: var(--line); box-shadow: 0 16px 48px rgba(0,0,0,.45); }
.info-modal::backdrop { background: rgba(6, 14, 18, .62); }
.info-form h2 { font-size: 20px; }
.info-form .row { gap: 8px; }

/* ---------- mural da torcida (painel) ---------- */
.qr-box { flex: none; width: 150px; height: 150px; border-radius: 10px; overflow: hidden; background: #fff; }
.qr-box svg { display: block; width: 100%; height: 100%; }
.msg-list li { gap: 10px; align-items: center; }
.msg-body { font-size: 15px; overflow-wrap: anywhere; }

/* ---------- reordenar jogos (arrastar ou setas) ---------- */
.reorder { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; counter-reset: none; }
.ro { display: grid; grid-template-columns: 44px 52px 1fr auto; gap: 8px; align-items: center; background: var(--panel); border-radius: 10px; padding: 6px 10px 6px 4px; }
.ro.dragging { position: fixed; z-index: 1200; box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 0 1.5px var(--gold); cursor: grabbing; margin: 0; }
.ro.ro-ph { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hairline); }
.ro.ro-ph > * { visibility: hidden; }
.ro.just-moved { animation: settle-row .7s var(--ease-out); }
@keyframes settle-row { from { background: var(--tint-gold); } }
.ro-handle { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 8px; cursor: grab; touch-action: none; color: var(--dim); }
.ro-handle:hover { background: var(--panel-2); color: var(--line); }
.grip { width: 14px; height: 20px; background-image: radial-gradient(circle, currentColor 1.6px, transparent 2px); background-size: 7px 7px; background-repeat: repeat; }
.ro-n { font-family: 'Oswald', sans-serif; color: var(--dim); text-align: center; font-variant-numeric: tabular-nums; }
.ro-body { min-width: 0; display: flex; flex-direction: column; }
.ro-tag { font-size: 12px; color: var(--dim); }
.ro-vs { font-weight: 600; overflow-wrap: anywhere; }
.ro-vs em { font-style: normal; color: var(--dim); font-weight: 400; margin: 0 4px; }
.ro-meta { font-size: 12px; color: var(--dim); }
.ro-btns { display: flex; gap: 4px; }
.ro-btns .btn { min-width: 44px; padding: 6px 8px; font-size: 16px; }
.ro-btns .btn:disabled { opacity: .3; }
.ro-msg { min-height: 1.5em; margin: 8px 0 0; font-size: 14px; }
.ro-msg.err { color: var(--out-ink); }
.ro-msg.ok { color: var(--win-ink); }
@media (max-width: 560px) { .ro { grid-template-columns: 44px 1fr auto; } .ro-n { display: none; } }

/* ---------- reordenar a Programação (arrastar linhas da tabela) ---------- */
.sched-tbl .sr-handle { width: 32px; height: 32px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 8px; cursor: grab; touch-action: none; color: var(--dim); }
.sched-tbl .sr-handle:hover { background: var(--panel-2); color: var(--line); }
.sched-tbl tr.dragging { position: fixed; z-index: 1200; background: var(--panel); box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 0 1.5px var(--gold); cursor: grabbing; }
.sched-tbl tr.sr-ph td { box-shadow: inset 0 0 0 1.5px var(--hairline); padding: 0; }
.sched-tbl tr.just-moved { animation: settle-row .7s var(--ease-out); }
.sched-tbl tr.is-tappable { cursor: pointer; }
.sched-tbl tr.is-tappable:hover { background: color-mix(in srgb, var(--gold) 8%, transparent); }
.sched-tbl tr.is-tappable td a, .sched-tbl tr.is-tappable td [data-open-info] { color: inherit; text-decoration: none; }
.sched-tbl tr.is-tappable td [data-open-info]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr-msg { min-height: 1.5em; margin: 8px 0 0; font-size: 14px; }
.sr-msg.err { color: var(--out-ink); }
.sr-msg.ok { color: var(--win-ink); }

/* ---------- patrocinadores (painel) ---------- */
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sp-item { display: flex; gap: 14px; align-items: center; background: var(--panel); border-radius: 10px; padding: 10px 14px; flex-wrap: wrap; }
.sp-item.is-off { opacity: .6; }
.sp-thumb { flex: none; width: 96px; height: 56px; background: #fff; border-radius: 8px; display: grid; place-items: center; overflow: hidden; padding: 6px; }
.sp-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sp-noimg { font-family: 'Oswald', sans-serif; font-weight: 700; color: #4b5a61; font-size: 20px; }

/* ---------- exclusão de times em massa ---------- */
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0 6px; border-bottom: 1px solid var(--hairline); }
.bulk-bar .check { min-height: 40px; }
.pick { width: 22px; height: 22px; min-height: 0; flex: none; }

/* barra de salvar da lista de times: um único botão para tudo */
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 10px -18px -18px; padding: 12px 18px; background: var(--panel); border-top: 1px solid var(--hairline); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- painel do organizador: sidebar ---------- */
.shell { display: grid; grid-template-columns: 284px minmax(0, 1fr); min-height: 100vh; }
.shell > .wrap { width: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 14px 12px 12px; background: var(--panel-3); border-right: 1px solid var(--hairline); scrollbar-width: thin; }
/* tema claro: a sidebar usa a cor de destaque do tema como fundo (não o fundo neutro do painel);
   redeclarar os tokens herdados aqui basta — todo o CSS abaixo (.nav-link, .sb-*) já lê essas variáveis */
html[data-mode="claro"] .sidebar {
  background: var(--gold);
  --line: var(--on-gold);
  --dim: color-mix(in srgb, var(--on-gold) 75%, var(--gold));
  --panel-2: color-mix(in srgb, var(--on-gold) 12%, var(--gold));
  --hairline: color-mix(in srgb, var(--on-gold) 25%, transparent);
  --tint-gold: color-mix(in srgb, var(--on-gold) 20%, transparent);
  --gold-ink: var(--on-gold);
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 6px; }
.sb-head .brand { padding: 6px 0; }
.sb-collapse { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); font-size: 22px; line-height: 1; cursor: pointer; }
.sb-collapse:hover { background: var(--panel-2); color: var(--line); }
.sb-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; }
.sb-label { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.sb-note { margin: 2px 10px 6px; font-size: 13px; color: var(--dim); }
.nav-link { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 10px; border-radius: 8px; color: var(--dim); font-size: 14.5px; text-decoration: none; overflow-wrap: anywhere; }
.nav-link:hover { background: var(--panel-2); color: var(--line); text-decoration: none; }
.nav-link.on { background: var(--tint-gold); color: var(--gold-ink); font-weight: 600; }
.nav-link.sub { padding-left: 22px; }
.nav-link.tour { color: var(--line); }
.nav-link .ext { font-size: 13px; opacity: .7; }
.nav-link .badge { flex: none; }
.sb-tour { margin: 6px 0 8px; padding: 8px 4px 8px; border-radius: 10px; background: color-mix(in srgb, var(--panel-2) 55%, transparent); display: flex; flex-direction: column; gap: 2px; }
.sb-tour-name { margin: 0; padding: 2px 10px 4px; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 17px; color: var(--line); overflow-wrap: anywhere; }
.sb-tour .sb-label { margin-top: 12px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.dot.running { background: var(--gold); } .dot.finished { background: var(--win); }
.sb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 12px 8px 0; border-top: 1px solid var(--hairline); }
.sb-user { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--dim); }
.sb-foot .linkbtn { padding: 10px 8px; flex: none; }

.mobilebar { display: none; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px; padding: 4px 12px; background: var(--panel-3); border-bottom: 1px solid var(--hairline); }
.menu-btn { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--panel-2); color: var(--line); font: 600 14px 'Inter', sans-serif; cursor: pointer; }
.scrim { position: fixed; inset: 0; z-index: 39; background: rgba(6, 14, 18, .6); }

/* celular / janela estreita: o menu vira uma gaveta por cima do conteúdo */
@media (max-width: 900px) {
  .shell { display: block; }
  .mobilebar { display: flex; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .25s var(--ease-out); box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .shell.nav-open .sidebar { transform: none; }
  .sb-collapse { display: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ---------- telas grandes: aproveita o espaço ---------- */
@media (min-width: 1600px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: 312px minmax(0, 1fr); }
}
/* tabelas de classificação não esticam até ficar ilegíveis em monitores largos */
.card > .tscroll > .tbl { max-width: 1200px; }

/* ---------- ícones ---------- */
.ic { width: 20px; height: 20px; flex: none; }
.btn .ic { width: 16px; height: 16px; }
.btn { gap: 8px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; }
.tabs .ic { width: 18px; height: 18px; opacity: .85; }
.meta-ic { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; vertical-align: middle; }
.meta-ic .ic { width: 15px; height: 15px; opacity: .8; }
.flash { display: flex; gap: 10px; align-items: flex-start; }
.flash .fl-ic { color: var(--win-ink); margin-top: 1px; }
.i-min { display: none; }
[data-zoom="full"].is-on .i-max { display: none; }
[data-zoom="full"].is-on .i-min { display: inline; }

/* ---------- sidebar com ícones + trilho recolhido ---------- */
.nav-link { position: relative; }
.nav-link .ic { opacity: .9; }
.nav-link .lbl { flex: 1; min-width: 0; }
.nav-link.on .ic { opacity: 1; }
.nav-link.out { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.nav-link .ext { width: 14px; height: 14px; opacity: .6; }
.sb-tour-name { display: flex; align-items: center; gap: 8px; }
.sb-tour-name .ic { color: var(--gold-ink); }
.sb-user { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--dim); }
.sb-user .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-foot { flex-direction: column; align-items: stretch; gap: 2px; }
.brand-mini, .i-rail { display: none; }
.sb-collapse { display: grid; place-items: center; }
.cat-ini { width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--panel-2); color: var(--line); font: 700 12px 'Oswald', sans-serif; letter-spacing: .02em; box-shadow: inset 0 0 0 2px var(--dim); }
.cat-ini.running { box-shadow: inset 0 0 0 2px var(--gold); }
.cat-ini.finished { box-shadow: inset 0 0 0 2px var(--win); }
.rail-tip { position: fixed; z-index: 90; transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; background: var(--panel-2); color: var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.4), 0 0 0 1px var(--hairline); pointer-events: none; }

@media (min-width: 901px) {
  html.nav-collapsed .shell { grid-template-columns: 76px minmax(0, 1fr); }
  html.nav-collapsed .sidebar { padding: 12px 8px; }
  html.nav-collapsed .sb-head { flex-direction: column; gap: 4px; padding: 0 0 6px; }
  html.nav-collapsed .brand-full { display: none; }
  html.nav-collapsed .brand-mini { display: grid; place-items: center; width: 48px; height: 40px; font: 700 20px 'Oswald', sans-serif; color: var(--gold-ink); }
  html.nav-collapsed .sb-collapse { width: 48px; height: 44px; }
  html.nav-collapsed .sb-collapse .i-open { display: none; }
  html.nav-collapsed .sb-collapse .i-rail { display: block; }
  html.nav-collapsed .i-open { display: none !important; }
  html.nav-collapsed .cat-ini.i-rail { display: grid; }
  /* rótulos: fora da vista, mas ainda lidos por leitores de tela */
  html.nav-collapsed .lbl, html.nav-collapsed .sb-label span, html.nav-collapsed .sb-tour-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html.nav-collapsed .sb-label { height: 1px; margin: 10px 12px; padding: 0; background: var(--hairline); overflow: hidden; }
  html.nav-collapsed .sb-nav { align-items: stretch; }
  html.nav-collapsed .nav-link, html.nav-collapsed .nav-link.sub { justify-content: center; width: 100%; min-height: 44px; padding: 0; }
  html.nav-collapsed .nav-link .badge { position: absolute; top: 2px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10px; line-height: 17px; text-align: center; }
  html.nav-collapsed .nav-link .badge:not([aria-label]) { display: none; }   /* "desligado" não cabe no trilho */
  html.nav-collapsed .sb-tour { padding: 4px 0; margin: 4px 0; }
  html.nav-collapsed .sb-foot { align-items: center; padding-top: 10px; }
  html.nav-collapsed .sb-user { justify-content: center; padding: 10px; }
  html.nav-collapsed .sb-foot form { width: 100%; }
}

.badge-ic { display: inline-flex; align-items: center; gap: 5px; }
.badge-ic .ic { width: 12px; height: 12px; }

/* =====================================================================
   Animações. Tudo dentro de prefers-reduced-motion: no-preference:
   quem pede menos movimento no sistema recebe as telas sem animação.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* ---- transição entre telas: View Transitions entre páginas (Chrome/Edge/Safari novos) ---- */
  @view-transition { navigation: auto; }
  .sidebar { view-transition-name: sidebar; }   /* o menu fica no lugar; só o conteúdo troca */
  ::view-transition-group(root) { animation-duration: .3s; }
  ::view-transition-old(root) { animation: vt-out .16s ease-in both; }
  ::view-transition-new(root) { animation: vt-in .32s var(--ease-out) both; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
  /* navegadores sem View Transitions: entrada suave do conteúdo */
  @supports not (view-transition-name: none) {
    main.wrap { animation: vt-in .32s var(--ease-out) both; }
  }

  /* ---- modais (<dialog>): entram e saem com fade + subida; o fundo escurece aos poucos ---- */
  dialog.info-modal {
    opacity: 0; transform: translateY(16px) scale(.97);
    transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), overlay .22s allow-discrete, display .22s allow-discrete;
  }
  dialog.info-modal[open] { opacity: 1; transform: none; }
  @starting-style { dialog.info-modal[open] { opacity: 0; transform: translateY(16px) scale(.97); } }
  dialog.info-modal::backdrop { background-color: rgba(6, 14, 18, 0); transition: background-color .22s, overlay .22s allow-discrete, display .22s allow-discrete; }
  dialog.info-modal[open]::backdrop { background-color: rgba(6, 14, 18, .62); }
  @starting-style { dialog.info-modal[open]::backdrop { background-color: rgba(6, 14, 18, 0); } }

  /* ---- editor de placar da chave e dicas ---- */
  .score-pop:not([hidden]) { animation: pop-in .18s var(--ease-out); }
  @keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
  .rail-tip:not([hidden]) { animation: fade-in .14s ease-out; }
  @keyframes fade-in { from { opacity: 0; } }

  /* ---- menu lateral: recolher/expandir e gaveta do celular ---- */
  .shell { transition: grid-template-columns .26s var(--ease-out); }
  .scrim:not([hidden]) { animation: fade-in .22s ease-out; }
  .nav-link, .tabs a, .linkbtn, .sb-collapse, .menu-btn { transition: background-color .15s, color .15s, border-color .2s; }
  input, select, textarea { transition: border-color .15s, background-color .15s; }

  /* ---- listas: cartões entram em sequência ---- */
  .tgrid > *, .sp-list > li, .podium { animation: rise-in .42s var(--ease-out) both; }
  .tgrid > :nth-child(2), .sp-list > li:nth-child(2) { animation-delay: .05s; }
  .tgrid > :nth-child(3), .sp-list > li:nth-child(3) { animation-delay: .10s; }
  .tgrid > :nth-child(4), .sp-list > li:nth-child(4) { animation-delay: .15s; }
  .tgrid > :nth-child(5), .sp-list > li:nth-child(5) { animation-delay: .20s; }
  .tgrid > :nth-child(n+6), .sp-list > li:nth-child(n+6) { animation-delay: .25s; }
  @keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
}

/* links dentro de avisos: área de toque maior sem mudar o visual */
.flash a { display: inline-block; padding: 12px 6px; margin: -12px 0; }

/* impressão: só o conteúdo (programação, súmulas), sem menus nem botões */
@media print {
  #sidebar, .sidebar, .mobilebar, .topbar, .tabs, .no-print, .flash, .skip, .scrim { display: none !important; }
  .shell { display: block !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .wrap, main { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .card { border: 0 !important; padding: 0 !important; }
  .tbl td, .tbl th { padding: 4px 6px; color: #000; }
  .tbl tr { break-inside: avoid; }
  .tbl thead { display: table-header-group; }
  .game-row, .round-title { break-inside: avoid; }
  .dim, .small { color: #333 !important; }

  /* fontes menores no papel: cabe mais por folha */
  @page { margin: 10mm; }
  body { font-size: 11px; line-height: 1.35; }
  h1 { font-size: 18px; } h2 { font-size: 14px; } h3 { font-size: 12px; }
  .small { font-size: 10px !important; }
  table.tbl { font-size: 11px; }
  .tbl th { font-size: 10px; padding: 3px 6px; }
  .tbl td { padding: 3px 6px; }
  .game-row { padding: 4px 0; gap: 4px 8px; grid-template-columns: 34px 1fr auto; }
  .tnum { width: 26px; }
  .round-title { font-size: 11px; margin: 10px 0 2px; }
  .badge, .score-pill { font-size: 10px !important; padding: 1px 6px !important; }
  .sched-tbl { font-size: 11px; }
}

.mesa-row { color: inherit; text-decoration: none; }
.mesa-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* números do torneio */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.kpi { background: var(--panel-2, var(--panel)); border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 14px; }
.kpi dt { font-size: 12px; color: var(--dim); margin: 0; }
.kpi dd { margin: 4px 0 0; font-family: 'Oswald', sans-serif; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* placar ao vivo: novo set, pedido de tempo e cartões */
.setline { margin: 14px 0 0; font-weight: 600; }
.setline.done { color: var(--win-ink); }
.newset { font-size: 20px; padding: 18px 28px; }
.side-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; align-items: stretch; }
.to-count { font-variant-numeric: tabular-nums; margin-left: 4px; opacity: .8; }
.tmo { margin-top: 16px; border: 2px solid var(--gold); border-radius: var(--radius); background: var(--tint-live); padding: 14px; text-align: center; }
.tmo.low { border-color: var(--live); }
.tmo-head { font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tmo-clock { font-family: 'Oswald', sans-serif; font-size: clamp(56px, 18vw, 96px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.tmo.low .tmo-clock { color: var(--out-ink); }
.cards-box { text-align: left; }
.cards-box > summary { list-style: none; cursor: pointer; width: 100%; justify-content: center; }
.cards-box > summary::-webkit-details-marker { display: none; }
.cards-form { border: 0; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cards-form legend { padding: 0; margin-bottom: 4px; }
.card-btns { display: grid; gap: 6px; margin-top: 6px; }
.cbtn { display: flex; align-items: center; gap: 8px; text-align: left; padding: 12px; min-height: 44px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--panel-2, transparent); color: inherit; font: inherit; cursor: pointer; }
.cbtn small { margin-left: auto; color: var(--dim); font-size: 12px; }
.cbtn:disabled { opacity: .5; cursor: not-allowed; }
.cardface { display: inline-block; width: 14px; height: 20px; border-radius: 2px; flex: none; }
.cardface.y { background: #F2C500; }
.cardface.r { background: #D3252B; }
.cardface.yr { background: linear-gradient(115deg, #F2C500 50%, #D3252B 50%); }
.cardface.yr.sep { background: linear-gradient(90deg, #F2C500 0 42%, transparent 42% 58%, #D3252B 58%); }
.card-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.card-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
@media (prefers-reduced-motion: no-preference) { .tmo:not([hidden]) { animation: pop-in .25s var(--ease-out, ease-out); } }

/* cartões ao lado do nome de quem recebeu */
.tn-cards { font-size: .85em; color: var(--dim); }
.n .cardface, .vs .cardface, .res-name .cardface, .rg-t .cardface, .nx-vs .cardface, .tname .cardface { width: 8px; height: 12px; vertical-align: -1px; margin-left: 3px; }

.mem-list { display: grid; gap: 4px; }

.card-list li .grow { flex: 1; }
.tname .tn-cards { font-size: 12px; color: var(--dim); }
.tname .cardface { width: 10px; height: 15px; }

.sets-input.to-row { margin-top: -2px; }
.sets-input.to-row input { padding: 6px; font-size: 13px; }

/* formulários do painel: usam a largura da tela, em seções lado a lado */
.form-page { max-width: 1500px; }
.form-mid { max-width: 1000px; }
.form-sections { display: grid; gap: 24px 36px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .form-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .form-sections:not(.two) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fsec > h2 { font-size: 16px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline); color: var(--gold-ink); }
.fsec details > summary { font-size: 16px; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--hairline); color: var(--gold-ink); cursor: pointer; }
.fsec details[open] > summary { margin-bottom: 14px; }
.grid1 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.form-page form.card > .btn.block { margin-top: 22px; }
.sumula-grid { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .sumula-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }

.tools-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tools-grid > .card { margin-top: 0; }

/* locais e quadras: uma coluna por local, rolando na horizontal quando não couberem todas */
.court-cols { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; align-items: flex-start; }
.court-col { flex: 0 0 220px; background: var(--panel); border-radius: var(--radius); padding: 14px; }
.court-col h2 { font-size: 15px; margin: 0; }
.court-col-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.court-col-new { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hairline); }
.court-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.court-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--panel-2); border-radius: 8px; padding: 6px 6px 6px 10px; font-size: 14px; }
.court-item form { display: contents; }
.court-add { display: flex; gap: 6px; }
.court-add input { flex: 1; min-width: 0; }

/* seletor de tema */
.theme-pick { position: relative; }
.theme-pick > summary { list-style: none; cursor: pointer; }
.theme-pick > summary::-webkit-details-marker { display: none; }
.theme-list { display: grid; gap: 2px; padding: 8px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); min-width: 250px; z-index: 60; }
.sb-foot .theme-list { position: absolute; bottom: calc(100% + 6px); left: 0; }
.topbar .theme-list { position: absolute; right: 0; top: calc(100% + 6px); }
.theme-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--line); font-size: 14px; }
.theme-opt:hover { background: var(--panel-2); }
.theme-opt:has(input:checked) { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--gold); }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt small { color: var(--dim); }
.chips-swatch { display: inline-flex; flex: none; border-radius: 6px; overflow: hidden; border: 1px solid var(--hairline); }
.chips-swatch i { width: 14px; height: 22px; display: block; }
.topbar .theme-pick > summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; color: inherit; }

.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 8px; background: var(--panel-3); border-radius: 10px; }
.mode-opt { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--dim); }
.mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mode-opt:has(input:checked) { background: var(--gold); color: var(--on-gold); }
.mode-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.theme-list { min-width: 260px; }

.game-row a.teams { color: inherit; text-decoration: none; }
.game-row a.teams:hover { text-decoration: none; }
.game-row a.teams:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }

/* voltar ao topo: aparece no canto ao rolar a página */
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--hairline); border-radius: 50%; background: var(--panel-2); color: var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.4); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s var(--ease-out), visibility .2s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--panel); border-color: var(--gold); }
.to-top .ic { width: 22px; height: 22px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
@media print { .to-top { display: none !important; } }

/* painel do torneio: 4 passos (times, chaves, jogos, programação) + iniciar */
.flow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); margin-top: 12px; }
.flow-card { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); padding: 16px; }
.flow-card.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.flow-card.todo { opacity: .86; }
.flow-head { display: flex; align-items: center; gap: 10px; }
.flow-head h2 { margin: 0; font-size: 20px; }
.flow-head .badge { margin-left: auto; }
.flow-n { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--dim); font: 700 15px 'Oswald', sans-serif; }
.flow-n .ic { width: 18px; height: 18px; }
.flow-card.done .flow-n { background: var(--tint-win); color: var(--win-ink); }
.flow-card.current .flow-n { background: var(--gold); color: var(--on-gold); }
.flow-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.flow-rows li { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.flow-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.btn.xl { font-size: 19px; min-height: 62px; padding: 16px 28px; border-radius: 12px; gap: 10px; }
.btn.xl .ic { width: 22px; height: 22px; }
.flow-start { margin-top: 16px; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px dashed var(--hairline); }
.flow-start.ready { border: 1px solid var(--win); background: var(--tint-win); }
.flow-live { margin-top: 18px; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--gold); }
.flow-live .progress { height: 8px; margin-top: 10px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.flow-live .progress i { display: block; height: 100%; background: var(--win); border-radius: 99px; }
@media print { .flow-start, .flow-live .flow-actions { display: none !important; } }

/* patrocinadores na página pública */
.sponsors-pub { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--hairline); text-align: center; }
.sponsors-pub h2 { font-size: 18px; margin-bottom: 14px; }
.sp-tier-block + .sp-tier-block { margin-top: 18px; }
.sp-tier-label { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.sp-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.sp-grid li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sp-card { display: grid; place-items: center; background: #fff; color: #17303C; border-radius: 12px; padding: 10px 16px; width: 150px; height: 76px; }
a.sp-card:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--gold); }
.sp-card img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sp-nm { font: 700 15px 'Oswald', sans-serif; line-height: 1.1; }
.sp-tag { margin: 0; font-size: 12.5px; color: var(--dim); max-width: 24ch; }
.t-master .sp-card { width: min(300px, 80vw); height: 130px; padding: 14px 22px; }
.t-master .sp-nm { font-size: 24px; }
.t-gold .sp-card { width: 200px; height: 96px; }
.t-support .sp-card { width: 120px; height: 60px; padding: 8px 12px; }
.t-support .sp-nm { font-size: 13px; }

/* fase de grupos no corpo da página (fora do quadro da chave) */
.groups-body { margin: 0 0 28px; }
.groups-body h2 { font-size: 19px; }
.groups-body-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; align-items: start; margin-top: 12px; }
.grp-games { margin-top: 10px; border-top: 1px solid var(--hairline); padding-top: 8px; }
.grp-games > summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
.grp-games > summary::-webkit-details-marker { display: none; }
.grp-games > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(-45deg); transition: transform .15s; }
.grp-games[open] > summary::before { transform: rotate(45deg); }
.gg-round { font: 600 11px 'Oswald', sans-serif; color: var(--gold-ink); letter-spacing: .04em; margin: 10px 0 4px; text-transform: uppercase; }
.gg-list { list-style: none; margin: 0; padding: 0; }
.gg-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; padding: 6px 0; border-top: 1px solid var(--hairline); font-size: 13px; }
.gg-row:first-child { border-top: 0; }
.gg-row.is-live { box-shadow: inset 3px 0 0 var(--live); padding-left: 8px; }
.gg-n { font-family: 'Oswald', sans-serif; color: var(--dim); min-width: 28px; }
.gg-teams { flex: 1 1 10ch; min-width: 0; }
.gg-teams em { font-style: normal; color: var(--dim); }
.gg-teams .w { font-weight: 700; color: var(--win-ink); }
.gg-meta { flex-basis: 100%; padding-left: 36px; }
.gg-go { margin-left: auto; }
.gt-ic { transition: transform .15s; }
[data-groups-toggle][aria-expanded=true] .gt-ic { transform: rotate(180deg); }

/* formulários de configuração: ajuda curta, campos dependentes, barra de ações, zona de perigo, erros */
.stack-top { margin-top: 18px; }
.help { margin: 4px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--dim); max-width: 62ch; }
.fsec-sum { margin: -6px 0 14px; font-size: 12.5px; color: var(--dim); }
.subfield { margin-left: 26px; padding-left: 14px; border-left: 1px solid var(--hairline); }
.rare { margin-top: 6px; }
.rare > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--dim); padding: 6px 0; }
.rare[open] > summary { margin-bottom: 8px; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--out); box-shadow: 0 0 0 1px var(--out); }
.error-summary strong { display: block; margin-bottom: 4px; }
.error-summary ul { margin: 0; padding-left: 18px; }
.error-summary a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.danger-zone { margin-top: 36px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--out) 45%, transparent); border-radius: var(--radius); }
.danger-zone h2 { font-size: 15px; color: var(--out-ink); margin: 0 0 6px; }
.dz-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--hairline); }
.dz-row:first-of-type { border-top: 0; }
.dz-row .help { margin-top: 2px; }
@media (max-width: 600px) { .form-actions .btn, .dz-row .btn { width: 100%; } .form-actions { flex-direction: column-reverse; align-items: stretch; } }
.ta-sm { min-height: 70px; } .ta-lg { min-height: 160px; }

.sched-form { margin-top: 12px; }
.fgroup { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.fgroup > legend { font: 700 14px 'Oswald', sans-serif; letter-spacing: .02em; color: var(--gold-ink); padding: 0 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--hairline); width: 100%; }
.grid4 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.replace-box { padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--gold) 8%, transparent); }
.sched-estimate { margin: 0 0 6px; font-size: 14px; font-weight: 600; min-height: 1.4em; }
.warn { color: var(--gold-ink); }
.reg-card { margin-top: 12px; padding: 4px 16px; overflow-x: auto; }
.reg-actions { gap: 6px; flex-wrap: wrap; }
.reg-actions form, .reg-note { margin: 0; }
.reg-note { display: flex; gap: 6px; margin-top: 6px; }
.reg-note input { min-width: 12rem; }
/* tabela que vira lista de cartões no celular: cada célula ganha seu rótulo */
@media (max-width: 700px) {
  .tbl-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
  .tbl-stack tr { padding: 12px 0; border-top: 1px solid var(--hairline); }
  .tbl-stack tr:first-child { border-top: 0; }
  .tbl-stack td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; }
  .tbl-stack td::before { content: attr(data-label); color: var(--dim); font-size: 12px; font-weight: 600; }
  .reg-note input { min-width: 0; flex: 1; }
}

.mt-0{margin-top:0}.mt-10{margin-top:10px}.mt-16{margin-top:16px}.mt-20{margin-top:20px}.mb-8{margin-bottom:8px}.mb-10{margin-bottom:10px}

.court-col-narrow { max-width: 340px; }
.copy-from { margin-bottom: 20px; padding: 12px 14px; border-radius: 8px; background: var(--panel-2); max-width: 520px; }

/* seções da Programação com respiro uniforme */
.page-stack { margin-top: 18px; }
.page-stack > * { margin-top: 0; }
.page-stack > * + * { margin-top: 28px; }
.page-stack > [data-pinned-wrap]:not(:has(.pinned-next)) { display: none; }
.page-stack > [data-pinned-wrap] .pinned-next { margin-bottom: 0; }
.sched-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 12px; }
.sched-toolbar h2 { font-size: 19px; margin-bottom: 2px; }
.sched-adjust { margin: 0; text-align: right; }
.sched-adjust .help { max-width: 30ch; margin-left: auto; }
.sched-card { margin-top: 0; padding: 4px 16px; }

/* gaveta deslizante (mesa de arbitragem e súmula) */
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw; padding: 0; border: 0; background: var(--bg); color: var(--line); box-shadow: -14px 0 40px rgba(0, 0, 0, .45); transform: translateX(100%); transition: transform .24s var(--ease-out); }
.drawer.in { transform: none; }
.drawer::backdrop { background: rgba(6, 14, 18, .55); opacity: 0; transition: opacity .24s; }
.drawer.in::backdrop { opacity: 1; }
.drawer-in { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); background: var(--bg); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 32px; overscroll-behavior: contain; }
.drawer .sumula-grid { grid-template-columns: 1fr; gap: 0; }
.drawer .cards-side { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer::backdrop { transition: none; } }
@media print { .drawer { display: none !important; } }

/* jogo em andamento na tabela da Programação */
.sched-tbl tr.is-live td { background: var(--tint-live); }
.sched-tbl tr.is-live td:first-child { border-radius: 8px 0 0 8px; }
.sched-tbl tr.is-live td:last-child { border-radius: 0 8px 8px 0; }

/* abertura da ordem de jogos dos grupos: o painel desce suave e as linhas entram em sequência */
.grp-games::details-content { block-size: 0; overflow: hidden; transition: block-size .28s var(--ease-out), content-visibility .28s allow-discrete; }
.grp-games[open]::details-content { block-size: auto; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }
@media (prefers-reduced-motion: no-preference) {
  @keyframes grp-row-in { from { opacity: 0; transform: translateY(-6px); } }
  .grp-games[open] .gg-round, .grp-games[open] .gg-row { animation: grp-row-in .32s var(--ease-out) both; }
  .grp-games[open] .gg-row:nth-child(1) { animation-delay: .04s; } .grp-games[open] .gg-row:nth-child(2) { animation-delay: .09s; }
  .grp-games[open] .gg-row:nth-child(3) { animation-delay: .14s; } .grp-games[open] .gg-row:nth-child(n+4) { animation-delay: .19s; }
}
@media (prefers-reduced-motion: reduce) { .grp-games::details-content { transition: none; } }

.logo-prev { background: #fff; border-radius: 10px; padding: 10px 14px; display: inline-block; margin-bottom: 8px; }
.logo-prev img { display: block; max-height: 56px; max-width: 220px; }

/* classificação: as chaves (grupos) em duas colunas em telas largas */
.stand-cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; align-items: start; }
@media (min-width: 900px) { .stand-cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* troca de lado: tela cheia sobre o placar */
.switch-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: var(--gold); color: var(--on-gold); opacity: 0.8; cursor: pointer; text-align: center; padding: 24px; }
.switch-overlay[hidden] { display: none; }
.so-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.so-arrows { width: min(46vw, 280px); height: min(46vw, 280px); }
.so-text { margin: 0; font: 800 clamp(34px, 9vw, 72px)/1 'Oswald', sans-serif; letter-spacing: .04em; color: var(--on-gold); }
.so-sub { margin: 0; font-size: clamp(18px, 4.4vw, 26px); font-weight: 700; color: var(--on-gold); }
@media (prefers-reduced-motion: no-preference) {
  .switch-overlay.go { animation: so-in .25s var(--ease-out) both; }
  .switch-overlay.out { animation: so-out .25s ease both; }
  .switch-overlay.go .so-arrows { animation: so-spin .9s cubic-bezier(.45, 0, .2, 1) both; }
  .switch-overlay.go .so-text { animation: so-text .35s var(--ease-out) .7s both; }
  .switch-overlay.go .so-sub { animation: so-text .35s var(--ease-out) .82s both; }
}
@keyframes so-in { from { opacity: 0; } }
@keyframes so-out { to { opacity: 0; } }
@keyframes so-spin { from { transform: rotate(-160deg) scale(.4); opacity: 0; } 25% { opacity: 1} to { transform: rotate(380deg) scale(1); } }
@keyframes so-text { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .switch-overlay .so-arrows { transform: none; } }

/* saque: um botão por jogador, lado a lado; quem saca em destaque, o resto apagado */
.serve-row { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; }
.serve-row[hidden] { display: none; }
.sv-label { font: 700 12px 'Oswald', sans-serif; letter-spacing: .12em; color: var(--dim); }
.serve-row.is-serving .sv-label { color: var(--gold-ink); }
.sv-m { flex: 1 1 0; min-width: 0; max-width: 11rem; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--panel-2); color: var(--dim); font: 600 14px 'Inter', sans-serif; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .65; }
.sv-m:hover { opacity: 1; }
.sv-m.on { opacity: 1; background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 800; }

/* inverter lados do placar (só visual, por aparelho) */
.scoreboard.flipped > section.side:first-of-type { order: 2; }
.scoreboard.flipped > section.side:last-of-type { order: 1; }

.brand-only { display: inline-flex; align-items: center; margin: 0 auto; }
.brand-logo { display: block; max-height: 34px; max-width: 200px; width: auto; }

/* botão de inverter lados: pequeno, só ícone, sobreposto ao centro do placar */
.scoreboard { position: relative; }
.flip-btn { position: absolute; z-index: 3; left: 50%; top: 4rem; transform: translate(-50%, -50%); width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--hairline); background: var(--panel-3); color: var(--dim); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.flip-btn .ic { width: 18px; height: 18px; }
.flip-btn:hover { color: var(--line); }
.flip-btn.is-on { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
@media (pointer: coarse) { .flip-btn { width: 44px; height: 44px; } }

/* tela de placar: placar enxuto, −1/+1 colados embaixo, controles em linhas (saque, tempo, cartões) */
.side { position: relative; overflow: hidden; }
.pts-wrap { position: relative; }
.side .setw { position: absolute; right: 10px; bottom: 8px; margin: 0; font-size: 12px; color: var(--dim); pointer-events: none; }
.adj { display: grid; grid-template-columns: 1fr 1fr; margin: 10px -12px -16px; }
.adj .btn { border-radius: 0; margin: 0; min-height: 54px; font-size: 22px; font-weight: 800; }
.top-actions { margin-top: 12px; }
.top-actions .btn[hidden] { display: none; }
.ctl { margin-top: 22px; }
.ctl-h { margin: 0 0 8px; font: 700 13px 'Oswald', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cell { min-width: 0; }
.cell-name { margin: 0 0 6px; font-size: 13px; text-align: center; color: var(--dim); overflow-wrap: anywhere; }
.pair-row.flipped > :first-child { order: 2; }
.pair-row.flipped > :last-child { order: 1; }
.ctl .btn.block { width: 100%; }
.sv-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: center; }
.sv-name { font-size: 14px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.sv-col .sv-m { max-width: none; width: 100%; font-size: 13px; letter-spacing: .06em; text-overflow: clip; }
.cards-modal { border: 0; border-radius: 12px; padding: 0; width: min(440px, 94vw); max-height: 90dvh; background: var(--panel); color: var(--line); }
.cards-modal::backdrop { background: rgba(6, 14, 18, .6); }
.cm-in { padding: 16px; }
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cm-head h2 { margin: 0; font-size: 17px; }
.live-foot { margin-top: 22px; }
.live-foot p { margin: 6px 0 0; }
.wo-row { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.wo-row .btn { width: 100%; }
.ctl > .card { margin-bottom: 12px; }

/* saque: o nome do jogador dentro do botão (pode quebrar em duas linhas em tela pequena) */
.serve-row .sv-m { max-width: none; width: 100%; min-height: 52px; padding: 8px 10px; font-size: 14px; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; display: grid; place-items: center; text-align: center; }
.ctl .btn.block { min-height: 48px; }

/* placar compacto: o essencial cabe numa tela de celular, sem rolar */
.live-page > .small:first-child { margin: 0 0 4px; }
.live-page h1 { font-size: 22px; }
.live-page .court-rule { margin-top: 8px; }
.live-page .top-actions { margin-top: 8px; }
.live-page .scoreboard { margin-top: 8px !important; gap: 8px; }
.live-page .side { padding: 8px 8px 8px; }
.live-page .side .tname { min-height: 32px; font-size: 16px; }
.live-page .adj { margin: 6px -8px -8px; }
.live-page .adj .btn { min-height: 46px; font-size: 20px; }
.live-page .ctl { margin-top: 8px; }
.live-page .ctl-h { margin-bottom: 4px; }
.live-page .pair-row { gap: 8px; }
.live-page .serve-row { gap: 6px; }
.live-page .serve-row .sv-m { min-height: 44px; padding: 6px 8px; font-size: 13px; }
.live-page .ctl .btn.block { min-height: 44px; }
.live-page .wo-row { margin-top: 8px; padding-top: 8px; }
.live-page .live-foot { margin-top: 10px; }
.live-page .live-foot p { margin: 4px 0 0; }
.live-page > .row { margin-top: 8px !important; }
.live-page #cardsCard { margin-top: 10px !important; }

/* seletor de emojis no mural da torcida */
.emoji-bar { margin-top: 6px; align-items: center; }
.emoji-box { margin-top: 8px; }
emoji-picker.emoji-pick { width: 100%; height: 320px; --background: var(--panel); --border-color: var(--hairline); --input-border-color: var(--hairline); --input-font-color: var(--line); --button-hover-background: var(--panel-2); --button-active-background: var(--panel-3); --indicator-color: var(--gold); --category-font-color: var(--dim); --num-columns: 8; }

/* botão de emoji dentro da caixa de texto, no canto de baixo à direita */
.ta-emoji { position: relative; }
.ta-emoji textarea { padding-right: 52px; }
.emoji-btn { position: absolute; right: 8px; bottom: 8px; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--panel-2); color: var(--dim); cursor: pointer; }
.emoji-btn:hover, .emoji-btn[aria-expanded=true] { color: var(--gold-ink); background: var(--tint-gold); }
.emoji-btn .ic { width: 22px; height: 22px; }

/* resultado nas listas: selo com o número grande e a legenda pequena embaixo */
.score-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.15; }
.score-wrap .score-sub { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* modo de manutenção */
.maint-bar { position: sticky; top: 0; z-index: 90; padding: 8px 16px; text-align: center; font-size: 14px; background: var(--live); color: var(--on-live); }
.maint-bar a { color: inherit; text-decoration: underline; margin-left: 8px; }
.maint-box { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; }
.maint-box legend { padding: 0 8px; font: 700 14px 'Oswald', sans-serif; color: var(--gold-ink); }

/* ---------- admin: abas, conteúdo do site, listas editáveis ---------- */
.admin-tabs, .admin-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.admin-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px; background: var(--panel-2); color: var(--line); font-weight: 600; font-size: 14px; text-decoration: none; min-height: 40px; }
.admin-tabs a[aria-current=page] { background: var(--gold); color: var(--on-gold); }
.admin-subtabs { margin-top: -6px; padding: 0 0 12px; border-bottom: 1px solid var(--hairline); }
.admin-subtabs a { padding: 6px 12px; border-radius: 99px; font-size: 13px; color: var(--dim); text-decoration: none; border: 1px solid var(--hairline); }
.admin-subtabs a:hover { color: var(--line); }
.admin-subtabs a[aria-current=page] { color: var(--line); border-color: var(--gold); background: var(--panel-2); font-weight: 600; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 18px; }
.site-card { display: flex; flex-direction: column; gap: 6px; }
.site-card h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.site-card p { margin: 0; }
.site-card .row { margin-top: auto; padding-top: 10px; }
.site-form { display: grid; gap: 18px; max-width: 980px; }
.site-group { border: 0; margin: 0; min-width: 0; }
.site-group > legend { font: 700 15px 'Oswald', sans-serif; letter-spacing: .02em; color: var(--gold-ink, var(--gold)); padding: 0 0 8px; float: left; width: 100%; }
.site-group > legend + * { clear: both; }
.site-actions { display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }
.site-reset { margin: 28px 0 8px; }
.rep { margin: 4px 0 18px; }
.rep-title { margin-bottom: 6px; }
.rep-items { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.rep-item { background: var(--panel-2); border-radius: 10px; padding: 12px 14px; }
.rep-item input[type=text], .rep-item select, .rep-item textarea { background: var(--panel-3); }
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rep-ctl { display: flex; gap: 6px; flex: none; }
.rep-ctl .btn[disabled] { opacity: .4; cursor: default; }
.btn.flip .ic { transform: rotate(180deg); }
.rep-body { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.rep-body .img-field, .rep-body .field:has(textarea) { grid-column: 1 / -1; }
.rep-inline { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rep-inline .rep-body { flex: 1 1 320px; grid-template-columns: 1fr; }
.rep-inline .field { margin-bottom: 8px; }
.img-field { display: grid; gap: 6px; justify-items: start; }
.img-prev { background: var(--panel-3); border-radius: 8px; padding: 6px; min-height: 48px; display: flex; align-items: center; }
.img-prev img { display: block; max-width: min(100%, 320px); max-height: 140px; height: auto; border-radius: 4px; }
.plan-forms { display: grid; gap: 18px; }
.plan-flags { display: flex; gap: 6px 22px; flex-wrap: wrap; margin-top: 8px; }
.site-form code { background: var(--panel-3); padding: 1px 6px; border-radius: 4px; }
.errors:focus { outline: none; }

/* cadastro: vantagens e depoimento */
.reg-perks { margin: 18px 0 0; }
.reg-perks h2 { font-size: 16px; margin: 0 0 8px; }
.reg-perks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reg-perks li { display: flex; gap: 8px; align-items: flex-start; color: var(--line); }
.reg-perks li .ic { color: var(--gold); margin-top: 2px; }
.testi { margin: 0; }
.testi blockquote { margin: 0; }
.testi blockquote p { margin: 0 0 10px; }
.testi figcaption { display: flex; flex-direction: column; font-size: 14px; }
.testi figcaption small { color: var(--dim); font-size: 13px; }
.reg-testi { margin: 22px 0 0; padding: 14px 16px; border-left: 3px solid var(--gold); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; }
.reg-testi blockquote p { font-style: italic; }

/* admin: plano de uma conta */
.plan-admin { display: grid; gap: 18px; margin-top: 18px; max-width: 980px; }
.kind-pick { border: 0; margin: 0 0 12px; padding: 0; display: flex; gap: 6px 24px; flex-wrap: wrap; }
.kind-pick .check { min-height: 40px; }
[data-kind][hidden] { display: none; }
