/* Axiom — mobile-first. Cores em variáveis; tema escuro automático. */
:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #ece7db;
  --ink: #1d1b34;
  --muted: #5f5c78;
  --line: #d9d3c4;
  --accent: #5b3df5;
  --accent-ink: #ffffff;
  --gold: #c27a00;
  --ok: #17803d;
  --ok-bg: #dff5e5;
  --bad: #c42b3a;
  --bad-bg: #fbe3e6;
  --shadow: 0 6px 24px rgba(40, 30, 90, 0.1);
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14122b;
    --surface: #1e1b3d;
    --surface-2: #2a2652;
    --ink: #f1eefc;
    --muted: #aaa6cc;
    --line: #34305f;
    --accent: #8f7bff;
    --accent-ink: #120f2e;
    --gold: #ffc247;
    --ok: #5fdc8a;
    --ok-bg: #123a27;
    --bad: #ff7b87;
    --bad-bg: #44192a;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 0;
  min-height: 100dvh;
}
.screen { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.screen[hidden] { display: none; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }

/* ---------- botões ---------- */
.btn {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.08s, filter 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 44px; align-self: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface);
  font-weight: 700; font-family: var(--mono);
}

/* ---------- início ---------- */
.home-top { display: flex; justify-content: space-between; align-items: center; }
.lang { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.lang-btn { border: 0; background: transparent; border-radius: 999px; min-width: 44px; height: 34px; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.lang-btn[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }
.brand { text-align: center; padding: 28px 0 22px; }
.logo {
  width: 64px; height: 64px; margin: 0 auto 10px;
  display: grid; place-items: center;
  border-radius: 20px; font-size: 2.2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: var(--accent-ink); transform: rotate(-6deg);
  box-shadow: var(--shadow);
}
.brand h1 { font-size: 2.6rem; letter-spacing: -0.04em; line-height: 1.1; }
.tagline { color: var(--muted); margin-top: 4px; }
.puzzle-no {
  display: inline-block; margin-top: 12px; padding: 3px 12px;
  border-radius: 999px; background: var(--surface-2);
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
}
.cards { display: grid; gap: 14px; }
.mode-card {
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  display: grid; gap: 10px; box-shadow: var(--shadow);
}
.mode-card .btn { justify-self: stretch; }
.mode-top { display: flex; align-items: center; gap: 10px; }
.mode-top h2 { font-size: 1.25rem; flex: 1; }
.mode-icon { font-size: 1.5rem; }
.check {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: var(--bg); font-weight: 700;
}
.mode-card p { color: var(--muted); }
.mode-card .mode-score { color: var(--ink); font-family: var(--mono); font-weight: 700; font-size: 1.3rem; }
.streak { text-align: center; margin: 22px 0 6px; font-weight: 700; }
.screen#screen-home { display: flex; flex-direction: column; }
.screen#screen-home[hidden] { display: none; }

/* ---------- jogo ---------- */
.game-head { display: flex; justify-content: space-between; align-items: center; min-height: 36px; }
.pill {
  padding: 4px 14px; border-radius: 999px; background: var(--surface-2);
  font-weight: 700; font-size: 0.9rem;
}
.pill.tier { background: var(--accent); color: var(--accent-ink); font-family: var(--mono); }
.hearts { font-size: 1.4rem; letter-spacing: 2px; }
.timerow { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.timebar { flex: 1; height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.timebar.low { animation: pulse 0.7s infinite alternate; }
.timebar-fill { height: 100%; width: 100%; transform-origin: left center; border-radius: 999px; background: hsl(140 70% 45%); }
.secs { font-family: var(--mono); font-weight: 700; min-width: 2.4ch; text-align: right; }
.qcard {
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 16px 14px 12px;
  text-align: center; position: relative; transition: border-color 0.15s, background 0.15s;
}
.qcard.ok { border-color: var(--ok); background: var(--ok-bg); animation: pop 0.35s; }
.qcard.bad { border-color: var(--bad); background: var(--bad-bg); animation: shake 0.4s; }
.prompt { color: var(--muted); font-weight: 500; }
.formula {
  overflow-x: auto; overflow-y: hidden; max-width: 100%;
  padding: 8px 0; margin: 4px 0;
  min-height: 3.2rem; display: flex; align-items: center;
}
.formula-inner { font-size: 1.9rem; max-width: none; margin: 0 auto; }
.formula .katex-display { margin: 0; }
.formula .katex { white-space: nowrap; }
.feedback { min-height: 1.6em; font-weight: 700; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.answer {
  margin: 12px 0; min-height: 64px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--accent); border-radius: 16px;
  font-family: var(--mono); font-weight: 700; font-size: 2rem; letter-spacing: 0.02em;
  overflow: hidden;
}
.answer[data-empty='1']::before { content: attr(data-placeholder); color: var(--muted); font-size: 1rem; font-weight: 500; font-family: var(--font); }
.keypad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding-bottom: env(safe-area-inset-bottom);
}
.key {
  min-height: 58px; border-radius: 16px; border: 0;
  background: var(--surface); box-shadow: 0 2px 0 var(--line), var(--shadow);
  font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  touch-action: manipulation; transition: transform 0.06s;
}
.key:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.key:disabled { opacity: 0.55; }
.key-aux { background: var(--surface-2); }
.key-ok { background: var(--accent); color: var(--accent-ink); grid-column: 1 / -1; font-family: var(--font); }

/* ---------- resultado ---------- */
.screen-title { font-size: 1rem; color: var(--muted); text-align: center; margin: 8px 0; font-weight: 500; }
.score-big { text-align: center; display: grid; margin: 8px 0 4px; }
.score-num { font-family: var(--mono); font-size: 4.2rem; font-weight: 700; line-height: 1.05; color: var(--accent); }
.score-unit { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; }
#screen-result > .muted { text-align: center; }
.emoji-row { text-align: center; font-size: 1.9rem; letter-spacing: 3px; margin: 10px 0 2px; }
.legend { text-align: center; font-size: 0.8rem; }
.breakdown { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 4px; }
.breakdown li { display: flex; justify-content: space-between; padding: 6px 12px; background: var(--surface); border-radius: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 14px 0; }
.stat { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; display: grid; }
.stat strong { font-family: var(--mono); font-size: 1.35rem; }
.stat span { font-size: 0.72rem; color: var(--muted); }
.section-title { font-size: 0.9rem; color: var(--muted); margin: 18px 0 8px; }
.dist { display: grid; gap: 4px; }
.dist-row { display: flex; align-items: center; gap: 8px; }
.dist-label { width: 1.2rem; font-family: var(--mono); font-size: 0.8rem; text-align: right; color: var(--muted); }
.dist-track { flex: 1; }
.dist-bar {
  background: var(--surface-2); color: var(--ink); border-radius: 6px; min-height: 22px;
  padding: 0 8px; text-align: right; font-family: var(--mono); font-size: 0.8rem; line-height: 22px; font-weight: 700;
}
.dist-row.today .dist-bar { background: var(--accent); color: var(--accent-ink); }
.next { text-align: center; margin: 22px 0 14px; color: var(--muted); display: grid; gap: 2px; }
.countdown { font-size: 2rem; font-weight: 700; color: var(--ink); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- modal e toast ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(10, 8, 30, 0.6);
  display: grid; place-items: center; padding: 16px; z-index: 20;
}
.modal {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  max-width: 440px; width: 100%; max-height: 90dvh; overflow-y: auto;
  display: grid; gap: 12px; box-shadow: var(--shadow);
}
.modal h2 { font-size: 1.4rem; }
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-weight: 700; transition: opacity 0.2s, transform 0.2s; z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- animações ---------- */
@keyframes pop { 50% { transform: scale(1.03); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pulse { to { opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 360px) {
  .formula-inner { font-size: 1.5rem; }
  .key { min-height: 52px; }
}
@media (max-height: 640px) {
  .key { min-height: 48px; }
  .answer { min-height: 54px; margin: 8px 0; }
}

/* ---------- Personagem (vida escolar) ---------- */
.kid-row {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 8px;
}
.kid-avatar { width: 52px; height: 55px; flex: none; transform-origin: 50% 100%; }
.kid-avatar svg { width: 100%; height: 100%; display: block; }
.kid-avatar[data-mood='joy'] { animation: kid-hop 0.45s ease-out; }
.kid-avatar[data-mood='sad'] { animation: kid-droop 0.5s ease-out; }
.kid-label { font-weight: 700; font-size: 0.95rem; color: var(--muted); }
@keyframes kid-hop { 0% { transform: translateY(0); } 40% { transform: translateY(-8px) scale(1.06); } 100% { transform: translateY(0); } }
@keyframes kid-droop { 0% { transform: rotate(0); } 30% { transform: rotate(-6deg); } 60% { transform: rotate(4deg); } 100% { transform: rotate(0); } }

.kid-hero { width: 150px; height: 158px; margin: 4px auto 0; }
.kid-hero svg { width: 100%; height: 100%; display: block; }
.kid-hero.graduated { animation: kid-hop 0.6s ease-out 0.2s 2; }
.kid-reached { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 8px; }
.kid-reached strong { font-size: 1.2rem; }
.kid-svg .bubble { animation: bubble 1.4s ease-in infinite; }
.kid-svg .bubble.b2 { animation-delay: 0.6s; }
.kid-svg .twinkle { transform-box: fill-box; transform-origin: center; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.6); opacity: 0.5; } }

/* Animação de evolução entre perguntas */
.evo-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: evo-fade-in 0.2s ease-out;
}
.evo-overlay.evo-out { animation: evo-fade-out 0.2s ease-in forwards; }
.evo-stage { position: relative; width: 210px; height: 220px; }
.evo-old, .evo-new { position: absolute; inset: 0; transform-origin: 50% 95%; }
.evo-old svg, .evo-new svg { width: 100%; height: 100%; display: block; }
.evo-old { animation: evo-old 0.55s ease-in forwards; }
.evo-new { opacity: 0; animation: evo-new 0.65s cubic-bezier(0.2, 1.4, 0.4, 1) 0.45s forwards; }
.evo-burst {
  position: absolute; left: 50%; top: 55%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--gold) 45%, transparent 70%);
  opacity: 0; animation: evo-burst 0.7s ease-out 0.35s forwards;
}
.evo-confetti i {
  position: absolute; left: 50%; top: 50%; width: 9px; height: 14px; border-radius: 2px;
  background: var(--c); opacity: 0;
  animation: evo-confetti 0.9s cubic-bezier(0.1, 0.7, 0.3, 1) 0.5s forwards;
}
.evo-label {
  margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--ink);
  opacity: 0; animation: evo-label 0.45s ease-out 0.7s forwards;
}
.evo-emoji { display: inline-block; }
@keyframes evo-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes evo-fade-out { to { opacity: 0; } }
@keyframes evo-old {
  0% { transform: scale(1); filter: brightness(1); opacity: 1; }
  60% { transform: scale(1.06); filter: brightness(2.2); opacity: 1; }
  100% { transform: scale(0.7); filter: brightness(3); opacity: 0; }
}
@keyframes evo-new {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes evo-burst {
  0% { transform: scale(0.2); opacity: 0.9; }
  100% { transform: scale(7); opacity: 0; }
}
@keyframes evo-confetti {
  0% { transform: rotate(var(--a)) translateY(0) rotate(0); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) rotate(220deg); opacity: 0; }
}
@keyframes evo-label {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-height: 640px) {
  .kid-row { margin: 0 0 4px; }
  .kid-avatar { width: 40px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .kid-avatar, .kid-hero, .evo-old, .evo-new, .evo-burst, .evo-confetti i, .evo-label,
  .kid-svg .bubble, .kid-svg .twinkle { animation-duration: 0.01s !important; animation-delay: 0s !important; }
  .evo-old { display: none; }
}
/* halo atrás do personagem (contraste no tema escuro) */
.evo-stage::before, .kid-hero, .kid-avatar {
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--accent) 28%, transparent) 0%, transparent 68%);
}
.evo-stage::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 240px; height: 240px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 30%, transparent) 0%, color-mix(in srgb, var(--accent) 22%, transparent) 45%, transparent 70%);
}
.kid-avatar { border-radius: 50%; }

