/* Arquivo Mega — tema da home e das paginas geradas.
 *
 * Mesmo sistema editorial do ArquivoLoto, no escuro: o magenta virou verde
 * Mega-Sena e o dourado aparece so no bloco da Mega da Virada. Os valores vem
 * da especificacao (ArquivoMega — Especificacao da Home) e do desenho.
 *
 * Desktop e mobile tem conteudos diferentes em alguns blocos. O HTML traz os
 * dois e as classes abaixo escolhem:
 *   .d-only  some no mobile (ate 640px)
 *   .m-only  some no desktop
 * Nenhuma das duas define `display` no breakpoint em que aparece, entao o
 * elemento mantem o display da propria classe (flex, grid...). */

:root {
  --bg: #0e1311;
  --surface: #141b18;
  --line: #26322c;
  --line-soft: #1d2723;
  --line-strong: #3a4842;
  --text: #eaf0ec;
  --text-2: #a4b3ab;
  --text-3: #c9d4ce;
  --label: #8fa097;
  --accent: #4fd39a;
  --accent-hover: #8ee6bd;
  --ball: #17835a;
  --ball-text: #ffffff;
  --green-border: #2f5a45;
  --green-bg: #12201a;
  --cell-muted: #19221e;
  --on-accent: #07140e;

  --heat-0: #18201c;
  --heat-1: #1d4a36;
  --heat-2: #23744f;
  --heat-3: #4fd39a;
  --absent-border: #4a5a52;

  --gold: #e2bf62;
  --gold-bg: #17150e;
  --gold-border: #5a4a22;
  --gold-line: #3a3220;
  --gold-text: #c9c3b0;
  --gold-label: #b5ad95;
  --gold-strong: #f1ead6;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

strong {
  color: var(--text);
  font-weight: 600;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
}

/* ── Utilitarios ──────────────────────────────────────────────────────── */

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono { font-family: var(--mono); }
.sans { font-family: var(--sans); }
.muted { color: var(--label); }
.accent { color: var(--accent); }
.gold { color: var(--gold); }
.num { text-align: right; }

.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 641px) {
  .m-only { display: none !important; }
}

@media (max-width: 640px) {
  .d-only { display: none !important; }
}

/* ── Rotulos e titulos ────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

.eyebrow--gold { color: var(--gold); }

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--label);
  text-transform: uppercase;
}

.title-1,
.title-2,
.title-3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
}

.title-1 { font-size: clamp(32px, 4vw, 48px); }
.title-2 { font-size: clamp(30px, 3.6vw, 42px); }
.title-3 { font-size: 24px; margin-top: 4px; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lede {
  margin: 0;
  max-width: 760px;
  color: var(--text-2);
}

.lede--lg { font-size: 18px; }

.section-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.freq {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 641px) {
  .freq { gap: 32px; }
  .freq > .lede { margin-top: -24px; }
}

/* ── Cabecalho ────────────────────────────────────────────────────────── */

.masthead { border-bottom: 1px solid var(--line); }

.masthead__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  /* O desenho usa 32px e 22px; com eles o cabecalho estoura 1136px por ~30px
     e a edicao cai para outra linha. Com 24px e 18px cabe numa linha so. */
  gap: 16px 24px;
}

.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  line-height: 1;
  color: var(--text);
}

.wordmark:hover { color: var(--text); }
.wordmark span { color: var(--accent); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  color: var(--text-2);
  padding: 10px 0;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); }
.nav a.nav__gold { color: var(--gold); }

.edition {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--label);
}

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 640px) {
  .masthead__inner {
    padding: 14px 16px;
    flex-wrap: nowrap;
  }

  .wordmark { font-size: 26px; }
  .menu-btn { display: flex; }
  .edition { display: none; }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 5;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }

  .masthead { position: relative; }
  .masthead[data-menu-open="true"] .nav { display: flex; }

  .nav a {
    padding: 14px 16px;
    color: var(--text-3);
    border-bottom: 1px solid var(--line-soft);
  }

  .nav a:last-child { border-bottom: 0; }
}

/* ── Secoes ───────────────────────────────────────────────────────────── */

.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section--flush { border-bottom: 0; }

