/* ============================================================
 * SUM4FRAN — estilos
 * Temas via body[data-theme]; layout mobile-first;
 * duelo com tela dividida (retrato espelhado / paisagem).
 * ============================================================ */

/* ---------------- temas ---------------- */

:root {
    --radius: 22px;
    --radius-s: 14px;
    --font-display: "Changa One", system-ui, sans-serif;
    --font-body: "Rubik", system-ui, sans-serif;
}

/* Clássico: a paleta do ícone — rosa e roxo do lettering Sum4Fran */
body[data-theme="classico"] {
    --bg1: #f27fd6; --bg2: #b06ae8;
    --card: #fff6fc; --card-2: #ffe8f7;
    --ink: #47214f; --muted: #a77cae;
    --accent: #c452d6; --accent-ink: #ffffff;
    --box-a: #ffd1ef; --box-b: #ecd6ff; --box-ink: #47214f;
    --good: #22c281; --bad: #ff4d70; --time: #ffbf47;
    --shadow: 0 14px 34px rgba(120, 30, 110, .35);
}

/* Azul: a paleta original da primeira versão, agora desbloqueável */
body[data-theme="azul"] {
    --bg1: #4658e8; --bg2: #7b5cf0;
    --card: #ffffff; --card-2: #f2f4ff;
    --ink: #23264a; --muted: #7d81a8;
    --accent: #4658e8; --accent-ink: #ffffff;
    --box-a: #ffd166; --box-b: #6ee7b7; --box-ink: #23264a;
    --good: #2dd882; --bad: #ff5d73; --time: #ffd166;
    --shadow: 0 14px 34px rgba(28, 32, 90, .35);
}

body[data-theme="dark"] {
    --bg1: #191b22; --bg2: #23262f;
    --card: #262a35; --card-2: #2f3442;
    --ink: #eef0f6; --muted: #9aa0b4;
    --accent: #7c8cff; --accent-ink: #101223;
    --box-a: #3a4054; --box-b: #454c66; --box-ink: #eef0f6;
    --good: #3ddc97; --bad: #ff6b81; --time: #ffd166;
    --shadow: 0 14px 34px rgba(0, 0, 0, .55);
}

body[data-theme="neon"] {
    --bg1: #0b0f1e; --bg2: #101736;
    --card: #131a33; --card-2: #1a2244;
    --ink: #e8fbff; --muted: #7f8fc9;
    --accent: #00d4ff; --accent-ink: #04121c;
    --box-a: #1e2c56; --box-b: #251d4e; --box-ink: #a7f6ff;
    --good: #38ffb0; --bad: #ff3d81; --time: #f9f871;
    --shadow: 0 0 26px rgba(0, 212, 255, .28);
}

body[data-theme="candy"] {
    --bg1: #ff7eb6; --bg2: #ffb86b;
    --card: #fff7fb; --card-2: #ffe9f3;
    --ink: #5a2c46; --muted: #b07d97;
    --accent: #ff4f9a; --accent-ink: #ffffff;
    --box-a: #ffd6e8; --box-b: #ffe8c9; --box-ink: #5a2c46;
    --good: #38c98c; --bad: #ff5d73; --time: #ffb340;
    --shadow: 0 14px 34px rgba(160, 60, 110, .35);
}

body[data-theme="retro"] {
    --bg1: #2f4034; --bg2: #55684a;
    --card: #f4ead2; --card-2: #eadfc0;
    --ink: #3a3226; --muted: #8a7f65;
    --accent: #cf7b34; --accent-ink: #fff6e6;
    --box-a: #e0b040; --box-b: #7fa06a; --box-ink: #332c1f;
    --good: #5c9c5c; --bad: #c85450; --time: #e0b040;
    --shadow: 0 12px 26px rgba(30, 34, 24, .45);
}

body[data-theme="espaco"] {
    --bg1: #0b0d2a; --bg2: #251a52;
    --card: #16183c; --card-2: #1e2150;
    --ink: #eceafe; --muted: #8f8cc4;
    --accent: #8f7bff; --accent-ink: #0e0a2a;
    --box-a: #262a5e; --box-b: #33245f; --box-ink: #d9d4ff;
    --good: #4be3a7; --bad: #ff5d8f; --time: #ffd166;
    --shadow: 0 14px 40px rgba(0, 0, 8, .6);
}

/* ---------------- base ---------------- */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Rolagem sem barras: o conteúdo continua rolável em todas as telas,
 * mas nenhum trilho/cursor aparece (web e app). */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: linear-gradient(160deg, var(--bg1), var(--bg2));
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }

.ic { width: 1.15em; height: 1.15em; vertical-align: -.22em; flex: none; }

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .78rem; }

/* a interface só é revelada com o estado inicial carregado (sem CLS);
 * o fundo (com o tema salvo) faz o papel de splash */
body.booting .main, body.booting .toast, body.booting .modal { visibility: hidden; }

