:root {
    --ink: #171b52;
    --muted: #627084;
    --blue: #0d74ff;
    --a: #00a7ff;
    --a-dark: #006dff;
    --b: #ff4e86;
    --b-dark: #f04b1f;
    --count: #ffe234;
    --count-dark: #f6a000;
    --done: #9aa7b5;
    --surface: rgba(255, 255, 255, 0.9);
    --line: rgba(76, 126, 199, 0.16);
    --shadow: 0 16px 34px rgba(52, 92, 150, 0.15);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 15%, rgba(255, 255, 255, 0.98), transparent 27%),
        radial-gradient(circle at 86% 12%, rgba(255, 226, 52, 0.34), transparent 28%),
        radial-gradient(circle at 9% 78%, rgba(0, 204, 255, 0.22), transparent 30%),
        linear-gradient(180deg, #f0fbff 0%, #e3f4ff 48%, #cfe5ff 100%);
    overflow: hidden;
}

button,
a {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    cursor: pointer;
}

.popit-shell {
    width: 100%;
    max-width: 430px;
    height: 100dvh;
    min-height: 680px;
    margin: 0 auto;
    padding:
        calc(env(safe-area-inset-top, 0px) + 10px)
        10px
        calc(env(safe-area-inset-bottom, 0px) + 10px);
    display: grid;
    grid-template-rows: 50px minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
}

.topbar {
    display: grid;
    grid-template-columns: 46px 1fr 46px 46px;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 118px;
    justify-self: center;
    filter: drop-shadow(0 8px 16px rgba(50, 130, 206, 0.14));
}

.back-button,
.sound-button,
.fullscreen-button,
.soft-button {
    min-width: 42px;
    min-height: 42px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--blue);
    box-shadow: 0 8px 18px rgba(50, 130, 206, 0.12);
    display: grid;
    place-items: center;
}

.fullscreen-button {
    min-width: 42px;
    min-height: 42px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--blue);
    box-shadow: 0 8px 18px rgba(50, 130, 206, 0.12);
    display: grid;
    place-items: center;
}

.back-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sound-button img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.fullscreen-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sound-button[aria-pressed="false"] {
    filter: grayscale(0.85);
    opacity: 0.62;
}

.game {
    min-height: 0;
    display: grid;
    grid-template-rows: 82px 56px 56px minmax(220px, 1fr) 164px 48px;
    gap: 8px;
}