@media (max-width: 640px) {
  .section { padding: 32px 0; gap: 18px; }
}

/* Visao basica: some o que e so da avancada (home_view.js marca o <html>). */
html[data-view="basic"] [data-view-only="advanced"] { display: none !important; }

/* ── Introducao e seletor de visao ────────────────────────────────────── */

.intro {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.intro__text {
  margin: 0;
  max-width: 900px;
  font-size: clamp(19px, 2.4vw, 28px);
  line-height: 1.4;
  color: var(--text-2);
}

.intro__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}

.intro__note {
  margin: 0;
  max-width: 520px;
  font-size: 14px;
  color: var(--text-2);
}

.toggle {
  display: flex;
  border: 1px solid var(--line-strong);
}

.toggle__btn,
.window-btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 13px 18px;
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--text);
}

.toggle__btn[aria-pressed="true"],
.window-btn[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
}

@media (max-width: 640px) {
  .intro { padding: 28px 0 24px; gap: 18px; }
  .intro__controls { flex-wrap: nowrap; gap: 12px; }
  .toggle { flex: 1; }
  .toggle__btn { flex: 1; min-height: 44px; padding: 0 12px; }
}

/* ── Grade de estatisticas ────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  align-self: start;
}

.stat {
  background: var(--bg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stat__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--label);
}

.stat__value {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.stat__value--md { font-size: 30px; }
.stat__value--lg { font-size: 44px; }
.stat__value--xl { font-size: 64px; line-height: 1; }

.stat__note {
  font-size: 13px;
  color: var(--text-2);
}

.stat-grid--sorteio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid--sorteio.stat-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid--acc,
.stat-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid--3 .stat { padding: 18px; gap: 4px; }

@media (max-width: 640px) {
  .stat { padding: 12px 10px; gap: 2px; }
  .stat__label { font-size: 10px; letter-spacing: 0.1em; }
  .stat__value { font-size: 26px; }
  .stat__note { font-size: 12px; }
  .stat-grid--sorteio { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid--acc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid--acc .stat { padding: 14px; }
  .stat-grid--3 { grid-template-columns: 1fr; }
}

/* ── Bolas ────────────────────────────────────────────────────────────── */

.ball {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  flex: none;
}

.ball--lg {
  width: 64px;
  height: 64px;
  background: var(--ball);
  color: var(--ball-text);
  font-size: 24px;
  font-weight: 500;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.28), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.ball--md {
  width: 44px;
  height: 44px;
  background: var(--ball);
  color: var(--ball-text);
  font-size: 16px;
  font-weight: 500;
}

.ball--outline {
  width: 34px;
  height: 34px;
  border: 1px solid var(--green-border);
  font-size: 13px;
  color: var(--text);
}

.ball--absent {
  width: 44px;
  height: 44px;
  border: 1px dashed var(--absent-border);
  color: var(--text-3);
  font-size: 15px;
}

.balls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 640px) {
  .balls {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
  }

  .ball--lg {
    width: auto;
    height: auto;
    aspect-ratio: 1;
    font-size: 19px;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.28);
  }

  .ball--outline { width: 36px; height: 36px; }
}

/* ── Tabelas ──────────────────────────────────────────────────────────── */

.table {
  border: 1px solid var(--line);
  background: var(--surface);
}

.table__head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--label);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.table-box { border: 1px solid var(--line); }
.table-box > .table { border: 0; }

/* Faixas do sorteio */
.tiers__row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  padding: 14px 18px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.tiers__row:last-child { border-bottom: 0; }
.tiers__row.table__head { padding: 12px 18px; }
.tiers__row .muted { font-size: 13px; }

@media (max-width: 640px) {
  .tiers__row {
    grid-template-columns: 1fr 64px 1.3fr;
    padding: 12px 14px;
    font-size: 14px;
  }

  .tiers__row.table__head { padding: 10px 14px; font-size: 10px; }
  .tiers__row:not(.table__head) .num { font-size: 13px; }
}

/* Ultimos concursos */
.last {
  background: transparent;
  overflow-x: auto;
}

.last__row {
  display: grid;
  grid-template-columns: 110px 130px minmax(264px, 1fr) 220px;
  grid-template-areas: "n d balls st";
  gap: 16px;
  padding: 12px 20px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  min-width: 760px;
}

