:root {
  color-scheme: light;
  --page: #fff4dc;
  --surface: #ffffff;
  --surface-2: #fff9ec;
  --ink: #1d1b16;
  --ink-2: #5b5648;
  --muted: #8a8270;
  --grid: #ecdcb5;
  --axis: #d3c193;
  --ring: rgba(29, 27, 22, 0.14);
  --line: #1d1b16;
  --accent: #2a78d6;
  --good: #0ca30c;
  --good-ink: #006300;
  --warn: #fab219;
  --track: #f0e4c4;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --c5: #e87ba4; --c6: #008300; --c7: #4a3aa7; --c8: #e34948;
  --valid: #2a78d6;
  --blank: #b9b7ae;
  --null: #6f6d66;
  --abst: transparent;
  --shadow: 5px 5px 0 var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #1c1a24; --surface: #2b2836; --surface-2: #353142;
    --ink: #fbf7ee; --ink-2: #c9c3b4; --muted: #9a93a8;
    --grid: #3e3a4b; --axis: #4a4559; --ring: rgba(255,255,255,0.12); --line: #000000;
    --accent: #3987e5; --good-ink: #0ca30c; --track: #403b4f;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
    --valid: #3987e5; --blank: #6d6b65; --null: #a9a79e;
    --shadow: 5px 5px 0 var(--line);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1c1a24; --surface: #2b2836; --surface-2: #353142;
  --ink: #fbf7ee; --ink-2: #c9c3b4; --muted: #9a93a8;
  --grid: #3e3a4b; --axis: #4a4559; --ring: rgba(255,255,255,0.12); --line: #000000;
  --accent: #3987e5; --good-ink: #0ca30c; --track: #403b4f;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767;
  --valid: #3987e5; --blank: #6d6b65; --null: #a9a79e;
  --shadow: 5px 5px 0 var(--line);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }

.refresh-bar {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50;
  background: var(--accent); transform-origin: left; transform: scaleX(0); opacity: .7;
}

/* ---------- topo ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--page) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand-kicker { display: block; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.brand h1 { margin: 0; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; }
.brand h1 span { color: var(--accent); }
.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--ring);
  background: var(--surface); display: grid; place-items: center;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 4px 16px 32px; }

.place-pill {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--ring);
  background: var(--surface); text-align: left; font-weight: 600;
}
.place-pill span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-pill .chev { color: var(--muted); }

.cargos {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 12px -16px 16px; padding: 2px 16px; scroll-snap-type: x proximity;
}
.cargos::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--ring);
  background: var(--surface); font-weight: 600; font-size: 15px; color: var(--ink-2);
}
.chip[aria-selected="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--ring); border-radius: 22px;
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.01em; }
.card .sub { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }

/* status / apuração */
.status { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
.ring { position: relative; width: 96px; height: 96px; }
.ring svg { transform: rotate(-90deg); }
.ring .bg { stroke: var(--track); }
.ring .fg { stroke: var(--accent); transition: stroke-dashoffset .8s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-label b { display: block; font-size: 22px; line-height: 1; letter-spacing: -.02em; }
.ring-label small { font-size: 11px; color: var(--muted); }
.headline { font-size: 17px; line-height: 1.35; margin: 0 0 8px; font-weight: 600; }
.headline em { font-style: normal; color: var(--accent); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good);
  animation: pulse 2s infinite;
}
.live.off::before { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12,163,12,.5); } 70% { box-shadow: 0 0 0 8px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }

.notice {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px;
}
.notice.sim { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); }
.btn {
  border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px;
  background: var(--ink); color: var(--page);
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ring); }

/* ---------- corrida (majoritário) ---------- */
.race { list-style: none; margin: 0; padding: 0; position: relative; }
.lane { position: relative; padding: 10px 0 12px; border-bottom: 1px solid var(--grid); }
.lane:last-child { border-bottom: 0; }
.lane-head {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: baseline; gap: 8px;
  width: 100%; padding: 0; background: none; border: 0; text-align: left;
}
.pos { font-size: 13px; font-weight: 700; color: var(--muted); }
.who { min-width: 0; }
.who b { display: block; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--ink-2); font-size: 13px; }
.pct { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pct small { font-size: 13px; font-weight: 600; color: var(--muted); }

.track { position: relative; height: 44px; margin: 8px 0 0 34px; }
.track-rail {
  position: absolute; left: 0; right: 22px; top: 50%; height: 10px; transform: translateY(-50%);
  border-radius: 999px; background: var(--track); overflow: visible;
}
.track-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%);
  border-radius: 999px; background: var(--c); transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.runner {
  position: absolute; top: 50%; left: var(--w, 0%); width: 44px; height: 44px;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px solid var(--c); background: var(--surface-2); overflow: hidden;
  box-shadow: 0 0 0 2px var(--surface); transition: left .9s cubic-bezier(.2,.8,.2,1);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--ink-2);
}
.runner img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.crown { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 16px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.goal {
  position: absolute; top: -18px; bottom: -18px; width: 0; left: var(--g);
  border-left: 2px dashed var(--ink-2); opacity: .45; pointer-events: none;
}
.race-scale { position: relative; height: 16px; margin: 4px 22px 0 34px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.race-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.race-scale span:first-child { transform: none; }
.race-scale span:last-child { transform: translateX(-100%); }
.race-scale .goal-tick { color: var(--ink); font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 2px;
  background: var(--surface-2); color: var(--ink-2);
}
.badge.win { background: color-mix(in srgb, var(--good) 18%, var(--surface)); color: var(--good-ink); }

.cut {
  display: flex; align-items: center; gap: 8px; margin: 2px 0; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.cut::before, .cut::after { content: ""; flex: 1; border-top: 2px dashed var(--axis); }

.details {
  display: none; margin: 10px 0 0 34px; padding: 12px; border-radius: 14px;
  background: var(--surface-2); font-size: 14px; color: var(--ink-2);
}
.lane.open .details { display: block; }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; color: var(--ink); }

.gap-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 20px; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- waffle ---------- */
.waffle { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin: 6px 0 14px; }
.cell { aspect-ratio: 1; border-radius: 3px; background: var(--track); }
.cell.valid { background: var(--valid); }
.cell.blank { background: var(--blank); }
.cell.null { background: var(--null); }
.cell.abst { background: transparent; box-shadow: inset 0 0 0 1.5px var(--axis); }
.cell.pend { background: var(--track); opacity: .5; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.legend li { display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: start; font-size: 13px; color: var(--ink-2); }
.legend li .sw { width: 12px; height: 12px; border-radius: 3px; margin-top: 3px; }
.legend li b { display: block; color: var(--ink); font-size: 15px; }

/* ---------- proporcional ---------- */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 74px 1fr 70px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.bars .lbl { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar { height: 12px; border-radius: 0 4px 4px 0; background: var(--accent); width: var(--w); min-width: 2px; transition: width .8s ease; }
.bars .v { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bars li .seats { display: flex; gap: 2px; flex-wrap: wrap; }

.seats-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.seat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.seat-chip b { font-size: 16px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: block; }

.search {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--ring);
  background: var(--surface-2); color: var(--ink); font: inherit; margin-bottom: 8px;
}
.cands { list-style: none; margin: 0; padding: 0; }
.cand {
  display: grid; grid-template-columns: 30px 44px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--grid);
}
.cand:last-child { border-bottom: 0; }
.cand .rank { font-size: 13px; font-weight: 700; color: var(--muted); text-align: right; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ink-2);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.cand .who b { font-size: 15px; }
.mini { height: 4px; border-radius: 0 4px 4px 0; background: var(--accent); margin-top: 6px; width: var(--w); min-width: 2px; }
.cand.elected .mini { background: var(--good); }
.cand .num { text-align: right; font-variant-numeric: tabular-nums; }
.cand .num b { display: block; font-size: 15px; }
.cand .num small { color: var(--muted); font-size: 12px; }
.more { width: 100%; margin-top: 10px; }
.empty { color: var(--muted); text-align: center; padding: 16px; font-size: 14px; }

/* ---------- sheet ---------- */
.sheet {
  width: 100%; max-width: 560px; max-height: 85vh; margin: auto auto 0; padding: 8px 16px 16px;
  border: 0; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink);
}
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 22px; } }
.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet[open] { display: flex; flex-direction: column; animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--axis); margin: 4px auto 12px; }
.sheet-head { display: flex; gap: 8px; }
.sheet-head input { flex: 1; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--ring); background: var(--surface-2); color: var(--ink); font: inherit; }
.place-list { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; }
.place-list button {
  width: 100%; text-align: left; padding: 13px 8px; background: none; border: 0;
  border-bottom: 1px solid var(--grid); font-size: 15px;
}
.place-list button[aria-current="true"] { color: var(--accent); font-weight: 700; }

