:root {
    --bg-deep: #160f24;
    --bg-warm: #2c1732;
    --panel: rgba(38, 25, 42, 0.82);
    --panel-strong: rgba(28, 18, 32, 0.94);
    --panel-border: rgba(255, 209, 132, 0.22);
    --gold: #ffd978;
    --gold-strong: #ffb84d;
    --cream: #fff2c9;
    --text-soft: #d8c5a3;
    --choco: #311b12;
    --choco-light: #6f4323;
    --success: #8be38d;
    --danger: #ff7979;
}

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

html {
    min-height: 100%;
}

html,
body {
    max-width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 207, 112, 0.22), transparent 28%),
        radial-gradient(circle at 82% 12%, rgba(255, 118, 94, 0.16), transparent 26%),
        linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-warm) 48%, #0f2637 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 217, 120, 0.12) 1px, transparent 1px);
    background-position: 0 0, 28px 34px;
    background-size: 72px 72px, 96px 96px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 82%);
}

button {
    font: inherit;
}

.game-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

/* ===== Cookie Section (Left) ===== */
.cookie-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 36px 28px 104px;
    overflow: hidden;
}

.cookie-section::before,
.cookie-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

.cookie-section::before {
    width: min(72vw, 720px);
    height: min(72vw, 720px);
    background: radial-gradient(circle, rgba(255, 191, 85, 0.22), transparent 66%);
    transform: translateY(30px);
    z-index: -1;
}

.cookie-section::after {
    width: 260px;
    height: 260px;
    right: 9%;
    top: 11%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 65%);
}

.game-title {
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 1;
    margin-bottom: 18px;
    color: var(--gold);
    letter-spacing: 0.03em;
    text-shadow:
        0 4px 0 rgba(85, 44, 18, 0.55),
        0 0 30px rgba(255, 191, 85, 0.46);
}

.cookie-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 34px;
    padding: 16px 22px;
    min-width: min(420px, 90vw);
    border: 1px solid rgba(255, 217, 120, 0.24);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(35, 23, 39, 0.84), rgba(28, 18, 32, 0.64));
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.cookie-count {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    color: #ffe38e;
    text-shadow: 0 0 20px rgba(255, 205, 89, 0.45);
}

.cps-display,
.click-power-display {
    font-size: 1rem;
    color: var(--text-soft);
}

.click-power-display {
    color: #fff0ba;
}

.cookie-wrapper {
    position: relative;
    width: min(78vw, 360px);
    height: min(78vw, 360px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-aura,
.cookie-ring,
.crumb-field,
#cookie-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cookie-aura {
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 223, 139, 0.3), transparent 54%),
        conic-gradient(from 90deg, transparent, rgba(255, 198, 92, 0.2), transparent, rgba(255, 244, 194, 0.14), transparent);
    filter: blur(4px);
    animation: aura-pulse 4s ease-in-out infinite;
}

.cookie-ring {
    inset: 30px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 221, 145, 0.28);
    animation: slow-spin 22s linear infinite;
}

.crumb-field {
    overflow: visible;
}

