:root {
    --blue: #2b5fe0;
    --blue-deep: #1e46b8;
    --blue-soft: #e8efff;
    --yellow: #ffc107;
    --yellow-deep: #e0a800;
    --green: #34c759;
    --ink: #1a2b4a;
    --muted: #7a8ba6;
    --bg: #f3f5fa;
    --card: #ffffff;
    --line: #e6ebf4;
    --radius: 28px;
    --shadow: 0 10px 28px rgba(30, 70, 140, .08);
    --touch: 56px;
    --sidebar: 232px;
    --font: "Fredoka", ui-rounded, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    height: -webkit-fill-available;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    color: var(--ink);
    font-family: var(--font);
    background: var(--bg);
}

.child-body {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    overflow: hidden;
}

a { color: inherit; text-decoration: none; }

button, a, .option-button, .kid-button { touch-action: manipulation; }

.voice-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid #dce8fb;
    border-radius: 999px;
    background: #fff;
    color: var(--blue);
    font: inherit;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(30, 70, 140, .08);
    cursor: pointer;
}

.voice-button.compact {
    width: 100%;
    margin-top: 10px;
}

.home-voice {
    justify-self: start;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 40;
    background: #fff;
    padding: 10px 14px;
    border-radius: 16px;
}

.skip-link:focus { top: 12px; }

.child-body.calm-mode,
html.calm-mode .child-body { background: #eef1f4; }

.child-body.high-contrast,
html.high-contrast .child-body {
    background: #fff;
    --ink: #111;
    --blue: #12357a;
    --shadow: 0 0 0 3px #111;
}

.child-body.large-ui,
html.large-ui .child-body {
    --touch: 68px;
    font-size: 1.08rem;
}

.child-app {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.child-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 16px;
    background: #fff;
    border-right: 1px solid var(--line);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 8px 28px;
}

.sidebar-brand img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
    background: var(--blue-soft);
}

.topbar-logo {
    height: 44px;
    width: auto;
    max-width: 132px;
    object-fit: contain;
    background: transparent;
}

.sidebar-brand strong,
.section-title,
.game-title,
.topbar-title,
.continue-copy h2,
.victory-card h2,
.story-card h2,
.panel-card h2 {
    font-weight: 700;
}

.sidebar-brand strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.1;
}

.sidebar-brand small {
    color: var(--muted);
    font-weight: 600;
}

.sidebar-nav,
.child-bottomnav { display: grid; gap: 8px; }

.sidebar-nav a,
.child-bottomnav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 14px;
    border-radius: 18px;
    font-weight: 600;
    color: #4b5d7a;
}

.sidebar-nav a.is-active,
.child-bottomnav a.is-active {
    color: #fff;
    background: var(--blue);
}

.nav-ico { width: 28px; text-align: center; font-size: 1.2rem; }

.child-workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.child-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(16px, 3vw, 32px) 8px;
}

.topbar-hello {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    color: inherit;
}

.topbar-title {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(1.1rem, 2.4vw, 1.7rem);
    line-height: 1.1;
}

.child-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-button,
.kid-button {
    border: 0;
    min-height: var(--touch);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.icon-button {
    width: var(--touch);
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow);
    font-size: 1.2rem;
}

.kid-button {
    padding: 0 26px;
    color: var(--ink);
    background: var(--yellow);
    box-shadow: 0 6px 0 var(--yellow-deep);
    font-size: 1.15rem;
    text-transform: uppercase;
}

.kid-button.secondary {
    color: #fff;
    background: var(--blue);
    box-shadow: 0 6px 0 var(--blue-deep);
}

.continue-panel .kid-button {
    width: auto;
}

.kid-button.compact { min-height: 48px; padding: 0 18px; font-size: 1rem; width: auto; }
.icon-button.compact { width: 44px; min-height: 44px; font-size: 1.1rem; }
.kid-button.block { width: 100%; margin-top: 16px; }

.kid-button:active,
.icon-button:active,
.option-button:active,
.world-card:active,
.destination-card:active,
.continue-panel:active {
    transform: translateY(2px);
}

.reduced-motion *,
.calm-mode * {
    animation: none !important;
    transition: none !important;
}

.child-main {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 8px clamp(16px, 3vw, 32px) 36px;
}

.home-screen { display: grid; gap: 20px; }

.continue-panel,
.destination-card,
.world-card,
.story-card,
.panel-card,
.activity-list,
.adult-card,
.settings-card,
.play-stage {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.continue-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 220px;
    padding: 24px 24px 24px 28px;
}

.continue-kicker {
    margin: 0 0 6px;
    color: var(--muted);
    font-weight: 600;
}

.continue-copy h2 {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.continue-igor {
    width: 180px;
    height: 240px;
    object-fit: contain;
}

.progress-block { margin: 0 0 18px; }

.xp-track,
.play-progress {
    display: flex;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e6edf8;
}

.xp-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.xp-label {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}

.destination-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.destination-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    min-height: 170px;
    padding: 18px;
    background: #fff;
}

.destination-card strong {
    font-size: 1.15rem;
    line-height: 1.15;
}

.destination-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: auto;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    font-size: 2rem;
    box-shadow: 0 8px 16px rgba(30, 70, 140, .08);
}