/* ---------- skeleton ---------- */
.skeleton .sk-line, .skeleton .sk-block { background: var(--surface-2); border-radius: 8px; animation: shimmer 1.2s infinite alternate; }
.sk-line { height: 14px; margin-bottom: 10px; }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; }
.sk-block { height: 220px; margin-top: 16px; }
@keyframes shimmer { to { opacity: .45; } }

.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.lane .who b, .cand .who b { white-space: normal; }
.race-scale .goal-tick { transform: translateX(-50%); }

/* abrangência (Presidente) */
.scope { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 14px; background: var(--surface-2); }
.scope button { border: 0; border-radius: 10px; padding: 9px 8px; background: transparent; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring); }

/* ---------- arena (bate-papo + jogo), estilo cartoon ---------- */
@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --a-bg: #fff4dc;
  --a-card: #ffffff;
  --a-card-2: #fff9ec;
  --a-ink: #1d1b16;
  --a-ink-2: #5b5648;
  --a-line: #1d1b16;
  --a-shadow: 3px 3px 0 var(--a-line);
  --a-shadow-lg: 5px 5px 0 var(--a-line);
  --a-yellow: #ffd23f;
  --a-pink: #ff7eb3;
  --a-blue: #5bc8f5;
  --a-green: #4ade80;
  --a-red: #ff6b6b;
  --a-purple: #a78bfa;
  --a-on: #1d1b16;
  --a-track: #f0e4c4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --a-bg: #1c1a24; --a-card: #2b2836; --a-card-2: #353142;
    --a-ink: #fbf7ee; --a-ink-2: #c9c3b4; --a-line: #000000; --a-track: #403b4f;
  }
}
:root[data-theme="dark"] {
  --a-bg: #1c1a24; --a-card: #2b2836; --a-card-2: #353142;
  --a-ink: #fbf7ee; --a-ink-2: #c9c3b4; --a-line: #000000; --a-track: #403b4f;
}

.arena, .fab-wrap { font-family: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif; }
.arena button, .arena input, .fab-wrap button { font-family: inherit; }

/* botão flutuante */
.fab-wrap { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.chat-fab {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 18px 10px 12px;
  border: 3px solid var(--a-line); border-radius: 999px; background: var(--a-yellow); color: var(--a-on);
  box-shadow: var(--a-shadow-lg); font-weight: 700; font-size: 18px; transition: transform .12s, box-shadow .12s;
  animation: wobble 3.5s ease-in-out infinite;
}
.chat-fab:hover { transform: translate(-1px, -1px); }
.chat-fab:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--a-line); }
.fab-ico { font-size: 26px; line-height: 1; }
@keyframes wobble { 0%, 86%, 100% { transform: rotate(0); } 89% { transform: rotate(-7deg); } 93% { transform: rotate(6deg); } 96% { transform: rotate(-3deg); } }
.chat-unread {
  position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px; background: var(--a-red); color: #fff; border: 2px solid var(--a-line);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.chat-unread[hidden] { display: none; }
.fab-hint {
  position: relative; max-width: 220px; padding: 8px 12px; border: 3px solid var(--a-line); border-radius: 16px;
  background: var(--a-card); color: var(--a-ink); font-weight: 600; font-size: 14px; box-shadow: var(--a-shadow);
  animation: bounce 1.6s ease-in-out infinite;
}
.fab-hint::after {
  content: ""; position: absolute; right: 28px; bottom: -10px; width: 14px; height: 14px; background: var(--a-card);
  border-right: 3px solid var(--a-line); border-bottom: 3px solid var(--a-line); transform: rotate(45deg);
}
.fab-hint[hidden] { display: none; }
@keyframes bounce { 50% { transform: translateY(-5px); } }
.wrap { padding-bottom: 110px; }

/* folha */
.sheet.arena {
  position: relative; overflow: hidden; height: 88vh; max-height: 88vh; background: var(--a-bg); color: var(--a-ink);
  border: 3px solid var(--a-line); border-bottom: 0;
}
@media (min-width: 640px) { .sheet.arena { border-bottom: 3px solid var(--a-line); box-shadow: 8px 8px 0 var(--a-line); } }
.arena .sheet-grip { background: var(--a-line); opacity: .35; }
.arena .chat-head { display: flex; align-items: center; gap: 10px; }
.mascot { font-size: 26px; display: inline-block; animation: wobble 4s ease-in-out infinite; }
.head-txt { flex: 1; min-width: 0; }
.arena .chat-head h2 { margin: 0; font-size: 19px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.arena .chat-head small { color: var(--a-ink-2); font-size: 12px; }

/* peças base */
.a-card { background: var(--a-card); border: 3px solid var(--a-line); border-radius: 20px; box-shadow: var(--a-shadow); padding: 14px; }
.a-icon, .a-btn {
  border: 3px solid var(--a-line); background: var(--a-card); color: var(--a-ink); box-shadow: var(--a-shadow);
  font-weight: 700; transition: transform .08s, box-shadow .08s;
}
.a-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 16px; flex: none; }
.a-btn { border-radius: 14px; padding: 10px 16px; font-size: 15px; }
.a-icon:active, .a-btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--a-line); }
.a-btn:disabled { opacity: .55; cursor: not-allowed; }
.a-btn.yellow { background: var(--a-yellow); color: var(--a-on); }
.a-btn.blue { background: var(--a-blue); color: var(--a-on); }
.a-btn.big { width: 100%; padding: 14px; font-size: 18px; border-radius: 16px; }
.a-btn.ghost { width: 100%; margin-top: 10px; background: transparent; box-shadow: none; border-style: dashed; }
.a-btn.round { width: 48px; height: 48px; padding: 0; border-radius: 50%; font-size: 24px; line-height: 1; }
.link { border: 0; background: none; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; }