.problem-card,
.count-zone {
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.problem-card {
    padding: 11px 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--blue);
    font-size: 0.62rem;
    font-weight: 950;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.problem-equation {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: 2.45rem;
    line-height: 0.9;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.problem-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.number-input {
    width: 58px;
    height: 48px;
    border: 0;
    border-radius: 17px;
    background:
        radial-gradient(circle at 35% 23%, rgba(255, 255, 255, 0.85), transparent 32%),
        linear-gradient(145deg, #ffffff, #e9f5ff);
    color: var(--ink);
    box-shadow:
        inset 0 -7px 10px rgba(20, 93, 168, 0.11),
        inset 0 7px 10px rgba(255, 255, 255, 0.92),
        0 8px 15px rgba(50, 130, 206, 0.14);
    font-family: "Archivo", sans-serif;
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    text-align: center;
    outline: none;
}

.number-input::placeholder {
    color: #8b98aa;
    opacity: 0.74;
}

.number-input[readonly] {
    caret-color: transparent;
}

.equation-answer {
    width: 58px;
    height: 48px;
    border-radius: 17px;
    background:
        radial-gradient(circle at 35% 23%, rgba(255, 255, 255, 0.85), transparent 32%),
        linear-gradient(145deg, #fff889, var(--count) 54%, #f6a000);
    color: #725100;
    box-shadow:
        inset 0 -7px 10px rgba(185, 123, 10, 0.12),
        inset 0 7px 10px rgba(255, 255, 255, 0.92),
        0 8px 15px rgba(210, 147, 20, 0.14);
    display: grid;
    place-items: center;
    font-family: "Archivo", sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
}

.number-input:focus {
    box-shadow:
        inset 0 -7px 10px rgba(20, 93, 168, 0.11),
        inset 0 7px 10px rgba(255, 255, 255, 0.92),
        0 0 0 4px rgba(0, 167, 255, 0.16),
        0 8px 15px rgba(50, 130, 206, 0.14);
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.soft-button {
    min-height: 38px;
    padding: 0 13px;
    border-radius: 15px;
    color: #1667c7;
    font-family: "Archivo", sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
}

.icon-soft-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
    display: grid;
    place-items: center;
}

.icon-soft-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-soft-button:disabled {
    cursor: default;
    filter: grayscale(0.9);
    opacity: 0.48;
}

.color-goals {
    display: block;
    min-height: 0;
}

.goal-chip {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 7px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.76);
    color: #344256;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 0 0 1px var(--line), 0 10px 22px rgba(74, 104, 166, 0.09);
}

.goal-chip.is-active {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px rgba(72, 184, 242, 0.28), 0 12px 24px rgba(74, 104, 166, 0.14);
}

.goal-chip.is-complete {
    opacity: 0.62;
}

.goal-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
    box-shadow: inset 0 -7px 10px rgba(23, 27, 82, 0.16), inset 0 6px 10px rgba(255, 255, 255, 0.58);
}

.goal-dot--a {
    background: linear-gradient(145deg, #8ff2ff, var(--a) 48%, var(--a-dark));
}

.goal-dot--b {
    background: linear-gradient(145deg, #ffd15c, #ff7b39 42%, var(--b));
}

.goal-chip strong {
    font-family: "Archivo", sans-serif;
    font-size: 1.25rem;
    line-height: 1;
}

.play-zone {
    min-height: 0;
    display: grid;
    place-items: center;
}

.popit-board {
    width: min(100%, 348px);
    height: min(100%, 276px);
    min-height: 232px;
    padding: 18px;
    border-radius: 42px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 38%),
        linear-gradient(135deg, #00d2ff 0%, #5b6dff 48%, #ff4e86 72%, #ffe234 100%);
    box-shadow:
        inset 0 12px 20px rgba(255, 255, 255, 0.42),
        inset 0 -18px 24px rgba(46, 86, 146, 0.18),
        0 22px 42px rgba(52, 92, 150, 0.18);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 11px;
}

.bubble {
    position: relative;
    min-width: 0;
    min-height: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.35) 28%, transparent 29%),
        radial-gradient(circle at 50% 55%, #f8fcff 0%, #e6f4ff 60%, #b6d0f2 100%);
    box-shadow:
        inset 0 -9px 13px rgba(57, 91, 142, 0.18),
        inset 0 8px 13px rgba(255, 255, 255, 0.92),
        0 7px 11px rgba(35, 74, 126, 0.12);
    transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease;
}

.bubble::after {
    content: "";
    position: absolute;
    inset: 18%;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 -5px 7px rgba(35, 74, 126, 0.12);
}

.bubble.is-a {
    background:
        radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85), transparent 30%),
        linear-gradient(145deg, #8ff2ff, var(--a) 46%, var(--a-dark));
    box-shadow:
        inset 0 10px 12px rgba(255, 255, 255, 0.36),
        inset 0 -13px 16px rgba(10, 80, 155, 0.34),
        0 4px 8px rgba(35, 74, 126, 0.1);
    transform: translateY(4px) scale(0.93);
}

.bubble.is-b {
    background:
        radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.86), transparent 30%),
        linear-gradient(145deg, #ffd15c, #ff7b39 42%, var(--b));
    box-shadow:
        inset 0 10px 12px rgba(255, 255, 255, 0.34),
        inset 0 -13px 16px rgba(191, 65, 42, 0.34),
        0 4px 8px rgba(35, 74, 126, 0.1);
    transform: translateY(4px) scale(0.93);
}

.bubble.is-collected {
    filter: saturate(0.72) opacity(0.58);
}

.count-zone {
    min-height: 0;
    padding: 10px;
    display: grid;
    grid-template-rows: 44px minmax(0, 1fr);
    gap: 8px;
}

.count-zone__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.count-zone h2 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: 1rem;
    line-height: 1;
}

#countedValue {
    min-width: 54px;
    min-height: 40px;
    border-radius: 16px;
    background: #eef6ff;
    color: var(--blue);
    display: grid;
    place-items: center;
    font-family: "Archivo", sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
}