/* fundo decorativo flutuante */
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bubble {
    position: absolute;
    font-family: var(--font-display);
    font-size: 3.4rem;
    color: rgba(255, 255, 255, .12);
    animation: floaty 9s ease-in-out infinite;
}
.b1 { top: 8%;  left: 8%; }
.b2 { top: 16%; right: 10%; animation-delay: -2s; font-size: 2.4rem; }
.b3 { top: 46%; left: 4%;  animation-delay: -4s; }
.b4 { bottom: 20%; right: 6%; animation-delay: -1s; font-size: 2.8rem; }
.b5 { bottom: 8%;  left: 16%; animation-delay: -6s; }
.b6 { top: 64%; right: 22%; animation-delay: -3s; font-size: 2.2rem; }

@keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-22px) rotate(6deg); }
}

/* ---------------- telas / cartões ---------------- */

.main {
    position: relative;
    z-index: 1;
    height: 100vh;      /* fallback para navegadores sem dvh */
    height: 100dvh;
    display: flex;
    justify-content: center;
    overflow-y: auto;   /* se algo exceder a tela, rola em vez de cortar */
    overflow-x: hidden; /* nunca rolagem horizontal */
    overscroll-behavior: contain;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

.screen { display: none; width: 100%; max-width: 440px; }
.screen.active { display: block; margin: auto; animation: screen-in .28s cubic-bezier(.2, .9, .3, 1.1); }

@keyframes screen-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 18px;
    max-height: calc(100vh - 24px);   /* fallback */
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Telas de lista (progresso, loja, missões): cabeçalho e abas ficam
 * fixos e apenas o conteúdo rola — nada é cortado em telas baixas. */
.card-tall {
    height: min(680px, calc(100vh - 24px));   /* fallback */
    height: min(680px, calc(100dvh - 24px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.card-tall .card-head, .card-tall .tabs { flex: none; }
.card-tall .tab-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px 3px 6px;   /* contornos (outline) das listas não são cortados */
}

.card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.card-head h2 { font-family: var(--font-display); font-size: 1.4rem; flex: 1; font-weight: 400; }
.head-coins {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--card-2); border-radius: 999px; padding: 6px 12px;
    font-size: .9rem;
}
.head-coins .ic, .coin-ic .ic { color: var(--time); }

.icon-btn {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--card-2);
    color: var(--ink);
    font-size: 1.15rem;
    transition: transform .12s, background .2s;
    flex: none;
}
.icon-btn:active { transform: scale(.9); }

/* ---------------- botões ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 1rem;
    transition: transform .12s, filter .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; pointer-events: none; }

/* botões empilhados dentro de um card nunca ficam colados */
.card > .btn + .btn { margin-top: 10px; }
.ad-offers .btn + .btn { margin-top: 8px; }

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);   /* fallback */
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent);
}
.btn-primary:active { filter: brightness(1.08); }

.btn-ghost { background: var(--card-2); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }

.btn-big {
    width: 100%;
    padding: 16px;
    font-size: 1.15rem;
    margin-top: 14px;
    font-family: var(--font-display);
    letter-spacing: .04em;
    font-weight: 400;
}

.btn-ad {
    width: 100%;
    background: var(--card-2);
    color: var(--ink);
    border: 2px dashed var(--muted);   /* fallback */
    border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    margin-top: 8px;
    font-size: .92rem;
}
.ad-offers { margin-top: 6px; }
.ad-skip { text-align: center; margin-top: 8px; font-size: .82rem; }
.ad-count { text-align: center; font-family: var(--font-display); font-size: 1.3rem; margin: 14px 0; }

/* ---------------- home ---------------- */

.home-card { text-align: center; position: relative; padding-top: 26px; }

.logo {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 11vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: .01em;
    cursor: pointer;
    font-weight: 400;
}
.logo span { color: var(--accent); }
.logo-sub {
    text-transform: uppercase;
    letter-spacing: .35em;
    font-size: .72rem;
    color: var(--muted);
    margin-top: 6px;
}

.home-stats { display: flex; justify-content: center; gap: 10px; margin: 16px 0 4px; min-height: 39px; }

.pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--card-2);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 700;
}
.pill.wide { width: 100%; justify-content: center; margin-top: 8px; padding: 12px; }
.pill-ic .ic { color: var(--accent); }
.pill .streak-ic .ic, .streak-ic .ic { color: var(--time); }

.home-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
    min-height: 56px;   /* reserva o espaço desde o primeiro frame */
}

/* atalhos só com ícone (nome acessível via aria-label/title):
 * tamanho fixo em px (não herda o font-size dos antigos rótulos)
 * e conteúdo centralizado nos dois eixos */
.nav-btn.icon-only {
    padding: 0;
    min-height: 56px;
    justify-content: center;
}
.nav-btn.icon-only .ic { width: 26px; height: 26px; }
.nav-btn {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px 4px 10px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink);
    transition: transform .12s;
}
.nav-btn:active { transform: scale(.94); }
.nav-btn .ic { width: 1.5em; height: 1.5em; color: var(--accent); }
.nav-btn .dot {
    position: absolute; top: 8px; right: 10px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--bad);
    animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { transform: scale(1.35); } }

/* ---------------- desafio do dia (home) ---------------- */

