/* =========================================================
   Atividades da Julia — mesma linguagem visual do Palavra Viva
   ========================================================= */

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

:root {
    --bg-app:        #050714;
    --bg-card:       #0f1330;
    --bg-soft:       #161b3d;

    --text:          #e6ebff;
    --text-soft:     #b3bbe5;
    --text-mute:     #6c7399;

    --border:        rgba(139, 92, 246, .18);
    --border-strong: rgba(139, 92, 246, .38);

    --neon-blue:     #38bdf8;
    --neon-purple:   #c084fc;
    --neon-cyan:     #22d3ee;
    --neon-pink:     #f472b6;
    --neon-green:    #34d399;
    --neon-amber:    #fbbf24;

    --grad-brand:    linear-gradient(135deg, #38bdf8 0%, #c084fc 100%);
    --grad-cyan:     linear-gradient(135deg, #22d3ee 0%, #38bdf8 100%);
    --grad-purple:   linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    --grad-pink:     linear-gradient(135deg, #f472b6 0%, #c084fc 100%);
    --grad-green:    linear-gradient(135deg, #34d399 0%, #22d3ee 100%);
    --grad-amber:    linear-gradient(135deg, #fbbf24 0%, #f472b6 100%);
    --grad-coral:    linear-gradient(135deg, #fb923c 0%, #ef4444 100%);

    --shadow:        0 2px 8px rgba(0,0,0,.5), 0 0 24px rgba(56,189,248,.04);
    --shadow-lg:     0 16px 48px rgba(0,0,0,.7), 0 0 60px rgba(192,132,252,.08);

    --tb-h:          58px;
    --strip-h:       58px;
}

@media (max-width: 600px) {
    :root { --tb-h: 50px; --strip-h: 54px; }
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-app);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(ellipse at 12% 0%,  rgba(56, 189, 248, .14)  0%, transparent 45%),
        radial-gradient(ellipse at 88% 90%, rgba(192, 132, 252, .16) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(244, 114, 182, .05) 0%, transparent 60%),
        var(--bg-app);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

/* páginas de jogo: tela cheia, sem rolagem */
body.app { overflow: hidden; touch-action: none; overscroll-behavior: none; }

/* ==================== Topbar ==================== */
.topbar {
    flex: 0 0 auto;
    height: var(--tb-h);
    background: linear-gradient(180deg, rgba(7,9,28,.95), rgba(7,9,28,.82));
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid rgba(192, 132, 252, .15);
    box-shadow: 0 2px 32px rgba(0,0,0,.5), 0 0 24px rgba(56,189,248,.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-inner {
    height: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px; gap: 10px;
    max-width: 1400px; margin: 0 auto;
}

.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; min-width: 0;
    text-decoration: none; color: var(--text);
}

.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--grad-brand); color: #fff;
    display: grid; place-items: center;
    font-weight: 800; font-size: 16px;
    box-shadow: 0 0 18px rgba(192, 132, 252, .55);
    flex-shrink: 0;
}

.brand-text {
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    letter-spacing: .02em; font-size: 16px; font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 540px) { .brand-text { display: none; } }

.tb-stats { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: center; min-width: 0; }

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 9px;
    background: rgba(192,132,252,.08);
    border: 1px solid rgba(192,132,252,.18);
    border-radius: 7px;
    font-size: 11px;
    color: var(--text-soft);
    letter-spacing: .05em; text-transform: uppercase; font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.chip b {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: 14px;
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    text-transform: none;
}

.chip.green b { background: var(--grad-green); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.chip.amber b { background: var(--grad-amber); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.chip.pink  b { background: var(--grad-pink);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
a.chip:hover { border-color: rgba(192,132,252,.5); background: rgba(192,132,252,.16); }

@media (max-width: 480px) {
    .chip { padding: 4px 7px; font-size: 10px; }
    .chip b { font-size: 13px; }
}

.tb-actions { display: flex; gap: 6px; flex-shrink: 0; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-grid; place-items: center;
    background: transparent;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 9px;
    color: var(--text);
    cursor: pointer;
    transition: all .2s ease;
    font-size: 16px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover { color: #fff; background: #008cff; border-color: #008cff; box-shadow: 0 0 16px rgba(56,189,248,.6); }
.icon-btn.btn-pink:hover  { background: #ec4899; border-color: #ec4899; box-shadow: 0 0 16px rgba(244,114,182,.6); }
.icon-btn.btn-green:hover { background: #10b981; border-color: #10b981; box-shadow: 0 0 16px rgba(52,211,153,.6); }
.icon-btn:active { transform: scale(.94); }

/* ==================== Página comum ==================== */
.wrap { max-width: 960px; width: 100%; margin: 0 auto; padding: 26px 14px 70px; }

.page-title {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: clamp(24px, 5vw, 34px);
    font-weight: 700;
    letter-spacing: -.01em;
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.page-sub { color: var(--text-soft); font-size: 14px; margin-bottom: 22px; }
.page-sub b { color: var(--neon-amber); }

.card {
    background: linear-gradient(180deg, rgba(15,19,48,.95), rgba(15,19,48,.7));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }
.card h2 { font-family: 'Space Grotesk', 'Segoe UI', sans-serif; font-size: 20px; margin-bottom: 10px; }
.card p  { color: var(--text-soft); }

.tag {
    display: inline-block;
    padding: 3px 9px; border-radius: 999px;
    background: rgba(192,132,252,.12);
    border: 1px solid rgba(192,132,252,.25);
    color: var(--neon-purple);
    font-size: 11px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
    margin-bottom: 10px;
}

/* ==================== Botões ==================== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px;
    border: none; border-radius: 11px;
    background: var(--grad-brand);
    color: #fff;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 15px; font-weight: 700;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 6px 20px rgba(56,189,248,.25);
    transition: all .2s cubic-bezier(.2,1.5,.4,1);
    -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(192,132,252,.4); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn.cyan  { background: var(--grad-cyan); }
.btn.pink  { background: var(--grad-pink); }
.btn.green { background: var(--grad-green); color: #04231a; }
.btn.amber { background: var(--grad-amber); color: #2a1600; }
.btn.ghost {
    background: transparent; color: var(--text);
    border: 1px solid rgba(255,255,255,.2); box-shadow: none;
}
.btn.ghost:hover { border-color: var(--neon-purple); box-shadow: 0 0 20px rgba(192,132,252,.25); }

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

/* ==================== Tiles de modo ==================== */
.mode-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 520px) { .mode-tiles { grid-template-columns: 1fr; gap: 12px; } }

.mode-tile {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: 30px 18px;
    border-radius: 18px;
    border: 1px solid rgba(192,132,252,.3);
    background: linear-gradient(180deg, rgba(15,19,48,.95), rgba(15,19,48,.7));
    color: #fff; cursor: pointer; text-decoration: none;
    font-family: inherit;
    transition: all .3s cubic-bezier(.2,1.5,.4,1);
    box-shadow: 0 8px 28px rgba(0,0,0,.5), 0 0 32px rgba(56,189,248,.08), inset 0 1px 0 rgba(255,255,255,.05);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.mode-tile::before {
    content: ''; position: absolute; inset: -1px;
    border-radius: 18px;
    background: var(--grad-brand);
    z-index: -1; opacity: .35; filter: blur(8px);
    transition: opacity .3s;
}

.mode-tile.mt-af::before  { background: linear-gradient(135deg, #34d399, #22d3ee); }
.mode-tile.mt-ne::before  { background: linear-gradient(135deg, #f472b6, #ef4444); }
.mode-tile.mt-in::before  { background: linear-gradient(135deg, #38bdf8, #c084fc); }
.mode-tile.mt-mix::before { background: linear-gradient(135deg, #fbbf24, #f472b6); }

.mode-tile:hover { transform: translateY(-4px) scale(1.02); border-color: rgba(192,132,252,.6); }
.mode-tile:hover::before { opacity: .7; }
.mode-tile:active { transform: translateY(0) scale(.99); }

.mt-icon { font-size: 40px; line-height: 1; filter: drop-shadow(0 0 14px rgba(56,189,248,.5)); }

.mt-label {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 15px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.mode-tile.mt-af  .mt-label { background: linear-gradient(135deg, #34d399, #22d3ee); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mode-tile.mt-ne  .mt-label { background: linear-gradient(135deg, #f472b6, #ef4444); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.mode-tile.mt-mix .mt-label { background: linear-gradient(135deg, #fbbf24, #f472b6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.mt-sub { font-size: 12px; color: var(--text-mute); text-align: center; }

/* ---- capa: dois tiles grandes ---- */
.capa { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - var(--tb-h) - 60px); }
.capa .page-title, .capa .page-sub { text-align: center; }
.capa-tiles { gap: 20px; }

.tile-grande { padding: 46px 22px; gap: 14px; }
.tile-grande .mt-icon { font-size: 66px; }
.tile-grande .mt-label { font-size: 19px; }
.tile-grande .mt-sub { max-width: 230px; line-height: 1.4; }

@media (max-width: 520px) {
    .tile-grande { padding: 32px 18px; }
    .tile-grande .mt-icon { font-size: 52px; }
}

/* ==================== Faixa de alvos (frases) ==================== */
.targets-strip {
    flex: 0 0 auto;
    min-height: var(--strip-h);
    padding: 7px 12px;
    display: flex; align-items: center; gap: 8px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
    background: rgba(7,9,28,.45);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(192,132,252,.08);
    -webkit-overflow-scrolling: touch;
}

.targets-strip::-webkit-scrollbar { display: none; }

.target {
    flex: 0 0 auto;
    padding: 7px 12px;
    background: linear-gradient(90deg, rgba(56,189,248,.08), rgba(192,132,252,.10));
    border: 1px solid rgba(192,132,252,.22);
    border-radius: 10px;
    display: flex; align-items: center; gap: 8px;
    transition: all .3s ease;
    font-size: 14px; font-weight: 600; color: #fff;
    line-height: 1.2;
    max-width: 60vw;
}

.target .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--grad-cyan);
    box-shadow: 0 0 10px rgba(56,189,248,.6);
    flex-shrink: 0;
}

.target.c-1 .dot { background: var(--grad-cyan);   box-shadow: 0 0 10px rgba(56,189,248,.6); }
.target.c-2 .dot { background: var(--grad-purple); box-shadow: 0 0 10px rgba(192,132,252,.6); }
.target.c-3 .dot { background: var(--grad-amber);  box-shadow: 0 0 10px rgba(251,191,36,.6); }
.target.c-4 .dot { background: var(--grad-green);  box-shadow: 0 0 10px rgba(52,211,153,.6); }
.target.c-5 .dot { background: var(--grad-pink);   box-shadow: 0 0 10px rgba(244,114,182,.6); }
.target.c-6 .dot { background: var(--grad-coral);  box-shadow: 0 0 10px rgba(251,146,60,.6); }

.target .t-modo {
    font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-mute); font-weight: 700;
}

.target .t-linhas { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.target .t-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target .t-sub {
    font-size: 11px; font-weight: 500; color: var(--text-mute);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
}
.target.done .t-sub { color: rgba(52,211,153,.7); }

.target.falavel { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.target.falavel:hover {
    background: linear-gradient(90deg, rgba(56,189,248,.18), rgba(192,132,252,.2));
    border-color: rgba(192,132,252,.5);
}
.target .t-desenho {
    font-size: 26px; line-height: 1; flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(56,189,248,.4));
}

.target .som { font-size: 13px; opacity: .75; flex-shrink: 0; }
.target.falavel:hover .som { opacity: 1; }
.target .check { opacity: 0; width: 0; transition: all .3s ease; }

.target.done {
    background: linear-gradient(90deg, rgba(52,211,153,.16), rgba(34,211,238,.12));
    border-color: rgba(52,211,153,.5);
}
.target.done .t-txt { text-decoration: line-through; color: var(--text-mute); }
.target.done .check { opacity: 1; width: auto; }

/* ==================== Tabuleiro ==================== */
.main {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    padding: 12px;
    min-height: 0;
}

.board-frame {
    position: relative;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(7,9,28,.92), rgba(7,9,28,.78));
    border: 1px solid rgba(192,132,252,.22);
    box-shadow: 0 0 60px rgba(192,132,252,.14), 0 0 120px rgba(56,189,248,.06), inset 0 1px 0 rgba(255,255,255,.04);
}

.board-frame::before {
    content: ''; position: absolute; inset: -1px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56,189,248,.35), rgba(192,132,252,.35), rgba(244,114,182,.25));
    z-index: -1; opacity: .4; filter: blur(6px);
}

@media (max-width: 600px) { .board-frame { padding: 6px; border-radius: 14px; } }

#board {
    position: relative;
    background: rgba(7,9,28,.5);
    border-radius: 10px;
    overflow: hidden;
    touch-action: none;
}

.bg-cell {
    position: absolute;
    border: 1px solid rgba(192,132,252,.06);
    border-radius: 6px;
    background: rgba(15,19,48,.35);
    transition: all .2s;
}

.bg-cell.hint {
    background: rgba(192,132,252,.14);
    border-color: rgba(192,132,252,.45);
    box-shadow: inset 0 0 14px rgba(192,132,252,.18);
}

.block {
    position: absolute;
    border-radius: 10px;
    background: var(--grad-cyan);
    box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(56,189,248,.45),
                inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18);
    display: grid; place-items: center;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-weight: 700; color: #fff;
    letter-spacing: .02em;
    text-shadow: 0 1px 6px rgba(0,0,0,.5);
    cursor: pointer;
    padding: 2px 4px;
    text-align: center;
    transition: left .28s cubic-bezier(.32,1.5,.4,1),
                top .28s cubic-bezier(.32,1.5,.4,1),
                transform .15s, filter .2s, box-shadow .2s, opacity .35s;
    user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    z-index: 5;
}

.block:hover { filter: brightness(1.15); }

.block.selected {
    z-index: 10;
    animation: selPulse 1.2s ease-in-out infinite;
}

@keyframes selPulse {
    0%, 100% { box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(0,0,0,.5), 0 0 36px rgba(192,132,252,.7), inset 0 1px 0 rgba(255,255,255,.3); }
    50%      { box-shadow: 0 0 0 3px #fff, 0 6px 16px rgba(0,0,0,.5), 0 0 48px rgba(244,114,182,.9), inset 0 1px 0 rgba(255,255,255,.3); }
}

/* ---- uma cor para cada classe gramatical ---- */
.block.cl-verbo  { background: var(--grad-purple); box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(192,132,252,.5),  inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }
.block.cl-pron   { background: var(--grad-cyan);   box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(56,189,248,.45),  inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }
.block.cl-subst  { background: var(--grad-green);  box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(52,211,153,.45),  inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); color: #04231a; text-shadow: none; }
.block.cl-adj    { background: var(--grad-amber);  box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(251,191,36,.45),  inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); color: #2a1600; text-shadow: none; }
.block.cl-adv    { background: var(--grad-pink);   box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(244,114,182,.5),  inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }
.block.cl-neg    { background: var(--grad-coral);  box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(251,146,60,.5),   inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }
.block.cl-art    { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(148,163,184,.35), inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }
.block.cl-silaba { background: var(--grad-cyan);   box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(56,189,248,.45),  inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }

/* ---- letras soltas: treino de escrever ---- */
.block.cl-letra {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(129,140,248,.45),
                inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 4px rgba(0,0,0,.18);
    letter-spacing: .06em;
}

/* ---- matemática: a conta, o igual e os números ---- */
.block.cl-conta { background: var(--grad-purple); box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(192,132,252,.5), inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }
.block.cl-igual { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(148,163,184,.35), inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); }
.block.cl-num   { background: var(--grad-amber);  box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 18px rgba(251,191,36,.45), inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 4px rgba(0,0,0,.18); color: #2a1600; text-shadow: none; }

/* ---- legenda das cores ---- */
.legenda {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px;
    margin-top: 12px; max-width: 720px;
}
.legenda:empty { display: none; }

.leg-item {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-soft);
}

.leg-cor {
    width: 13px; height: 13px; border-radius: 4px;
    display: inline-block;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.leg-cor.cl-verbo  { background: var(--grad-purple); }
.leg-cor.cl-pron   { background: var(--grad-cyan); }
.leg-cor.cl-subst  { background: var(--grad-green); }
.leg-cor.cl-adj    { background: var(--grad-amber); }
.leg-cor.cl-adv    { background: var(--grad-pink); }
.leg-cor.cl-neg    { background: var(--grad-coral); }
.leg-cor.cl-art    { background: linear-gradient(135deg, #94a3b8, #64748b); }
.leg-cor.cl-silaba { background: var(--grad-cyan); }

.block.matching { animation: matchPulse .55s ease-in-out infinite; cursor: default; }
@keyframes matchPulse {
    0%, 100% { transform: scale(1); filter: brightness(1.1); }
    50%      { transform: scale(1.08); filter: brightness(1.5); }
}

.block.exploding { transform: scale(1.6); opacity: 0; filter: blur(4px) brightness(2); pointer-events: none; }

/* encaixe ao soltar o arrasto — squash + bounce */
.block.landing { animation: landSnap .42s cubic-bezier(.34,1.56,.64,1); }
@keyframes landSnap {
    0%   { transform: scale(1,1); }
    25%  { transform: scale(1.08,0.88); filter: brightness(1.25); }
    55%  { transform: scale(0.95,1.05); filter: brightness(1.10); }
    80%  { transform: scale(1.02,0.98); filter: brightness(1.03); }
    100% { transform: scale(1,1); filter: brightness(1); }
}

.block.spawning { animation: spawnIn .4s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes spawnIn {
    from { transform: scale(.2); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.reveal-banner {
    position: absolute;
    top: 42%; left: 50%;
    transform: translate(-50%,-50%) scale(.4);
    opacity: 0; pointer-events: none; z-index: 25;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-weight: 800;
    font-size: clamp(24px, 6vw, 46px);
    letter-spacing: .02em;
    background: var(--grad-amber);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 24px rgba(251,191,36,.4));
    white-space: nowrap;
}

.reveal-banner.show { animation: revealPop 1.8s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes revealPop {
    0%   { transform: translate(-50%,-50%) scale(.4); opacity: 0; }
    18%  { transform: translate(-50%,-50%) scale(1.12); opacity: 1; }
    65%  { transform: translate(-50%,-50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%,-150%) scale(.85); opacity: 0; }
}

/* ==================== Overlay ==================== */
.overlay {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center;
    padding: 20px;
    background: rgba(5,7,20,.82);
    backdrop-filter: blur(10px);
    transition: opacity .3s;
}

.overlay.hidden { display: none; }

.overlay-card {
    width: 100%; max-width: 420px;
    background: linear-gradient(180deg, rgba(15,19,48,.98), rgba(11,14,38,.95));
    border: 1px solid rgba(192,132,252,.3);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: spawnIn .35s cubic-bezier(.2,1.5,.4,1) both;
}

.fim-desenho {
    font-size: 62px; line-height: 1; margin-bottom: 6px;
    filter: drop-shadow(0 0 26px rgba(251,191,36,.45));
    animation: spawnIn .45s cubic-bezier(.2,1.6,.4,1) both;
}

.overlay-card h2 {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 26px; margin-bottom: 8px;
    background: var(--grad-amber);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.overlay-card p { color: var(--text-soft); margin-bottom: 6px; }

.final-num {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 52px; font-weight: 800; line-height: 1.1;
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.final-num.frase-final {
    font-size: clamp(22px, 6vw, 34px);
    line-height: 1.25;
    background: var(--grad-amber);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.premio-linha {
    display: inline-flex; align-items: center; gap: 10px;
    margin: 14px 0 6px;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(251,191,36,.1);
    border: 1px solid rgba(251,191,36,.35);
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 18px; font-weight: 700;
    color: var(--neon-amber);
}

.fim-restam {
    margin-top: 10px;
    font-size: 13px;
    color: var(--neon-blue);
}
.fim-restam b { color: var(--neon-amber); }

.overlay-card .botoes { justify-content: center; margin-top: 18px; }

/* ==================== Quiz (perguntas) ==================== */
.linha-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-soft); font-weight: 600; margin-bottom: 6px; }

.barra-progresso { height: 10px; background: rgba(192,132,252,.12); border-radius: 999px; overflow: hidden; margin-bottom: 20px; border: 1px solid rgba(192,132,252,.18); }
.barra-progresso span { display: block; height: 100%; width: 0; background: var(--grad-brand); border-radius: 999px; transition: width .35s ease; box-shadow: 0 0 14px rgba(56,189,248,.6); }

.enunciado { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--neon-purple); margin-bottom: 10px; }

.frase {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: clamp(22px, 5vw, 32px); font-weight: 700; line-height: 1.35;
    margin-bottom: 6px;
}

.pistas { color: var(--text-mute); font-style: italic; margin-bottom: 16px; }

.opcoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.opcao {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 19px; font-weight: 700;
    padding: 13px 24px;
    border-radius: 12px;
    border: 1px solid rgba(192,132,252,.28);
    background: rgba(15,19,48,.8);
    color: var(--text);
    cursor: pointer;
    transition: all .2s cubic-bezier(.2,1.5,.4,1);
}

.opcao:hover { border-color: var(--neon-purple); transform: translateY(-2px); box-shadow: 0 0 20px rgba(192,132,252,.25); }
.opcao.marcada { border-color: var(--neon-blue); background: rgba(56,189,248,.14); box-shadow: 0 0 20px rgba(56,189,248,.3); }
.opcao.certa   { border-color: var(--neon-green); background: rgba(52,211,153,.16); color: #d6fff1; }
.opcao.errada  { border-color: #ef4444; background: rgba(239,68,68,.16); }
.opcao:disabled { cursor: default; transform: none; }

.campo {
    width: 100%;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 20px; font-weight: 600;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid rgba(192,132,252,.28);
    background: rgba(7,9,28,.7);
    color: var(--text);
    margin-top: 8px;
}

.campo:focus { outline: none; border-color: var(--neon-blue); box-shadow: 0 0 20px rgba(56,189,248,.25); }
.campo::placeholder { color: var(--text-mute); }
.campo.certa  { border-color: var(--neon-green); background: rgba(52,211,153,.14); color: #d6fff1; }
.campo.errada { border-color: #ef4444; background: rgba(239,68,68,.14); color: #ffdcdc; }

.linha-montagem {
    min-height: 60px;
    border: 1px dashed rgba(192,132,252,.35);
    border-radius: 12px;
    padding: 9px;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    background: rgba(7,9,28,.5);
    margin-bottom: 12px;
}

.linha-montagem:empty::after { content: "toque nas palavras aqui embaixo 👇"; color: var(--text-mute); font-size: 14px; }
.linha-montagem.certa  { border-style: solid; border-color: var(--neon-green); background: rgba(52,211,153,.1); }
.linha-montagem.errada { border-style: solid; border-color: #ef4444; background: rgba(239,68,68,.1); }

.pecas { display: flex; flex-wrap: wrap; gap: 8px; }

.peca {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 17px; font-weight: 700;
    padding: 9px 15px;
    border-radius: 10px;
    border: none;
    background: var(--grad-cyan);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,.4), 0 0 14px rgba(56,189,248,.35), inset 0 1px 0 rgba(255,255,255,.2);
    transition: transform .15s;
}

.peca:hover { transform: translateY(-2px); }
.peca.usada { visibility: hidden; }
.peca.na-linha { background: var(--grad-purple); box-shadow: 0 3px 10px rgba(0,0,0,.4), 0 0 14px rgba(192,132,252,.4), inset 0 1px 0 rgba(255,255,255,.2); }

.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 15px; display: none; }
.feedback.mostrar { display: block; }
.feedback.acerto { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.4); color: #b8ffe8; }
.feedback.erro   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.4);  color: #ffd5d5; }
.feedback b { display: block; font-family: 'Space Grotesk', 'Segoe UI', sans-serif; font-size: 17px; margin-bottom: 3px; }
.feedback small { display: block; margin-top: 6px; opacity: .8; }

.rodape-atividade { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ==================== Carteira ==================== */
.destaque-carteira { text-align: center; }
.destaque-carteira .valorzao {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: clamp(40px, 10vw, 60px); font-weight: 800; line-height: 1;
    background: var(--grad-amber);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.destaque-carteira .moedinhas-txt { color: var(--text-soft); margin-top: 8px; }

/* ---- festa do pagamento ---- */
.festa-card { border-color: rgba(251,191,36,.5); box-shadow: 0 0 60px rgba(251,191,36,.25), var(--shadow-lg); }
.festa-emoji {
    font-size: 72px; line-height: 1;
    animation: festaPula 1.1s ease-in-out infinite;
}
@keyframes festaPula {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-12px) rotate(6deg); }
}

.confete {
    position: fixed; top: -40px; z-index: 300;
    pointer-events: none;
    animation: cai linear forwards;
}
@keyframes cai {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(420deg); opacity: .1; }
}

/* ---- caixa de pagamento (página do adulto) ---- */
.pagar-caixa { margin-top: 20px; text-align: left; }
.pagar-caixa label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 8px; }

.pagar-linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pagar-cifrao {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 18px; font-weight: 700; color: var(--text-soft);
}

.pagar-linha input {
    flex: 1; min-width: 120px;
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    font-size: 24px; font-weight: 700;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(192,132,252,.3);
    background: rgba(7,9,28,.7);
    color: var(--neon-amber);
}
.pagar-linha input:focus { outline: none; border-color: var(--neon-amber); box-shadow: 0 0 20px rgba(251,191,36,.2); }

.btn.pequeno { padding: 8px 14px; font-size: 13px; }
.pagar-conta { font-size: 13px; color: var(--text-soft); margin-top: 10px; }
.pagar-conta b { color: var(--neon-amber); }

/* ---- prêmios que dá para comprar ---- */
.premios { display: flex; flex-direction: column; gap: 10px; }

.premio {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(192,132,252,.18);
    background: rgba(7,9,28,.5);
    opacity: .6;
    transition: all .25s ease;
}

.premio.liberado {
    opacity: 1;
    border-color: rgba(52,211,153,.5);
    background: linear-gradient(90deg, rgba(52,211,153,.14), rgba(34,211,238,.06));
    box-shadow: 0 0 24px rgba(52,211,153,.12);
}

.premio-emoji { font-size: 30px; line-height: 1; flex-shrink: 0; }

.premio-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.premio-txt b { font-family: 'Space Grotesk', 'Segoe UI', sans-serif; font-size: 16px; }
.premio-txt small { color: var(--text-mute); font-size: 12px; }

.premio-status {
    font-size: 12px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-mute);
    text-align: right; flex-shrink: 0;
}

.premio.liberado .premio-status { color: var(--neon-green); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid rgba(192,132,252,.12); }
th { color: var(--neon-purple); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
td { color: var(--text-soft); }
td.num, th.num { text-align: right; }
.vazio { color: var(--text-mute); font-style: italic; }

/* ==================== Moedinha voando ==================== */
@keyframes sobeMoeda {
    0%   { transform: translateY(0) scale(.6); opacity: 0; }
    25%  { transform: translateY(-14px) scale(1.25); opacity: 1; }
    100% { transform: translateY(-90px) scale(1); opacity: 0; }
}

.moeda-voando {
    position: fixed; z-index: 200;
    font-size: 30px; pointer-events: none;
    animation: sobeMoeda 1s ease-out forwards;
    filter: drop-shadow(0 0 12px rgba(251,191,36,.8));
}

@keyframes pulinho { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18); } }
.pula { animation: pulinho .4s ease; }