.last__row:last-child { border-bottom: 0; }
.last__row.table__head { border-bottom: 1px solid var(--line); }
.last__n { grid-area: n; }
.last__n a { color: var(--text); }
.last__n a:hover { color: var(--accent); }
.last__d { grid-area: d; font-size: 14px; }
.last__balls { grid-area: balls; display: flex; gap: 8px; }
.last__st { grid-area: st; text-align: right; font-size: 14px; color: var(--label); }
.last__st.is-won { color: var(--accent); font-weight: 600; }

@media (max-width: 640px) {
  .last {
    border: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }

  .last__row {
    min-width: 0;
    grid-template-columns: 1fr auto;
    grid-template-areas: "n st" "balls balls";
    gap: 8px;
    padding: 14px 0;
    font-family: var(--mono);
    font-size: 12px;
  }

  .last__balls { gap: 6px; }
  .last__st { font-size: 12px; }
  .last__st.is-won { font-weight: 500; }
}

/* Boloes */
.odds__row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.4fr 1.4fr;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 14px;
  min-width: 480px;
  background: var(--bg);
}

.odds__row:last-child { border-bottom: 0; }
.odds__row.table__head { padding: 12px 18px; font-size: 11px; letter-spacing: 0.1em; background: var(--surface); }

@media (max-width: 640px) {
  .odds__row {
    grid-template-columns: 0.8fr 1.4fr 1.4fr;
    min-width: 0;
    padding: 10px 14px;
    font-size: 13px;
  }

  .odds__row.table__head { padding: 10px 14px; font-size: 10px; }
}

/* Probabilidades */
.probs__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg);
}

.probs__row:last-child { border-bottom: 0; }
.probs__row.table__head { font-size: 11px; letter-spacing: 0.1em; background: var(--surface); }

/* ── O Sorteio ────────────────────────────────────────────────────────── */

.sorteio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 40px;
}

.sorteio__main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stamp {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--label);
}

@media (max-width: 640px) {
  .sorteio { gap: 20px; }
  .sorteio__main { gap: 20px; }
  .section-head .title-1 { font-size: 32px; }
}

/* ── Cartoes ──────────────────────────────────────────────────────────── */

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.card--green {
  border-color: var(--green-border);
  background: var(--green-bg);
  gap: 10px;
}

.card__head { display: flex; flex-direction: column; }
.card__text { margin: 0; font-size: 14px; color: var(--text-2); }
.card__foot { font-size: 13px; color: var(--label); }

.cards {
  display: grid;
  gap: 24px;
}

.cards--380 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.cards--520 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }

@media (max-width: 640px) {
  .card { padding: 16px; gap: 12px; }
  .card .title-3 { font-size: 22px; }
}

.btn-outline {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  border: 1px solid var(--green-border);
  padding: 13px 18px;
  align-self: start;
}

@media (max-width: 640px) {
  .btn-outline { align-self: stretch; text-align: center; padding: 14px; }
}

/* ── Acumulacao ───────────────────────────────────────────────────────── */

/* Duas colunas fixas: com auto-fit, a linha do tempo (que ocupa a linha
   inteira) manteria uma terceira coluna viva e espremeria o cartao. */
.acc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 760px) {
  .acc { grid-template-columns: minmax(0, 1fr); }
}

.next {
  padding: 28px;
  gap: 12px;
}

.next__value {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
}

.next__note { color: var(--text-2); }

.timeline-block {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(84px, 1fr));
  gap: 6px;
  min-width: 880px;
}

.timeline__cell a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  height: 100%;
}

.timeline__cell.is-won a { background: var(--accent); color: var(--on-accent); }
.timeline__cell.is-acc a { background: var(--cell-muted); color: var(--text-3); border: 1px solid var(--line-strong); }
.timeline__n { font-family: var(--mono); font-size: 12px; }
.timeline__label { font-size: 13px; font-weight: 600; }

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--text-2);
}

.legend > span { display: inline-flex; align-items: center; gap: 8px; }

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
}

.swatch--won { background: var(--accent); }
.swatch--acc { background: var(--cell-muted); border: 1px solid var(--line-strong); }