.home-daily { display: flex; gap: 8px; margin-top: 12px; min-height: 64px; }
.daily-card {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 10px;
    text-align: left;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    color: var(--ink);
    transition: transform .12s;
}
.daily-card:active { transform: scale(.97); }
.daily-card .ic { color: var(--accent); width: 1.4em; height: 1.4em; }
.daily-card.played .ic { color: var(--good); }
.dc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dc-info b { font-size: .92rem; }
.dc-info small { color: var(--muted); font-size: .72rem; line-height: 1.3; }
.dc-share { align-self: center; color: var(--accent); }

/* ---------------- fases ---------------- */

.lv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lv-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-s);
    background: var(--card-2);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    color: var(--ink);
    transition: transform .12s;
}
.lv-btn:active { transform: scale(.93); }
.lv-btn b { font-family: var(--font-display); font-size: 1.3rem; }
.lv-btn .lv-stars { font-size: .7rem; color: var(--time); letter-spacing: .05em; }
.lv-btn.locked { opacity: .45; }
.lv-btn.locked .ic { color: var(--muted); }
.lv-btn.done { outline: 2px solid var(--good); outline: 2px solid color-mix(in srgb, var(--good) 45%, transparent); }

/* ---------------- game feel: calor do combo ---------------- */

.principal.shake { animation: shake .45s ease; }

.btn-share { width: 100%; margin-top: 8px; }

/* ---------------- lista de modos ---------------- */

.mode-list { display: flex; flex-direction: column; gap: 10px; }

.mode-card {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 14px;
    color: var(--ink);
    transition: transform .12s;
}
.mode-card:active { transform: scale(.97); }
.mode-ic {
    width: 46px; height: 46px; flex: none;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--card-2);   /* fallback */
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    font-size: 1.3rem;
}
.mode-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mode-info b { font-size: 1rem; }
.mode-info small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.mode-best {
    font-size: .8rem; font-weight: 700; color: var(--muted);
    display: inline-flex; align-items: center; gap: 4px; flex: none;
}
.mode-best .ic { color: var(--time); }

/* ---------------- regras / segmentados ---------------- */

.sec-label {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    font-weight: 700;
    margin: 16px 0 8px;
}
.sec-label:first-child { margin-top: 0; }

.seg { display: flex; gap: 6px; }
/* com 6 idiomas, o seletor quebra em 2 linhas de 3 (sem overflow) */
.seg.seg-wrap { flex-wrap: wrap; }
.seg.seg-wrap .seg-btn { flex: 1 1 calc(33.33% - 6px); min-width: 0; }
.seg-btn {
    flex: 1;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 10px 6px;
    display: flex; flex-direction: column; gap: 2px;
    color: var(--ink);
    border: 2px solid transparent;
    transition: border-color .15s, background .15s;
    min-width: 0;
}
.seg-btn b { font-size: .92rem; }
.seg-btn small { font-size: .68rem; color: var(--muted); line-height: 1.25; }
.seg-btn.on {
    border-color: var(--accent);
    background: var(--card-2);   /* fallback */
    background: color-mix(in srgb, var(--accent) 12%, var(--card-2));
}
.seg-btn.on b { color: var(--accent); }

.toggle-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    margin-top: 8px;
}
.toggle-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toggle-info b { font-size: .92rem; }
.toggle-info small { color: var(--muted); font-size: .76rem; }

.switch {
    width: 52px; height: 30px; flex: none;
    border-radius: 999px;
    background: var(--muted);   /* fallback */
    background: color-mix(in srgb, var(--muted) 45%, transparent);
    position: relative;
    transition: background .2s;
}
.switch i {
    position: absolute; top: 3px; left: 3px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s cubic-bezier(.2, .9, .3, 1.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.switch.on { background: var(--good); }
.switch.on i { transform: translateX(22px); }

.ops-row { display: flex; gap: 8px; }
.op-chip {
    width: 56px; height: 48px;
    border-radius: var(--radius-s);
    background: var(--card-2);
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--muted);
    border: 2px solid transparent;
    transition: all .15s;
}
.op-chip.on {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--card-2);   /* fallback */
    background: color-mix(in srgb, var(--accent) 12%, var(--card-2));
}

/* ---------------- jogo solo ---------------- */

#sc-game { max-width: 460px; }

/* o cartão do jogo não rola: efeitos (brilhos, contadores dos
 * power-ups, animação de acerto) podem "respirar" sem serem cortados */
#sc-game .card {
    overflow: visible;
    max-height: none;
}

.principal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    transition: box-shadow .3s;
}

.principal { position: relative; }
.principal.frenzy {
    box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--time) 55%, transparent);
}
.principal.frenzy::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 30px color-mix(in srgb, var(--time) 45%, transparent);
    animation: glow-pulse 1s ease-in-out infinite;
}
@keyframes glow-pulse {
    0%, 100% { opacity: .25; }
    50%      { opacity: 1; }
}

.principal.flash-bad { animation: flash-bad .5s ease; }
@keyframes flash-bad {
    0%, 100% { box-shadow: var(--shadow); }
    40% { box-shadow: 0 0 0 5px var(--bad), var(--shadow); }
}

