:root {
  color-scheme: dark;
  --noite: #0b1f15;
  --noite-2: #123222;
  --noite-3: #1a4530;
  --linha: rgba(255, 255, 255, 0.16);
  --giz: #f4f7f2;
  --giz-2: #b9d6c3;
  --giz-3: #8fb39c;
  --amarelo: #f5d33f;
  --vermelho: #e5484d;
  --verde: #4cc38a;
  --fonte: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --base: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--noite);
  color: var(--giz);
  font-family: var(--fonte);
  font-size: var(--base);
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 700; }
p { margin: 0; }

button, input, select { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: 1px solid var(--linha);
  background: var(--noite-2);
  border-radius: 8px;
  padding: 11px 16px;
  min-height: 44px;
}
button:hover:not(:disabled) { background: var(--noite-3); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--amarelo); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.primario {
  background: var(--amarelo);
  border-color: var(--amarelo);
  color: #1a1a00;
  font-weight: 700;
}
.primario:hover:not(:disabled) { background: #ffe25c; }

input, select {
  width: 100%;
  background: var(--noite);
  border: 1px solid var(--linha);
  border-radius: 8px;
  padding: 11px 12px;
  min-height: 44px;
}

label { display: grid; gap: 5px; font-size: 0.9em; color: var(--giz-2); }

.linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.entre { justify-content: space-between; }
.pilha { display: grid; gap: 12px; }
.grade-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.suave { color: var(--giz-2); }
.pequeno { font-size: 0.86em; }

.painel {
  background: var(--noite-2);
  border: 1px solid var(--linha);
  border-radius: 12px;
  padding: 16px;
}

/* Menu */
.menu { min-height: calc(100vh - 32px); display: grid; align-content: center; justify-items: center; text-align: center; gap: 26px; }
.logo { font-size: clamp(44px, 11vw, 92px); font-weight: 800; line-height: 1.12; letter-spacing: -0.01em; text-transform: uppercase; }
.logo em { display: block; font-style: normal; color: var(--amarelo); }
.chamada { max-width: 480px; color: var(--giz-2); font-size: 1.1em; }
.menu-botoes { display: grid; gap: 10px; width: min(340px, 100%); }

/* Criação */
.criacao { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
.previa { display: grid; gap: 10px; justify-items: center; text-align: center; position: sticky; top: 16px; }
.previa canvas { width: 180px; height: 200px; }
.ovr { font-size: 2.6em; font-weight: 800; color: var(--amarelo); line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 7px 12px; }
.chip[aria-pressed="true"] { background: var(--amarelo); color: #1a1a00; border-color: var(--amarelo); font-weight: 700; }
.bolinha { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; border: 2px solid var(--linha); }
.bolinha[aria-pressed="true"] { border: 3px solid var(--amarelo); }
.attr { display: grid; grid-template-columns: 62px 30px 1fr 92px; gap: 8px; align-items: center; }
.attr button { padding: 0; min-height: 40px; }
.barra { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--verde); }

/* Hub */
.topo-hub { display: flex; gap: 14px; align-items: center; }
.topo-hub canvas { width: 76px; height: 86px; flex: none; }
.topo-hub h1 { font-size: 1.8em; overflow-wrap: anywhere; }
.proximo { display: grid; gap: 12px; text-align: center; }
.confronto { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; font-size: 1.25em; font-weight: 700; }
.confronto .x { color: var(--giz-3); font-size: 0.75em; }
.escudo { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; font-size: 13px; font-weight: 800; border: 2px solid; margin-bottom: 4px; }
.abas { display: flex; gap: 6px; border-bottom: 1px solid var(--linha); overflow-x: auto; }
.abas button { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--giz-2); white-space: nowrap; }
.abas button[aria-selected="true"] { color: var(--giz); border-bottom-color: var(--amarelo); font-weight: 700; }
.rolagem-x { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; font-variant-numeric: tabular-nums; }
th { color: var(--giz-3); font-weight: 500; font-size: 0.85em; }
td:nth-child(2), th:nth-child(2) { text-align: left; }
tr.meu td { color: var(--amarelo); font-weight: 700; }
.aviso { border-left: 4px solid var(--vermelho); background: rgba(229, 72, 77, 0.13); border-radius: 0 8px 8px 0; padding: 10px 12px; }
.bom { border-left-color: var(--verde); background: rgba(76, 195, 138, 0.13); }

/* Partida */
.placar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.placar .fora { text-align: right; }
.placar .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.numeros { text-align: center; font-size: 2em; font-variant-numeric: tabular-nums; line-height: 1; }
.minuto { font-size: 0.42em; color: var(--amarelo); display: block; margin-top: 4px; }
#campo { display: block; width: 100%; max-height: 58vh; aspect-ratio: 105 / 68; margin: 0 auto; border-radius: 10px; background: #27703c; }
.narracao { min-height: 2.9em; padding: 10px 2px; font-size: 1.05em; }
.controles { display: flex; gap: 8px; align-items: center; }
.controles .chip { flex: 0 0 auto; }

.feed { list-style: none; margin: 0; padding: 0; display: none; gap: 6px; color: var(--giz-2); font-size: 0.92em; }
.feed li { border-left: 2px solid var(--linha); padding: 2px 0 2px 10px; }
.feed li.destaque { color: var(--giz); border-left-color: var(--amarelo); }
@media (min-width: 1000px) { .feed { display: grid; } .partida-grade .narracao { min-height: 0; } }

.decisao { display: grid; gap: 10px; margin-top: 10px; border-color: var(--amarelo); }
.decisao h2 { font-size: 1.45em; color: var(--amarelo); }
.selo { display: inline-block; font-size: 0.72em; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 99px; background: var(--vermelho); color: #fff; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.opcao { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; text-align: left; align-items: center; padding: 12px; position: relative; overflow: hidden; }
.opcao .num { font-weight: 800; color: var(--amarelo); }
.opcao .pct { font-weight: 800; font-size: 1.15em; }
.opcao .sub { display: block; font-size: 0.82em; color: var(--giz-2); }
.opcao > * { position: relative; }
.opcao .voto { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(245, 211, 63, 0.24); transition: width 0.25s; }
.decisao.votando .opcao:disabled { opacity: 1; cursor: default; }
.escolhida { font-weight: 700; }
.votacao { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; flex-wrap: wrap; }
.timer { font-size: 1.5em; color: var(--amarelo); font-variant-numeric: tabular-nums; }

.dado-area { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 6px 0; }
.dado {
  width: 92px; height: 92px; display: grid; place-items: center;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--amarelo); color: #1a1a00; font-size: 2.2em; font-weight: 800;
}
.dado.girando { animation: giro 0.3s linear infinite; }
.dado.ok { background: var(--verde); }
.dado.ruim { background: var(--vermelho); color: #fff; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dado.girando { animation: none; } }

.momento { border-left: 4px solid var(--verde); padding: 2px 0 2px 10px; }
.momento.ruim { border-left-color: var(--vermelho); }
.grande-placar { font-size: 3.2em; font-weight: 800; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; text-align: center; }
.stats b { display: block; font-size: 1.8em; line-height: 1.1; color: var(--amarelo); }
.stats span { font-size: 0.8em; color: var(--giz-2); }

.proposta { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }

.card-final { width: min(100%, 460px); height: auto; border-radius: 10px; display: block; margin: 0 auto; }

/* Tela de OBS: letra grande, sem enfeite. */
body.obs { --base: 22px; }
body.obs #app { max-width: 1280px; }
body.obs .sem-obs { display: none !important; }
body.obs .partida-grade { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
body.obs .decisao { margin-top: 0; }
@media (min-width: 1000px) {
  #app:has(.partida-grade) { max-width: 1240px; }
  .partida-grade { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
  .partida-grade .decisao, .partida-grade .dado-area { margin-top: 0; }
}

@media (max-width: 720px) {
  .criacao { grid-template-columns: minmax(0, 1fr); }
  .previa { position: static; order: -1; grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; }
  .previa canvas { width: 96px; height: 106px; grid-row: span 2; }
  .grade-2 { grid-template-columns: minmax(0, 1fr); }
  .confronto { font-size: 1.05em; }
  body.obs .partida-grade { grid-template-columns: minmax(0, 1fr); }
}