.crumb {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 45% 55% 48% 52%;
    background: radial-gradient(circle at 35% 35%, #f3c06a, #9d5f2f 78%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
    animation: crumb-pop 720ms ease-out forwards;
}

.big-cookie {
    width: min(70vw, 300px);
    height: min(70vw, 300px);
    border: 0;
    border-radius: 46% 54% 49% 51% / 48% 45% 55% 52%;
    display: block;
    flex: 0 0 auto;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
    cursor: pointer;
    position: relative;
    z-index: 2;
    overflow: hidden;
    background-color: #dc9444;
    background:
        radial-gradient(ellipse at 32% 24%, rgba(255, 246, 195, 0.9) 0 8%, transparent 24%),
        radial-gradient(circle at 62% 16%, rgba(255, 210, 118, 0.5) 0 10%, transparent 20%),
        radial-gradient(circle at 25% 72%, rgba(111, 47, 18, 0.3) 0 12%, transparent 23%),
        radial-gradient(circle at 73% 69%, rgba(97, 39, 15, 0.28) 0 15%, transparent 28%),
        conic-gradient(from 12deg, #9a5425, #df9846, #f5c66e, #d8863d, #7e3f1e, #b86a2f, #9a5425),
        radial-gradient(circle at 40% 35%, #ffc96f 0%, #dc9444 42%, #a85e2b 69%, #673219 100%);
    background-color: #dc9444;
    box-shadow:
        0 30px 58px rgba(22, 8, 6, 0.52),
        0 0 68px rgba(255, 184, 77, 0.34),
        inset 18px 18px 30px rgba(255, 245, 182, 0.26),
        inset -18px -26px 36px rgba(63, 23, 9, 0.5),
        inset 0 0 0 9px rgba(128, 63, 25, 0.22),
        inset 0 0 0 18px rgba(255, 205, 111, 0.06);
    transition: transform 120ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.big-cookie::before,
.big-cookie::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 26%, rgba(126, 70, 36, 0.95) 0 18%, transparent 19%),
        radial-gradient(circle at 45% 42%, #5f3218 0 38%, var(--choco) 72%, #150805 100%);
    box-shadow:
        58px 8px 0 -1px #2f160c,
        118px 31px 0 3px #3a1a0d,
        27px 70px 0 1px #2a1209,
        94px 92px 0 -2px #4a220e,
        151px 78px 0 0 #2a1209,
        42px 144px 0 4px #35170b,
        111px 158px 0 1px #4c2510,
        171px 135px 0 -2px #2a1209,
        72px 208px 0 -1px #39190c,
        143px 220px 0 3px #2a1209,
        8px 3px 8px rgba(255, 213, 134, 0.16),
        7px 8px 12px rgba(27, 8, 3, 0.36);
    filter: drop-shadow(2px 4px 3px rgba(24, 8, 3, 0.35));
}

.big-cookie::before {
    width: 24px;
    height: 24px;
    top: 48px;
    left: 54px;
}

.big-cookie::after {
    width: 16px;
    height: 16px;
    top: 96px;
    left: 34px;
    opacity: 0.92;
    box-shadow:
        41px -28px 0 2px #2a140c,
        110px -12px 0 4px #3b1c0d,
        157px 21px 0 1px #2a140c,
        69px 48px 0 3px #4b2813,
        15px 95px 0 0 #2a140c,
        130px 97px 0 2px #35190d,
        181px 113px 0 4px #2a140c,
        79px 159px 0 2px #43200f,
        31px 188px 0 4px #2a140c,
        5px 7px 8px rgba(23, 7, 3, 0.34);
}

.big-cookie:hover {
    transform: translateY(-4px) scale(1.035);
    filter: saturate(1.16) brightness(1.04);
    box-shadow:
        0 36px 68px rgba(22, 8, 6, 0.54),
        0 0 84px rgba(255, 191, 85, 0.48),
        inset 18px 18px 30px rgba(255, 245, 182, 0.3),
        inset -18px -26px 36px rgba(63, 23, 9, 0.5),
        inset 0 0 0 9px rgba(128, 63, 25, 0.2),
        inset 0 0 0 18px rgba(255, 205, 111, 0.08);
}

.big-cookie:active,
.big-cookie.clicked {
    transform: scale(0.94) rotate(-1.5deg);
    filter: brightness(1.08) saturate(1.1);
}

.big-cookie.clicked {
    animation: cookie-bounce 240ms ease-out;
}

/* Cookie particles */
.cookie-particle {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffe07f;
    text-shadow:
        0 2px 0 rgba(88, 43, 13, 0.55),
        0 0 14px rgba(255, 218, 106, 0.72);
    animation: particle-fly 1s cubic-bezier(0.16, 0.8, 0.22, 1) forwards;
}

.cookie-particle.small {
    font-size: 1rem;
    color: #fff1b8;
}

.cookie-particle.critical {
    font-size: 1.5rem;
    color: #ffffff;
}

/* ===== Store Section (Right) ===== */
.store-section {
    width: min(440px, 38vw);
    min-width: 360px;
    background: linear-gradient(180deg, rgba(35, 23, 39, 0.94), rgba(18, 24, 35, 0.94));
    border-left: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -24px 0 55px rgba(0, 0, 0, 0.22);
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 22px 20px 18px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(48, 31, 50, 0.98), rgba(28, 20, 34, 0.94)),
        radial-gradient(circle at 50% 0, rgba(255, 201, 106, 0.18), transparent 60%);
    border-bottom: 1px solid rgba(255, 217, 120, 0.25);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16);
}

.eyebrow,
.section-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(255, 229, 167, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
}

.store-title {
    margin-top: 2px;
    color: var(--gold);
    font-size: 2rem;
    text-shadow: 0 0 18px rgba(255, 191, 85, 0.34);
}

.store-subtitle {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.section-label {
    padding: 16px 16px 6px;
}

.upgrades-label {
    border-top: 1px solid rgba(255, 217, 120, 0.14);
    margin-top: 6px;
}

/* Buildings */
.buildings-list {
    flex: 1;
    padding: 8px 14px 12px;
}

.building-item {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 13px;
    margin-bottom: 10px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg, #2e2037, #171d2a);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    position: relative;
    overflow: hidden;
}

.building-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 231, 161, 0.12), transparent);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
}