/* jogador */
.me-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 8px; padding: 7px 10px; background: var(--a-card); border: 3px solid var(--a-line); border-radius: 20px; box-shadow: var(--a-shadow); }
.me-bar[hidden] { display: none; }
.me-av {
  position: relative; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--a-line);
  background: color-mix(in srgb, var(--mc) 35%, var(--a-card)); font-size: 26px; display: grid; place-items: center; padding: 0;
}
.me-av .star { position: absolute; right: -8px; bottom: -6px; }
.me-info { min-width: 0; }
.me-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.me-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-badges { font-size: 14px; white-space: nowrap; overflow: hidden; }
.me-sub { font-size: 11px; color: var(--a-ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-bar { position: relative; height: 20px; margin-top: 4px; border: 2px solid var(--a-line); border-radius: 999px; background: var(--a-track); overflow: hidden; }
.xp-bar i {
  position: absolute; inset: 0 auto 0 0; width: var(--w); border-right: 2px solid var(--a-line);
  background: repeating-linear-gradient(-45deg, var(--a-green) 0 10px, color-mix(in srgb, var(--a-green) 70%, #fff) 10px 20px);
  background-size: 28px 28px; animation: stripes 1s linear infinite; transition: width .7s cubic-bezier(.3, 1.4, .5, 1);
}
.xp-bar span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 700; line-height: 16px; color: var(--a-on); }
:root[data-theme="dark"] .xp-bar span { color: var(--a-ink); text-shadow: 0 1px 2px #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .xp-bar span { color: var(--a-ink); text-shadow: 0 1px 2px #000; } }
@keyframes stripes { to { background-position: 28px 0; } }
.me-rank {
  display: grid; justify-items: center; line-height: 1.05; padding: 6px 10px; border: 3px solid var(--a-line); border-radius: 14px;
  background: var(--a-yellow); color: var(--a-on); box-shadow: var(--a-shadow);
}
.me-rank span { font-size: 18px; }
.me-rank b { font-size: 18px; }
.me-rank small { font-size: 10px; }

/* abas */
.game-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.game-tabs[hidden] { display: none; }
.game-tabs button {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 4px;
  border: 3px solid var(--a-line); border-radius: 14px; background: var(--a-card); color: var(--a-ink); font-weight: 700; font-size: 15px;
  box-shadow: var(--a-shadow); transition: transform .08s, box-shadow .08s, background .15s;
}
.game-tabs button span { font-size: 18px; }
.game-tabs button[aria-selected="true"] { background: var(--a-pink); color: var(--a-on); transform: translate(3px, 3px); box-shadow: 0 0 0 var(--a-line); }
.tab-dot { position: absolute; top: -7px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--a-red); border: 2px solid var(--a-line); animation: a-pulse 1.2s infinite; }
.tab-dot[hidden] { display: none; }
@keyframes a-pulse { 50% { transform: scale(1.25); } }

.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 12px; }
.pane[hidden] { display: none; }
.pane.scroll { overflow-y: auto; gap: 14px; padding: 2px 6px 10px 2px; }

/* selos */
.star {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 5px; font-size: 11px; font-weight: 700; color: var(--a-on);
  background: var(--a-yellow); border: 2px solid var(--a-line); vertical-align: -5px;
  clip-path: polygon(50% 0, 63% 32%, 98% 35%, 71% 58%, 80% 95%, 50% 75%, 20% 95%, 29% 58%, 2% 35%, 37% 32%);
}
.tor { display: inline-grid; place-items: center; min-width: 24px; height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 6px; border: 2px solid var(--a-line); font-size: 10px; font-weight: 700; color: #fff; background: var(--tc); vertical-align: 1px; }
.bd { margin-left: 3px; font-size: 13px; }

/* mensagens */
.chat-list { list-style: none; margin: 0; padding: 4px 6px 4px 2px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { display: grid; grid-template-columns: 38px minmax(0, auto); gap: 6px 8px; align-self: flex-start; max-width: 88%; animation: pop .25s cubic-bezier(.3, 1.6, .5, 1); }
.msg .av { grid-row: span 2; align-self: end; }
.av {
  width: 38px; height: 38px; border-radius: 50%; border: 2.5px solid var(--a-line); display: grid; place-items: center;
  font-size: 21px; background: color-mix(in srgb, var(--mc, var(--a-blue)) 35%, var(--a-card));
}
.av.sm { width: 32px; height: 32px; font-size: 17px; }
.bubble { position: relative; padding: 7px 12px 5px; border: 2.5px solid var(--a-line); border-radius: 18px 18px 18px 6px; background: var(--a-card); box-shadow: 2px 2px 0 var(--a-line); min-width: 0; }
.msg.mine { align-self: flex-end; grid-template-columns: minmax(0, auto); }
.msg.mine .av { display: none; }
.msg.mine .bubble { border-radius: 18px 18px 6px 18px; background: color-mix(in srgb, var(--a-blue) 45%, var(--a-card)); }
.msg-who { display: block; font-size: 13px; font-weight: 700; color: var(--a-ink-2); }
.msg.mine .msg-who { display: none; }
.msg-text { display: block; font-size: 16px; overflow-wrap: anywhere; }
.msg-text.big { font-size: 36px; line-height: 1.15; }
.msg time { display: block; text-align: right; font-size: 10px; color: var(--a-ink-2); }
.msg .rxs { grid-column: 2; }
.msg.mine .rxs { grid-column: 1; justify-content: flex-end; }
.msg.sys { grid-template-columns: auto 1fr; align-self: center; max-width: 96%; align-items: center; padding: 5px 12px 4px 8px; gap: 2px 8px; border: 2.5px solid var(--a-line); border-radius: 16px; background: var(--a-yellow); color: var(--a-on); box-shadow: 2px 2px 0 var(--a-line); }
.sys-ico { font-size: 20px; }
.sys-who { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.msg.sys span { font-size: 13px; font-weight: 500; }
.msg.sys time { color: var(--a-on); opacity: .7; }
.chat-list .empty { align-self: center; margin: auto; display: grid; justify-items: center; gap: 6px; color: var(--a-ink-2); }
.chat-list .empty span { font-size: 40px; }

.rxs { display: flex; flex-wrap: wrap; gap: 5px; }
.rx, .rx-pick button { display: inline-flex; align-items: center; gap: 3px; border: 2px solid var(--a-line); background: var(--a-card); color: var(--a-ink); border-radius: 999px; padding: 1px 8px; font-size: 14px; box-shadow: 1.5px 1.5px 0 var(--a-line); }
.rx b { font-size: 12px; }
.rx.on { background: var(--a-yellow); color: var(--a-on); }
.rx.add { opacity: .7; }
.rx.add:hover { opacity: 1; }
.rx-pick { display: inline-flex; gap: 4px; padding: 3px; border: 2px solid var(--a-line); border-radius: 999px; background: var(--a-card); animation: pop .2s cubic-bezier(.3, 1.6, .5, 1); }
.rx-pick button { font-size: 20px; padding: 0 5px; border: 0; box-shadow: none; background: none; transition: transform .1s; }
.rx-pick button:hover { transform: scale(1.3); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.chat-quick { display: flex; gap: 6px; padding: 10px 0 8px; overflow-x: auto; scrollbar-width: none; }
.chat-quick[hidden] { display: none; }
.chat-quick button { flex: none; border: 2px solid var(--a-line); background: var(--a-card); border-radius: 999px; padding: 3px 12px; font-size: 19px; box-shadow: 2px 2px 0 var(--a-line); }
.chat-quick button:active { transform: translate(2px, 2px); box-shadow: none; }
.chat-form { display: grid; gap: 6px; }
.chat-form[hidden] { display: none; }
.chat-form input, .join-form input {
  width: 100%; padding: 12px 14px; border: 3px solid var(--a-line); border-radius: 16px; background: var(--a-card); color: var(--a-ink); font: inherit; font-size: 16px;
}
.chat-form input:focus, .join-form input:focus { outline: none; box-shadow: 0 0 0 3px var(--a-blue); }
.chat-send { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat-send .a-btn { width: 52px; padding: 0; font-size: 20px; }
#joinCta { margin-top: 10px; }
#joinCta[hidden] { display: none; }

/* entrada */
.join-card { display: grid; gap: 14px; }
.join-hero { text-align: center; }
.join-hero > span { font-size: 54px; display: inline-block; animation: bounce 1.6s ease-in-out infinite; }
.join-hero h3 { margin: 0; font-size: 24px; }
.join-hero p { margin: 2px 0 0; color: var(--a-ink-2); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--a-card); border: 3px solid var(--a-line); border-radius: 16px; box-shadow: var(--a-shadow); }
.steps small { display: block; color: var(--a-ink-2); font-size: 13px; }
.step-ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px; border: 2.5px solid var(--a-line); border-radius: 12px; }
.step-ico.yellow { background: var(--a-yellow); } .step-ico.pink { background: var(--a-pink); } .step-ico.blue { background: var(--a-blue); }
.join-form { display: grid; gap: 4px; }
.av-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
@media (max-width: 420px) { .av-grid { grid-template-columns: repeat(6, 1fr); } }
.av-opt { aspect-ratio: 1; border: 2.5px solid var(--a-line); border-radius: 14px; background: var(--a-card); font-size: 24px; padding: 0; transition: transform .12s; }
.av-opt.on { background: var(--a-yellow); transform: scale(1.12) rotate(-6deg); box-shadow: var(--a-shadow); }
.join-form .a-btn.big { margin-top: 14px; }

/* bolão */
.q { margin: 14px 0 8px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.q.small { font-size: 15px; margin-top: 4px; }
.q small { color: var(--a-ink-2); font-weight: 500; font-size: 12px; }
.q .num { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2.5px solid var(--a-line); background: var(--a-pink); color: var(--a-on); font-size: 14px; }
.hint { font-size: 13px; color: var(--a-ink-2); margin: 8px 0 0; }
.hint.center { text-align: center; }

.race-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.race-switch button {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 3px solid var(--a-line); border-radius: 16px;
  background: var(--a-card); color: var(--a-ink); font-weight: 700; font-size: 13px; box-shadow: var(--a-shadow);
}
.race-switch button[aria-selected="true"] { background: var(--a-blue); color: var(--a-on); transform: translate(3px, 3px); box-shadow: none; }
.rs-emoji { font-size: 22px; }
.rs-mark { position: absolute; top: -9px; right: -7px; font-size: 15px; }
.rs-mark .dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--a-red); border: 2px solid var(--a-line); animation: a-pulse 1.2s infinite; }

.bolao-card header h3, .sec { margin: 0; font-size: 20px; }
.bolao-card h3 small, .sec small { color: var(--a-ink-2); font-weight: 500; font-size: 13px; }
.apur { margin: 10px 0; }
.apur-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--a-ink-2); margin-bottom: 4px; }
.apur-bar { position: relative; height: 16px; border: 2.5px solid var(--a-line); border-radius: 999px; background: var(--a-track); }
.apur-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--a-blue); border-radius: 999px; transition: width .7s ease; }
.apur-bar b { position: absolute; top: -6px; bottom: -6px; left: var(--w); width: 4px; margin-left: -2px; background: var(--a-line); border-radius: 2px; }
.mult { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2.5px dashed var(--a-line); border-radius: 16px; background: var(--a-card-2); }
.mult-big { flex: none; font-size: 28px; font-weight: 700; padding: 4px 10px; border: 3px solid var(--a-line); border-radius: 14px; background: var(--a-green); color: var(--a-on); transform: rotate(-4deg); box-shadow: var(--a-shadow); }
.mult small { display: block; font-size: 12px; color: var(--a-ink-2); }
.mult > div:last-child { flex: 1; min-width: 0; }
.mult-bar { height: 8px; margin-top: 6px; border: 2px solid var(--a-line); border-radius: 999px; background: var(--a-track); overflow: hidden; }
.mult-bar i { display: block; height: 100%; width: var(--w); background: var(--a-green); }