.timeline-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--label);
}

@media (max-width: 640px) {
  .acc { gap: 18px; }
  .next { padding: 20px; gap: 8px; }
  .next .label { font-size: 10px; }
  .next__value { font-size: 48px; }
  .next__note { font-size: 14px; }
  .timeline-block { order: 2; margin-top: 0; gap: 8px; }
  .stat-grid--acc { order: 3; }
  .timeline { min-width: 0; gap: 4px; grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .timeline__cell a { height: 28px; padding: 0; }
  .timeline__n,
  .timeline__label { display: none; }
}

/* ── Mega da Virada ───────────────────────────────────────────────────── */

.virada {
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  padding: clamp(24px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 40px;
}

.virada__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.virada__copy em { color: var(--gold); }
.virada__copy p { margin: 0; color: var(--gold-text); max-width: 520px; }

.virada__link {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold);
  align-self: start;
  padding: 12px 0;
}

.virada__link:hover { color: var(--gold-strong); }

.stat-grid--gold {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--gold-line);
  border-color: var(--gold-line);
  align-self: center;
}

.stat-grid--gold .stat { background: var(--gold-bg); padding: 24px; }
.stat-grid--gold .stat__label { color: var(--gold-label); letter-spacing: 0.12em; }
.stat-grid--gold .stat__note { color: var(--gold-text); }
.stat-grid--gold .stat__value--lg { color: var(--gold-strong); }

.virada__rule { margin: 0; font-size: 14px; color: var(--gold-text); }

@media (max-width: 640px) {
  .virada { padding: 22px; gap: 14px; }
  .virada .title-2 { font-size: 30px; }
  .stat-grid--gold .stat { padding: 14px; }
  .stat-grid--gold .stat__value--xl { font-size: 44px; }
  .stat-grid--gold .stat__value--lg { font-size: 30px; }
}

/* ── Recorte ──────────────────────────────────────────────────────────── */

.recorte { padding: 64px 0 40px; gap: 22px; border-bottom: 0; }
.recorte__text { margin: 0; max-width: 720px; color: var(--text-2); }

.window-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.window-picker .label { margin-right: 8px; }

.window-btn {
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
}

.window-btn[aria-pressed="true"] { border-color: var(--text); }
.window-btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }

.window-status {
  font-size: 13px;
  color: var(--label);
}

/* ── Curiosidades ─────────────────────────────────────────────────────── */

.curiosidades { padding-top: 24px; }

.curios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.curio {
  background: var(--bg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.curio__value {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.05;
}

.curio__title { font-weight: 600; }
.curio__text { font-size: 14px; color: var(--text-2); }

@media (max-width: 640px) {
  .curiosidades { padding-top: 32px; }
  .curios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .curio { padding: 16px 14px; gap: 4px; }
  .curio__value { font-size: 30px; }
  .curio__title { font-size: 13px; }
  .curio__text { font-size: 12px; }
  .m-order-1 { order: 1; }
  .m-order-2 { order: 2; }
  .m-order-3 { order: 3; }
  .m-order-4 { order: 4; }
}

/* ── Frequencias ──────────────────────────────────────────────────────── */

.podium {
  list-style: none;
  margin: 0;
  padding: 0;
}

.podium__row {
  display: grid;
  grid-template-columns: 40px 56px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.podium__row .mono { font-size: 13px; }

.delay {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.delay__n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--label);
}

.grid-60 {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.heat__cell,
.vol__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
}

.heat__cell { color: #dfe7e2; }
.h0 { background: var(--heat-0); }
.h1 { background: var(--heat-1); }
.h2 { background: var(--heat-2); }
.h3 { background: var(--heat-3); color: var(--on-accent); }
i.swatch.h0 { border: 1px solid var(--line); }
.legend--heat { gap: 14px; font-family: var(--mono); font-size: 12px; }
.legend--heat .swatch { width: 18px; }

.vol__cell { border: 1px solid var(--line); color: var(--label); }
.vol__cell.is-hit { background: var(--ball); border-color: var(--ball); color: var(--ball-text); border-radius: 50%; }

/* Colunas tem dez valores e linhas, seis: a segunda coluna e mais larga para
   "0 · 1 · 0 · ..." caber numa linha. */
.geometry {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  font-size: 12px;
}

.geometry > div { display: flex; flex-direction: column; gap: 4px; }

.bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: 170px;
}

.bars__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 6px;
  height: 100%;
  font-size: 12px;
  color: var(--text-3);
}

.bars__bar {
  width: 100%;
  max-width: 44px;
  background: var(--heat-2);
}

.bars__bar.is-top { background: var(--accent); }

.sumbar {
  position: relative;
  height: 96px;
  margin-top: 8px;
  font-family: var(--mono);
}

.sumbar__axis { position: absolute; left: 0; right: 0; top: 44px; height: 2px; background: var(--line); }
.sumbar__range { position: absolute; top: 38px; height: 14px; background: var(--heat-1); }
.sumbar__last { position: absolute; top: 30px; width: 2px; height: 30px; background: var(--accent); }
.sumbar__tag { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; white-space: nowrap; }
.sumbar__tick { position: absolute; top: 64px; transform: translateX(-50%); font-size: 12px; color: var(--text-3); }
.sumbar__end { position: absolute; top: 64px; font-size: 12px; color: var(--label); }
.sumbar__end--l { left: 0; }
.sumbar__end--r { right: 0; }

@media (max-width: 640px) {
  .grid-60 { gap: 3px; }
  .heat__cell { font-size: 10px; }
}

/* ── Boloes ───────────────────────────────────────────────────────────── */

.boloes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 24px;
}