.dest-map .destination-icon { background: #e8efff; }
.dest-library .destination-icon { background: #fff4c4; }
.dest-trophy .destination-icon { background: #ffe7a3; }
.dest-shop .destination-icon { background: #d9fbe8; }

.page-head,
.world-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-title {
    margin: 0;
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

.ghost-link {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--blue);
    font-weight: 700;
}

.level-picker { display: flex; gap: 8px; }

.level-picker a {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.level-picker .active {
    color: #fff;
    background: var(--blue);
}

.world-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.world-card {
    min-height: 168px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px;
}

.world-card strong { font-size: 1.2rem; }

.world-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin-bottom: auto;
    overflow: hidden;
    border-radius: 20px;
    background: var(--world-color, #7dd3fc);
    font-size: 1.8rem;
}

.stars-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px 0 10px;
    border-radius: 999px;
    background: #ffe7a3;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(245, 197, 24, .18);
}

.stars-pill .ui-icon {
    filter: none;
    color: #f5c518;
}

.stars-count {
    min-width: 1.1em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.gear-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    color: #24344f;
    background: #fff;
    box-shadow: 0 6px 16px rgba(30, 55, 110, .12);
}

.gear-button .ui-icon {
    display: block;
}

.play-screen { display: grid; gap: 16px; }

.play-screen,
.play-screen .memorize-replay,
.victory-overlay {
    text-transform: uppercase;
}

.play-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 15;
    background: var(--bg);
    padding: 4px 0 10px;
}

.play-progress {
    flex: 1;
    height: 12px;
    gap: 2px;
    background: transparent;
}

.play-progress span {
    flex: 1;
    border-radius: 999px;
    background: #d9e4f5;
}

.play-progress span.is-done { background: var(--green); }
.play-progress span.is-now { background: var(--yellow); }

.play-progress.is-done span { background: var(--green); }

.play-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: start;
}

.play-stage { padding: 22px; min-height: 520px; overflow: visible; }

.game-title { margin: 0; font-size: clamp(1.5rem, 3vw, 2.3rem); }

.year-playing {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.instruction-bubble {
    margin: 12px 0 18px;
    padding: 14px 16px;
    border-radius: 20px;
    background: var(--blue-soft);
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    font-weight: 600;
}

.prompt-sample {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 140px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: #f6f8fd;
    font-size: 1.3rem;
    font-weight: 700;
}

.color-splat {
    --splat: var(--blue);
    width: 78px;
    height: 62px;
    display: block;
    background: var(--splat);
    border-radius: 70% 30% 56% 44% / 48% 62% 38% 52%;
    box-shadow:
        16px 10px 0 -8px var(--splat),
        -12px 14px 0 -12px var(--splat),
        10px 8px 0 rgba(0, 0, 0, .08);
}

.color-splat.is-hero {
    width: 176px;
    height: 128px;
    box-shadow:
        28px 16px 0 -14px var(--splat),
        -22px 22px 0 -18px var(--splat),
        14px 12px 0 rgba(0, 0, 0, .08);
}

.color-tile .color-name { display: none; }

.option-grid,
.easy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.option-grid.mid-grid,
.option-grid.dense-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.option-grid.mid-grid .option-button,
.option-grid.dense-grid .option-button {
    min-height: 88px;
    padding: 10px;
    font-size: 1rem;
}

.sequence-prompt {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border-radius: 24px;
    background: #f6f8fd;
}

.sequence-prompt-item {
    display: grid;
    place-items: center;
    min-width: 64px;
}

.sequence-prompt .color-splat {
    width: 52px;
    height: 42px;
}

.sequence-prompt .shape-icon {
    width: 46px;
    height: 46px;
}

.sequence-prompt .shape-art {
    width: 46px;
    height: 46px;
}

.sequence-prompt .symbol-option { font-size: 2rem; }
.sequence-prompt .color-name,
.sequence-prompt-item > span:last-child { display: none; }

.sequence-prompt.is-preview {
    outline: 3px dashed #2b5fe0;
    outline-offset: 6px;
    border-radius: 22px;
}

.sequence-prompt.is-hidden {
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.option-grid.is-locked {
    pointer-events: none;
    opacity: .45;
}

.memorize-replay {
    display: flex;
    margin: 0 auto 14px;
    width: auto;
    min-width: 180px;
    font-size: 1rem;
}

.memory-grid + .memorize-replay,
.memorize-replay + .sequence-pool {
    margin-top: 14px;
}

.memorize-replay:disabled {
    opacity: .45;
    cursor: default;
    box-shadow: none;
}

.sequence-picked {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 14px;
}

.sequence-slot.is-filled {
    border-style: solid;
    border-color: var(--green);
    background: #e8f8ee;
    color: var(--green);
}

.emotion-prompt .symbol-option { font-size: 4.4rem; }

.option-button,
.memory-card,
.sequence-chip {
    min-height: 120px;
    padding: 14px;
    display: grid;
    place-items: center;
    gap: 8px;
    border: 0;
    border-radius: 24px;
    background: #fff;
    color: var(--ink);
    font: 700 1.1rem/1.15 var(--font);
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.color-tile {
    padding: 12px;
    background: #fff;
}

.color-tile .color-swatch {
    width: 100%;
    height: 88px;
    border-radius: 18px;
    border: 0;
    box-shadow: none;
}

.color-swatch,
.pattern-dot {
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

.shape-icon { width: 72px; height: 72px; background: var(--blue); }
.shape-icon.circle { border-radius: 50%; }
.shape-icon.square { border-radius: 16px; background: #f26f63; }
.shape-icon.triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid var(--yellow);
}
.shape-icon.star {
    width: 72px;
    height: 72px;
    background: var(--yellow);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.shape-icon.heart {
    width: 64px;
    height: 58px;
    background: #ef4444;
    clip-path: polygon(50% 92%, 6% 42%, 6% 22%, 22% 6%, 38% 10%, 50% 28%, 62% 10%, 78% 6%, 94% 22%, 94% 42%);
}
.shape-icon.diamond {
    width: 56px;
    height: 56px;
    background: #7c3aed;
    transform: rotate(45deg);
    border-radius: 10px;
}
.shape-icon.oval {
    width: 78px;
    height: 48px;
    background: #22c55e;
    border-radius: 50%;
}
.shape-icon.rect {
    width: 78px;
    height: 44px;
    background: #0ea5e9;
    border-radius: 10px;
}

.shape-art { display: inline-block; width: 76px; height: 76px; }
.shape-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.prompt-sample .shape-art { width: 96px; height: 96px; }

.symbol-option { font-size: 2.8rem; line-height: 1; }

.option-button.is-hint { box-shadow: 0 0 0 5px var(--green); }
.option-button.is-miss { opacity: .4; }

.memory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.memory-grid.is-six,
.memory-grid.is-eight { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.memory-grid.is-eight .memory-card { min-height: 88px; font-size: 1.7rem; }
.memory-grid.is-twelve { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.memory-grid.is-twelve .memory-card { min-height: 78px; font-size: 1.45rem; }

.memory-card {
    min-height: 130px;
    color: #fff;
    font-size: 2.2rem;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), transparent 28%),
        repeating-linear-gradient(135deg, #4d7cf0 0 10px, #3b6ae0 10px 20px);
}

.memory-card.is-open,
.memory-card.is-matched {
    background: #fff8d6;
    color: var(--ink);
}

.play-guide {
    padding: 16px;
    text-align: center;
}

.play-guide img {
    width: 180px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.igor-says {
    display: inline-flex;
    margin: 10px 0 0;
    padding: 10px 14px;
    background: #fff;
    border-radius: 18px 18px 18px 6px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.emotion-face {
    width: min(200px, 60vw);
    aspect-ratio: 1;
    margin: 0 auto 18px;
    position: relative;
    border-radius: 50%;
    background: #ffd775;
}

.emotion-face::before,
.emotion-face::after {
    content: "";
    position: absolute;
    top: 34%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #263238;
}

.emotion-face::before { left: 28%; }
.emotion-face::after { right: 28%; }

.emotion-mouth {
    position: absolute;
    left: 50%;
    bottom: 26%;
    width: 80px;
    height: 40px;
    transform: translateX(-50%);
    border-bottom: 8px solid #7c4a2b;
    border-radius: 0 0 80px 80px;
}

.count-items,
.pattern-row,
.sequence-selected,
.sequence-pool {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.count-symbol { font-size: 3.4rem; }
.count-items.is-many .count-symbol { font-size: 2.1rem; }

.num-wrap { width: 100%; max-width: 100%; overflow: visible; }
.num-prompt {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 4px 0 14px;
    overflow: visible;
}

.num-art {
    display: block;
    max-width: 100%;
    max-height: min(300px, 38vh);
    width: auto;
    height: auto;
    margin: 0 auto;
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    user-select: none;
}
.num-art-wide {
    max-width: 100%;
    max-height: min(280px, 36vh);
}
.num-art-clock,
.num-art-frac,
.num-art-abacus {
    width: auto;
    height: auto;
    max-width: min(280px, 78vw);
    max-height: min(280px, 36vh);
}
.num-art-frac { max-width: min(240px, 70vw); max-height: min(240px, 34vh); }
.num-art-ruler { max-width: min(560px, 100%); max-height: 160px; }
.num-art-shelf,
.num-art-legend { max-width: 100%; max-height: min(230px, 32vh); }
.num-art-pred {
    max-width: min(460px, 94vw);
    max-height: min(260px, 36vh);
    width: auto;
    height: auto;
}
.num-art-opt {
    max-width: 100%;
    max-height: 110px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}
.num-art-opt.is-drink { max-height: 130px; }
.option-button .num-art,
.option-button .num-art-opt { pointer-events: none; }

.count-set.count-tiles {
    max-width: min(720px, 100%);
    overflow: visible;
}
.count-tiles .count-tile {
    width: 52px;
    height: 52px;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}
.count-tiles.is-many .count-tile { width: 40px; height: 40px; }
.count-tiles.is-lots .count-tile { width: 32px; height: 32px; }

.pred-row.is-art .pred-blank {
    height: 110px;
    width: 110px;
    object-fit: cover;
    object-position: left center;
}

.count-set {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid #d7deea;
    border-radius: 22px;
    background: #f7f9fd;
    width: 100%;
    max-width: 420px;
}
.count-set .count-symbol { font-size: 2.2rem; }
.count-set.is-many { gap: 4px; padding: 8px; }
.count-set.is-many .count-symbol { font-size: 1.5rem; }
.count-set.is-lots .count-symbol { font-size: 1.25rem; }

.set-sum {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    overflow: visible;
}
.set-sum.is-tiles { gap: 14px; }
.set-group {
    background: #f6f8fd;
    border-radius: 22px;
    padding: 12px 14px;
    overflow: visible;
}
.set-group .count-set {
    margin: 0;
    background: transparent;
    padding: 0;
    overflow: visible;
    border: 0;
    max-width: none;
    width: auto;
}
.set-group .count-tiles .count-tile {
    width: 58px;
    height: 58px;
}
.set-group .count-tiles.is-many .count-tile { width: 42px; height: 42px; }
.set-group .count-tiles.is-lots .count-tile { width: 34px; height: 34px; }
.set-op {
    font-size: 2.2rem;
    font-weight: 800;
}
.gap-box {
    width: 72px;
    height: 72px;
    border: 3px solid #1f2937;
    border-radius: 12px;
    background: #fff;
}
.gap-total {
    min-width: 72px;
    min-height: 72px;
    display: grid;
    place-items: center;
    border: 3px solid #1f2937;
    border-radius: 12px;
    font-size: 2rem;
    font-weight: 800;
}

.entre-table {
    border-collapse: collapse;
    min-width: 240px;
    background: #fff;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.entre-table th,
.entre-table td {
    border: 2px solid #cbd5e1;
    padding: 10px 18px;
    text-align: center;
    font-weight: 800;
}
.entre-table th { background: #f8fafc; }
.entre-miss { color: #ef4444; font-size: 1.5rem; }

.vadd {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: right;
    min-width: 110px;
}
.vadd div:last-child {
    border-bottom: 4px solid #111;
    padding-bottom: 4px;
}
.vadd span { margin-right: 12px; }

.clock-svg,
.frac-svg,
.ruler-svg,
.abacus-svg {
    width: min(240px, 72vw);
    height: auto;
    display: block;
    margin: 0 auto;
    overflow: visible;
}
.ruler-svg { width: min(420px, 96vw); }

.groc-board,
.money-shelf,
.drink-legend {
    width: 100%;
    overflow-x: auto;
}
.groc-title {
    text-align: center;
    font-size: .75rem;
    letter-spacing: .08em;
    font-weight: 800;
    color: #64748b;
}
.groc-shelf,
.money-shelf,
.drink-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 4px 12px;
}
.groc-item,
.money-item,
.drink-card {
    display: grid;
    place-items: center;
    gap: 2px;
    min-width: 58px;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 0 #e2e8f0;
    text-align: center;
    font-size: .7rem;
}
.groc-emoji { font-size: 1.6rem; }
.groc-item strong,
.money-item strong { color: #b45309; font-size: .78rem; }
.groc-shelf.is-compact { gap: 4px; padding: 0; }
.groc-shelf.is-compact .groc-item { min-width: 48px; padding: 4px; box-shadow: none; }
.option-button .groc-shelf,
.option-button .drink-card { pointer-events: none; }

.drink-card {
    background: #fff;
    border: 3px solid var(--drink, #94a3b8);
    min-width: 72px;
    padding: 8px 6px;
}
.drink-card span { font-size: 1.6rem; }

.pred-apples {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.pred-apple-svg {
    width: min(142px, 38vw);
    height: auto;
    display: block;
    overflow: visible;
}
.pred-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pred-apple {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border: 4px solid #111;
    border-radius: 50% 50% 48% 48%;
    background: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    position: relative;
}
.pred-apple::after {
    content: '';
    position: absolute;
    top: -10px;
    width: 18px;
    height: 18px;
    background: #22c55e;
    clip-path: ellipse(50% 60% at 50% 50%);
}
.pred-apple.is-empty { background: #fff; }

.cdu-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cdu-plus { font-size: 2.4rem; font-weight: 800; }
.cdu-table { border-collapse: collapse; background: #fff; }
.cdu-table th {
    background: #fecdd3;
    padding: 6px 12px;
    font-size: .85rem;
}
.cdu-table td {
    border: 2px solid #e2e8f0;
    min-width: 42px;
    height: 38px;
    text-align: center;
    color: #2563eb;
    font-weight: 800;
    font-size: 1.2rem;
}
.cdu-result td { height: 42px; color: #111; }

.frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.7rem;
    line-height: 1.05;
    font-weight: 800;
}
.frac span:first-child {
    border-bottom: 3px solid currentColor;
    padding: 0 8px 2px;
    min-width: 28px;
    text-align: center;
}
.decomp-eq {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
}

.sequence-slot,
.pattern-mystery {
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    display: grid;
    place-items: center;
    border: 3px dashed #c5d0e0;
    border-radius: 50%;
    background: #f7f9fd;
    font-weight: 700;
}

.sequence-chip.is-used { opacity: .35; }
.sequence-chip span { display: block; font-size: 1.8rem; }

.play-stage .feedback-panel {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.praise-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    overflow: hidden;
    pointer-events: none;
}

.praise-balloon {
    position: relative;
    width: max-content;
    max-width: min(460px, 88vw);
    margin-top: -6vh;
    padding: 18px 28px 20px;
    border: 4px solid #fff;
    border-radius: 36px;
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    box-shadow: 0 18px 0 rgba(21, 128, 61, .28), 0 28px 48px rgba(22, 163, 74, .35);
    color: #fff;
    text-align: center;
    animation: praise-rise 2.8s ease-out forwards;
}

.praise-balloon::after {
    content: "";
    position: absolute;
    left: 36px;
    bottom: -18px;
    border-width: 18px 16px 0;
    border-style: solid;
    border-color: #16a34a transparent transparent;
}

.praise-balloon strong {
    display: block;
    color: #fff;
    font-size: clamp(1.7rem, 4.4vw, 2.3rem);
    line-height: 1.05;
}

.praise-balloon span {
    display: block;
    margin-top: 4px;
    color: #fff;
    font-size: clamp(1.35rem, 3.6vw, 1.9rem);
    font-weight: 800;
    line-height: 1.15;
}

.praise-emoji {
    margin-top: 2px;
    font-size: 2.1rem;
    font-weight: 400;
    line-height: 1;
}

.confetti-layer {
    position: fixed;
    inset: 0;
    z-index: 89;
    overflow: hidden;
    pointer-events: none;
}

.confetti-bit {
    position: absolute;
    top: -18px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    animation-name: confetti-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}

.confetti-bit.is-round {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.confetti-bit.is-emoji {
    width: auto;
    height: auto;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
}

@keyframes confetti-fall {
    0% { transform: translate3d(0, -12px, 0) rotate(0deg); opacity: 1; }
    82% { opacity: 1; }
    100% { transform: translate3d(var(--drift, 16px), 108vh, 0) rotate(520deg); opacity: 0; }
}

.praise-balloon.is-fail {
    background: linear-gradient(180deg, #fdba74 0%, #f97316 100%);
    box-shadow: 0 18px 0 rgba(194, 65, 12, .22), 0 28px 48px rgba(249, 115, 22, .32);
    animation-name: praise-fail;
}

.praise-balloon.is-fail::after {
    border-color: #f97316 transparent transparent;
}

.praise-balloon.is-calm {
    animation-timing-function: ease;
}

@keyframes praise-fail {
    0% { opacity: 0; transform: translateY(48px) scale(.86) rotate(-8deg); }
    12% { opacity: 1; transform: translateY(6px) scale(1) rotate(5deg); }
    20% { transform: translateY(-2px) rotate(-4deg); }
    28% { transform: translateY(0) rotate(2deg); }
    78% { opacity: 1; transform: translateY(-32px) rotate(0deg); }
    100% { opacity: 0; transform: translateY(-110px) scale(1.03); }
}

@keyframes praise-rise {
    0% { opacity: 0; transform: translateY(56px) scale(.86); }
    8% { opacity: 1; transform: translateY(8px) scale(1); }
    78% { opacity: 1; transform: translateY(-36px) scale(1); }
    100% { opacity: 0; transform: translateY(-120px) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
    .praise-balloon,
    .praise-balloon.is-fail {
        animation-name: praise-fade;
    }
}

@keyframes praise-fade {
    0% { opacity: 0; transform: none; }
    8% { opacity: 1; transform: none; }
    78% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: none; }
}

.feedback-panel.try-again { background: #fff6d4; }

.play-guide .igor-says { margin-top: 8px; }

.activity-list { padding: 18px; }

.year-block { display: grid; gap: 12px; margin-bottom: 8px; }

.year-block-title {
    margin: 0;
    font-size: 1.25rem;
}

.year-grid {
    display: grid;
    gap: 10px;
}

.year-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 14px 18px;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.year-badge {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 18px;
    background: #e8efff;
    color: var(--blue);
    font-size: 1.15rem;
    font-weight: 800;
}

.year-copy {
    display: grid;
    gap: 2px;
}

.year-copy strong {
    font-size: 1.25rem;
    line-height: 1.1;
}

.year-copy small {
    color: var(--muted);
    font-weight: 700;
}

.year-1 { box-shadow: inset 6px 0 0 #34c759, var(--shadow); }
.year-1 .year-badge { background: #d9fbe8; color: #157347; }
.year-2 { box-shadow: inset 6px 0 0 #2b5fe0, var(--shadow); }
.year-2 .year-badge { background: #e8efff; color: var(--blue); }
.year-3 { box-shadow: inset 6px 0 0 #ffc107, var(--shadow); }
.year-3 .year-badge { background: #fff4c4; color: #9a6b00; }
.year-4 { box-shadow: inset 6px 0 0 #f97316, var(--shadow); }
.year-4 .year-badge { background: #ffe0c2; color: #b45309; }
.year-5 { box-shadow: inset 6px 0 0 #ef4444, var(--shadow); }
.year-5 .year-badge { background: #ffd6d6; color: #b42318; }

.mundinho-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel-card { padding: 20px; }
.panel-card h2 { margin: 0 0 14px; }

.achievement-grid,
.mundinho-room {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.reward-item {
    min-height: 120px;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 12px;
    border-radius: 22px;
    background: #f7f9fd;
    text-align: center;
    font-weight: 700;
}

.reward-item.locked { opacity: .45; filter: grayscale(1); }
.reward-icon { font-size: 2.2rem; }

.story-grid {
    display: grid;
    grid-template-columns: 1.2fr .9fr .9fr;
    gap: 16px;
}

.story-card { overflow: hidden; }

.story-art {
    height: 160px;
    display: grid;
    place-items: center;
    background: linear-gradient(#d7e6ff, var(--story-theme, var(--blue)));
    font-size: 4rem;
}

.story-body { padding: 16px; }
.story-kicker { margin: 0; color: var(--blue); font-size: .82rem; font-weight: 700; }
.story-card h2 { margin: 4px 0 8px; font-size: 1.3rem; }
.story-card p { color: var(--muted); font-weight: 600; }

.hero-play {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: center;
}

.igor-figure img,
.victory-card img {
    width: min(280px, 100%);
    height: auto;
}

.soft-copy { color: var(--muted); font-weight: 600; }

.kid-input {
    width: 100%;
    min-height: 58px;
    margin: 8px 0 16px;
    padding: 12px 16px;
    border: 2px solid var(--line);
    border-radius: 16px;
    font: 700 1.3rem var(--font);
}

.field-label { display: block; font-weight: 700; }
.stack { margin-top: 16px; }
.adult-card { padding: 20px; }

.victory-overlay {
    position: absolute;
    inset: 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: calc(32px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
    overflow: hidden;
    border-radius: 0;
    background:
        radial-gradient(circle at 14% 18%, #ffd54a 0 5px, transparent 6px),
        radial-gradient(circle at 78% 12%, #fff 0 3px, transparent 4px),
        radial-gradient(circle at 88% 42%, #fff7b0 0 4px, transparent 5px),
        radial-gradient(circle at 10% 72%, #fff 0 2px, transparent 3px),
        radial-gradient(circle at 70% 82%, #ffd54a 0 6px, transparent 7px),
        #162f65;
}

.victory-overlay[hidden] { display: none; }

.victory-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 22% 30%, rgba(255,255,255,.9) 0 2px, transparent 3px),
        radial-gradient(circle at 62% 22%, rgba(255,213,74,.9) 0 3px, transparent 4px),
        radial-gradient(circle at 84% 68%, rgba(255,255,255,.8) 0 2px, transparent 3px);
}

.victory-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    text-align: center;
    background: transparent;
    color: #fff;
    box-shadow: none;
    border-radius: 0;
}

.victory-kicker {
    margin: 0;
    color: #ffcc00;
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
}

.victory-reward {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 18px;
    padding: 12px 22px;
    border-radius: 999px;
    background: rgba(20, 32, 64, .45);
    font-size: 1.2rem;
    font-weight: 700;
}

.victory-card img {
    width: min(280px, 68vw);
    flex: 1;
    max-height: 46dvh;
    object-fit: contain;
}

.victory-card .kid-button {
    width: 100%;
    min-height: 64px;
}

.settings-drawer {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(20, 40, 80, .28);
}

.settings-drawer[hidden] { display: none; }

.settings-card {
    width: min(440px, calc(100vw - 32px));
    padding: 22px;
}

.settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 0 8px;
    padding: 4px 0 10px;
    background: inherit;
}

.settings-head h2 { margin: 0; }

.settings-label {
    margin: 16px 0 6px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    border-bottom: 1px solid #eef2f7;
    font-weight: 700;
}

.toggle-switch {
    appearance: none;
    width: 52px;
    height: 32px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: #d8dee8;
    position: relative;
    cursor: pointer;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    transition: transform .16s ease;
}

.toggle-switch:checked { background: var(--green); }
.toggle-switch:checked::after { transform: translateX(20px); }

.is-play .child-sidebar,
.is-play .child-topbar,
.is-play .child-bottomnav { display: none; }

.is-play .child-app { grid-template-columns: 1fr; }

.is-play .child-main {
    width: min(980px, 100%);
    padding-top: 16px;
}

@media (hover: hover) and (pointer: fine) {
    .destination-card:hover,
    .world-card:hover,
    .story-card:hover,
    .option-button:hover { transform: translateY(-3px); }

    .sidebar-nav a:hover:not(.is-active) { background: var(--blue-soft); color: var(--blue); }
}

@media (max-width: 1100px) {
    .world-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .destination-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .story-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    .child-app,
    .play-board,
    .mundinho-columns,
    .hero-play { grid-template-columns: 1fr; }

    .continue-panel { grid-template-columns: minmax(0, 1fr) 118px; }

    .child-sidebar { display: none; }

    .child-bottomnav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        padding: 4px 6px 2px;
        background: #fff;
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(30, 70, 140, .06);
    }

    .child-bottomnav a {
        flex-direction: column;
        justify-content: center;
        min-height: 48px;
        font-size: .75rem;
        border-radius: 16px;
    }

        .child-main { padding-bottom: 18px; }

    .world-grid,
    .destination-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .continue-igor {
        width: 120px;
        height: 160px;
        justify-self: end;
        margin-top: -28px;
    }

    .continue-panel {
        padding: 20px;
        min-height: 0;
    }

    .play-guide {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        padding: 0 4px;
    }

    .play-guide img { width: 84px; }
    .play-stage { min-height: 0; padding: 16px; }
    .is-play .child-bottomnav { display: none; }
}

@media (max-width: 560px) {
    .child-topbar { padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 4px; }
    .child-main { padding-left: 14px; padding-right: 14px; }
    .topbar-kicker { display: none; }
    .kid-button { width: 100%; }
    .destination-card,
    .world-card { min-height: 150px; }
    .option-button { min-height: 132px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

html.await-splash .child-app,
html.await-splash .child-bottomnav { visibility: hidden; }

html.await-splash .igor-loader { display: none !important; }

html.await-splash .igor-splash,
html.await-splash .igor-splash[hidden] {
    display: flex !important;
}

.igor-splash {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: max(10px, env(safe-area-inset-top, 0px)) 16px max(12px, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    background:
        var(--capa) center 68% / cover no-repeat,
        linear-gradient(#57b4ff 0 38%, #9fe0ff 38% 48%, #7fd15a 48% 62%, #4e9a32 100%);
}

.igor-splash[hidden],
.igor-splash.is-done { display: none !important; }

.splash-inner {
    width: min(430px, 100%);
    min-height: min(100vh, 860px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
}

.brand-mark { text-align: center; margin-top: 8px; }
.brand-mark img { width: min(280px, 78vw); height: auto; filter: drop-shadow(0 10px 18px rgba(10, 30, 80, .25)); }
.brand-fallback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.splash-scene {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: end center;
}

.splash-igor {
    width: min(280px, 70vw);
    height: auto;
    filter: drop-shadow(0 18px 20px rgba(20, 50, 20, .28));
}

.splash-bubble {
    position: absolute;
    right: 8px;
    top: 18%;
    max-width: 180px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 22px 22px 22px 6px;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.2;
    box-shadow: var(--shadow);
}

.splash-start {
    width: min(360px, 100%);
    min-height: 64px;
    font-size: 1.35rem;
}

.play-ico {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: .9rem;
}

.page-lead {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 600;
}

.igor-tip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 22px;
    background: #eef4ff;
}

.igor-tip .tip-ico { font-size: 1.6rem; }
.igor-tip strong { display: block; font-size: .95rem; }
.igor-tip p { margin: 2px 0 0; color: var(--muted); font-weight: 600; }

.story-card.is-featured { grid-column: 1 / -1; }
.story-card.is-featured .story-art {
    height: 220px;
    background:
        radial-gradient(circle at 80% 20%, #fff7b0 0 8px, transparent 9px),
        linear-gradient(#1b3a86, #5b8def);
}
.story-card.is-featured .story-art img {
    height: 200px;
    width: auto;
    margin-top: 24px;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .28));
}
.story-card.is-featured .story-body { padding: 20px; }
.story-card.is-featured h2 { font-size: 1.7rem; }

.story-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.story-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d5deee;
}

.story-dots .is-on { background: var(--blue); }

.settings-link {
    text-decoration: none;
    color: inherit;
}

.topbar-logo,
.continue-igor,
.splash-igor,
.play-guide img,
.victory-card img,
.story-art img {
    background: transparent;
}

.world-icon {
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12), 0 10px 16px rgba(30, 70, 140, .12);
    font-weight: 800;
}

.game-title em,
.game-title strong { color: var(--blue); }

@media (min-width: 921px) {
    .igor-splash {
        place-items: center;
        background:
            var(--capa) center / cover no-repeat,
            linear-gradient(#57b4ff 0 42%, #7fd15a 42% 100%);
    }

    .splash-inner {
        width: min(520px, 92vw);
        min-height: 0;
        padding: 36px 28px 32px;
        border-radius: 36px;
        background: linear-gradient(#6db8ff 0 46%, #8fd36a 46% 100%);
        box-shadow: 0 30px 60px rgba(16, 40, 90, .25);
    }

    .destination-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .continue-panel .kid-button { width: auto; }
    .memory-grid.is-six,
    .memory-grid.is-eight { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .memory-grid.is-twelve { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .memory-card { min-height: 96px; font-size: 1.7rem; }
    .memory-grid.is-twelve .memory-card { min-height: 72px; font-size: 1.35rem; }
    .sequence-slot { width: 78px; height: 78px; min-width: 78px; min-height: 78px; }
}

/* Same phone UI on mobile and desktop */
.child-sidebar { display: none !important; }

.device-stage,
.device-frame {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    min-height: 0;
}

.device-stage {
    display: grid;
    place-items: stretch;
    background: var(--bg);
}

.device-frame {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    border-radius: 0;
    isolation: isolate;
}

.child-topbar {
    flex-shrink: 0;
    z-index: 20;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 6px;
}

.child-main {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 8px 16px 28px;
}

.child-bottomnav {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 40;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 100%;
    flex: 0 0 auto;
    padding: 4px 6px 2px;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(30, 70, 140, .06);
}

.child-bottomnav a {
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-height: 48px;
    padding: 4px 2px 2px;
    font-size: .72rem;
    border-radius: 16px;
    pointer-events: auto;
}

.child-bottomnav .ui-icon { color: currentColor; }

.destination-grid,
.world-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px;
}

.play-board,
.mundinho-columns,
.hero-play,
.story-grid,
.continue-panel {
    grid-template-columns: 1fr !important;
}

.continue-panel {
    grid-template-columns: minmax(0, 1fr) 120px !important;
    min-height: 198px;
    overflow: visible;
    padding: 20px 16px 18px 20px;
}

.continue-igor {
    width: 124px;
    height: 176px;
    margin-top: -36px;
    margin-right: -8px;
}

.continue-copy h2 { font-size: 1.45rem; }

.destination-card,
.world-card {
    min-height: 148px;
}

.destination-icon,
.world-icon {
    width: 58px;
    height: 58px;
}

.play-board { gap: 10px; }
.play-stage { min-height: 0; padding: 16px; overflow: visible; }
.play-guide {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 0 4px 8px;
}
.play-guide img { width: 86px; }

.material-symbols-rounded,
.ui-icon {
    font-family: "Material Symbols Rounded", sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga";
    font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
    display: inline-block;
    width: 1em;
    height: 1em;
    overflow: hidden;
    flex-shrink: 0;
    user-select: none;
}

.dest-map .destination-icon { color: #2b5fe0; }
.dest-library .destination-icon { color: #d97706; }
.dest-trophy .destination-icon { color: #ca8a04; }
.dest-shop .destination-icon { color: #16a34a; }

.world-icon {
    color: #fff;
}

.stars-pill .ui-icon {
    color: #f5c518;
}

.igor-loader {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(180deg, #4aa3f0 0%, #2b5fe0 55%, #1e46b8 100%);
}
.igor-loader[hidden] { display: none !important; }
.igor-loader-card {
    width: min(300px, 100%);
    padding: 28px 22px 22px;
    border-radius: 32px;
    background: #fff;
    text-align: center;
    box-shadow: 0 24px 48px rgba(10, 24, 64, .28);
}
.igor-loader-card img { width: 88px; height: 120px; object-fit: contain; }
.igor-loader-card strong { display: block; margin: 8px 0 4px; font-size: 1.35rem; }
.igor-loader-card small { color: var(--muted); font-weight: 700; }
.igor-loader-bar { height: 10px; margin: 16px 0 10px; overflow: hidden; border-radius: 999px; background: #e7eef8; }
.igor-loader-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #f5c518, #34c759); animation: igorLoad 1.1s ease forwards; }
.igor-loader.is-done { opacity: 0; pointer-events: none; transition: opacity .2s ease; }
@keyframes igorLoad { to { width: 100%; } }

.igor-splash {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top, 0px)) 18px max(12px, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    background:
        var(--capa) center 68% / cover no-repeat,
        linear-gradient(#57b4ff 0 40%, #8fd36a 40% 100%);
}
.igor-splash[hidden],
.igor-splash.is-done { display: none !important; }

.splash-logo {
    width: auto;
    max-width: min(280px, 78%);
    height: auto;
    max-height: 22svh;
    margin: 0;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 10px 18px rgba(10, 30, 80, .25));
}

.splash-scene {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: end center;
    overflow: hidden;
}

.splash-igor {
    width: auto;
    max-width: min(240px, 70%);
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 18px 20px rgba(20, 50, 20, .28));
}

.splash-bubble {
    position: absolute;
    right: 8px;
    top: 8%;
    max-width: min(168px, 46%);
    margin: 0;
    padding: 12px 14px;
    border-radius: 22px 22px 22px 6px;
    background: #fff;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: var(--shadow);
}

.splash-actions {
    width: min(360px, 100%);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.igor-splash .install-text-button {
    background: rgba(255, 255, 255, .78);
    border-radius: 18px;
    color: #16306d;
}

@media (max-height: 680px) {
    .splash-logo { max-height: 18svh; max-width: min(200px, 70%); }
    .splash-igor { max-width: min(180px, 58%); }
    .splash-bubble { top: 4%; max-width: 140px; font-size: .9rem; padding: 8px 10px; }
    .splash-start { min-height: 52px; }
}

.settings-drawer {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: block;
    padding: 0;
    background: var(--bg);
    place-items: stretch;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.settings-card {
    width: 100%;
    min-height: 100%;
    border-radius: 0;
    box-shadow: none;
    padding: max(12px, env(safe-area-inset-top, 0px)) 18px max(28px, env(safe-area-inset-bottom, 0px));
}

html.await-splash .child-topbar,
html.await-splash .child-main,
html.await-splash .child-bottomnav { visibility: hidden; }
html.await-splash .igor-loader { display: none !important; }
html.await-splash .igor-splash,
html.await-splash .igor-splash[hidden] { display: flex !important; }

.is-play .child-topbar,
.is-play .child-bottomnav { display: none !important; }

.is-play .child-main {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-bottom: 16px;
}

.kid-button { width: auto; }
.kid-button.block,
.splash-start { width: 100%; }

.continue-copy .xp-label { margin: 0 0 18px; }

.profile-screen { display: grid; gap: 16px; }

.player-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.player-grid form { margin: 0; }

.player-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 150px;
    padding: 16px;
    border: 0;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* PWA loader */
.igor-loader {
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(180deg, #3e8df2 0%, #2b5fe0 54%, #1e46b8 100%);
}

.loader-scenery {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.loader-sun {
    position: absolute;
    top: max(42px, 8vh);
    right: max(34px, 10vw);
    width: 72px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #ffc107;
    box-shadow: 0 8px 0 rgba(185, 132, 0, .16);
    animation: loaderFloat 3.8s ease-in-out infinite;
}

.loader-cloud {
    position: absolute;
    width: 118px;
    height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .76);
}

.loader-cloud::before,
.loader-cloud::after {
    content: "";
    position: absolute;
    bottom: 10px;
    border-radius: 50%;
    background: inherit;
}

.loader-cloud::before {
    left: 22px;
    width: 48px;
    height: 48px;
}

.loader-cloud::after {
    right: 20px;
    width: 58px;
    height: 58px;
}

.loader-cloud-a {
    left: 9vw;
    top: 16vh;
    animation: loaderDrift 6s ease-in-out infinite;
}

.loader-cloud-b {
    right: 8vw;
    top: 38vh;
    transform: scale(.74);
    opacity: .72;
    animation: loaderDrift 7s ease-in-out infinite reverse;
}

.loader-hill {
    position: absolute;
    bottom: -18vh;
    width: 72vw;
    height: 34vh;
    border-radius: 50% 50% 0 0;
    background: #34c759;
}

.loader-hill-a {
    left: -20vw;
}

.loader-hill-b {
    right: -22vw;
    background: #2fb25c;
}

.igor-loader-card {
    position: relative;
    width: min(324px, calc(100vw - 42px));
    padding: 24px 22px 20px;
    border: 4px solid rgba(255, 255, 255, .72);
    border-radius: 34px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 26px 56px rgba(10, 24, 64, .3);
    transform: translateY(0);
}

.loader-avatar-ring {
    width: 118px;
    height: 118px;
    display: grid;
    place-items: end center;
    margin: 0 auto 10px;
    overflow: hidden;
    border-radius: 30px;
    background: linear-gradient(180deg, #e8efff 0%, #fff8d7 100%);
    box-shadow: inset 0 -8px 0 rgba(43, 95, 224, .1), 0 10px 22px rgba(43, 95, 224, .16);
}

.loader-avatar-ring img {
    width: 82px;
    height: 112px;
    object-fit: contain;
    object-position: center bottom;
}

.igor-loader-card strong {
    margin-top: 8px;
    color: var(--ink);
    font-size: 1.45rem;
}

.igor-loader-card small {
    color: #556987;
}

.igor-loader-bar {
    height: 12px;
    border: 2px solid #dfe8f6;
    background: #f2f6fc;
}

.igor-loader-bar span {
    background: linear-gradient(90deg, #ffc107 0%, #34c759 56%, #2b5fe0 100%);
    animation: igorLoad 1.05s cubic-bezier(.22, .9, .3, 1) forwards;
}

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2b5fe0;
    animation: loaderDot 1s ease-in-out infinite;
}

.loader-dots span:nth-child(2) { animation-delay: .14s; background: #ffc107; }
.loader-dots span:nth-child(3) { animation-delay: .28s; background: #34c759; }

@keyframes loaderFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes loaderDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(12px); }
}

@keyframes loaderDot {
    0%, 100% { transform: translateY(0); opacity: .55; }
    50% { transform: translateY(-5px); opacity: 1; }
}

html.reduced-motion .loader-sun,
html.reduced-motion .loader-cloud,
html.reduced-motion .loader-dots span,
html.calm-mode .loader-sun,
html.calm-mode .loader-cloud,
html.calm-mode .loader-dots span {
    animation: none;
}

html.calm-mode .igor-loader {
    background: #eef1f4;
}

.player-card strong {
    font-size: 1.15rem;
    line-height: 1.15;
}

.player-card em {
    font-style: normal;
    font-size: .85rem;
    font-weight: 700;
    color: var(--blue);
}

.player-card.is-current {
    outline: 3px solid var(--blue);
}

.player-avatar {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #e8efff;
}

.player-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #b45309;
    font-weight: 700;
}

.profile-form { margin: 0; }

@media (min-width: 560px) {
    .device-stage {
        padding: 0;
        background:
            radial-gradient(circle at top, #d9e6ff 0, transparent 42%),
            var(--bg);
    }

    .device-stage,
    .device-frame {
        position: absolute;
        inset: 0;
        width: auto;
        height: auto;
        min-height: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .child-topbar,
    .child-main {
        width: min(520px, 100%);
        margin-left: auto;
        margin-right: auto;
    }

    .is-play .child-main {
        width: min(720px, 100%);
    }

    .child-bottomnav {
        width: 100%;
        margin: 0;
        padding-left: max(8px, calc((100% - 520px) / 2));
        padding-right: max(8px, calc((100% - 520px) / 2));
    }

    .igor-splash {
        padding-left: max(18px, calc((100% - 420px) / 2));
        padding-right: max(18px, calc((100% - 420px) / 2));
    }
}

.install-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 14px;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.install-card .destination-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 0;
    border-radius: 18px;
    background: var(--blue-soft);
    color: var(--blue);
}

.install-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.25;
}

.install-card .kid-button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 56px;
}

.install-card[hidden] { display: none !important; }

.install-text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    border: 0;
    background: transparent;
    color: #16306d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.install-settings-button {
    width: 100%;
    background: transparent;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.install-settings-button span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.install-sheet {
    position: absolute;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: end center;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    background: rgba(16, 32, 72, .48);
    overflow: auto;
}

.install-sheet[hidden] { display: none !important; }

.install-sheet-card {
    width: min(400px, 100%);
    max-height: min(80vh, 520px);
    overflow: auto;
    padding: 20px 18px 14px;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 24px 48px rgba(16, 40, 90, .28);
}

.install-lead {
    margin: 0 0 12px;
    color: var(--muted);
    font-weight: 600;
}

.install-steps {
    margin: 0 0 18px;
    padding-left: 22px;
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.install-steps li { line-height: 1.3; }

html.is-ios-device .install-step.is-android,
html.is-ios-device .install-step.is-other,
html:not(.is-ios-device) .install-step.is-ios,
html.can-native-install .install-step.is-other,
html:not(.is-ios-device):not(.can-native-install) .install-step.is-android { display: none; }

html:not(.can-native-install) .install-sheet [data-install-native] { display: none; }

html.is-pwa-installed .install-card,
html.is-pwa-installed [data-install-app],
html.is-pwa-installed [data-install-sheet] { display: none !important; }

html:not(.await-splash) body.child-body:not(.is-play) .child-bottomnav {
    display: grid !important;
    visibility: visible;
}

.install-sheet-card {
    max-height: min(78%, 520px);
}

.install-sheet-card .settings-head {
    background: #fff;
}

.child-topbar,
.child-actions {
    min-width: 0;
}

.skip-link {
    flex: none;
}

@media (max-width: 560px) and (max-height: 740px) {
    .option-button { min-height: 96px; }
    .play-stage { min-height: 0; padding: 12px; }
    .prompt-sample { min-height: 96px; margin-bottom: 12px; }
    .sequence-slot { width: 64px; height: 64px; min-width: 64px; min-height: 64px; }
}

@media (max-height: 640px) {
    .splash-logo { max-height: 16svh; }
    .splash-start { min-height: 48px; }
    .child-bottomnav a { min-height: 44px; }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
    html {
        height: 100%;
        background: #fff;
    }

    body.child-body {
        background: #fff;
        inset: 0;
        width: auto;
        height: auto;
        min-height: 0;
    }

    .device-stage,
    .device-frame {
        background: var(--bg);
        width: auto;
        height: auto;
    }

    .child-bottomnav {
        padding: 4px 6px 2px;
        padding-bottom: max(2px, calc(env(safe-area-inset-bottom, 0px) - 28px));
        background: #fff;
    }
}

html.is-pwa-installed .child-bottomnav {
    padding-bottom: max(2px, calc(env(safe-area-inset-bottom, 0px) - 28px));
}

html.is-pwa-installed:not(.is-ios-device) .child-bottomnav {
    padding-bottom: 2px;
}

@media (min-width: 900px) {
    .child-body {
        font-size: 15px;
    }

    .topbar-title {
        font-size: 1.15rem;
    }

    .continue-copy h2 {
        font-size: 1.28rem;
    }

    .destination-card strong,
    .world-card strong {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.35rem;
    }

    .game-title {
        font-size: 1.4rem;
    }

    .kid-button {
        font-size: 1rem;
    }

    .xp-label,
    .page-lead,
    .year-playing {
        font-size: .85rem;
    }
}

.child-body,
.child-body button,
.child-body .voice-button,
.child-body .install-text-button,
.child-body .install-settings-button {
    text-transform: uppercase;
}

.child-body .ui-icon,
.child-body .material-symbols-rounded,
.child-body input,
.child-body textarea,
.child-body select,
.child-body option,
.child-body .praise-emoji,
.child-body .confetti-bit {
    text-transform: none;
}

.game-title,
.section-title,
.continue-copy h2,
.destination-card strong,
.world-card strong,
.year-copy strong,
.victory-kicker,
.igor-says,
.option-button,
.sequence-chip,
.instruction-bubble {
    line-height: 1.2;
    overflow-wrap: break-word;
}

.play-guide {
    flex-wrap: wrap;
}

.play-guide .igor-says {
    flex: 1 1 9.5rem;
    min-width: 9.5rem;
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
}

.play-guide .voice-button {
    flex: 1 1 8rem;
    width: auto;
    min-width: 8rem;
}

.option-button,
.sequence-chip {
    min-width: 0;
}

.child-bottomnav a {
    text-align: center;
    line-height: 1.05;
}

.child-bottomnav a span {
    display: block;
    max-width: 100%;
    font-size: .64rem;
    line-height: 1.05;
    white-space: normal;
}

.settings-row > label {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
    line-height: 1.25;
}

.settings-link > span:first-child {
    min-width: 0;
    line-height: 1.25;
}

.toggle-switch {
    flex-shrink: 0;
}


/* ===== Efeitos de toque e resposta =====
   O modo calmo e "Menos animações" desligam tudo (regras .calm-mode * e .reduced-motion * acima). */

.option-button,
.memory-card,
.sequence-chip,
.kid-button,
.icon-button,
.world-card {
    position: relative;
    overflow: hidden;
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s ease, filter .18s ease;
}

@media (hover: hover) {
    .option-button:hover,
    .memory-card:hover,
    .sequence-chip:hover:not(:disabled),
    .world-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 28px rgba(31, 41, 80, .16);
    }
}

.kid-button:active,
.icon-button:active,
.option-button:active,
.memory-card:active,
.sequence-chip:active,
.world-card:active,
.destination-card:active,
.continue-panel:active {
    transform: translateY(2px) scale(.96);
    filter: brightness(.97);
    transition-duration: .06s;
}

/* Onda que sai do ponto tocado */
.touch-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, .75) 0%, rgba(120, 160, 255, .28) 45%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: touch-ripple .55s ease-out forwards;
}

@keyframes touch-ripple {
    to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Resposta certa: pula com brilho verde */
.option-button.is-correct {
    animation: answer-correct .7s cubic-bezier(.34, 1.56, .64, 1);
    box-shadow: 0 0 0 5px #34c759, 0 0 28px rgba(52, 199, 89, .55);
}

@keyframes answer-correct {
    0% { transform: scale(1); }
    35% { transform: scale(1.12) rotate(-2deg); }
    60% { transform: scale(.97) rotate(1deg); }
    100% { transform: scale(1); }
}

/* Resposta errada: balança de leve */
.is-shake { animation: answer-shake .45s ease-in-out; }

@keyframes answer-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-9px) rotate(-2deg); }
    40% { transform: translateX(8px) rotate(2deg); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(4px); }
}

/* Passo certo numa sequência e par da memória */
.is-step,
.is-pop { animation: answer-pop .45s cubic-bezier(.34, 1.56, .64, 1); }

@keyframes answer-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.memory-card.is-matched { box-shadow: 0 0 0 4px #34c759, 0 8px 20px rgba(52, 199, 89, .35); }

/* Carta virando */
.memory-card.is-open:not(.is-peek) { animation: card-flip .32s ease-out; }

@keyframes card-flip {
    0% { transform: perspective(600px) rotateY(90deg) scale(.95); }
    100% { transform: perspective(600px) rotateY(0) scale(1); }
}

/* Item da rotina escolhido */
.sequence-chip.is-used { transform: scale(.92); }
.sequence-selected .sequence-slot.is-filled,
.sequence-selected .sequence-slot:has(small) { animation: answer-pop .4s cubic-bezier(.34, 1.56, .64, 1); }

/* Nova fase entrando */
.game-area > * { animation: phase-in .45s cubic-bezier(.22, 1, .36, 1); }
.game-title { animation: phase-in .45s cubic-bezier(.22, 1, .36, 1); }

/* Só movimento, sem opacidade: se o aparelho atrasar a animação, a fase nunca fica apagada. */
@keyframes phase-in {
    from { transform: translateY(14px) scale(.98); }
    to { transform: none; }
}

/* Contador de estrelas quando ganha uma */
.stars-pill.is-bump { animation: star-bump .6s cubic-bezier(.34, 1.56, .64, 1); }

@keyframes star-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.3) rotate(-6deg); box-shadow: 0 0 0 6px rgba(245, 197, 24, .35); }
    100% { transform: scale(1); }
}

/* ===== Complete o padrão ===== */
.pattern-row {
    align-items: center;
    gap: 8px;
    margin: 10px 0 18px;
}

.pattern-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

/* Ajuda visual (1º ao 3º ano): cada volta do padrão num "trenzinho" com fundo */
.pattern-row.has-groups .pattern-group {
    padding: 8px 10px;
    border-radius: 20px;
    background: #eef3ff;
    box-shadow: inset 0 0 0 2px #dbe5ff;
}

.pattern-cell {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
}

.pattern-cell .pattern-piece { width: 100%; height: 100%; display: block; }

.pattern-row .pattern-mystery {
    position: relative;
    width: 76px;
    height: 76px;
    min-width: 76px;
    min-height: 76px;
    padding: 0;
    border: 4px dashed #2b5fe0;
    border-radius: 50%;
    background: #fff;
    overflow: visible;
    animation: mystery-pulse 1.6s ease-in-out infinite;
}

.pattern-igor {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
}

/* Balãozinho de pergunta saindo do Igor */
.pattern-ask {
    position: absolute;
    top: -10px;
    right: -12px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #facc15;
    color: #1e293b;
    font-size: 1.15rem;
    font-weight: 900;
    box-shadow: 0 3px 0 #ca8a04;
}

.pattern-row .pattern-mystery.is-filled {
    padding: 4px;
    border: 4px solid #34c759;
    background: #ecfdf3;
    animation: none;
}

.pattern-row .pattern-mystery.is-shake {
    border-color: #ef4444;
    background: #fef2f2;
    animation: answer-shake .45s ease-in-out;
}

@keyframes mystery-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(43, 95, 224, .35); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(43, 95, 224, 0); }
}

.pattern-option-art { width: 76px; height: 76px; display: grid; place-items: center; }
.pattern-option-art .pattern-piece { width: 100%; height: 100%; }

@media (max-width: 520px) {
    .pattern-cell { width: 40px; height: 40px; }
    .pattern-row .pattern-mystery { width: 56px; height: 56px; min-width: 56px; min-height: 56px; }
    .pattern-ask { width: 26px; height: 26px; font-size: .95rem; top: -8px; right: -9px; }
    .pattern-row.has-groups .pattern-group { padding: 6px 7px; gap: 4px; }
    .pattern-option-art { width: 60px; height: 60px; }
}

/* ===== Certo e errado bem visíveis em todos os jogos ===== */
.option-button.is-right {
    box-shadow: 0 0 0 5px #34c759, 0 10px 26px rgba(52, 199, 89, .4);
    background: #ecfdf3;
}

.option-button.is-miss {
    opacity: 1;
    background: #fef2f2;
    box-shadow: 0 0 0 4px #ef4444;
    filter: grayscale(.35);
}

.option-button.is-right::after,
.option-button.is-miss::after {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    line-height: 1;
}

.option-button.is-right::after { content: '✓'; background: #22c55e; }
.option-button.is-miss::after { content: '✕'; background: #ef4444; }

/* Depois do acerto, as outras opções somem um pouco para destacar a certa */
.option-grid.is-solved .option-button:not(.is-right) { opacity: .35; }

/* Dica depois de 2 erros: brilho amarelo pulsando (verde é só para acerto) */
.option-button.is-suggest { animation: suggest-pulse 1.2s ease-in-out infinite; }

@keyframes suggest-pulse {
    0%, 100% { box-shadow: 0 0 0 4px #facc15; }
    50% { box-shadow: 0 0 0 9px rgba(250, 204, 21, .45); }
}

/* ===== Pergunta da fase: o Igor "fala" num balão grande =====
   O jogo não tem voz, então a pergunta precisa ser a coisa mais visível da tela. */
.ask-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 6px;
    scroll-margin-top: 76px;
}

.ask-igor {
    flex: none;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
    background: #e8efff;
    box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(31, 41, 80, .18);
}

.ask-bubble {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border-radius: 24px;
    background: #2b5fe0;
    color: #fff;
    box-shadow: 0 8px 0 #1d46b3;
}

/* Pontinha do balão apontando para o Igor */
.ask-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    width: 24px;
    height: 24px;
    background: #2b5fe0;
    border-radius: 4px;
    transform: translateY(-50%) rotate(45deg);
}

.ask-bubble .game-title {
    position: relative;
    margin: 0;
    color: #fff;
    font-size: clamp(1.45rem, 3.6vw, 2.25rem);
    line-height: 1.15;
}

.ask-key {
    display: inline-block;
    padding: 0 10px;
    border-radius: 12px;
    background: #fff;
    color: #2b5fe0 !important;
}

.ask-key.is-color {
    background: var(--key);
    color: var(--key-ink) !important;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7);
}

.ask-tip {
    position: relative;
    margin: 8px 0 0;
    color: #dbe6ff;
    font-size: clamp(.95rem, 2.2vw, 1.1rem);
    font-weight: 700;
}

.ask-tip::before { content: '👆 '; }

.play-stage .year-playing { margin: 10px 0 8px 98px; font-size: .85rem; }

@media (max-width: 520px) {
    .ask-card { gap: 10px; }
    .ask-igor { width: 58px; height: 58px; }
    .ask-bubble { padding: 12px 14px; border-radius: 20px; }
    .ask-bubble::before { left: -9px; width: 18px; height: 18px; }
    .ask-bubble .game-title { font-size: 1.3rem; }
    .play-stage .year-playing { margin-left: 68px; }
}