.cand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cand-card {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; text-align: center;
  border: 3px solid var(--a-line); border-radius: 18px; background: var(--a-card); color: var(--a-ink); box-shadow: var(--a-shadow);
  transition: transform .12s cubic-bezier(.3, 1.6, .5, 1);
}
.cand-card:hover { transform: translateY(-2px); }
.cand-card.on { background: color-mix(in srgb, var(--cc) 30%, var(--a-card)); transform: scale(1.03) rotate(-1.5deg); }
.cand-card b { font-size: 15px; line-height: 1.15; margin-top: 4px; }
.cand-card small { font-size: 12px; color: var(--a-ink-2); }
.cc-n { position: absolute; top: 8px; left: 8px; min-width: 28px; padding: 1px 5px; border: 2px solid var(--a-line); border-radius: 8px; background: var(--cc); color: #fff; font-weight: 700; font-size: 12px; }
.cc-check { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; display: none; place-items: center; border: 3px solid var(--a-line); border-radius: 50%; background: var(--a-green); color: var(--a-on); font-weight: 700; }
.cand-card.on .cc-check { display: grid; animation: pop .25s cubic-bezier(.3, 1.6, .5, 1); }

.ph { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--a-line); background: var(--cc); overflow: hidden; display: grid; place-items: center; }
.ph img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ph .ini { color: #fff; font-size: 20px; }
.ph.big { width: 76px; height: 76px; }
.ph.sm { width: 34px; height: 34px; border-width: 2px; }
.ph.sm .ini { font-size: 12px; }
.ph.xs { width: 26px; height: 26px; border-width: 2px; }
.ph.xs .ini { font-size: 10px; }

.pct-box { display: flex; align-items: center; justify-content: center; gap: 18px; }
.pct-box output { min-width: 4.2em; text-align: center; font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bolao-form input[type=range] { width: 100%; margin-top: 8px; accent-color: var(--a-pink); height: 28px; }
.bolao-form .a-btn.big { margin-top: 2px; }

.ticket { margin-top: 12px; border: 3px solid var(--a-line); border-radius: 18px; background: var(--a-card-2); overflow: hidden; box-shadow: var(--a-shadow); }
.ticket-head { padding: 6px 12px; background: var(--a-yellow); color: var(--a-on); border-bottom: 3px dashed var(--a-line); font-weight: 700; }
.ticket-body { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 12px 14px 8px; }
.ticket-body small { display: block; font-size: 12px; color: var(--a-ink-2); }
.ticket-body > div > b { font-size: 19px; }
.hl { color: var(--a-ink); font-size: 15px; }
.ticket-foot { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px; }
.ticket-foot small { font-size: 12px; color: var(--a-ink-2); }
.ticket-mult { flex: none; font-size: 20px; font-weight: 700; padding: 1px 8px; border: 2.5px solid var(--a-line); border-radius: 12px; background: var(--a-green); color: var(--a-on); transform: rotate(-4deg); }
.ticket .a-btn.ghost { width: auto; margin: 0 12px 12px; display: block; width: calc(100% - 24px); }
.locked-msg { text-align: center; font-weight: 700; margin: 12px 0 0; }
.join-mini { display: grid; justify-items: center; text-align: center; gap: 6px; margin-top: 12px; }
.join-mini span { font-size: 40px; }
.join-mini p { margin: 0; }

.crowd ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crowd li { display: grid; grid-template-columns: auto minmax(0, 7em) 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.cr-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cr-bar { height: 14px; border: 2px solid var(--a-line); border-radius: 999px; background: var(--a-track); overflow: hidden; }
.cr-bar i { display: block; height: 100%; width: var(--w); background: var(--cc); transition: width .7s ease; }

.winner { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border: 3px solid var(--a-line); border-radius: 18px; background: var(--a-yellow); color: var(--a-on); box-shadow: var(--a-shadow); }
.winner small { display: block; font-size: 12px; }
.winner b { font-size: 20px; }
.score { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; border: 3px solid var(--a-line); border-radius: 16px; background: var(--a-card-2); }
.score.win { background: color-mix(in srgb, var(--a-green) 40%, var(--a-card)); }
.score small { display: block; font-size: 12px; color: var(--a-ink-2); }
.score-ico { font-size: 30px; }
.score-pts { font-size: 26px; font-weight: 700; }
.mini-rank { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 4px; }
.mini-rank li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; padding: 4px 8px; border: 2px solid var(--a-line); border-radius: 12px; background: var(--a-card-2); }

.rules summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.rules ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.rules li { display: grid; grid-template-columns: 28px 1fr; align-items: start; }
.rules li span { font-size: 18px; }

/* ranking */
.podio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin-top: 14px; }
.pod-col { display: grid; justify-items: center; text-align: center; gap: 2px; min-width: 0; }
.pod-av { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--a-line); display: grid; place-items: center; font-size: 30px; background: color-mix(in srgb, var(--mc) 35%, var(--a-card)); }
.p1 .pod-av { width: 68px; height: 68px; font-size: 38px; animation: bounce 2s ease-in-out infinite; }
.pod-av .crown { position: absolute; top: -22px; left: auto; font-size: 24px; transform: rotate(-12deg); }
.pod-nome { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; margin-top: 4px; }
.pod-col small { font-size: 12px; color: var(--a-ink-2); }
.pod-col.me .pod-nome { text-decoration: underline wavy var(--a-pink); }
.pod-block { width: 100%; margin-top: 4px; display: grid; place-items: start center; padding-top: 6px; font-size: 26px; border: 3px solid var(--a-line); border-bottom: 0; border-radius: 12px 12px 0 0; }
.p1 .pod-block { height: 92px; background: var(--a-yellow); }
.p2 .pod-block { height: 66px; background: var(--a-blue); }
.p3 .pod-block { height: 48px; background: var(--a-pink); }
.players { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.players li { display: grid; grid-template-columns: 26px auto 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; border: 2.5px solid var(--a-line); border-radius: 14px; background: var(--a-card-2); font-size: 15px; }
.players li.me { background: color-mix(in srgb, var(--a-blue) 40%, var(--a-card)); }
.players .pos { text-align: center; font-weight: 700; }
.p-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.torcidas { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.torcidas li { display: grid; grid-template-columns: auto minmax(0, 7.5em) 1fr; gap: 8px; align-items: center; font-size: 14px; }
.torcidas li.mine .t-nome { text-decoration: underline wavy var(--tc); }
.t-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.t-bar { position: relative; height: 22px; border: 2.5px solid var(--a-line); border-radius: 999px; background: var(--a-track); overflow: hidden; }
.t-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--tc); transition: width .7s ease; }
.t-bar em { position: relative; display: block; padding-left: 8px; font-style: normal; font-size: 11px; font-weight: 700; line-height: 17px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tor-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tor-btn { display: inline-flex; align-items: center; gap: 6px; border: 2.5px solid var(--a-line); background: var(--a-card); color: var(--a-ink); border-radius: 999px; padding: 3px 12px 3px 3px; font-size: 14px; font-weight: 600; box-shadow: 2px 2px 0 var(--a-line); }
.tor-btn.on { background: color-mix(in srgb, var(--tc) 35%, var(--a-card)); }
.a-card > .a-btn.yellow { width: 100%; margin-top: 12px; }

.badges { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.badges li { display: grid; justify-items: center; text-align: center; padding: 10px 8px; border: 2.5px dashed var(--a-line); border-radius: 16px; opacity: .6; }
.badges li.got { opacity: 1; border-style: solid; background: var(--a-yellow); color: var(--a-on); box-shadow: var(--a-shadow); }
.badges span { font-size: 28px; }
.badges b { font-size: 14px; }
.badges small { font-size: 11px; color: inherit; opacity: .8; }

/* toasts e confete */
.toasts { position: absolute; left: 0; right: 0; top: 70px; display: grid; justify-items: center; gap: 8px; pointer-events: none; z-index: 5; }
.toast {
  max-width: 90%; padding: 9px 16px; border: 3px solid var(--a-line); border-radius: 999px; background: var(--a-card); color: var(--a-ink);
  font-size: 15px; text-align: center; box-shadow: var(--a-shadow); animation: pop .3s cubic-bezier(.3, 1.8, .5, 1);
  transition: opacity .4s, transform .4s;
}
.toast.xp { background: var(--a-green); color: var(--a-on); font-weight: 700; font-size: 17px; }
.toast.good { background: var(--a-yellow); color: var(--a-on); }
.toast.bad { background: var(--a-red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-14px) scale(.9); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 10px; height: 14px; border: 2px solid var(--a-line); border-radius: 3px; background: var(--c); animation: fall var(--d) ease-in forwards; }
@keyframes fall { to { transform: translateY(88vh) rotate(var(--r)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .chat-fab, .mascot, .fab-hint, .join-hero > span, .p1 .pod-av, .xp-bar i { animation: none !important; }
}

/* ---------- tema cartoon do app ---------- */
body { font-family: "Fredoka", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif; }
button, input { font-family: inherit; }
.refresh-bar { height: 5px; background: var(--a-yellow); opacity: 1; border-bottom: 2px solid var(--line); }

.top { background: var(--page); backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand h1 { font-size: 28px; font-weight: 700; }
.brand h1 span {
  display: inline-block; margin-left: 2px; padding: 0 8px; border: 3px solid var(--line); border-radius: 10px;
  background: var(--a-yellow); color: var(--a-on); transform: rotate(-5deg); box-shadow: 2px 2px 0 var(--line);
}
.brand-kicker { font-weight: 600; color: var(--ink-2); }

/* botões e controles */
.icon-btn, .place-pill, .chip, .btn, .scope button, .search, .sheet-head input {
  border: 3px solid var(--line); box-shadow: 3px 3px 0 var(--line); color: var(--ink);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.icon-btn:active, .place-pill:active, .chip:active, .btn:active, .scope button:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.icon-btn { border-radius: 14px; background: var(--surface); }
.place-pill { border-radius: 18px; padding: 11px 14px; }
.place-pill .chev { color: var(--ink); }
.cargos { padding: 2px 16px 8px; margin-bottom: 12px; }
.chip { padding: 8px 16px; font-weight: 600; color: var(--ink); }
.chip[aria-selected="true"] { background: var(--a-pink); color: var(--a-on); border-color: var(--line); transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.btn { border-radius: 14px; background: var(--a-yellow); color: var(--a-on); font-weight: 700; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 3px dashed var(--line); box-shadow: none; }
.search, .sheet-head input { border-radius: 16px; background: var(--surface); box-shadow: none; }
.search:focus, .sheet-head input:focus { outline: none; box-shadow: 0 0 0 3px var(--a-blue); }
.scope { gap: 8px; padding: 0 4px 4px 0; background: none; }
.scope button { border-radius: 14px; background: var(--surface); color: var(--ink); }
.scope button[aria-checked="true"] { background: var(--a-blue); color: var(--a-on); transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }

/* cards */
.card { border: 3px solid var(--line); border-radius: 24px; margin-bottom: 20px; }
.card h2 { font-size: 21px; font-weight: 700; }
.headline { font-weight: 500; }
.headline em { font-weight: 700; color: var(--ink); background: linear-gradient(transparent 55%, color-mix(in srgb, var(--a-yellow) 85%, transparent) 55%); padding: 0 2px; }
:root[data-theme="dark"] .headline em { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--a-purple) 70%, transparent) 55%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .headline em { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--a-purple) 70%, transparent) 55%); } }
.notice { border: 3px dashed var(--line); border-radius: 18px; background: var(--surface-2); }
.notice.sim { background: var(--a-yellow); color: var(--a-on); border-style: solid; }

/* anel da apuração com contorno */
.ring::before, .ring::after { content: ""; position: absolute; border: 3px solid var(--line); border-radius: 50%; pointer-events: none; }
.ring::before { inset: 2px; }
.ring::after { inset: 11px; }
.ring .fg { stroke: var(--a-blue); }
.ring-label b { font-size: 21px; font-weight: 700; }

/* corrida */
.lane { border-bottom: 2px dashed var(--grid); }
.pos { font-size: 15px; color: var(--ink-2); }
.pct { font-weight: 700; }
.track-rail { height: 16px; border: 2.5px solid var(--line); background: var(--track); }
.track-fill { border-radius: 999px; }
.runner { width: 48px; height: 48px; border-width: 3px; box-shadow: 0 0 0 2.5px var(--line), 2px 3px 0 2.5px var(--line); }
.goal { border-left: 3px dashed var(--line); opacity: .6; }
.race-scale .goal-tick { font-weight: 700; }
.badge { border: 2px solid var(--line); font-size: 11px; color: var(--ink); background: var(--surface); padding: 0 8px; }
.badge.win { background: var(--a-green); color: var(--a-on); }
.cut { color: var(--ink-2); }
.cut::before, .cut::after { border-top: 3px dashed var(--line); opacity: .35; }
.details { border: 2.5px dashed var(--line); border-radius: 16px; }
.gap-row { gap: 12px; }
.stat { border: 3px solid var(--line); border-radius: 18px; box-shadow: 3px 3px 0 var(--line); }
.gap-row .stat:nth-child(1) { background: var(--a-yellow); color: var(--a-on); }
.gap-row .stat:nth-child(2) { background: var(--a-blue); color: var(--a-on); }
.gap-row .stat span { color: inherit; opacity: .8; }
.stat b { font-weight: 700; }

/* votos (waffle) */
.waffle { gap: 3px; }
.cell { border-radius: 4px; border: 1.5px solid var(--line); }
.cell.abst { box-shadow: none; border: 1.5px dashed var(--axis); }
.cell.pend { border-color: var(--axis); }
.legend li .sw { width: 14px; height: 14px; border: 2px solid var(--line); border-radius: 4px; }

/* proporcional */
.bars li { grid-template-columns: 82px 1fr 64px; padding: 4px 0; }
.bars .bar { height: 18px; border: 2.5px solid var(--line); border-radius: 0 10px 10px 0; box-shadow: 2px 2px 0 var(--line); }
.bars li:nth-child(8n+1) .bar { background: var(--c1); } .bars li:nth-child(8n+2) .bar { background: var(--c2); }
.bars li:nth-child(8n+3) .bar { background: var(--c3); } .bars li:nth-child(8n+4) .bar { background: var(--c4); }
.bars li:nth-child(8n+5) .bar { background: var(--c5); } .bars li:nth-child(8n+6) .bar { background: var(--c6); }
.bars li:nth-child(8n+7) .bar { background: var(--c7); } .bars li:nth-child(8n+8) .bar { background: var(--c8); }
.bars .v { font-weight: 600; color: var(--ink); }
.seat-chip { border: 2.5px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 2px 2px 0 var(--line); }
.dots i { width: 10px; height: 10px; border: 1.5px solid var(--line); background: var(--a-green); }
.cand { border-bottom: 2px dashed var(--grid); }
.cand .rank { font-size: 14px; color: var(--ink-2); }
.avatar { border: 2.5px solid var(--line); }
.mini { height: 8px; border: 2px solid var(--line); border-radius: 0 6px 6px 0; background: var(--a-blue); }
.cand.elected .mini { background: var(--a-green); }

/* folha de municípios */
.sheet:not(.arena) { background: var(--page); border: 3px solid var(--line); border-bottom: 0; }
@media (min-width: 640px) { .sheet:not(.arena) { border-bottom: 3px solid var(--line); box-shadow: 8px 8px 0 var(--line); } }
.sheet-grip { background: var(--line); opacity: .35; }
.place-list button { border-bottom: 2px dashed var(--grid); }
.place-list button[aria-current="true"] { color: var(--ink); background: var(--a-yellow); border-radius: 12px; }
:root[data-theme="dark"] .place-list button[aria-current="true"] { color: var(--a-on); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .place-list button[aria-current="true"] { color: var(--a-on); } }

.skeleton { border-style: dashed; }
.foot { color: var(--ink-2); }

/* ---------- destaques (cards estilo figurinha) ---------- */
.tops { padding-right: 0; overflow: hidden; }
.tc-row {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 0 -6px -4px; padding: 12px 18px 14px 4px;
}
.tc-row::-webkit-scrollbar { display: none; }
.tc {
  position: relative; flex: none; width: 150px; scroll-snap-align: start;
  display: grid; justify-items: center; text-align: center; gap: 1px; padding: 0 10px 12px;
  border: 3px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink);
  box-shadow: 4px 4px 0 var(--line); overflow: hidden; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.tc:nth-child(odd) { transform: rotate(-1.5deg); }
.tc:nth-child(even) { transform: rotate(1.5deg); }
button.tc:hover { transform: rotate(0) translateY(-3px); }
button.tc:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.tc::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 66px; background: var(--c); border-bottom: 3px solid var(--line);
  background-image: radial-gradient(rgba(255,255,255,.35) 2px, transparent 2.5px); background-size: 12px 12px;
}
.tc-pos { position: absolute; top: 6px; left: 8px; z-index: 1; font-size: 24px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 var(--line); }
.tc-photo {
  position: relative; width: 92px; height: 92px; margin-top: 18px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--line); background: var(--surface-2); display: grid; place-items: center;
  font-size: 26px; font-weight: 700; color: var(--ink-2); box-shadow: 0 0 0 4px var(--surface);
}
.tc-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.tc-num {
  position: relative; margin-top: -14px; min-width: 40px; padding: 0 8px; border: 2.5px solid var(--line); border-radius: 10px;
  background: var(--c); color: #fff; font-weight: 700; font-size: 14px;
}
.tc-nome { margin-top: 6px; font-size: 16px; line-height: 1.15; }
.tc-part { font-size: 12px; color: var(--ink-2); }
.tc-pct { margin-top: 4px; font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tc-pct small { font-size: 16px; }
.tc-votos { font-size: 11px; color: var(--ink-2); }
.tc-votos b { color: var(--ink); }
.tc-tag { margin-top: 6px; padding: 1px 10px; border: 2px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--a-on); }
.tc-tag.win { background: var(--a-green); }
.tc-tag.run { background: var(--a-yellow); }
.tc-tag.lead { background: var(--a-pink); }
.tc-tag.out { background: var(--surface-2); color: var(--ink-2); }