.building-item:hover:not(.locked),
.building-item.affordable {
    border-color: rgba(255, 217, 120, 0.6);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24), 0 0 22px rgba(255, 190, 86, 0.12);
}

.building-item:hover:not(.locked) {
    transform: translateX(-5px) translateY(-1px);
}

.building-item:hover:not(.locked)::before {
    transform: translateX(120%);
}

.building-item.locked {
    opacity: 0.48;
    cursor: not-allowed;
    filter: grayscale(0.35);
}

.building-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.building-info {
    min-width: 0;
}

.building-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: #ffe1a0;
}

.building-desc {
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-top: 3px;
    line-height: 1.3;
}

.building-production {
    margin-top: 5px;
    font-size: 0.78rem;
    color: #fff0ba;
    font-weight: 700;
}

.building-cost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 7px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 217, 120, 0.12);
    color: var(--gold);
    font-size: 0.84rem;
    font-weight: 700;
}

.building-count {
    min-width: 42px;
    text-align: right;
    font-size: 1.9rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
}

/* Upgrades */
.upgrades-list {
    padding: 8px 14px 18px;
    max-height: 280px;
    overflow-y: auto;
}

.upgrades-title {
    display: none;
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 10px;
}

.upgrade-item {
    height: 56px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.18), transparent 36%),
        linear-gradient(135deg, #34532e, #1d3324);
    border: 1px solid rgba(139, 227, 141, 0.44);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    position: relative;
}

.upgrade-item.affordable {
    box-shadow: 0 0 18px rgba(139, 227, 141, 0.22);
}

.upgrade-item:hover:not(.locked) {
    transform: translateY(-4px) scale(1.08);
    border-color: var(--gold);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 18px rgba(255, 217, 120, 0.34);
}

.upgrade-item.locked {
    opacity: 0.34;
    cursor: not-allowed;
    background: linear-gradient(135deg, #313034, #1a1b20);
    border-color: rgba(255, 255, 255, 0.1);
    filter: grayscale(0.55);
}

.upgrade-tooltip {
    display: none;
    position: fixed;
    max-width: min(260px, 90vw);
    background: rgba(28, 19, 31, 0.97);
    border: 1px solid rgba(255, 217, 120, 0.72);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #fff;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.44);
}

/* ===== Controls ===== */
.controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    z-index: 50;
    max-width: calc(100vw - 40px);
    padding: 8px;
    border: 1px solid rgba(255, 217, 120, 0.18);
    border-radius: 22px;
    background: rgba(24, 17, 29, 0.72);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(12px);
}

.control-btn {
    padding: 9px 15px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
        rgba(33, 23, 39, 0.9);
    border: 1px solid rgba(255, 217, 120, 0.26);
    border-radius: 999px;
    color: #fff5d4;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    background:
        linear-gradient(135deg, rgba(255, 217, 120, 0.18), rgba(255, 255, 255, 0.04)),
        rgba(45, 29, 48, 0.94);
}

.control-btn.danger {
    border-color: rgba(255, 121, 121, 0.46);
}

.control-btn.danger:hover {
    border-color: var(--danger);
    background:
        linear-gradient(135deg, rgba(255, 121, 121, 0.18), rgba(255, 255, 255, 0.04)),
        rgba(58, 24, 30, 0.94);
}

.control-btn.muted {
    border-color: rgba(255, 255, 255, 0.18);
    opacity: 0.72;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 6, 13, 0.76);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background:
        radial-gradient(circle at 50% 0, rgba(255, 217, 120, 0.16), transparent 55%),
        linear-gradient(135deg, #33213a, #171d2a);
    border: 1px solid rgba(255, 217, 120, 0.55);
    border-radius: 24px;
    padding: 32px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: var(--gold);
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 22px;
    line-height: 1.6;
    color: var(--text-soft);
}

.modal-content button {
    padding: 11px 30px;
    background: linear-gradient(135deg, var(--gold), var(--gold-strong));
    border: none;
    border-radius: 999px;
    color: #241423;
    font-weight: 900;
    cursor: pointer;
    font-size: 1rem;
}

/* ===== Notification ===== */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffe69b, #ffba53);
    color: #241423;
    padding: 13px 24px;
    border-radius: 999px;
    font-weight: 900;
    z-index: 300;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
    animation: notif-fade 2s ease forwards;
}

/* ===== Animations ===== */
@keyframes aura-pulse {
    0%, 100% {
        opacity: 0.74;
        transform: scale(0.96);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes slow-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes cookie-bounce {
    0% {
        transform: scale(1) rotate(0deg);
    }
    45% {
        transform: scale(0.92) rotate(-2deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes crumb-pop {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(0.7);
    }
    100% {
        opacity: 0;
        transform: translate(var(--crumb-x), var(--crumb-y)) rotate(var(--crumb-rot)) scale(0.2);
    }
}

@keyframes particle-fly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--particle-x, 0px)), calc(-160px + var(--particle-y, 0px))) scale(1.45);
    }
}

