/* LabLoto — mapa.css (Mapa dos ganhadores, v1.0.0, P-391) */

/* Cores do mapa de calor (v1.1.0, pedido do dono): do amarelo-claro (poucos ganhadores) ao laranja e ao vermelho-escuro
   (muitos). "Nenhum" é cinza, sem tom. No tema escuro a escala é outra: do vinho escuro ao amarelo brilhante. */
:root {
  --map-0: #e8e9ef;
  --map-1: #fff1b8;
  --map-2: #fdc96b;
  --map-3: #f8913f;
  --map-4: #e0512f;
  --map-5: #a51d2d;
  --map-line: #ffffff;
  --map-sel: #141a33;
  --map-dot: #2b44c9;
  --map-ink-lo: #1b1300;
  --map-ink-hi: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --map-0: #1b2038;
    --map-1: #4a1c1c;
    --map-2: #8c2a1f;
    --map-3: #d24a26;
    --map-4: #f6893a;
    --map-5: #ffd166;
    --map-line: #0b1024;
    --map-sel: #ffffff;
    --map-dot: #8392ff;
    --map-ink-lo: #ffffff;
    --map-ink-hi: #1b1300;
  }
}
:root[data-theme="dark"] {
  --map-0: #1b2038;
  --map-1: #4a1c1c;
  --map-2: #8c2a1f;
  --map-3: #d24a26;
  --map-4: #f6893a;
  --map-5: #ffd166;
  --map-line: #0b1024;
  --map-sel: #ffffff;
  --map-dot: #8392ff;
  --map-ink-lo: #ffffff;
  --map-ink-hi: #1b1300;
}
.m-c0 { fill: var(--map-0); background: var(--map-0); }
.m-c1 { fill: var(--map-1); background: var(--map-1); }
.m-c2 { fill: var(--map-2); background: var(--map-2); }
.m-c3 { fill: var(--map-3); background: var(--map-3); }
.m-c4 { fill: var(--map-4); background: var(--map-4); }
.m-c5 { fill: var(--map-5); background: var(--map-5); }