.hud { display: flex; align-items: center; gap: 6px; }
.hud-item { flex: 1; text-align: center; min-width: 0; }
.hud-label {
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 700;
}
.pontuacao, .nivel, .maior-pontuacao {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.1;
}
.pontuacao { color: var(--accent); }
.pontuacao.bump { animation: bump .3s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes bump { 40% { transform: scale(1.35); } }

.hud-lives { display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; }
.life .ic { color: var(--bad); width: 1.05em; height: 1.05em; }
.life.off .ic { color: var(--muted); color: color-mix(in srgb, var(--muted) 40%, transparent); }

.timer-wrap { display: flex; align-items: center; gap: 10px; }
.timer-track {
    flex: 1;
    height: 12px;
    border-radius: 999px;
    background: var(--card-2);
    overflow: hidden;
}
.timer-bar {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: var(--time);
    transform-origin: left;
    transition: background .25s;
}
.timer-bar.danger { background: var(--bad); }
.timer-bar.frozen {
    background: #7fd4ff;
    animation: frozen-shimmer 1s linear infinite;
}
@keyframes frozen-shimmer { 50% { opacity: .55; } }

.restante { font-size: .85rem; color: var(--muted); min-width: 34px; text-align: right; }
.segundos { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }

.stage {
    position: relative;
    text-align: center;
    padding: 16px 8px 10px;
    min-height: 128px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.combo-badge {
    position: absolute;
    top: 4px; right: 4px;
    display: none;
    align-items: center;
    gap: 5px;
    background: var(--card-2);   /* fallback */
    background: color-mix(in srgb, var(--accent) 14%, var(--card-2));
    color: var(--accent);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 800;
    font-size: .85rem;
}
.combo-badge.on { display: inline-flex; }
.combo-badge.pulse { animation: bump .35s cubic-bezier(.2, .9, .3, 1.4); }
.combo-badge.frenzy-badge {
    background: var(--time);
    color: #4a3200;
    animation: bump .35s, pulse-dot 1s ease-in-out infinite;
}

.numero {
    font-family: var(--font-display);
    font-size: clamp(3rem, 15vw, 4.4rem);
    line-height: 1.05;
    font-weight: 400;
}
.numero .ghost { color: var(--muted); opacity: .55; }
.numero .prev {
    color: var(--accent);
    animation: prev-fade 1.2s ease forwards;
}
@keyframes prev-fade { 70% { opacity: 1; } 100% { opacity: .35; } }

.numero.pop { animation: num-pop .3s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes num-pop {
    from { transform: scale(.8); opacity: .4; }
    to   { transform: scale(1); opacity: 1; }
}

.dica {
    font-size: .82rem;
    color: var(--muted);
    min-height: 1.2em;
    margin-top: 4px;
}

/* power-ups */
.pu-bar { display: flex; justify-content: center; gap: 10px; }
.pu-btn {
    position: relative;
    width: 52px; height: 46px;
    border-radius: var(--radius-s);
    background: var(--card-2);
    color: var(--accent);
    display: grid; place-items: center;
    font-size: 1.2rem;
    transition: transform .12s;
}
.pu-btn:active { transform: scale(.9); }
.pu-btn.hidden { display: none; }
.pu-count {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 20px; height: 20px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: .72rem;
    display: grid; place-items: center;
    padding: 0 5px;
}

/* alternativas — mantém a grade 3x2 do original */
.answers { display: flex; gap: 10px; }
.boxes { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.botao { width: 100%; }

.box {
    height: 64px;
    border-radius: var(--radius-s);
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 1.7rem;
    color: var(--box-ink);
    background: var(--box-a);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .14);
    transition: transform .1s, opacity .25s, box-shadow .1s;
}
.botao:active .box { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .14); }

.option2, .option4, .option6 { background: var(--box-b); }

.box.hit {
    background: var(--good) !important;
    color: #fff;
    animation: hit-pop .3s cubic-bezier(.2, .9, .3, 1.3);
}
@keyframes hit-pop { 40% { transform: scale(1.06); } }
.box.miss {
    background: var(--bad) !important;
    color: #fff;
    animation: shake .4s ease;
}
@keyframes shake {
    20%, 60% { transform: translateX(-7px); }
    40%, 80% { transform: translateX(7px); }
}
.box.revela {
    background: var(--good) !important;
    color: #fff;
    animation: pulse-dot .5s ease 2;
}
.box.removed { opacity: .18; pointer-events: none; }

/* ---------------- fim de partida ---------------- */

.over-card { text-align: center; }

.over-reason {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--bad);
}
.over-record {
    display: none;
    font-weight: 800;
    color: var(--good);
    margin-top: 2px;
    animation: bump .5s ease infinite alternate;
}
.over-record.on { display: block; }


.over-score {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1;
    color: var(--accent);
    margin: 4px 0 12px;
}

.over-grid { display: grid; grid-template-columns: 1fr; gap: 6px; text-align: left; }
.over-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 10px 14px;
    font-size: .88rem;
}
.over-item span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.over-item span .ic { color: var(--accent); }
.over-item b { font-size: 1.02rem; }

/* ---------------- duelo ---------------- */