@keyframes notif-fade {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.96); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.96); }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
        min-height: auto;
    }

    .cookie-section {
        min-height: 620px;
    }

    .store-section {
        width: 100%;
        min-width: 0;
        border-left: none;
        border-top: 1px solid var(--panel-border);
        max-height: none;
    }

    .store-header {
        position: relative;
    }

    .buildings-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 10px;
    }

    .building-item {
        margin-bottom: 0;
    }
}

@media (max-width: 560px) {
    body {
        min-height: 100svh;
    }

    .cookie-section {
        justify-content: flex-start;
        padding: 28px 14px 34px;
        min-height: auto;
    }

    .game-title {
        font-size: clamp(2.35rem, 12vw, 3.3rem);
        margin-bottom: 16px;
        text-align: center;
    }

    .cookie-stats {
        min-width: 0;
        width: 100%;
        gap: 5px;
        margin-bottom: 26px;
        padding: 14px 16px;
        border-radius: 18px;
    }

    .cookie-count {
        font-size: clamp(2.15rem, 10vw, 3rem);
        line-height: 1.05;
        text-align: center;
    }

    .cps-display,
    .click-power-display {
        font-size: 0.95rem;
    }

    .cookie-wrapper {
        width: 290px;
        height: 290px;
        max-width: 76vw;
        max-height: 76vw;
        flex: 0 0 auto;
    }

    .big-cookie {
        width: 240px;
        height: 240px;
        max-width: 66vw;
        max-height: 66vw;
    }

    .big-cookie::before {
        width: 19px;
        height: 19px;
        top: 38px;
        left: 43px;
        box-shadow:
            46px 6px 0 -1px #2c160d,
            94px 25px 0 2px #35190d,
            22px 56px 0 1px #2a140c,
            75px 74px 0 -2px #44200e,
            121px 62px 0 0 #2a140c,
            34px 115px 0 3px #32180d,
            89px 126px 0 1px #452411,
            137px 108px 0 -2px #2a140c,
            58px 166px 0 -1px #35190d,
            114px 176px 0 3px #2a140c;
    }

    .big-cookie::after {
        width: 13px;
        height: 13px;
        top: 77px;
        left: 27px;
        box-shadow:
            33px -22px 0 2px #2a140c,
            88px -10px 0 3px #3b1c0d,
            126px 17px 0 1px #2a140c,
            55px 38px 0 2px #4b2813,
            12px 76px 0 0 #2a140c,
            104px 78px 0 2px #35190d,
            145px 90px 0 3px #2a140c,
            63px 127px 0 2px #43200f,
            25px 150px 0 3px #2a140c;
    }

    .building-item {
        grid-template-columns: 50px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 12px;
    }

    .building-icon {
        width: 46px;
        height: 46px;
        font-size: 1.75rem;
    }

    .controls {
        position: static;
        justify-content: center;
        gap: 8px;
        max-width: none;
        width: calc(100% - 24px);
        margin: 12px auto calc(16px + env(safe-area-inset-bottom));
        padding: 8px;
        border-radius: 18px;
    }

    .control-btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        padding: 10px 9px;
        font-size: 0.86rem;
        text-align: center;
    }

    #sound-btn {
        flex: 0 0 48px;
    }
}

@media (max-width: 420px) {
    .cookie-section {
        padding-top: 24px;
    }

    .game-title {
        font-size: clamp(2rem, 11vw, 2.8rem);
    }

    .cookie-stats {
        padding: 12px 14px;
    }

    .cookie-count {
        font-size: clamp(1.9rem, 9.5vw, 2.55rem);
    }

    .cookie-wrapper {
        width: 260px;
        height: 260px;
        max-width: 72vw;
        max-height: 72vw;
    }

    .big-cookie {
        width: 220px;
        height: 220px;
        max-width: 62vw;
        max-height: 62vw;
    }

    .store-title {
        font-size: 1.65rem;
    }

    .store-subtitle {
        font-size: 0.84rem;
    }

    .buildings-list {
        grid-template-columns: 1fr;
        padding: 8px 10px 12px;
    }

    .building-name {
        font-size: 1rem;
    }

    .building-desc {
        font-size: 0.76rem;
    }

    .building-count {
        min-width: 34px;
        font-size: 1.6rem;
    }

    .upgrades-list {
        padding-inline: 10px;
    }

    .controls {
        width: calc(100% - 16px);
        margin-top: 10px;
    }

    .control-btn {
        flex-basis: calc(50% - 6px);
        padding: 9px 8px;
        font-size: 0.8rem;
    }
}