.m-main { display: grid; gap: 20px; padding-bottom: 32px; }
.m-filters { display: grid; gap: 14px; padding: 18px 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.m-lots { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.m-lots .g-lot[data-lot="-1"] i { background: conic-gradient(var(--hue-1), var(--hue-2), var(--hue-4), var(--hue-6), var(--hue-1)); }
.m-row2 { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.m-sel { display: grid; gap: 6px; }
.m-sel select { min-height: 44px; min-width: 7rem; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: 600 1rem/1 var(--font-body, inherit); }
.m-play { gap: 8px; }
.m-play svg { width: 18px; height: 18px; }
.m-seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-left: auto; }
.m-seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: 700 .875rem/1 var(--font-body, inherit); cursor: pointer; }
.m-seg button[aria-checked="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.12)); }

.m-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.m-fig { position: relative; margin: 0; padding: 12px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.m-svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.m-states path { stroke: var(--map-line); stroke-width: 1; stroke-linejoin: round; cursor: pointer; transition: fill .35s ease; outline: none; }
.m-states path:hover, .m-states path:focus-visible { stroke: var(--ink); stroke-width: 1.5; }
.m-states path.is-sel { stroke: var(--map-sel); stroke-width: 2.5; }
.m-cities circle { fill: var(--map-dot); fill-opacity: .85; stroke: var(--map-line); cursor: pointer; outline: none; }
.m-cities circle:hover, .m-cities circle:focus-visible, .m-cities circle.is-sel { fill: #ec4899; fill-opacity: 1; }
.m-tip { position: absolute; left: 0; top: 0; z-index: 5; display: grid; gap: 2px; max-width: 240px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-solid); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: .875rem; pointer-events: none; }
.m-tip b { font-weight: 800; }
.m-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 4px; }
.m-key { display: inline-block; width: 22px; height: 12px; border-radius: 4px; border: 1px solid var(--line); }
.m-legend__sep { width: 1px; height: 14px; margin: 0 6px; background: var(--line-strong); }
.m-legend__range { margin-left: auto; font-variant-numeric: tabular-nums; }
.m-online { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: .9375rem; }
.m-online > svg { width: 22px; height: 22px; color: var(--primary); margin-top: 1px; }
.m-online > div { display: grid; gap: 2px; }

.m-panel { display: grid; gap: 12px; align-content: start; padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); max-height: calc(100dvh - 40px); overflow-y: auto; position: sticky; top: 16px; }
.m-back { justify-self: start; gap: 6px; }
.m-back svg { width: 16px; height: 16px; }
.m-sum { display: grid; gap: 2px; }
.m-sum b { font: 800 1.375rem/1.2 var(--font-display); }
.m-h { margin: 6px 0 0; font: 800 1rem/1.2 var(--font-display); }
.m-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: m; }
.m-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 34%) auto; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: 600 .9375rem/1.2 var(--font-body, inherit); text-align: left; cursor: pointer; }
.m-row:hover, .m-row:focus-visible, .m-row[aria-pressed="true"] { background: var(--surface-2); }
.m-row__name small { display: block; font-weight: 500; color: var(--ink-soft); }
.m-row__bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.m-row__bar i { display: block; height: 100%; border-radius: 4px; background: var(--map-4); }
.m-row b { font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.m-draws { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.m-drawlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.m-drawlist li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.m-drawlist a { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 700; text-decoration: none; }
.m-drawlist a:hover { text-decoration: underline; }
.m-drawlist i { width: 10px; height: 10px; border-radius: 50%; background: var(--lot); }
.m-note { max-width: 60rem; margin-inline: auto; text-align: center; } /* pedido do dono (04/12/2026): a nota fica centralizada */
/* porcentagem de cada estado no total de ganhadores, como a da internet (pedido do dono, 04/12/2026) */
.m-row b { display: inline-flex; align-items: baseline; gap: 6px; }
.m-row__pct { min-width: 4.2ch; text-align: right; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); }

@media (max-width: 900px) {
  .m-grid { grid-template-columns: minmax(0, 1fr); }
  .m-panel { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .m-filters { padding: 14px; border-radius: 20px; }
  .m-lots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-seg { margin-left: 0; width: 100%; }
  .m-seg button { flex: 1; }
  .m-fig { padding: 6px; border-radius: 20px; }
  .m-legend__range { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .m-states path { transition: none; } }
/* bordas sempre finas, com ou sem zoom; com um estado aberto, os outros ficam apagados */
.m-states path, .m-cities circle { vector-effect: non-scaling-stroke; }
.m-cities circle { stroke-width: 1.5; }
.m-svg.has-sel .m-states path:not(.is-sel) { opacity: .35; }
.m-states path { transition: fill .35s ease, opacity .35s ease; }
.m-lots .g-lot[data-lot="-1"] { --lot: var(--primary); }
.m-drawlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; }
/* "Pela internet" dentro da lista dos estados (não é clicável: não tem estado nem cidade) */
.m-row--online { cursor: default; }
.m-row--online .m-row__name { display: inline-flex; align-items: center; gap: 6px; font-style: italic; }
.m-row--online .m-row__name svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.m-row--online .m-row__bar i { background: var(--accent); }

/* Números dentro de cada estado (v1.1.0): sigla pequena e porcentagem; a cor do texto acompanha o fundo */
.m-lab text { font-family: var(--font-body, inherit); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke-linejoin: round; }
.m-lab__uf { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.m-lab__v { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* cor do texto por tom do fundo (contraste): escuro nos tons claros, branco nos tons fortes */
.m-l0 text, .m-l1 text, .m-l2 text, .m-l3 text { fill: var(--map-ink-lo); }
.m-l4 text, .m-l5 text { fill: var(--map-ink-hi); }
:root[data-theme="dark"] .m-l3 text { fill: var(--map-ink-lo); }
.m-lab.is-out text { fill: var(--ink); }
.m-lab line { stroke: var(--ink-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.m-svg.has-sel .m-labels { display: none; } /* com um estado aberto aparecem as cidades */
@media (max-width: 640px) {
  /* no celular, dentro do estado só a porcentagem (a sigla aparece nos números que ficam no mar) */
  .m-lab:not(.is-out) .m-lab__uf { display: none; }
  .m-lab:not(.is-out) .m-lab__v { transform: translateY(-2px); }
  .m-lab__uf { font-size: 15px; }
  .m-lab__v { font-size: 19px; }
}

/* quadro "Pela internet" pintado com a cor do mapa de calor; texto escuro nos tons claros e branco nos fortes */
.m-online { border-color: color-mix(in srgb, var(--ink) 12%, transparent); }
.m-online.m-l1, .m-online.m-l2, .m-online.m-l3 { color: var(--map-ink-lo); }
.m-online.m-l4, .m-online.m-l5 { color: var(--map-ink-hi); }
:root[data-theme="dark"] .m-online.m-l3 { color: var(--map-ink-lo); }
.m-online:not(.m-c0) > svg, .m-online:not(.m-c0) .muted { color: inherit; opacity: .85; }
.m-online.m-c0 { background: var(--surface-2); }
.m-online.m-c1 { background: var(--map-1); }
.m-online.m-c2 { background: var(--map-2); }
.m-online.m-c3 { background: var(--map-3); }
.m-online.m-c4 { background: var(--map-4); }
.m-online.m-c5 { background: var(--map-5); }