.count-tray {
    min-height: 0;
    padding: 10px;
    border-radius: 22px;
    background: linear-gradient(180deg, #fffbe5, #fff0a9);
    box-shadow: inset 0 0 0 1px rgba(216, 154, 18, 0.12);
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-auto-rows: minmax(32px, 1fr);
    gap: 7px;
    align-content: center;
}

.count-ball {
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.88), transparent 33%),
        linear-gradient(145deg, #fff889, var(--count) 48%, var(--count-dark));
    box-shadow:
        inset 0 7px 9px rgba(255, 255, 255, 0.42),
        inset 0 -9px 12px rgba(185, 123, 10, 0.28),
        0 6px 11px rgba(81, 81, 99, 0.12);
    transform: scale(0);
    animation: popIn 220ms ease forwards;
}

.count-ball.is-a,
.count-ball.is-leftover {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.85), transparent 30%),
        linear-gradient(145deg, #8ff2ff, var(--a) 46%, var(--a-dark));
    box-shadow:
        inset 0 8px 10px rgba(255, 255, 255, 0.34),
        inset 0 -10px 13px rgba(10, 80, 155, 0.28),
        0 6px 11px rgba(35, 74, 126, 0.12);
}

.count-ball.is-b {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.86), transparent 30%),
        linear-gradient(145deg, #ffd15c, #ff7b39 42%, var(--b));
    box-shadow:
        inset 0 8px 10px rgba(255, 255, 255, 0.34),
        inset 0 -10px 13px rgba(191, 65, 42, 0.28),
        0 6px 11px rgba(35, 74, 126, 0.12);
}

.count-ball.is-counted {
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.65), transparent 35%),
        linear-gradient(145deg, #c5ced8, var(--done));
    box-shadow:
        inset 0 7px 9px rgba(255, 255, 255, 0.25),
        inset 0 -8px 12px rgba(62, 72, 84, 0.28);
    transform: translateY(2px) scale(0.94);
}

.game-actions {
    min-height: 0;
    display: grid;
    grid-template-columns: 84px 102px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.result-button {
    min-width: 0;
    margin: 0;
    min-height: 38px;
    padding: 0 8px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.62);
    color: #536070;
    font-size: 0.7rem;
    line-height: 1.15;
    font-weight: 800;
    text-align: center;
    display: grid;
    place-items: center;
    overflow-wrap: anywhere;
}

.result-button:disabled {
    cursor: default;
    opacity: 0.62;
}