/* ---------- Gráfico (área entre curvas) ---------- */
.plot { margin: 4px 0 2px; }
.plot-svg { width: 100%; height: auto; display: block; max-height: 190px; }
.plot-grid line { stroke: var(--line); stroke-width: 1; opacity: 0.6; }
.plot-axis line { stroke: var(--muted); stroke-width: 1.6; }
.plot-area { fill: color-mix(in srgb, var(--gold) 38%, transparent); stroke: none; }
.plot-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.plot-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.plot-tick { font: 600 11px var(--mono); fill: var(--muted); }
.plot-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 4px; font-size: 1.05rem; }
.plot-key { display: inline-flex; align-items: center; gap: 6px; }
.plot-key::before { content: ''; width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.formula[hidden] { display: none; }
.plot-svg { max-height: 150px; }
.kid-avatar { width: 46px; height: 48px; }
.kid-row { margin: 0 0 6px; }
.kid-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kid-main .timerow { margin: 0; }
.kid-label { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plot-svg { max-height: 140px; }

/* ---------- Figuras de geometria ---------- */
.figure { margin: 4px 0 2px; }
.figure-svg { width: 100%; height: auto; max-height: 200px; display: block; }
.fig-shape { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.fig-shade { fill: color-mix(in srgb, var(--gold) 34%, transparent); }
.fig-seg { stroke: var(--ink); stroke-width: 2; }
.fig-dashed { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 1.6; }
.fig-mark { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.fig-grid line { stroke: var(--line); stroke-width: 1; }
.fig-axes line { stroke: var(--muted); stroke-width: 1.5; }
.fig-label {
  font: 700 15px var(--mono); fill: var(--ink);
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
.fig-unknown { fill: var(--accent); font-style: italic; font-size: 17px; }

/* ---------- Forja ---------- */
.forge-target { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 2px 0 4px; }
.forge-make { font-weight: 700; color: var(--muted); font-size: 1.1rem; }
.forge-num { font-family: var(--mono); font-weight: 700; font-size: 2.6rem; color: var(--accent); line-height: 1; }
.forge-rules { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.forge-rules li {
  display: flex; align-items: center; gap: 8px; font-size: 0.92rem;
  padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1.5px solid var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.forge-rules li.ok { border-color: var(--ok); background: var(--ok-bg); }
.rule-icon { width: 1.3em; text-align: center; }
.forge-box {
  background: var(--surface); border: 2px solid var(--accent); border-radius: 16px;
  padding: 6px 10px 8px; margin-bottom: 8px;
}
.forge-box.shake { animation: shake 0.4s; }
.forge-expr { min-height: 3.1rem; overflow-x: auto; overflow-y: hidden; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.forge-expr .katex-display { margin: 0; }
.forge-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.85rem; }
.forge-status { font-family: var(--mono); font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forge-status.muted { color: var(--muted); font-family: var(--font); font-weight: 500; }
.forge-status.hit { color: var(--ok); }
.forge-status.bad { color: var(--bad); font-family: var(--font); }
.forge-count { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.forge-count.under { color: var(--ok); font-weight: 700; }
.forge-count.over { color: var(--gold); }
.forge-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.fkey {
  min-height: 46px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  font: 600 1.05rem var(--mono);
}
.fkey:active { transform: translateY(1px); }
.fkey-num { font-weight: 700; font-size: 1.2rem; }
.fkey-fn { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); font-size: 0.95rem; }
.fkey-aux { background: color-mix(in srgb, var(--ink) 10%, var(--surface)); }
.forge-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 8px; }
.forge-panel {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
  animation: panel-up 0.25s ease-out;
}
.forge-panel-title { font-size: 1.5rem; }
.forge-panel .btn { width: 100%; margin-top: 6px; }
.forge-ref:empty { display: none; }
@keyframes panel-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.forge-breakdown li { flex-direction: column; align-items: stretch; }
.forge-row { display: flex; justify-content: space-between; gap: 8px; }
.forge-mini { overflow-x: auto; padding-top: 2px; font-size: 0.95rem; }
@media (max-height: 700px) {
  .fkey { min-height: 40px; }
  .forge-num { font-size: 2.1rem; }
}
.mode-sub { font-size: 0.8rem; color: var(--muted); font-style: italic; margin-left: auto; }
.forge-mini { overflow-y: hidden; scrollbar-width: none; } .forge-mini::-webkit-scrollbar { display: none; }

/* ---------- Fundo arcade ---------- */
#arcade-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: block; }
#app { position: relative; z-index: 1; }
/* com o fundo animado, cartões ganham um vidro leve para continuar legíveis */
.mode-card, .qcard, .answer, .forge-box, .forge-rules li, .stat, .breakdown li, .pill, .key, .fkey {
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.plot-svg .plot-tick { font-size: 12.5px; }
.plot-svg .plot-tick-v { fill: var(--ink); }
.plot .plot-svg { max-height: 145px; }

/* ---------- Distribuição dos jogadores do dia ---------- */
:root { --dist-bar: #5b3df5; --dist-me: #c27a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --dist-bar: #8f7bff; --dist-me: #c2841a; } }
:root[data-theme='dark'] { --dist-bar: #8f7bff; --dist-me: #c2841a; }
.dist-box { margin: 6px 0 14px; padding: 12px 12px 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); }
.dist-box .section-title { margin: 0 0 4px; }
.dist-headline { margin: 0 0 10px; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.dist-headline.good::before { content: '🏆 '; }
.dist-chart { display: flex; align-items: flex-end; gap: 2px; height: 110px; padding-top: 18px; }
.dist-col { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; cursor: default; outline-offset: 2px; }
.dist-col:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.dist-fill { width: 100%; background: var(--dist-bar); border-radius: 4px 4px 0 0; opacity: 0.85; transition: opacity 0.15s; }
.dist-col:hover .dist-fill, .dist-col:focus .dist-fill { opacity: 1; }
.dist-col.me .dist-fill { background: var(--dist-me); opacity: 1; }
.dist-you {
  position: absolute; left: 50%; bottom: calc(100% + 0px); transform: translateX(-50%);
  font: 700 0.7rem var(--mono); color: var(--ink); white-space: nowrap;
}
.dist-col.me { z-index: 1; }
.dist-col.me .dist-you { bottom: auto; top: -16px; }
.dist-axis { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); border-top: 1.5px solid var(--line); padding-top: 3px; }
.dist-caption { margin: 6px 0 0; font-size: 0.82rem; color: var(--ink); min-height: 1.2em; }
.dist-total { margin: 2px 0 0; font-size: 0.8rem; }
.dist-loading { margin: 0; font-size: 0.85rem; }
.dist-fill { position: relative; }
.dist-col.me .dist-you, .dist-you { position: absolute; top: auto; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); }
.privacy-link { display: block; text-align: center; font-size: 0.85rem; color: var(--muted); }