.boloes__side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.boloes__side .stat-grid { align-self: stretch; }
.example { margin: 0; font-size: 17px; }
.boloes__rule { margin: 0; font-size: 14px; color: var(--text-2); }

@media (max-width: 640px) {
  .boloes { gap: 16px; }
  .table-box.scroll-x { overflow: visible; }
}

/* ── Ferramentas ──────────────────────────────────────────────────────── */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.tool {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
}

.tool:hover { color: var(--text); border-color: var(--green-border); }

.tool__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.tool__title { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.tool__text { font-size: 14px; color: var(--text-2); }
.tool__arrow { color: var(--accent); }

@media (max-width: 640px) {
  .tools {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .tool {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 12px;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    background: transparent;
  }

  .tool:last-child { border-bottom: 0; }
  .tool__title { grid-column: 1; font-size: 20px; }
  .tool__text { grid-column: 1; font-size: 13px; }
  .tool__arrow { grid-column: 2; grid-row: 1 / span 2; }
}

/* ── Privacidade ──────────────────────────────────────────────────────── */

.privacy {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 32px;
}

.privacy__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.privacy__col p { margin: 0; color: var(--text-2); font-size: 15px; }
.privacy__col .label + p { margin-top: 0; }
.privacy__col p + .label { margin-top: 12px; }
.source { font-size: 13px; color: var(--label); }

.privacy-short {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.privacy-short p { margin: 0; font-size: 14px; color: var(--text-2); }

/* ── Rodape ───────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); }

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--label);
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    gap: 8px;
    padding: 20px 16px 28px;
    font-size: 10px;
  }
}

/* ── Aviso de erro do gate ────────────────────────────────────────────── */

.notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.notice button {
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  min-height: 24px;
}

/* ── Paginas geradas (arquivo e concurso) ─────────────────────────────── */

.crumbs {
  padding-top: 28px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--label);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }

.page-head {
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page-head > .stat-grid,
.section > .stat-grid { align-self: stretch; }

.badge {
  display: inline-block;
  align-self: start;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  border: 1px solid var(--green-border);
  color: var(--accent);
}

.badge--gold { border-color: var(--gold-border); color: var(--gold); }

.prose { max-width: 760px; color: var(--text-2); }
.prose p { margin: 0 0 14px; }

.winners {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.winners li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.years {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.years a {
  background: var(--bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
}

.years a:hover { background: var(--surface); color: var(--text); }
.years a[aria-current="page"] { background: var(--surface); box-shadow: inset 0 -2px 0 var(--accent); }
.years__y { font-family: var(--serif); font-size: 28px; line-height: 1.1; }
.years__n { font-family: var(--mono); font-size: 11px; color: var(--label); letter-spacing: 0.08em; }