#sc-duel { max-width: none; height: calc(100vh - 24px); height: calc(100dvh - 24px); }

.duel-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.duel-half {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: var(--card);
    transition: background .25s, opacity .25s;
    overflow: hidden;
}
.duel-half.p1 { transform: rotate(180deg); border-radius: 0 0 var(--radius) var(--radius); }
.duel-half.p2 { border-radius: var(--radius) var(--radius) 0 0; }

.duel-half.locked { opacity: .55; background: var(--card-2); background: color-mix(in srgb, var(--bad) 10%, var(--card)); }
.duel-half.won-round { background: var(--card-2); background: color-mix(in srgb, var(--good) 14%, var(--card)); }
.duel-half.winner {
    position: relative;
    background: var(--card-2);   /* fallback */
    background: color-mix(in srgb, var(--good) 20%, var(--card));
}
.duel-half.winner::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 34px color-mix(in srgb, var(--good) 45%, transparent);
    animation: glow-pulse 1.2s ease-in-out infinite;
}

.duel-divider {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--bg1), var(--bg2));
    flex: none;
}
.duel-divider .icon-btn { width: 36px; height: 36px; background: rgba(255, 255, 255, .18); color: #fff; }

.duel-top { display: flex; align-items: center; justify-content: space-between; }
.duel-name {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 800;
    color: var(--muted);
}
.duel-score {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--accent);
    min-width: 34px;
    text-align: center;
    background: var(--card-2);
    border-radius: 12px;
    padding: 0 10px;
}

.duel-q {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 6.5vh, 3rem);
    text-align: center;
    flex: none;
}

.duel-answers {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-height: 0;
}
.duel-opt {
    border-radius: var(--radius-s);
    background: var(--box-a);
    color: var(--box-ink);
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 4.5vh, 2rem);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .14);
    transition: transform .1s, opacity .2s;
    min-height: 44px;
}
.duel-opt:nth-child(2), .duel-opt:nth-child(3) { background: var(--box-b); }
.duel-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .14); }
.duel-opt.hit { background: var(--good) !important; color: #fff; animation: bump .35s; }
.duel-opt.miss { background: var(--bad) !important; color: #fff; animation: shake .4s; }
.duel-opt.revela { background: var(--good) !important; color: #fff; }

.duel-status {
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    min-height: 1.2em;
    flex: none;
}

.duel-end {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.big-ic { width: 56px; height: 56px; color: var(--time); }

/* paisagem: lado a lado, ambos na vertical normal */
@media (orientation: landscape) {
    .duel-wrap { flex-direction: row; } /* Jogador 1 à esquerda, divisor no meio */
    .duel-half.p1 { transform: none; border-radius: 0 var(--radius) var(--radius) 0; }
    .duel-half.p2 { border-radius: var(--radius) 0 0 var(--radius); }
    .duel-divider { height: auto; width: 46px; flex-direction: column; }
}

/* ---------------- abas / progresso ---------------- */

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    flex: 1;
    white-space: nowrap;
    background: var(--card-2);
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
    font-size: .82rem;
    color: var(--muted);
    transition: all .15s;
}
.tab-btn.on { background: var(--accent); color: var(--accent-ink); }

.tab-body { display: flex; flex-direction: column; gap: 8px; }

.lvl-ring {
    width: 84px; height: 84px;
    border-radius: 50%;
    border: 5px solid var(--accent);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: var(--card-2);
}
.lvl-ring b { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; }
.lvl-ring small { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.xp-wrap { text-align: center; }
.xp-wrap small { color: var(--muted); font-size: .76rem; }
.xp-track {
    height: 12px;
    border-radius: 999px;
    background: var(--card-2);
    overflow: hidden;
    margin-bottom: 4px;
}
.xp-track.small { height: 7px; margin: 6px 0 4px; }
.xp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--good));
    border-radius: 999px;
    transition: width .4s ease;
}

/* conquistas */
.ach {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px;
    opacity: .6;
}
.ach.done { opacity: 1; }
.ach-ic {
    width: 42px; height: 42px; flex: none;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--card-2);   /* fallback */
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-size: 1.2rem;
}
.ach.done .ach-ic { background: var(--accent); color: var(--accent-ink); }
.ach div { flex: 1; }
.ach b { font-size: .92rem; display: block; }
.ach small { color: var(--muted); font-size: .76rem; }
.ach-check { color: var(--good); font-size: 1.2rem; }


/* ---------------- loja ---------------- */