/* ---------- seletor de estado ---------- */
.uf-sec { list-style: none; }
.uf-title { margin: 14px 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.uf-sec:first-child .uf-title { margin-top: 4px; }
.uf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; padding: 0 4px 6px 0; }
.place-list .uf-grid button {
  width: auto; padding: 8px 4px; text-align: center; font-weight: 700; font-size: 15px;
  border: 2.5px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 2px 2px 0 var(--line);
}
.place-list .uf-grid button:active { transform: translate(2px, 2px); box-shadow: none; }
.place-list .uf-grid button[aria-current="true"] { background: var(--a-pink); color: var(--a-on); border-radius: 12px; }

/* ---------- papo ao vivo: widget flutuante, bolhas e emojis subindo ---------- */
.lw { position: fixed; left: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 28; }
.lw[hidden] { display: none; }
.lw-pill {
  display: flex; align-items: center; gap: 8px; max-width: min(300px, calc(100vw - 168px)); padding: 7px 12px 7px 10px;
  border: 3px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-align: left;
  box-shadow: 4px 4px 0 var(--line); transition: transform .08s, box-shadow .08s;
}
.lw-pill:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--line); }
.lw[data-state="open"] .lw-pill { display: none; }
.lw-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--a-red); border: 2px solid var(--line); animation: a-pulse 1.4s infinite; }
.lw-preview { min-width: 0; font-size: 13px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lw-preview b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-preview.tick { animation: lw-tick .4s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes lw-tick { from { transform: translateY(8px); opacity: 0; } }
.lw-badge { flex: none; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 999px; background: var(--a-red); color: #fff; font-size: 12px; font-weight: 700; }
.lw-badge[hidden] { display: none; }

.lw-panel { display: none; }
.lw[data-state="open"] .lw-panel {
  display: flex; flex-direction: column; width: min(360px, calc(100vw - 24px)); height: min(460px, 56vh);
  border: 3px solid var(--line); border-radius: 22px; background: var(--page); color: var(--ink);
  box-shadow: 6px 6px 0 var(--line); overflow: hidden; animation: lw-open .3s cubic-bezier(.3, 1.4, .5, 1); transform-origin: bottom left;
}
@keyframes lw-open { from { transform: scale(.7); opacity: 0; } }
/* celular: o painel sobe acima da fileira do botão da Arena */
@media (max-width: 640px) { .lw[data-state="open"] { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); } .lw[data-state="open"] .lw-panel { width: 100%; } }
.lw.erro .lw-form input { box-shadow: 0 0 0 3px var(--a-red); }
.lw-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; background: var(--a-yellow); color: var(--a-on); border-bottom: 3px solid var(--line); }
.lw-head > b { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-online { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border: 2px solid var(--line); border-radius: 999px; background: var(--a-green); font-size: 12px; font-weight: 700; white-space: nowrap; }
.lw-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-on); animation: a-pulse 1.4s infinite; }
.lw-btn { flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: 2px 2px 0 var(--line); }
.lw-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.lw-btn.off { opacity: .45; }
.lw-list { list-style: none; margin: 0; padding: 10px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.lw-list .empty { margin: auto; }
.lw-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px; border-top: 3px solid var(--line); background: var(--surface); }
.lw-form[hidden] { display: none; }
.lw-form input { min-width: 0; padding: 9px 12px; border: 2.5px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 15px; }
.lw-form input:focus { outline: none; box-shadow: 0 0 0 3px var(--a-blue); }
.lw-form .a-btn { width: 44px; padding: 0; font-size: 18px; }
.lw-join { margin: 8px; }
.lw-join[hidden] { display: none; }