.result-button.is-ready {
    background: linear-gradient(135deg, #ffffff, #eef6ff);
    color: #1667c7;
    box-shadow: 0 8px 18px rgba(50, 130, 206, 0.12);
    opacity: 1;
}

.result-button.is-revealed {
    background: linear-gradient(135deg, #fff8a8, #ffd84d);
    color: #725100;
    box-shadow: 0 8px 18px rgba(210, 147, 20, 0.14);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.36) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-height: 740px) {
    .popit-shell {
        min-height: 620px;
        padding-top: calc(env(safe-area-inset-top, 0px) + 7px);
        gap: 6px;
    }

    .topbar {
        height: 46px;
    }

    .game {
        grid-template-rows: 72px 50px 50px minmax(192px, 1fr) 138px 44px;
        gap: 7px;
    }

    .problem-equation {
        font-size: 2.06rem;
    }

    .number-input {
        width: 52px;
        height: 43px;
        font-size: 1.74rem;
    }

    .popit-board {
        min-height: 210px;
        padding: 15px;
        gap: 9px;
        border-radius: 36px;
    }

    .count-zone {
        padding: 8px;
        grid-template-rows: 39px minmax(0, 1fr);
    }

    .count-tray {
        padding: 8px;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .popit-shell {
        padding-left: 8px;
        padding-right: 8px;
    }

    .topbar {
        grid-template-columns: 42px 1fr 42px 42px;
        gap: 6px;
    }

    .brand-logo {
        width: 106px;
    }

    .back-button,
    .sound-button,
    .fullscreen-button,
    .soft-button {
        min-width: 40px;
        min-height: 40px;
        border-radius: 14px;
    }

    .game {
        grid-template-rows: auto 50px 50px minmax(188px, 1fr) 136px 42px;
        gap: 6px;
    }

    .problem-card {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .problem-card > div:first-child {
        min-width: 0;
    }

    .problem-equation {
        font-size: 1.9rem;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .number-input,
    .equation-answer {
        width: 50px;
        height: 42px;
        border-radius: 15px;
        font-size: 1.55rem;
        flex: 0 0 auto;
    }

    .equation-answer {
        font-size: 1.35rem;
    }

    .problem-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
    }

    .soft-button {
        padding: 0 10px;
        font-size: 0.72rem;
    }

    .icon-soft-button {
        width: 40px;
        min-width: 40px;
        padding: 0;
    }

    .goal-chip {
        min-height: 50px;
        padding: 7px 10px;
    }

    .goal-dot {
        width: 30px;
        height: 30px;
    }

    .goal-chip strong {
        font-size: 1.06rem;
    }

    .popit-board {
        width: min(100%, 300px);
        min-height: 188px;
        height: min(100%, 224px);
        padding: 14px;
        border-radius: 30px;
        gap: 8px;
    }

    .count-zone {
        padding: 8px;
        grid-template-rows: 38px minmax(0, 1fr);
        gap: 6px;
    }

    .count-zone h2 {
        font-size: 0.92rem;
    }

    #countedValue {
        min-width: 46px;
        min-height: 34px;
        font-size: 1.15rem;
    }

    .count-tray {
        padding: 8px;
        gap: 5px;
        grid-auto-rows: minmax(22px, 1fr);
    }

    .game-actions {
        grid-template-columns: 1fr 1fr 1.1fr;
        gap: 6px;
    }

    .result-button {
        min-height: 34px;
        font-size: 0.64rem;
        border-radius: 13px;
    }
}

@media (max-width: 360px) {
    .popit-board {
        gap: 8px;
        padding: 13px;
    }

    .count-tray {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .game-actions {
        grid-template-columns: 72px 88px minmax(0, 1fr);
    }

    .soft-button {
        padding: 0 10px;
        font-size: 0.7rem;
    }

    .problem-equation {
        font-size: 1.72rem;
    }

    .number-input,
    .equation-answer {
        width: 46px;
        height: 40px;
        font-size: 1.38rem;
    }
}

@media (min-width: 900px) {
    body {
        overflow: hidden;
    }

    .popit-shell {
        width: min(100vw, 1280px);
        max-width: 1280px;
        height: 100dvh;
        min-height: 0;
        padding: 84px clamp(18px, 3vw, 44px) 18px;
        position: relative;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        grid-template-rows: repeat(5, minmax(0, 1fr));
        gap: 5px;
        overflow: hidden;
    }

    .topbar {
        position: absolute;
        top: 18px;
        left: clamp(18px, 3vw, 44px);
        right: clamp(18px, 3vw, 44px);
        z-index: 8;
        height: 52px;
        display: grid;
        grid-template-columns: 48px 150px minmax(0, 1fr) 48px 48px;
        align-items: center;
        gap: 8px;
        pointer-events: none;
    }

    .brand-logo {
        width: 142px;
        grid-column: 2;
        justify-self: start;
    }

    .back-button,
    .sound-button,
    .fullscreen-button,
    .soft-button {
        min-width: 48px;
        min-height: 48px;
        border-radius: 18px;
    }

    .sound-button,
    .fullscreen-button {
        justify-self: end;
    }

    .back-button,
    .brand-logo,
    .sound-button,
    .fullscreen-button {
        pointer-events: auto;
    }

    .back-button {
        grid-column: 1;
        grid-row: 1;
    }

    .sound-button {
        grid-column: 4;
        grid-row: 1;
    }

    .fullscreen-button {
        grid-column: 5;
        grid-row: 1;
    }

    .game {
        display: contents;
    }

    .problem-card {
        min-height: 0;
        padding: 14px 16px;
        border-radius: 28px;
        align-self: stretch;
    }

    .eyebrow {
        font-size: 0.68rem;
    }

    .problem-equation {
        font-size: clamp(1.65rem, 3vw, 2.5rem);
        gap: 8px;
    }

    .number-input,
    .equation-answer {
        width: clamp(50px, 4.5vw, 68px);
        height: clamp(46px, 4.5vw, 58px);
        border-radius: 20px;
        font-size: clamp(1.45rem, 2.4vw, 2rem);
    }

    .color-goals {
        display: block;
        gap: 12px;
    }

    .goal-chip {
        width: 100%;
        height: 100%;
        min-height: 0;
        grid-template-columns: 54px minmax(0, 1fr);
        padding: 12px 16px;
        border-radius: 24px;
    }

    .goal-dot {
        width: 50px;
        height: 50px;
    }

    .goal-chip strong {
        font-size: clamp(1.2rem, 2.4vw, 1.8rem);
    }

    .play-zone {
        min-height: 0;
    }

    .popit-board {
        width: min(100%, 470px);
        max-height: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 5 / 4;
        padding: clamp(14px, 2vw, 24px);
        border-radius: clamp(34px, 4vw, 54px);
        gap: clamp(9px, 1.4vw, 14px);
    }

    .count-zone {
        min-height: 0;
        padding: 14px;
        border-radius: 30px;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
    }

    .count-zone h2 {
        font-size: clamp(1.05rem, 1.8vw, 1.32rem);
    }

    #countedValue {
        min-width: 58px;
        min-height: 46px;
        border-radius: 19px;
        font-size: 1.55rem;
    }

    .count-tray {
        grid-auto-rows: minmax(38px, 1fr);
        gap: 8px;
        padding: 12px;
        overflow: hidden;
    }

    .game-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: minmax(44px, auto);
        gap: 8px;
        align-self: stretch;
    }

    .result-text {
        grid-column: 1 / -1;
        min-height: 44px;
        border-radius: 18px;
        font-size: 0.78rem;
    }

    .layout-main {
        grid-column: span 2 / span 2;
        grid-row: span 4 / span 4;
        grid-column-start: 2;
        grid-row-start: 2;
    }

    .layout-operation {
        grid-column: span 2 / span 2;
        grid-column-start: 4;
        grid-row-start: 1;
    }

    .layout-count {
        grid-column: span 2 / span 2;
        grid-row: span 3 / span 3;
        grid-column-start: 4;
        grid-row-start: 2;
    }

    .layout-logo {
        grid-column: auto;
        grid-row: auto;
    }

    .layout-goal-a {
        grid-column-start: 2;
        grid-row-start: 1;
    }

    .layout-goal-b {
        grid-column-start: 3;
        grid-row-start: 1;
    }

    .layout-actions {
        grid-column: span 2 / span 2;
        grid-column-start: 4;
        grid-row-start: 5;
    }
}

.count-stack {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(76px, 1fr) auto;
    gap: 10px;
}

.count-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 12px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.count-result__label { color: #7c8698; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.count-result__equation { font-family: "Archivo", sans-serif; font-size: 1.25rem; line-height: 1; color: #48556d; }
.count-result__value { font-family: "Archivo", sans-serif; font-size: 1.8rem; line-height: 1; color: #6d7788; }
.count-result__hint { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.25; }
.count-result.is-ready { background: linear-gradient(135deg, rgba(255, 248, 168, .76), rgba(255, 255, 255, .96)); }
.count-result.is-revealed { transform: translateY(-2px); background: linear-gradient(135deg, #fff7a8, #ffd84d); animation: answerRevealPop 420ms cubic-bezier(.2,.9,.25,1.08); }
.count-result.is-revealed .count-result__equation { color: #6f4b00; }
.count-result.is-revealed .count-result__value { color: #725100; font-size: 2.7rem; }
.equation-answer.is-revealed { transform: scale(1.08); animation: answerRevealPop 420ms cubic-bezier(.2,.9,.25,1.08); }
#countedValue.is-confirmed { background: rgba(255,255,255,.92); color: #2f8b68; font-size: 1rem; letter-spacing: .06em; }

@keyframes answerRevealPop {
    0% { opacity: .5; transform: scale(.88); }
    70% { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 899px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .popit-shell {
        height: auto;
        min-height: 100svh;
        overflow: visible;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    }

    .game {
        grid-template-rows: auto 56px 56px auto auto 48px;
    }

    .play-zone {
        min-height: 248px;
    }

    .count-zone {
        min-height: 214px;
        overflow: visible;
    }

    .count-stack {
        grid-template-rows: minmax(78px, auto) auto;
    }

    .count-tray {
        min-height: 78px;
        overflow: visible;
    }

    .count-result {
        min-height: 98px;
    }

    .game-actions {
        min-height: 48px;
        position: static;
    }
}