.shop-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 10px 12px;
}
.shop-item .btn { padding: 9px 16px; font-size: .85rem; flex: none; }
.swatch {
    width: 50px; height: 50px; flex: none;
    border-radius: 14px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.shop-info { flex: 1; min-width: 0; }
.shop-info b { font-size: .95rem; display: block; }
.shop-info small { color: var(--muted); font-size: .76rem; }

/* ---------------- missões ---------------- */

.mission {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px;
}
.mission.done { outline: 2px solid var(--good); outline: 2px solid color-mix(in srgb, var(--good) 55%, transparent); }
.mission-info { flex: 1; min-width: 0; }
.mission-info b { font-size: .9rem; line-height: 1.3; display: block; }
.mission-info small { color: var(--muted); font-size: .74rem; }
.mission .btn { padding: 9px 14px; font-size: .8rem; flex: none; }


/* ---------------- desafio do dia (home) ---------------- */

.home-daily { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.daily-card {
    flex: 1;
    display: flex; align-items: center; gap: 10px;
    text-align: left;
    background: linear-gradient(120deg,
        color-mix(in srgb, var(--time) 30%, var(--card-2)),
        var(--card-2) 70%);
    border-radius: var(--radius-s);
    padding: 11px 14px;
    color: var(--ink);
    transition: transform .12s;
}
.daily-card:active { transform: scale(.97); }
.daily-card > .ic { color: var(--accent); width: 1.5em; height: 1.5em; }
.daily-card.played { background: var(--card-2); }
.dc-info { display: flex; flex-direction: column; min-width: 0; }
.dc-info b { font-size: .92rem; }
.dc-info small { color: var(--muted); font-size: .74rem; }
.dc-share { align-self: center; }

.btn-share { width: 100%; margin-top: 8px; }
.share-box {
    width: 100%;
    border: 2px solid var(--card-2);
    border-radius: var(--radius-s);
    background: var(--card-2);
    color: var(--ink);
    font-family: inherit;
    font-size: .85rem;
    padding: 10px;
    resize: none;
}

/* ---------------- mapa de fases ---------------- */

#levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    align-content: start;
}
.lv-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-s);
    background: var(--card-2);
    color: var(--ink);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    transition: transform .12s;
}
.lv-btn:active { transform: scale(.92); }
.lv-btn b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 400; }
.lv-btn.locked { opacity: .45; color: var(--muted); }
.lv-btn.done {
    background: var(--card-2);
    background: color-mix(in srgb, var(--good) 14%, var(--card-2));
}
.lv-stars { font-size: .68rem; color: var(--time); letter-spacing: .05em; }

/* ---------------- calor do combo + tremor do frenesi ---------------- */

.principal { transition: box-shadow .4s ease; }
.principal.heat1 { box-shadow: var(--shadow), 0 0 0 2px color-mix(in srgb, var(--time) 35%, transparent); }
.principal.heat2 { box-shadow: var(--shadow), 0 0 18px 2px color-mix(in srgb, var(--time) 45%, transparent); }
.principal.heat3 { box-shadow: var(--shadow), 0 0 26px 5px color-mix(in srgb, var(--bad) 40%, transparent); }

.principal.shake { animation: shake-big .45s ease; }
@keyframes shake-big {
    15% { transform: translate(-6px, 2px) rotate(-.6deg); }
    30% { transform: translate(6px, -2px) rotate(.6deg); }
    45% { transform: translate(-5px, 1px); }
    60% { transform: translate(5px, -1px); }
    75% { transform: translate(-3px, 0); }
}

/* ---------------- modais ---------------- */

.modal {
    position: fixed; inset: 0;
    z-index: 50;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(10, 12, 34, .6);
    backdrop-filter: blur(4px);
}
.modal.open { display: grid; }

.modal-card {
    overflow-x: hidden;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 60px);   /* fallback */
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    background: var(--card);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow);
    animation: screen-in .25s cubic-bezier(.2, .9, .3, 1.15);
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}
.modal-card h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
}
.modal-card .btn { align-self: center; min-width: 60%; }

.help-sec { text-align: left; margin-top: 6px; }
.help-sec .ic { color: var(--accent); }
.help-p { text-align: left; font-size: .9rem; line-height: 1.5; color: var(--muted); }
.help-list {
    text-align: left;
    padding-left: 20px;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--muted);
    display: flex; flex-direction: column; gap: 6px;
}

.vol-row {
    display: flex; align-items: center; gap: 14px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    margin-top: 8px;
}
.vol-label { flex: none; font-size: .92rem; }
.vol-row input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: var(--accent);
    height: 26px;   /* área de toque confortável */
}

.egg-heart .ic {
    width: 52px; height: 52px;
    color: var(--bad);
    animation: breathe 1.6s ease-in-out infinite;
}
.egg-text { font-size: .92rem; line-height: 1.55; color: var(--muted); text-align: left; }

/* ---------------- toast / partículas ---------------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    transform: translate(-50%, 20px);
    background: var(--ink);
    color: var(--card);
    padding: 11px 20px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 90;
    max-width: calc(100vw - 40px);
    text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.particle {
    position: fixed;
    width: 9px; height: 9px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 80;
}

.float-pts {
    position: fixed;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--good);
    pointer-events: none;
    z-index: 80;
    animation: float-up .8s ease forwards;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
@keyframes float-up {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-46px); }
}


/* ---------------- ajustes de altura / acessibilidade ---------------- */

@media (max-height: 640px) {
    .stage { min-height: 100px; padding-top: 10px; }
    .box { height: 54px; font-size: 1.45rem; }
    .card { padding: 14px; }
    .btn-big { padding: 13px; }
}