/* mensagens dentro do widget */
.fi { display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: start; padding: 7px 9px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.fi.new { animation: fi-in .5s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes fi-in { from { transform: translateY(10px) scale(.96); opacity: 0; background: var(--a-yellow); } }
.fi.mine { background: color-mix(in srgb, var(--a-blue) 25%, var(--surface)); }
.fi.sys { background: var(--a-yellow); color: var(--a-on); }
.fi.sys time { color: var(--a-on); }
.fi-av { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--mc, var(--a-yellow)) 35%, var(--surface)); }
.fi-body { min-width: 0; }
.fi-body > b { display: flex; align-items: center; font-size: 13px; }
.fi-body p { margin: 1px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.fi-body p.big { font-size: 28px; line-height: 1.15; }
.fi time { margin-left: auto; padding-left: 8px; font-size: 10px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.fi-rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.fi-rx button {
  display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 13px; opacity: .5; transition: transform .1s, opacity .1s;
}
.fi-rx button.tem { opacity: 1; }
.fi-rx button.on { opacity: 1; background: var(--a-yellow); color: var(--a-on); }
.fi-rx button:hover:not(:disabled) { opacity: 1; transform: scale(1.12); }
.fi-rx button:disabled { cursor: default; }
.fi-rx b { font-size: 11px; }

/* bolhas acima da pílula, com o widget minimizado */
.bubbles {
  position: fixed; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: min(300px, calc(100vw - 150px)); pointer-events: none;
}
.bubble-live {
  pointer-events: auto; display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 12px 6px 6px; text-align: left;
  border: 2.5px solid var(--line); border-radius: 18px 18px 18px 6px; background: var(--surface); color: var(--ink);
  box-shadow: 3px 3px 0 var(--line); font-size: 13px; line-height: 1.25; animation: bl-in .45s cubic-bezier(.3, 1.6, .5, 1);
  transition: opacity .5s, transform .5s;
}
.bubble-live.sys { background: var(--a-yellow); color: var(--a-on); }
.bubble-live b { display: block; font-size: 12px; }
.bubble-live > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-av { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 17px; background: color-mix(in srgb, var(--mc) 35%, var(--surface)); }
.bubble-live.out { opacity: 0; transform: translateY(-12px); }
@keyframes bl-in { from { transform: translateX(-30px) scale(.8); opacity: 0; } }

.floaters { position: fixed; right: 40px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 26; width: 0; height: 0; pointer-events: none; }
.floater { position: absolute; left: 0; bottom: 0; font-size: 30px; animation: float-up 2.1s ease-out forwards; }
@keyframes float-up {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  15% { transform: translate(calc(var(--x) * .3), -30px) scale(1.15); opacity: 1; }
  100% { transform: translate(var(--x), -220px) rotate(var(--r)) scale(.9); opacity: 0; }
}
/* widget aberto no celular: o balão do bolão cobriria o campo de texto */
@media (max-width: 640px) { body:has(.lw[data-state="open"]) .fab-hint { display: none; } }