/* telas muito baixas (paisagem em celular, aparelhos compactos) */
@media (max-height: 560px) {
    .principal { gap: 7px; padding: 12px; }
    .stage { min-height: 80px; padding: 6px 4px 2px; }
    .numero { font-size: clamp(2rem, 9vh, 2.6rem); }
    .dica { min-height: 0; }
    .box { height: 46px; font-size: 1.3rem; }
    .pu-btn { width: 46px; height: 40px; font-size: 1.05rem; }
    .logo { font-size: 2rem; }
    .home-stats { margin: 10px 0 2px; }
    .btn-big { padding: 10px; font-size: 1rem; margin-top: 10px; }
    .card-tall { height: calc(100vh - 24px); height: calc(100dvh - 24px); }
    .over-score { font-size: 2.8rem; margin-bottom: 8px; }
}

/* telas estreitas (320–360px de largura) */
@media (max-width: 360px) {
    .card { padding: 16px 12px; }
    .logo { font-size: 2.2rem; }
    .pill { padding: 7px 12px; font-size: .9rem; }
    .home-nav { gap: 6px; }
    .nav-btn { font-size: .64rem; padding: 10px 2px 8px; }
    .box { font-size: 1.4rem; }
    .answers, .boxes { gap: 8px; }
    .seg-btn small { display: none; }   /* rótulos curtos nos presets */
    .op-chip { width: 48px; height: 44px; }
    .over-score { font-size: 3.2rem; }
    .duel-answers { gap: 6px; }
    .tab-btn { padding: 8px 10px; font-size: .76rem; }
    .shop-item .btn, .mission .btn { padding: 8px 12px; font-size: .78rem; }
    .toast { font-size: .8rem; padding: 9px 14px; }
}

@media (min-width: 700px) and (orientation: landscape) {
    #sc-game .principal { max-height: calc(100dvh - 24px); }
    .box { height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .bubble { display: none; }
}

/* ---------------- acessibilidade ---------------- */

/* fonte simplificada: números e títulos na fonte de leitura */
body.font-simple { --font-display: "Rubik", system-ui, sans-serif; }
body.font-simple .numero, body.font-simple .box, body.font-simple .duel-opt,
body.font-simple .pontuacao, body.font-simple .nivel, body.font-simple .maior-pontuacao,
body.font-simple .over-score, body.font-simple .duel-q, body.font-simple .duel-score,
body.font-simple .segundos, body.font-simple .logo { font-weight: 800; letter-spacing: .01em; }

/* reduzir animações (equivalente manual ao prefers-reduced-motion) */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
}
body.reduce-motion .bubble { display: none; }
body.reduce-motion .particle, body.reduce-motion .float-pts { display: none; }

/* símbolos além das cores (daltonismo): ✓ no certo, ✕ no errado */
.box, .duel-opt { position: relative; }
body.color-assist .box.hit::after, body.color-assist .duel-opt.hit::after,
body.color-assist .box.revela::after, body.color-assist .duel-opt.revela::after {
    content: '✓';
}
body.color-assist .box.miss::after, body.color-assist .duel-opt.miss::after {
    content: '✕';
}
body.color-assist .box::after, body.color-assist .duel-opt::after {
    position: absolute;
    top: -8px; right: -8px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--card);
    font-size: 16px;
    font-family: var(--font-body);
    font-weight: 900;
    display: grid; place-items: center;
    line-height: 1;
}

/* rótulos de camada das missões */
.tier-label {
    background: var(--card-2);   /* fallback (as cores por camada vêm abaixo) */
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin: 10px 0 2px;
    padding: 4px 12px;
    border-radius: 999px;
    align-self: flex-start;
}
.tier-facil   { background: color-mix(in srgb, var(--good) 18%, var(--card-2)); color: var(--good); }
.tier-media   { background: color-mix(in srgb, var(--time) 24%, var(--card-2)); color: #a07400; }
.tier-dificil { background: color-mix(in srgb, var(--bad) 16%, var(--card-2)); color: var(--bad); }
.tier-epica   { background: color-mix(in srgb, var(--accent) 18%, var(--card-2)); color: var(--accent); }

.sec-label.small-label { margin-top: 8px; font-size: .68rem; }



/* ============================================================
 * EVOLUÇÃO — novos componentes e responsividade real
 * ============================================================ */

/* ---------- modo bloqueado (Precisão) ---------- */
.mode-card.locked { opacity: .6; }
.mode-card.locked .mode-ic { color: var(--muted); background: var(--card-2); }

/* ---------- partida assistida ---------- */
.principal.assisted::before {
    content: 'REC ▸';
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    background: var(--time);
    color: #4a3200;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .12em;
    padding: 3px 10px;
    border-radius: 999px;
}
.over-assist {
    display: none;
    font-size: .78rem;
    font-weight: 700;
    color: #a07400;
    background: color-mix(in srgb, var(--time) 26%, var(--card-2));
    border-radius: 999px;
    padding: 6px 12px;
    margin: 6px auto 0;
    max-width: 100%;
}
.over-assist.on { display: inline-block; }

/* ---------- oferta de continuação (anúncio opcional) ---------- */
.continue-box {
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 14px;
    margin: 10px 0 4px;
    text-align: center;
}
.continue-box b { font-size: 1rem; }
.continue-box p { margin: 4px 0 10px; line-height: 1.4; }
.continue-box .btn { width: 100%; }
.continue-box .btn + .btn { margin-top: 8px; }

/* ---------- comparações na tela de resultado ---------- */
.over-compare { margin-top: 8px; text-align: left; }
.cmp-line {
    display: flex; align-items: center; gap: 8px;
    font-size: .82rem;
    color: var(--muted);
    padding: 5px 4px;
}
.cmp-line .ic { color: var(--accent); flex: none; }
.cmp-line span { min-width: 0; }

/* ---------- histórico ---------- */
.hist-row {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 10px 14px;
}
.hist-score {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--accent);
    min-width: 44px;
    text-align: center;
    flex: none;
}
.hist-info { flex: 1; min-width: 0; }
.hist-info b { font-size: .88rem; display: block; }
.hist-info small { color: var(--muted); font-size: .72rem; }
.hist-date { color: var(--muted); font-size: .72rem; flex: none; }

/* calendário de atividade (14 dias) */
.cal-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-day {
    aspect-ratio: 1;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--card-2);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
}
.cal-day.on {
    background: var(--good);
    background: color-mix(in srgb, var(--good) 28%, var(--card-2));
    color: var(--good);
    outline: 2px solid color-mix(in srgb, var(--good) 55%, transparent);
}

/* ---------- seletor de tema (Ajustes) ---------- */
.theme-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    max-width: 100%;
}
.theme-chip {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 4px;
    border-radius: var(--radius-s);
    border: 2px solid transparent;
    color: var(--muted);
    font-size: .68rem;
}
.theme-chip small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.theme-chip .theme-swatch {
    width: 38px; height: 38px;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.theme-chip.on { border-color: var(--accent); color: var(--accent); background: var(--card-2); }

/* botões de linha nos Ajustes (Ajuda → Como jogar / Rever introdução) */
.btn-row { width: 100%; justify-content: flex-start; margin-top: 8px; }

/* ============================================================
 * RESPONSIVIDADE — o layout se reorganiza com o espaço disponível
 * (nada esticado, nada preso à largura de celular)
 * ============================================================ */

/* tablets e janelas médias: mais respiro, alvos maiores */
@media (min-width: 720px) {
    .main { padding: 24px; }
    .screen { max-width: 500px; }
    #sc-game { max-width: 540px; }
    .card { padding: 26px 24px; }
    .box { height: 72px; font-size: 1.85rem; }
    .numero { font-size: clamp(3.4rem, 9vw, 5rem); }
    .card-tall { height: min(720px, calc(100dvh - 48px)); }
    .logo { font-size: 3.4rem; }
    .nav-btn.icon-only { min-height: 62px; }
    .nav-btn.icon-only .ic { width: 30px; height: 30px; }
    .lv-grid { grid-template-columns: repeat(6, 1fr); }
}

/* desktop: composição própria — listas em duas colunas,
 * conteúdo mais largo onde faz sentido, sem esticar botões */
@media (min-width: 1080px) {
    #sc-modes, #sc-progress, #sc-missions { max-width: 720px; }
    .mode-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .mode-card { align-items: flex-start; }
    .over-grid { grid-template-columns: 1fr 1fr; }
    #sc-levels { max-width: 640px; }
    .lv-grid { grid-template-columns: repeat(8, 1fr); }
    .cal-strip { grid-template-columns: repeat(14, 1fr); }
    #sc-over { max-width: 560px; }
    .tab-body { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
    .tab-body > .lv-grid, .tab-body > .prog-hero, .tab-body > .growth-box, .tab-body > .over-grid,
    .tab-body > .sec-label, .tab-body > .cal-strip, .tab-body > .center,
    .tab-body > .mission, .tab-body > p { grid-column: 1 / -1; }
}

/* ============================================================
 * PROGRESSO — Evolução (cabeçalho, crescimento e minigráficos)
 * ============================================================ */

.prog-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px 14px;
}
.prog-hero .lvl-ring { width: 64px; height: 64px; border-width: 4px; flex: none; background: var(--card); }
.prog-hero .lvl-ring b { font-size: 1.3rem; }
.prog-hero-info { flex: 1; min-width: 0; }
.prog-hero-info .xp-track.small { margin: 2px 0 3px; }
.prog-hero-pills { display: flex; gap: 8px; margin-top: 7px; }
.prog-hero-pills .pill { padding: 5px 12px; font-size: .8rem; background: var(--card); }

.growth-box {
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px 14px;
}
.growth-box > b { font-size: .82rem; display: block; margin-bottom: 4px; }
.growth-box .cmp-line { padding: 4px 0; color: var(--ink); }

.chart-card {
    background: var(--card-2);
    border-radius: var(--radius-s);
    padding: 12px 14px 8px;
}
.chart-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 6px;
}
.chart-head span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.chart-head b { font-family: var(--font-display); font-size: 1.25rem; color: var(--accent); }
.spark { display: block; width: 100%; height: 68px; }
.chart-hint { display: block; color: var(--muted); font-size: .68rem; margin-top: 2px; }

