

:root {
    --sky-top:        #f4c8db;
    --sky-mid:        #d4c0f0;
    --sky-bottom:     #b8d2ea;

    --carrot-light:   #ffd166;
    --carrot:         #ff8a3d;
    --carrot-deep:    #d65010;
    --carrot-stroke:  #5a1700;

    --leaf-light:     #a8e878;
    --leaf:           #66cc44;
    --leaf-deep:      #2a7a1f;
    --leaf-stroke:    #1a4a10;

    --magic-light:    #b07cf5;
    --magic:          #8a4ddb;
    --magic-deep:     #5b2db8;
    --magic-stroke:   #2d1255;

    --gold:           #ffd966;
    --gold-deep:      #b88a1a;
    --cheek:          #ff7a9f;

    --ink:            #3a2659;
    --ink-soft:       #6b5a8a;
    --ink-faint:      #a89cc2;

    --font:           'Baloo 2', 'Comic Sans MS', system-ui, -apple-system, sans-serif;

    --panel-bord:     rgba(180, 160, 220, 0.55);
    --panel-shadow:   0 4px 24px rgba(58, 38, 89, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 60% 50% at 50% 35%, rgba(255, 220, 130, 0.18) 0%, transparent 65%),
        linear-gradient(180deg, #2a1a4a 0%, #4a2a6e 45%, #6b3a82 80%, #8a4a8e 100%);
    overflow: hidden;
    cursor: pointer;
    animation: introFadeIn 0.4s ease both,
               introFadeOut 0.6s ease 3.0s both;
    will-change: opacity;
}
.intro-overlay.is-hidden {
    display: none;
}

.intro-stars { position: absolute; inset: 0; pointer-events: none; }
.intro-star {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff5b8;
    box-shadow: 0 0 8px 2px rgba(255, 230, 150, 0.85);
    opacity: 0;
    animation: introStarTwinkle 2s ease-in-out infinite;
}
.intro-star--1  { top: 12%; left: 18%;  width: 5px; height: 5px; animation-delay: 0.2s; }
.intro-star--2  { top: 24%; left: 78%;  width: 3px; height: 3px; animation-delay: 0.6s; }
.intro-star--3  { top: 18%; left: 50%;  width: 4px; height: 4px; animation-delay: 1.0s; }
.intro-star--4  { top: 70%; left: 12%;  width: 3px; height: 3px; animation-delay: 0.4s; }
.intro-star--5  { top: 62%; left: 84%;  width: 5px; height: 5px; animation-delay: 0.8s; }
.intro-star--6  { top: 82%; left: 38%;  width: 3px; height: 3px; animation-delay: 1.2s; }
.intro-star--7  { top: 38%; left: 8%;   width: 4px; height: 4px; animation-delay: 1.4s; }
.intro-star--8  { top: 50%; left: 92%;  width: 3px; height: 3px; animation-delay: 0.3s; }
.intro-star--9  { top: 88%; left: 68%;  width: 4px; height: 4px; animation-delay: 1.6s; }
.intro-star--10 { top: 8%;  left: 86%;  width: 3px; height: 3px; animation-delay: 0.9s; }
@keyframes introStarTwinkle {
    0%, 100% { opacity: 0;   transform: scale(0.6); }
    50%      { opacity: 0.9; transform: scale(1.1); }
}

.intro-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 1;
}

.intro-mark {
    width: 220px;
    height: 220px;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
    opacity: 0;
    transform: scale(0.3) rotate(-20deg);
    animation: introMarkPop 0.9s cubic-bezier(.34, 1.56, .64, 1) 0.2s forwards,
               introMarkBob 3s ease-in-out 1.2s infinite;
}
.intro-mark svg { width: 100%; height: 100%; display: block; }
.intro-mark__sparkles {
    transform-origin: center;
    animation: introSparkleSpin 6s linear infinite;
}
@keyframes introMarkPop {
    0%   { opacity: 0; transform: scale(0.3) rotate(-20deg); }
    60%  { opacity: 1; transform: scale(1.12) rotate(8deg); }
    100% { opacity: 1; transform: scale(1)    rotate(0deg); }
}
@keyframes introMarkBob {
    0%, 100% { transform: translateY(0)   rotate(0deg); }
    50%      { transform: translateY(-8px) rotate(-2deg); }
}
@keyframes introSparkleSpin {
    from { transform: rotate(0deg);   transform-origin: 100px 100px; }
    to   { transform: rotate(360deg); transform-origin: 100px 100px; }
}

.intro-title {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.intro-letter {
    display: inline-block;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(180deg, #fff8d8 0%, #ffd166 45%, #ff8a3d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 1.5px #5a1700;
    text-shadow: 0 4px 0 rgba(90, 23, 0, 0.55), 0 8px 14px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(30px);
    animation: introLetterUp 0.5s cubic-bezier(.34, 1.4, .64, 1) calc(0.6s + var(--i, 0) * 0.07s) forwards;
}
@keyframes introLetterUp {
    0%   { opacity: 0; transform: translateY(30px) scale(0.8); }
    60%  { opacity: 1; transform: translateY(-4px) scale(1.05); }
    100% { opacity: 1; transform: translateY(0)    scale(1); }
}

.intro-tagline {
    font-family: 'Baloo 2', sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 12px;
    margin-left: 12px;
    color: #ffe48f;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 4px 12px rgba(255, 200, 100, 0.4);
    opacity: 0;
    transform: translateY(12px);
    animation: introTaglineFade 0.55s ease 1.3s forwards;
}
@keyframes introTaglineFade {
    0%   { opacity: 0; transform: translateY(12px); letter-spacing: 4px; }
    100% { opacity: 1; transform: translateY(0);    letter-spacing: 12px; }
}

.intro-presents {
    font-family: 'Baloo 2', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    color: rgba(255, 245, 220, 0.65);
    margin-top: 10px;
    opacity: 0;
    animation: introPresentsFade 0.5s ease 1.7s forwards;
}
@keyframes introPresentsFade {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 0.75; transform: translateY(0); }
}

.intro-skip {
    position: absolute;
    bottom: 28px;
    right: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 245, 220, 0.4);
    color: rgba(255, 245, 220, 0.85);
    font-family: 'Baloo 2', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 22px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: background 0.15s ease, transform 0.1s ease;
    animation: introSkipFade 0.4s ease 1.5s forwards;
    z-index: 2;
}
.intro-skip:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}
.intro-skip:active { transform: translateY(0); }
@keyframes introSkipFade {
    to { opacity: 1; }
}

@keyframes introFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes introFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; visibility: hidden; }
}

@media (max-width: 600px) {
    .intro-mark { width: 160px; height: 160px; }
    .intro-letter { font-size: 44px; -webkit-text-stroke: 1.2px #5a1700; }
    .intro-tagline { font-size: 16px; letter-spacing: 8px; margin-left: 8px; }
    .intro-presents { font-size: 11px; }
    .intro-skip { bottom: 18px; right: 18px; padding: 6px 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .intro-overlay,
    .intro-mark,
    .intro-letter,
    .intro-tagline,
    .intro-presents,
    .intro-skip,
    .intro-star,
    .intro-mark__sparkles {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
html, body {
    height: 100%;
    overflow: hidden;

    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}
@supports (height: 100dvh) {
    html, body { height: 100dvh; }
}

button, .carrot-btn, .bld-card, .upg-card, .tile-card, .tab, .mobile-toggle, .mobile-nav-btn, .ts-icon, .event-timer--clickable, [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
button, .tile-card, .mobile-nav-btn, .upg-buy, .bld-buy, .btn-action, .ts-icon {
    user-select: none;
    -webkit-user-select: none;
}

.ts-icon.is-pressed {
    transform: scale(0.92) !important;
    transition-duration: 0.04s !important;
}
.mobile-nav-btn.is-pressed {
    transform: scale(0.92) !important;
    transition-duration: 0.04s !important;
}
.event-timer--clickable.is-pressed {
    transform: translateY(2px) scale(0.95) !important;
    transition-duration: 0.04s !important;
}
.bld-card.is-pressed,
.upg-card.is-pressed {
    transform: scale(0.985);
    transition-duration: 0.04s;
}

button, [role="button"], a, input, select, textarea {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
button::-moz-focus-inner { border: 0; padding: 0; }
button:focus { outline: none; }
button:focus:not(:focus-visible) { outline: none; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 50%, var(--sky-bottom) 100%);
    min-height: 100vh;
    min-height: 100dvh;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    position: relative;
}




.bg-sky, .bg-clouds, .bg-sparkles {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}


.bg-celestial-overlay,
.bg-celestial,
.bg-stars {
    position: fixed; inset: 0; pointer-events: none; overflow: hidden;
}
.bg-celestial-overlay {
    z-index: 11;
    background-color: transparent;
    animation: skyTint 480s linear infinite;
}
.bg-stars { z-index: 0; }
.bg-celestial { z-index: 0; }

.celestial {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    will-change: transform, opacity;
}
.celestial--sun {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle at 35% 32%, #fffbe5 0%, #ffe680 32%, #ffb84a 72%, rgba(255, 138, 61, 0) 100%);
    box-shadow:
        0 0 40px 8px rgba(255, 217, 102, 0.55),
        0 0 90px 26px rgba(255, 180, 80, 0.35),
        0 0 160px 56px rgba(255, 138, 61, 0.20),
        0 0 240px 80px rgba(255, 138, 61, 0.10);
    animation: celestialArc 480s linear infinite;
}
.celestial--sun::after {
    content: '';
    position: absolute;
    inset: -90px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        transparent 0deg, rgba(255, 220, 130, 0.14) 8deg, transparent 16deg,
        transparent 30deg, rgba(255, 220, 130, 0.14) 38deg, transparent 46deg,
        transparent 60deg, rgba(255, 220, 130, 0.14) 68deg, transparent 76deg,
        transparent 90deg, rgba(255, 220, 130, 0.14) 98deg, transparent 106deg,
        transparent 120deg, rgba(255, 220, 130, 0.14) 128deg, transparent 136deg,
        transparent 150deg, rgba(255, 220, 130, 0.14) 158deg, transparent 166deg,
        transparent 180deg, rgba(255, 220, 130, 0.14) 188deg, transparent 196deg,
        transparent 210deg, rgba(255, 220, 130, 0.14) 218deg, transparent 226deg,
        transparent 240deg, rgba(255, 220, 130, 0.14) 248deg, transparent 256deg,
        transparent 270deg, rgba(255, 220, 130, 0.14) 278deg, transparent 286deg,
        transparent 300deg, rgba(255, 220, 130, 0.14) 308deg, transparent 316deg,
        transparent 330deg, rgba(255, 220, 130, 0.14) 338deg, transparent 346deg,
        transparent 360deg);
    animation: sunRays 90s linear infinite;
    z-index: -1;
}
.celestial--moon {
    width: 64px;
    height: 64px;
    background: radial-gradient(circle at 38% 32%, #ffffff 0%, #f0eaf0 50%, #c8c0d8 90%);
    box-shadow:
        0 0 28px 6px rgba(232, 224, 240, 0.45),
        0 0 60px 16px rgba(200, 200, 230, 0.30),
        0 0 110px 28px rgba(180, 180, 210, 0.18);
    animation: celestialArc 480s linear infinite;
    animation-delay: -240s;
}
.celestial--moon::before {
    content: '';
    position: absolute;
    inset: 14% 32% 50% 18%;
    border-radius: 50%;
    background: rgba(170, 165, 195, 0.22);
}
.celestial--moon::after {
    content: '';
    position: absolute;
    inset: 50% 18% 18% 48%;
    border-radius: 50%;
    background: rgba(170, 165, 195, 0.16);
}

.bg-stars {
    animation: starsFade 480s linear infinite;
    will-change: opacity;
}
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow:
        0 0 4px 1px rgba(255, 255, 255, 0.75),
        0 0 8px 2px rgba(220, 230, 255, 0.4);
    animation: starTwinkle 3.4s ease-in-out infinite;
    will-change: opacity, transform;
}
.star--big {
    width: 3px;
    height: 3px;
    box-shadow:
        0 0 6px 2px rgba(255, 255, 255, 0.85),
        0 0 12px 3px rgba(220, 230, 255, 0.5),
        0 0 20px 4px rgba(180, 200, 255, 0.25);
}
.star--1  { top: 6%;  left: 8%;  animation-duration: 2.6s; animation-delay: -0.4s; }
.star--2  { top: 11%; left: 22%; animation-duration: 3.2s; animation-delay: -1.6s; }
.star--3  { top: 4%;  left: 36%; animation-duration: 2.8s; animation-delay: -0.9s; }
.star--4  { top: 15%; left: 52%; animation-duration: 3.6s; animation-delay: -2.1s; }
.star--5  { top: 7%;  left: 64%; animation-duration: 2.4s; animation-delay: -0.2s; }
.star--6  { top: 13%; left: 78%; animation-duration: 3.8s; animation-delay: -1.3s; }
.star--7  { top: 5%;  left: 92%; animation-duration: 2.7s; animation-delay: -0.7s; }
.star--8  { top: 18%; left: 4%;  animation-duration: 3.1s; animation-delay: -2.4s; }
.star--9  { top: 22%; left: 16%; animation-duration: 3.5s; animation-delay: -1.0s; }
.star--10 { top: 25%; left: 30%; animation-duration: 2.9s; animation-delay: -0.5s; }
.star--11 { top: 19%; left: 44%; animation-duration: 3.3s; animation-delay: -1.8s; }
.star--12 { top: 24%; left: 58%; animation-duration: 2.5s; animation-delay: -2.2s; }
.star--13 { top: 21%; left: 72%; animation-duration: 3.7s; animation-delay: -0.6s; }
.star--14 { top: 27%; left: 86%; animation-duration: 2.8s; animation-delay: -1.5s; }
.star--15 { top: 30%; left: 10%; animation-duration: 3.4s; animation-delay: -2.0s; }
.star--16 { top: 34%; left: 24%; animation-duration: 2.6s; animation-delay: -0.8s; }
.star--17 { top: 32%; left: 40%; animation-duration: 3.6s; animation-delay: -1.2s; }
.star--18 { top: 36%; left: 56%; animation-duration: 2.7s; animation-delay: -1.9s; }
.star--19 { top: 33%; left: 70%; animation-duration: 3.2s; animation-delay: -0.3s; }
.star--20 { top: 38%; left: 84%; animation-duration: 2.9s; animation-delay: -2.3s; }
.star--21 { top: 41%; left: 6%;  animation-duration: 3.5s; animation-delay: -1.4s; }
.star--22 { top: 43%; left: 20%; animation-duration: 3.0s; animation-delay: -0.4s; }
.star--23 { top: 39%; left: 50%; animation-duration: 2.8s; animation-delay: -1.7s; }
.star--24 { top: 45%; left: 66%; animation-duration: 3.3s; animation-delay: -2.5s; }
.star--25 { top: 42%; left: 80%; animation-duration: 2.5s; animation-delay: -0.9s; }
.star--26 { top: 48%; left: 14%; animation-duration: 3.6s; animation-delay: -1.1s; }
.star--27 { top: 50%; left: 38%; animation-duration: 2.7s; animation-delay: -2.0s; }
.star--28 { top: 47%; left: 92%; animation-duration: 3.4s; animation-delay: -0.6s; }

@keyframes starTwinkle {
    0%, 100% { transform: scale(0.7); opacity: 0.4; }
    50%      { transform: scale(1.2); opacity: 1; }
}
@keyframes starsFade {
    0%   { opacity: 0; }
    51%  { opacity: 0; }
    56%  { opacity: 0.4; }
    62%  { opacity: 0.95; }
    90%  { opacity: 0.95; }
    96%  { opacity: 0.3; }
    100% { opacity: 0; }
}

@keyframes celestialArc {
    0%    { transform: translate(-12vw, 65vh) scale(0.55); opacity: 0; }
    3%    { transform: translate(-3vw, 52vh) scale(0.78); opacity: 0.55; }
    8%    { transform: translate(8vw, 34vh) scale(0.92); opacity: 1; }
    16%   { transform: translate(22vw, 18vh) scale(1); opacity: 1; }
    25%   { transform: translate(50vw, 8vh) scale(1.05); opacity: 1; }
    34%   { transform: translate(78vw, 18vh) scale(1); opacity: 1; }
    42%   { transform: translate(92vw, 34vh) scale(0.92); opacity: 1; }
    47%   { transform: translate(103vw, 52vh) scale(0.78); opacity: 0.55; }
    50%   { transform: translate(112vw, 65vh) scale(0.55); opacity: 0; }
    100%  { transform: translate(112vw, 65vh) scale(0.55); opacity: 0; }
}
@keyframes sunRays {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes skyTint {
    0%    { background-color: rgba(255, 130, 90, 0.14); }
    4%    { background-color: rgba(255, 220, 170, 0.06); }
    10%   { background-color: rgba(255, 245, 220, 0); }
    40%   { background-color: rgba(255, 245, 200, 0); }
    46%   { background-color: rgba(255, 200, 140, 0.10); }
    50%   { background-color: rgba(255, 130, 80, 0.16); }
    54%   { background-color: rgba(80, 40, 100, 0.20); }
    60%   { background-color: rgba(15, 12, 50, 0.25); }
    90%   { background-color: rgba(15, 12, 50, 0.25); }
    96%   { background-color: rgba(80, 40, 100, 0.20); }
    100%  { background-color: rgba(255, 130, 90, 0.14); }
}

@media (max-width: 720px) {
    .celestial--sun { width: 70px; height: 70px; }
    .celestial--sun::after { inset: -70px; }
    .celestial--moon { width: 50px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) {
    .celestial--sun::after { animation: none; }
    .star { animation: none; opacity: 0.85; }
}

.bg-mountains {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.mountains {
    width: 100vw;
    height: 100%;
    display: block;
}
@media (max-width: 920px) {
    .bg-mountains { height: 52vh; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

.bg-sky {
    background:
        radial-gradient(ellipse 60% 40% at 25% 15%, rgba(255, 220, 180, 0.45) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 75% 25%, rgba(216, 196, 255, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 70% 50% at 50% 90%, rgba(180, 220, 255, 0.55) 0%, transparent 70%),
        radial-gradient(circle at 50% 50%, rgba(255, 245, 220, 0.25) 0%, transparent 60%);
}

.cloud {
    position: absolute;
    filter: drop-shadow(0 4px 6px rgba(58, 38, 89, 0.06));
    animation: cloudDrift 60s linear infinite;
    will-change: transform;
    opacity: 0.6;
}
.cloud--1 { width: 110px; top: 15.1%; animation-name: cloudDriftd; animation-duration: 157s; animation-delay: -41s; opacity: 0.73; }
.cloud--2 { width: 90px; top: 37.4%; animation-name: cloudDriftb; animation-duration: 102s; animation-delay: -31s; opacity: 0.61; }
.cloud--3 { width: 90px; top: 18.5%; animation-name: cloudDrift; animation-duration: 97s; animation-delay: -49s; opacity: 0.67; }
.cloud--4 { width: 120px; top: 36.1%; animation-name: cloudDriftd; animation-duration: 139s; animation-delay: -77s; opacity: 0.6; }
.cloud--5 { width: 85px; top: 57.7%; animation-name: cloudDriftd; animation-duration: 153s; animation-delay: -140s; opacity: 0.46; }
.cloud--6 { width: 85px; top: 52.9%; animation-name: cloudDriftc; animation-duration: 141s; animation-delay: -54s; opacity: 0.67; }
.cloud--7 { width: 50px; top: 70.3%; animation-name: cloudDriftb; animation-duration: 124s; animation-delay: -23s; opacity: 0.42; }
.cloud--8 { width: 85px; top: 33.6%; animation-name: cloudDriftc; animation-duration: 106s; animation-delay: -67s; opacity: 0.67; }
.cloud--9 { width: 110px; top: 67.1%; animation-name: cloudDriftc; animation-duration: 126s; animation-delay: -86s; opacity: 0.56; }
.cloud--10 { width: 70px; top: 52.7%; animation-name: cloudDriftc; animation-duration: 126s; animation-delay: -100s; opacity: 0.42; }
.cloud--11 { width: 65px; top: 58.4%; animation-name: cloudDriftc; animation-duration: 160s; animation-delay: -131s; opacity: 0.48; }
.cloud--12 { width: 100px; top: 13.2%; animation-name: cloudDrift; animation-duration: 82s; animation-delay: -52s; opacity: 0.4; }
.cloud--13 { width: 100px; top: 14.1%; animation-name: cloudDriftd; animation-duration: 158s; animation-delay: -152s; opacity: 0.4; }
.cloud--14 { width: 100px; top: 24.8%; animation-name: cloudDrift; animation-duration: 117s; animation-delay: -47s; opacity: 0.54; }
.cloud--15 { width: 120px; top: 60.2%; animation-name: cloudDriftd; animation-duration: 101s; animation-delay: -72s; opacity: 0.6; }
.cloud--16 { width: 85px; top: 54.0%; animation-name: cloudDriftc; animation-duration: 137s; animation-delay: -78s; opacity: 0.68; }
.cloud--17 { width: 50px; top: 13.4%; animation-name: cloudDriftb; animation-duration: 149s; animation-delay: -105s; opacity: 0.68; }
.cloud--18 { width: 85px; top: 26.0%; animation-name: cloudDriftd; animation-duration: 129s; animation-delay: -84s; opacity: 0.74; }
.cloud--19 { width: 70px; top: 75.0%; animation-name: cloudDriftb; animation-duration: 150s; animation-delay: -67s; opacity: 0.63; }
.cloud--20 { width: 110px; top: 52.2%; animation-name: cloudDriftb; animation-duration: 120s; animation-delay: -9s; opacity: 0.71; }
.cloud--21 { width: 100px; top: 34.0%; animation-name: cloudDriftc; animation-duration: 114s; animation-delay: -106s; opacity: 0.56; }
.cloud--22 { width: 75px; top: 23.6%; animation-name: cloudDrift; animation-duration: 80s; animation-delay: -28s; opacity: 0.44; }
.cloud--23 { width: 70px; top: 60.8%; animation-name: cloudDriftb; animation-duration: 110s; animation-delay: -1s; opacity: 0.68; }
.cloud--24 { width: 120px; top: 69.1%; animation-name: cloudDriftc; animation-duration: 83s; animation-delay: -68s; opacity: 0.58; }
.cloud--25 { width: 100px; top: 26.7%; animation-name: cloudDriftd; animation-duration: 110s; animation-delay: -78s; opacity: 0.67; }
.cloud--26 { width: 75px; top: 28.9%; animation-name: cloudDriftb; animation-duration: 111s; animation-delay: -18s; opacity: 0.41; }
.cloud--27 { width: 110px; top: 17.2%; animation-name: cloudDriftb; animation-duration: 159s; animation-delay: -24s; opacity: 0.46; }
.cloud--28 { width: 60px; top: 57.3%; animation-name: cloudDriftb; animation-duration: 120s; animation-delay: -118s; opacity: 0.65; }
.cloud--29 { width: 100px; top: 35.9%; animation-name: cloudDriftc; animation-duration: 117s; animation-delay: -106s; opacity: 0.55; }
.cloud--30 { width: 100px; top: 48.5%; animation-name: cloudDriftc; animation-duration: 136s; animation-delay: -50s; opacity: 0.73; }
@keyframes cloudDrift {
    0%   { transform: translate(-15vw,   0); }
    25%  { transform: translate(15vw,  -6px); }
    50%  { transform: translate(45vw,   3px); }
    75%  { transform: translate(78vw,  -7px); }
    100% { transform: translate(115vw,  0); }
}
@keyframes cloudDriftb {
    0%   { transform: translate(-15vw,   2px); }
    20%  { transform: translate(8vw,   -10px); }
    45%  { transform: translate(38vw,    5px); }
    70%  { transform: translate(72vw,   -3px); }
    100% { transform: translate(115vw,   0); }
}
@keyframes cloudDriftc {
    0%   { transform: translate(-15vw,   0); }
    30%  { transform: translate(22vw,    4px); }
    55%  { transform: translate(50vw,  -11px); }
    85%  { transform: translate(90vw,    6px); }
    100% { transform: translate(115vw,   0); }
}
@keyframes cloudDriftd {
    0%   { transform: translate(-15vw,  -3px); }
    18%  { transform: translate(5vw,     8px); }
    40%  { transform: translate(32vw,   -5px); }
    65%  { transform: translate(65vw,    9px); }
    90%  { transform: translate(98vw,   -2px); }
    100% { transform: translate(115vw,   0); }
}
    20%  { transform: translate(11vw,  -7px); }
    40%  { transform: translate(35vw,   3px); }
    60%  { transform: translate(60vw,  -8px); }
    80%  { transform: translate(85vw,   2px); }
    100% { transform: translate(115vw,  0); }
}

.sparkle {
    position: absolute;
    width: 18px;
    height: 18px;
    animation: sparkleFloat 9s ease-in-out infinite, sparkleTwinkle 2.4s ease-in-out infinite;
    will-change: transform, opacity;
    pointer-events: none;
    opacity: 0.35;
    filter: drop-shadow(0 0 4px rgba(255, 217, 102, 0.25));
}
.sparkle--1  { top: 25%; left: 14%; animation-delay: 0s,    0s;    }
.sparkle--2  { top: 65%; left: 22%; animation-delay: -2s,   -0.4s; width: 18px; height: 18px; }
.sparkle--3  { top: 38%; left: 78%; animation-delay: -4s,   -1s;   width: 20px; height: 20px; }
.sparkle--4  { top: 78%; left: 88%; animation-delay: -6s,   -1.5s; width: 16px; height: 16px; }
.sparkle--5  { top: 12%; left: 50%; animation-delay: -1s,   -0.8s; width: 24px; height: 24px; }
.sparkle--6  { top: 50%; left: 8%;  animation-delay: -3.5s, -1.3s; }
.sparkle--7  { top: 88%; left: 60%; animation-delay: -5.5s, -0.6s; }
.sparkle--8  { top: 6%;  left: 90%; animation-delay: -7s,   -1.8s; }
.sparkle--9  { top: 35%; left: 55%; animation-delay: -2.7s, -0.2s; width: 20px; height: 20px; }
.sparkle--10 { top: 55%; left: 70%; animation-delay: -4.2s, -1.6s; width: 14px; height: 14px; }
.sparkle--11 { top: 22%; left: 65%; animation-delay: -6.5s, -0.9s; width: 22px; height: 22px; }
.sparkle--12 { top: 75%; left: 40%; animation-delay: -3.1s, -1.1s; width: 18px; height: 18px; }
.sparkle--13 { top: 45%; left: 35%; animation-delay: -5.8s, -1.4s; width: 16px; height: 16px; }
.sparkle--14 { top: 60%; left: 50%; animation-delay: -7.5s, -0.7s; width: 14px; height: 14px; }

@keyframes sparkleFloat {
    0%, 100% { transform: translateY(0)   rotate(0deg); }
    50%      { transform: translateY(-25px) rotate(180deg); }
}
@keyframes sparkleTwinkle {
    0%, 100% { opacity: 0.15; transform: scale(0.7); }
    50%      { opacity: 0.5;  transform: scale(1.0); }
}

.bg-shooting {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.firefly {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff5b8 0%, #ffd966 35%, rgba(255, 217, 102, 0.6) 60%, rgba(255, 217, 102, 0) 100%);
    box-shadow:
        0 0 8px rgba(255, 232, 150, 0.85),
        0 0 16px rgba(255, 217, 102, 0.55),
        0 0 28px rgba(255, 200, 80, 0.3);
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
}
.firefly--1  { top: 18%; left: 12%; animation: fireflyDrift 11s ease-in-out infinite, fireflyTwinkle 2.4s ease-in-out infinite; animation-delay: 0s, 0s; }
.firefly--2  { top: 28%; left: 78%; animation: fireflyDrift 13s ease-in-out infinite, fireflyTwinkle 3.1s ease-in-out infinite; animation-delay: -2s, -0.6s; width: 5px; height: 5px; }
.firefly--3  { top: 42%; left: 35%; animation: fireflyDrift 15s ease-in-out infinite, fireflyTwinkle 2.7s ease-in-out infinite; animation-delay: -4s, -1.1s; }
.firefly--4  { top: 22%; left: 88%; animation: fireflyDrift 12s ease-in-out infinite, fireflyTwinkle 3.4s ease-in-out infinite; animation-delay: -6s, -0.4s; width: 4px; height: 4px; }
.firefly--5  { top: 35%; left: 8%;  animation: fireflyDrift 14s ease-in-out infinite, fireflyTwinkle 2.2s ease-in-out infinite; animation-delay: -1s, -1.5s; width: 7px; height: 7px; }
.firefly--6  { top: 12%; left: 52%; animation: fireflyDrift 16s ease-in-out infinite, fireflyTwinkle 2.9s ease-in-out infinite; animation-delay: -8s, -0.9s; }
.firefly--7  { top: 48%; left: 65%; animation: fireflyDrift 13s ease-in-out infinite, fireflyTwinkle 3.6s ease-in-out infinite; animation-delay: -3s, -2s; width: 5px; height: 5px; }
.firefly--8  { top: 32%; left: 22%; animation: fireflyDrift 17s ease-in-out infinite, fireflyTwinkle 2.5s ease-in-out infinite; animation-delay: -5s, -0.2s; width: 4px; height: 4px; }
.firefly--9  { top: 8%;  left: 70%; animation: fireflyDrift 12s ease-in-out infinite, fireflyTwinkle 3.2s ease-in-out infinite; animation-delay: -7s, -1.8s; width: 6px; height: 6px; }
.firefly--10 { top: 46%; left: 90%; animation: fireflyDrift 15s ease-in-out infinite, fireflyTwinkle 2.6s ease-in-out infinite; animation-delay: -10s, -0.7s; width: 5px; height: 5px; }
.firefly--11 { top: 25%; left: 45%; animation: fireflyDrift 14s ease-in-out infinite, fireflyTwinkle 3s ease-in-out infinite; animation-delay: -9s, -1.3s; width: 4px; height: 4px; }
.firefly--12 { top: 38%; left: 58%; animation: fireflyDrift 11s ease-in-out infinite, fireflyTwinkle 2.8s ease-in-out infinite; animation-delay: -2.5s, -0.3s; }

@keyframes fireflyDrift {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(28px, -18px); }
    50%  { transform: translate(48px, 14px); }
    75%  { transform: translate(20px, 28px); }
    100% { transform: translate(0, 0); }
}
@keyframes fireflyTwinkle {
    0%, 100% { opacity: 0.15; }
    40%      { opacity: 0.85; }
    60%      { opacity: 0.55; }
}

.shoot {
    position: absolute;
    width: 36px;
    height: 36px;
    will-change: transform, opacity;
    opacity: 0.4;
}
.shoot--1 { top: -8%;  left: 20%; animation: shootDiag 13s linear infinite; animation-delay: 0s; }
.shoot--2 { top: -8%;  left: 65%; animation: shootDiag 16s linear infinite; animation-delay: -3s;   width: 30px; height: 30px; }
.shoot--3 { top: -8%;  left: 40%; animation: shootDiag 15s linear infinite; animation-delay: -6s;   width: 32px; height: 32px; }
.shoot--4 { top: -8%;  left: 85%; animation: shootDiag 18s linear infinite; animation-delay: -9s;   width: 26px; height: 26px; }
.shoot--5 { top: -8%;  left: 10%; animation: shootDiag 14s linear infinite; animation-delay: -4.5s; width: 34px; height: 34px; }

@keyframes shootDiag {
    0%   { transform: translate(0, 0)         rotate(15deg); opacity: 0; }
    10%  { opacity: 0.45; }
    50%  { opacity: 0.5; }
    90%  { opacity: 0.25; }
    100% { transform: translate(-30vw, 110vh) rotate(15deg); opacity: 0; }
}

.brand-header {
    position: relative;
    z-index: 5;
    padding: 6px 16px 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 0;
}

.brand { display: none; }
.brand-bak {
    display: inline-flex;
    align-items: baseline;
    font-size: 32px;
    font-weight: 700;
    color: var(--carrot-deep);
    text-shadow: 3px 3px 0 #fff5b8, 4px 4px 0 #b88a1a;
    letter-spacing: 1px;
    line-height: 1;
}
.brand__letter {
    display: inline-block;
    animation: letterBob 2s ease-in-out infinite;
}
.brand__space { width: 14px; }
.brand__letter:nth-child(1)  { animation-delay: 0s;     color: #ee6c0a; }
.brand__letter:nth-child(2)  { animation-delay: 0.08s;  color: #ff8a3d; }
.brand__letter:nth-child(3)  { animation-delay: 0.16s;  color: #ffae3a; }
.brand__letter:nth-child(4)  { animation-delay: 0.24s;  color: #ffd166; }
.brand__letter:nth-child(5)  { animation-delay: 0.32s;  color: #ee6c0a; }
.brand__letter:nth-child(6)  { animation-delay: 0.40s;  color: #ff8a3d; }
.brand__letter:nth-child(7)  { animation-delay: 0.48s;  color: #ffae3a; }
.brand__letter:nth-child(8)  { animation-delay: 0.56s;  color: #ffd166; }
.brand__letter:nth-child(10) { animation-delay: 0.72s;  color: #b07cf5; }
.brand__letter:nth-child(11) { animation-delay: 0.80s;  color: #8a4ddb; }
.brand__letter:nth-child(12) { animation-delay: 0.88s;  color: #b07cf5; }
.brand__letter:nth-child(13) { animation-delay: 0.96s;  color: #8a4ddb; }
.brand__letter:nth-child(14) { animation-delay: 1.04s;  color: #b07cf5; }
.brand__letter:nth-child(15) { animation-delay: 1.12s;  color: #8a4ddb; }

@keyframes letterBob {
    0%, 100% { transform: translateY(0)   rotate(-2deg); }
    50%      { transform: translateY(-4px) rotate(2deg); }
}

.buffs-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.buff-pill {
    background: linear-gradient(180deg, #fff5b8, #ffd966 60%, #b88a1a);
    color: var(--ink);
    padding: 4px 12px 4px 6px;
    border-radius: 14px;
    border: 2.5px solid var(--gold-deep);
    font-size: 12px;
    font-weight: 700;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.6),
        0 2px 0 var(--gold-deep),
        0 4px 10px rgba(184, 138, 26, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.buff-icon { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; }
.buff-icon svg { width: 100%; height: 100%; display: block; }

.season-icon { width: 20px; height: 20px; display: inline-block; flex-shrink: 0; }
.season-icon svg { width: 100%; height: 100%; display: block; }
.stage__season-badge { display: inline-flex; align-items: center; gap: 8px; }

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    gap: 0;
    min-height: 0;
    position: relative;

}

.panel {

    background:
        linear-gradient(180deg, rgba(252, 246, 255, 0.92) 0%, rgba(232, 216, 250, 0.92) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 6px 30px rgba(58, 38, 89, 0.12);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 10;
    min-width: 0;
}
.tabs-content { overflow-x: hidden; min-width: 0; }

.treasure-shell {
    flex: 1;
    min-height: 0;
    min-width: 0;
    position: relative;
}

.treasure-sidebar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 78px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 8px;
    overflow-y: auto;
    overflow-x: visible;
    background: linear-gradient(180deg, rgba(248, 240, 255, 0.92) 0%, rgba(225, 208, 245, 0.88) 100%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 8px 24px rgba(91, 45, 184, 0.18),
        0 2px 6px rgba(58, 38, 89, 0.1);
    z-index: 5;
}
.treasure-sidebar::-webkit-scrollbar { width: 3px; }
.treasure-sidebar::-webkit-scrollbar-thumb { background: rgba(176, 124, 245, 0.55); border-radius: 2px; }

.treasure-sidebar__group-label {
    font-size: 8.5px;
    font-weight: 800;
    color: var(--magic-deep);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    text-align: center;
    margin: 6px 0 3px;
    opacity: 0.55;
    flex-shrink: 0;
    user-select: none;
}
.treasure-sidebar__group-label:first-child { margin-top: 0; }
.treasure-sidebar__divider {
    height: 1px;
    margin: 4px 8px 2px;
    background: linear-gradient(90deg, transparent, rgba(176, 124, 245, 0.4), transparent);
    flex-shrink: 0;
}

.ts-icon {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.98) 0%, rgba(248, 240, 255, 0.92) 35%, rgba(232, 216, 250, 0.88) 100%);
    border-radius: 14px;
    padding: 7px;
    cursor: pointer;
    transition:
        transform 0.18s cubic-bezier(.34, 1.4, .64, 1),
        box-shadow 0.18s ease,
        border-color 0.16s ease,
        background 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1.5px 0 rgba(176, 124, 245, 0.18),
        0 3px 8px rgba(91, 45, 184, 0.18),
        0 1px 2px rgba(58, 38, 89, 0.1);
    flex-shrink: 0;
}
.ts-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 1.5px 1.5px rgba(58, 38, 89, 0.18)) drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.05));
}
.ts-icon:hover {
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1.5px 0 rgba(176, 124, 245, 0.2),
        0 5px 14px rgba(91, 45, 184, 0.32),
        0 2px 5px rgba(58, 38, 89, 0.15);
}
.ts-icon:active {
    transform: scale(0.94);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 1px 3px rgba(91, 45, 184, 0.22);
}
.ts-icon.is-active {
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.95) 0%, rgba(216, 196, 255, 0.85) 30%, rgba(176, 124, 245, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
        inset 0 -2px 0 rgba(45, 18, 85, 0.25),
        0 6px 18px rgba(91, 45, 184, 0.5),
        0 2px 6px rgba(45, 18, 85, 0.2);
    transform: scale(1.06);
}
.ts-icon.is-active svg {
    filter: drop-shadow(0 2px 3px rgba(45, 18, 85, 0.4)) brightness(1.05);
}
.ts-icon.is-active::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 70%;
    background: linear-gradient(180deg, var(--magic-light), var(--magic-deep));
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px rgba(91, 45, 184, 0.85);
    animation: tsActivePulse 1.6s ease-in-out infinite;
}
@keyframes tsActivePulse {
    0%, 100% { opacity: 0.85; box-shadow: 0 0 10px rgba(91, 45, 184, 0.7); }
    50%      { opacity: 1;    box-shadow: 0 0 18px rgba(91, 45, 184, 1); }
}
.ts-icon__badge {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffae3a 0%, #ff7a2a 60%, #c84d00 100%);
    color: #fff;
    border: 2px solid #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 2px 6px rgba(214, 80, 16, 0.6);
    pointer-events: none;
    animation: badgeBob 1.5s ease-in-out infinite;
    text-shadow: 0 1px 0 rgba(122, 34, 0, 0.4);
}

.treasure-content {
    position: fixed;
    top: 50%;
    right: 110px;
    width: min(540px, calc(100vw - 130px));
    height: min(720px, 82vh);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: linear-gradient(180deg, rgba(244, 232, 252, 0.97) 0%, rgba(220, 200, 240, 0.94) 100%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 22px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 16px 48px rgba(58, 38, 89, 0.32),
        0 6px 14px rgba(58, 38, 89, 0.14);
    transform: translate(calc(100% + 130px), -50%) scale(0.92);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.36s cubic-bezier(.22, 1.0, .36, 1),
        opacity 0.24s ease;
    z-index: 50;
    overflow: hidden;
    transform-origin: right center;
}
.treasure-content.is-open {
    transform: translate(0, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 720px) {
    .treasure-content {
        right: 88px;
        width: calc(100vw - 102px);
        height: min(640px, 78vh);
        border-radius: 18px;
    }
}
@media (max-width: 480px) {
    .treasure-content {
        right: 12px;
        left: 12px;
        width: auto;
        height: min(640px, 78vh);
    }
    .treasure-content.is-open {
        transform: translateY(-50%) scale(1);
    }
}

.treasure-content__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 16px;
    border-bottom: 1.5px dashed rgba(91, 45, 184, 0.22);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(216, 196, 255, 0.35), transparent);
}
.treasure-content__head-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.treasure-content__title {
    font-family: var(--font);
    font-weight: 800;
    font-size: 17px;
    color: var(--magic-deep);
    letter-spacing: 0.2px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.treasure-content__sub {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.treasure-content__close,
.treasure-content__back {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: 1.5px solid rgba(176, 124, 245, 0.45);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 9px;
    color: var(--magic-deep);
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}
.treasure-content__back svg { width: 100%; height: 100%; display: block; }
.treasure-content__back:hover {
    background: var(--magic-light);
    border-color: var(--magic-deep);
    transform: translateX(-2px);
}
.treasure-content__back:active { transform: translateX(0) scale(0.94); }
.treasure-content__close svg { width: 100%; height: 100%; display: block; }
.treasure-content__close:hover {
    background: var(--magic-light);
    border-color: var(--magic-deep);
    color: var(--magic-deep);
    transform: scale(1.06) rotate(90deg);
}
.treasure-content__close:active { transform: scale(0.95) rotate(90deg); }

.treasure-content .tabs-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 14px 16px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

@keyframes treasureSlideIn {
    0%   { opacity: 0; transform: translateX(28px); }
    100% { opacity: 1; transform: translateX(0); }
}
.tabs-content.is-entering {
    animation: treasureSlideIn 0.28s cubic-bezier(.22, 1.0, .36, 1);
}

.treasure-mobile-toggle { display: none; }

@media (max-width: 600px) {
    .treasure-mobile-toggle {
        display: flex;
        position: relative;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 11px 14px;
        margin-bottom: 8px;
        background: linear-gradient(180deg, #fbf2fb 0%, #d8c4ff 100%);
        border: 2.4px solid var(--magic-stroke);
        border-radius: 14px;
        font-family: var(--font);
        font-size: 14px;
        font-weight: 800;
        color: var(--ink);
        cursor: pointer;
        box-shadow:
            inset 0 1.5px 0 rgba(255, 255, 255, 0.9),
            inset 0 -2px 0 rgba(91, 45, 184, 0.18),
            0 3px 0 var(--magic-stroke),
            0 5px 14px rgba(91, 45, 184, 0.22);
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    .treasure-mobile-toggle:active {
        transform: translateY(2px);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.7),
            0 1px 0 var(--magic-stroke);
    }
    .treasure-mobile-toggle__icon {
        width: 26px;
        height: 26px;
        flex-shrink: 0;
        background: #fff;
        border: 1.6px solid var(--magic-stroke);
        border-radius: 8px;
        padding: 3px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    }
    .treasure-mobile-toggle__icon svg { width: 100%; height: 100%; }
    .treasure-mobile-toggle__label {
        flex: 1;
        text-align: left;
        font-size: 14px;
        line-height: 1.1;
    }
    .treasure-mobile-toggle__chev { width: 18px; height: 18px; transition: transform 0.22s cubic-bezier(.34, 1.4, .64, 1); flex-shrink: 0; color: var(--magic-deep); }
    .treasure-mobile-toggle.is-open .treasure-mobile-toggle__chev { transform: rotate(180deg); }

    .treasure-shell { flex-direction: column; gap: 0; }
    .treasure-sidebar {
        position: absolute;
        top: 58px;
        left: 0;
        right: 0;
        width: auto;
        z-index: 60;
        flex-direction: column;
        gap: 5px;
        max-height: 70vh;
        padding: 10px;
        display: none;
        background: linear-gradient(180deg, #ffffff 0%, #f4e8ff 100%);
        box-shadow: 0 12px 32px rgba(58, 38, 89, 0.45);
        border: 2px solid var(--magic-stroke);
        border-radius: 16px;
        animation: treasureDrop 0.22s cubic-bezier(.34, 1.4, .64, 1);
    }
    @keyframes treasureDrop {
        0%   { opacity: 0; transform: translateY(-8px) scaleY(0.85); transform-origin: top; }
        100% { opacity: 1; transform: translateY(0)    scaleY(1); }
    }
    .treasure-sidebar.is-open { display: flex; }

    .treasure-sidebar__group-label {
        text-align: left;
        font-size: 10px;
        padding: 6px 6px 2px;
        margin: 0;
        opacity: 0.7;
        background: linear-gradient(90deg, rgba(216, 196, 255, 0.4), transparent);
        border-radius: 6px;
    }
    .treasure-sidebar__group-label:first-child { margin-top: 0; }
    .treasure-sidebar__divider { display: none; }

    .ts-icon {
        aspect-ratio: auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 14px;
        height: 50px;
        border-radius: 12px;
        transform: none !important;
    }
    .ts-icon:hover { transform: none; }
    .ts-icon:active { transform: scale(0.98) !important; }
    .ts-icon svg { width: 22px; height: 22px; flex-shrink: 0; }
    .ts-icon::before {
        content: attr(data-label);
        font-family: var(--font);
        font-weight: 700;
        font-size: 14px;
        color: var(--ink);
    }
    .ts-icon.is-active {
        transform: none !important;
    }
    .ts-icon.is-active::before { color: var(--magic-deep); }
    .ts-icon.is-active::after {
        left: auto;
        right: -2px;
        top: 8px;
        bottom: 8px;
        height: auto;
        width: 4px;
        transform: none;
    }
    .ts-icon__badge {
        position: static;
        margin-left: auto;
        animation: none;
    }
}
.upg-grid     { min-width: 0; }
.upg-card     { min-width: 0; max-width: 100%; }
.upg-main, .upg-row, .upg-cost, .upg-cost__val {
    min-width: 0;
    max-width: 100%;
}
.upg-cost__val { overflow: hidden; text-overflow: ellipsis; }
.panel--left {
    background: transparent;
    box-shadow: none;
    border-right: none;
    border-radius: 0;
    padding: 12px 0 18px 14px;
}

.empire-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px 8px;
    margin-bottom: 6px;
}
.empire-head__sub {
    font-size: 10px;
    font-weight: 800;
    color: var(--carrot-deep);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    opacity: 0.8;
}
.panel--right {
    background: transparent;
    box-shadow: none;
    border-left: none;
    border-radius: 0;
    padding: 12px 14px 18px 0;
    pointer-events: none;
}
.panel--right .treasure-shell { pointer-events: none; }
.panel--right .treasure-sidebar { pointer-events: auto; }
.panel--right .treasure-content { pointer-events: none; }
.panel--right .treasure-content.is-open { pointer-events: auto; }

.panel__header {
    text-align: center;
    padding: 8px 4px 14px;
    border-bottom: 2px dashed var(--panel-bord);
    margin-bottom: 6px;
}
.panel__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--carrot-deep);
    text-shadow: 2px 2px 0 #fff5b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.panel--right .panel__title { color: var(--magic-deep); text-shadow: 2px 2px 0 #f8f0ff; }
.panel__star {
    width: 18px;
    height: 18px;
    color: var(--gold);
    animation: spin 4s linear infinite;
    display: inline-block;
    vertical-align: middle;
}
.panel--right .panel__star { color: var(--magic-light); }
.panel__subtitle {
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 4px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.panel__header--buildings {
    padding: 6px 4px 12px;
    border-bottom: 2px dashed var(--panel-bord);
    margin-bottom: 8px;
}
.hero-banner {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.panel__subline {
    font-size: 12.5px;
    color: var(--ink-soft);
    margin-top: 6px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.panel__header--treasure {
    padding: 6px 4px 12px;
    border-bottom: 2px dashed var(--panel-bord);
    margin-bottom: 8px;
}

.panel__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    justify-content: safe center;
}

.bld-card {
    display: flex;
    gap: 10px;
    padding: 9px 12px;
    background:
        linear-gradient(180deg, rgba(255, 250, 240, 0.92) 0%, rgba(252, 232, 200, 0.85) 100%);
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    transition: border-color 0.15s ease;
    cursor: default;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 2px 6px rgba(58, 38, 89, 0.08);
    position: relative;
}

@media (hover: hover) and (pointer: fine) {
    .bld-card:hover { border-color: var(--carrot-light); }
}
.bld-card.is-locked { opacity: 0.6; filter: saturate(0.5); }
.bld-card.is-locked .bld-buy { cursor: not-allowed; }

.bld-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fff5d8, #ffd180);
    border: 1.5px solid rgba(214, 80, 16, 0.6);
    border-radius: 14px;
    padding: 5px;
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.85),
        inset 0 -1.5px 0 rgba(214, 80, 16, 0.12),
        0 2px 6px rgba(214, 80, 16, 0.18),
        0 1px 2px rgba(58, 38, 89, 0.06);
    align-self: center;
}
.bld-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 1px 1.5px rgba(58, 38, 89, 0.18));
}

.bld-info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bld-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.bld-row--head { gap: 6px; }
.bld-row--buy  { gap: 6px; }

.bld-name {
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    line-height: 1.2;
}
.bld-count {
    background: linear-gradient(180deg, var(--magic-light), var(--magic));
    color: #fff;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    min-width: 42px;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 2px 0 var(--magic-stroke);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.bld-cps {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-soft);
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bld-stat__val--total {
    color: var(--carrot-deep);
    font-weight: 800;
    font-size: 13px;
}
.bld-cost {
    font-size: 15px;
    color: var(--gold-deep);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.bld-cost__icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex-shrink: 0;
}
.bld-cost__icon svg { width: 100%; height: 100%; display: block; }

.bld-buy {
    --btn-l: var(--carrot-light);
    --btn-c: var(--carrot);
    --btn-d: var(--carrot-deep);
    --btn-s: var(--carrot-stroke);
    background: linear-gradient(180deg, var(--btn-l) 0%, var(--btn-c) 50%, var(--btn-d) 100%);
    color: #fff;
    border: 3px solid var(--btn-s);
    border-radius: 14px;
    padding: 9px 22px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    min-width: 76px;
    outline: none;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        inset 0 -3px 0 rgba(0, 0, 0, 0.18),
        0 4px 0 var(--btn-s),
        0 6px 12px rgba(0, 0, 0, 0.18);
    transform: translateY(0);
    transition: transform 0.06s ease, box-shadow 0.06s ease;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
    .bld-buy:hover {
        transform: translateY(-1px);
        box-shadow:
            inset 0 2px 0 rgba(255, 255, 255, 0.55),
            inset 0 -3px 0 rgba(0, 0, 0, 0.18),
            0 5px 0 var(--btn-s),
            0 7px 14px rgba(0, 0, 0, 0.22);
    }
}
.bld-buy:active,
.bld-buy.is-pressed {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18),
        0 1px 0 var(--btn-s),
        0 2px 4px rgba(0, 0, 0, 0.15);
}
.bld-buy:focus-visible { outline: 3px dashed var(--magic); outline-offset: 3px; }

.stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 12px 12px;
    overflow: hidden;
    min-width: 0;
}

.stage__season-badge {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--magic-light), var(--magic));
    color: #fff;
    padding: 6px 18px;
    border-radius: 18px;
    font-weight: 700;
    border: 2.5px solid var(--magic-stroke);
    box-shadow: 0 2px 12px rgba(91, 45, 184, 0.3);
    z-index: 3;
}

.hud-wrap {
    width: 100%;
    padding: 6px 14px 4px;
    display: flex;
    justify-content: center;
    z-index: 3;
    position: relative;
    animation: hudBob 4.5s ease-in-out infinite;
    will-change: transform;
}
.hud-panel {
    width: 100%;
    max-width: 1100px;
    height: auto;
    display: block;
}
.hud-panel--mobile { display: none; }

.hud-bar {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(248, 240, 252, 0.78) 0%, rgba(228, 212, 240, 0.72) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.85),
        0 6px 22px rgba(91, 45, 184, 0.14),
        0 2px 6px rgba(58, 38, 89, 0.08);
}

.hud-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(244, 232, 252, 0.45) 100%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 1.5px 4px rgba(58, 38, 89, 0.06);
    cursor: help;
    min-width: 0;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.hud-card:hover {
    transform: translateY(-2px);
    border-color: rgba(176, 124, 245, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 4px 12px rgba(91, 45, 184, 0.18);
}

.hud-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 6px;
    border: 1.5px solid;
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.7),
        inset 0 -1.5px 0 rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(58, 38, 89, 0.1);
}
.hud-card__icon svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px rgba(58, 38, 89, 0.15)); }

.hud-card__icon--carrot {
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border-color: var(--carrot-deep);
}
.hud-card__icon--bolt {
    background: linear-gradient(180deg, #fff8d8, #ffd966);
    border-color: var(--gold-deep);
}
.hud-card__icon--gem {
    background: linear-gradient(180deg, #f0e0fa, #c8a8ec);
    border-color: var(--magic-stroke);
}
.hud-card__icon--sugar {
    background: linear-gradient(180deg, #fff0d8, #f0c898);
    border-color: #7a3a14;
}

.hud-card__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.hud-card__label {
    font-size: 10px;
    font-weight: 800;
    color: #6b5a8a;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    line-height: 1;
    white-space: nowrap;
}
.hud-card .hud-val {
    font-family: var(--font);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hud-card--carrots  .hud-val { color: var(--carrot-deep); }
.hud-card--cps      .hud-val { color: var(--gold-deep); }
.hud-card--prestige .hud-val { color: var(--magic-deep); }
.hud-card--sugar    .hud-val { color: #c97a4d; }

@media (max-width: 720px) {
    .hud-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .hud-card { padding: 8px 10px; gap: 8px; }
    .hud-card__icon { width: 38px; height: 38px; padding: 5px; }
    .hud-card .hud-val { font-size: 18px; }
}
@media (max-width: 480px) {
    .hud-bar { padding: 6px; gap: 6px; }
    .hud-card { padding: 6px 8px; gap: 7px; border-radius: 12px; }
    .hud-card__icon { width: 34px; height: 34px; border-radius: 10px; }
    .hud-card__label { font-size: 9px; letter-spacing: 0.5px; }
    .hud-card .hud-val { font-size: 16px; }
}

@media (max-width: 720px) {
    .hud-panel--legacy.hud-panel--desktop { display: none !important; }
    .hud-panel--legacy.hud-panel--mobile  { display: none !important; }
}
.hud-panel text {
    pointer-events: none;
    user-select: none;
    paint-order: stroke fill;
    -webkit-user-select: none;
}
@keyframes hudBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

.hud-panel text.is-bumping { animation: textBump 0.3s ease; transform-origin: center; transform-box: fill-box; }
@keyframes textBump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.stage__platform {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
}

.carrot-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 3;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transform-origin: center 70%;
}
.carrot-btn:focus,
.carrot-btn:focus-visible,
.carrot-btn:focus:not(:focus-visible) { outline: none !important; box-shadow: none !important; }
.carrot-btn.is-bouncing { animation: squish 0.34s cubic-bezier(.22,1.2,.4,1) both; }

.stage__platform::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -52%);
    background:
        radial-gradient(circle, rgba(255, 209, 102, 0.32) 0%, rgba(255, 138, 61, 0.12) 40%, transparent 65%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    animation: glowPulse 3.5s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -52%) scale(1);    opacity: 0.7; }
    50%      { transform: translate(-50%, -52%) scale(1.05); opacity: 0.95; }
}

.dragon-orbit {
    pointer-events: none;
    --cat-w: 100px;
    --cat-h: 80px;
    --cat-speed: 75;
}
.dragon-orbit[data-level="1"] { --cat-w: 80px; --cat-h: 64px; --cat-speed: 50; }
.dragon-orbit[data-level="2"] { --cat-w: 100px; --cat-h: 80px; --cat-speed: 65; }
.dragon-orbit[data-level="3"] { --cat-w: 130px; --cat-h: 104px; --cat-speed: 80; }
.dragon-orbit[data-level="4"] { --cat-w: 170px; --cat-h: 136px; --cat-speed: 100; }
.dragon-orbit[data-level="5"] { --cat-w: 220px; --cat-h: 176px; --cat-speed: 120; }

.dragon-orbit__item {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--cat-w);
    height: var(--cat-h);
    will-change: transform;
    transform: translate(-9999px, -9999px);
}
.dragon-orbit__item::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 14%;
    width: 76%;
    height: 11%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(20, 30, 10, 0.55) 0%, rgba(20, 30, 10, 0.32) 45%, rgba(20, 30, 10, 0) 75%);
    pointer-events: none;
    z-index: -1;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.dragon-orbit__item.is-walking::before {
    opacity: 0.9;
    transform: translateX(-50%) scaleY(0.95);
}
.dragon-orbit__item.is-sitting::before {
    transform: translateX(-50%) scale(1.08, 1.1);
    opacity: 0.95;
}
.cat-sprite {
    display: block;
    width: 100%;
    height: 100%;
    background-image: url('cat_walk.png');
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: calc(var(--cat-w) * 12) var(--cat-h);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 3px 4px rgba(20, 30, 10, 0.45));
    animation: catFramesWalk 0.7s steps(12) infinite;
    animation-play-state: paused;
}
.dragon-orbit__item.is-walking .cat-sprite {
    animation-play-state: running;
}
.dragon-orbit__item.is-sitting .cat-sprite {
    background-image: url('cat_idle.png');
    background-size: calc(var(--cat-w) * 8) var(--cat-h);
    animation: catFramesIdle 1.4s steps(8) infinite;
    animation-play-state: running;
}

@keyframes catFramesWalk {
    from { background-position: 0 0; }
    to   { background-position: calc(var(--cat-w) * -12) 0; }
}
@keyframes catFramesIdle {
    from { background-position: 0 0; }
    to   { background-position: calc(var(--cat-w) * -8) 0; }
}

@media (max-width: 720px) {
    .dragon-orbit[data-level="1"] { --cat-w: 40px; --cat-h: 32px; }
    .dragon-orbit[data-level="2"] { --cat-w: 55px; --cat-h: 44px; }
    .dragon-orbit[data-level="3"] { --cat-w: 75px; --cat-h: 60px; }
    .dragon-orbit[data-level="4"] { --cat-w: 100px; --cat-h: 80px; }
    .dragon-orbit[data-level="5"] { --cat-w: 130px; --cat-h: 104px; }
}

.carrot-shadow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 20px;
    margin-top: 218px;
    background: radial-gradient(ellipse at center, rgba(58, 38, 89, 0.30), transparent 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    transform: translateX(-50%);
    animation: shadowPulse 2.6s ease-in-out infinite;
}
@keyframes shadowPulse {
    0%, 100% { transform: translateX(-50%) scale(1, 1);    opacity: 0.85; }
    50%      { transform: translateX(-50%) scale(0.85, 0.95); opacity: 0.55; }
}

@media (max-width: 720px) {
    .carrot-shadow { margin-top: 145px; width: 130px; height: 14px; }
}

.stage__ground {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    display: block;
}
.stage__ground--back {
    height: 36vh;
    min-height: 240px;
    z-index: 1;
}
.stage__ground--rim {
    height: 36vh;
    min-height: 240px;
    z-index: 4;
    filter: drop-shadow(0 -2px 5px rgba(20, 8, 0, 0.35));
}
.stage__ground--front {
    height: 18vh;
    min-height: 120px;
    z-index: 5;
    filter: drop-shadow(0 -2px 6px rgba(58, 38, 89, 0.18));
}

@media (max-width: 920px) {
    .stage__ground--back { height: 30vh; min-height: 200px; }
    .stage__ground--rim {
        height: 30vh;
        min-height: 200px;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .stage__ground--front {
        height: 14vh;
        min-height: 90px;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .stage__ground--back { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-height: 640px) {
    .stage__ground--back { height: 28vh; min-height: 170px; }
    .stage__ground--rim { height: 28vh; min-height: 170px; }
    .stage__ground--front { height: 12vh; min-height: 78px; }
}

.stage__platform {
    align-items: flex-end !important;
    justify-content: center !important;
    padding-bottom: 0 !important;
}
.carrot-btn {
    position: fixed !important;
    left: 50% !important;
    bottom: 15vh !important;
    transform: translateX(-50%);
    z-index: 3;
}
.carrot-shadow { display: none !important; }
.dragon-orbit {
    position: fixed !important;
    inset: 0 !important;
    z-index: 6;
}

@media (max-width: 920px) {
    .carrot-btn { bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 11vh) !important; }
}


.carrot-bob {
    display: block;
    transform-origin: center bottom;
    animation: idleBob 2.8s ease-in-out infinite;
    will-change: transform;
}
@keyframes idleBob {
    0%   { transform: translateY(-2px) rotate(-7deg); }
    25%  { transform: translateY(-9px) rotate(-4deg); }
    50%  { transform: translateY(-2px) rotate(-7deg); }
    75%  { transform: translateY(-9px) rotate(-10deg); }
    100% { transform: translateY(-2px) rotate(-7deg); }
}
@keyframes squish {
    0%   { transform: translateX(-50%) scale(1, 1); }
    30%  { transform: translateX(-50%) scale(1.12, 0.86); }
    65%  { transform: translateX(-50%) scale(0.94, 1.08); }
    100% { transform: translateX(-50%) scale(1, 1); }
}

.carrot-svg {
    width: 320px;
    height: 510px;
    filter: drop-shadow(0 14px 28px rgba(214, 80, 16, 0.32));
}

/* Carrot leaves: gentle sway, each group with its own phase */
.carrot-leaves {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: leafSway 3.4s ease-in-out infinite;
    will-change: transform;
}
.carrot-leaves--side-l { animation-duration: 3.6s; animation-delay: -0.4s; transform-origin: 90% 100%; }
.carrot-leaves--side-r { animation-duration: 3.6s; animation-delay: -2.0s; transform-origin: 10% 100%; }
.carrot-leaves--mid-l  { animation-duration: 3.0s; animation-delay: -1.1s; transform-origin: 80% 100%; }
.carrot-leaves--mid-r  { animation-duration: 3.0s; animation-delay: -2.6s; transform-origin: 20% 100%; }
.carrot-leaves--center { animation-duration: 2.8s; animation-delay: -0.7s; transform-origin: 50% 100%; }

@keyframes leafSway {
    0%, 100% { transform: rotate(-3deg); }
    50%      { transform: rotate(3deg); }
}
.carrot-leaves--side-l, .carrot-leaves--mid-l { animation-name: leafSwayLeft; }
.carrot-leaves--side-r, .carrot-leaves--mid-r { animation-name: leafSwayRight; }
@keyframes leafSwayLeft {
    0%, 100% { transform: rotate(-4deg); }
    50%      { transform: rotate(2deg); }
}
@keyframes leafSwayRight {
    0%, 100% { transform: rotate(-2deg); }
    50%      { transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
    .carrot-leaves { animation: none; }
}

.floating-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

.entities {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}
.entities > * { pointer-events: none; }
.golden-carrot, .wrinkler, .reindeer { pointer-events: auto; }

.float-num {
    position: absolute;
    font-weight: 800;
    color: var(--carrot-deep);
    text-shadow: 1px 1px 0 #fff, 2px 2px 0 rgba(214, 80, 16, 0.2);
    pointer-events: none;
    animation: floatUp 1.0s ease-out forwards;
    font-size: 19px;
    will-change: transform, opacity;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}
.float-num--gold     {
    color: var(--gold-deep);
    font-size: 28px;
    text-shadow: 0 0 12px #fff8d8, 1px 1px 0 #fff5b8, 2px 2px 0 rgba(184, 138, 26, 0.5);
    animation: floatGold 1.8s ease-out forwards;
    filter: drop-shadow(0 0 8px rgba(255, 215, 100, 0.8));
}
@keyframes floatGold {
    0%   { opacity: 0; transform: translate(-50%, -50%)        scale(0.4); }
    12%  { opacity: 1; transform: translate(-50%, -65%)        scale(1.4); }
    25%  { opacity: 1; transform: translate(-50%, -75%)        scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, calc(-50% - 90px)) scale(0.95); }
}
.float-num--reindeer { color: #d44a4a;           font-size: 22px; }
.float-num--wrinkler { color: var(--leaf-deep);  font-size: 20px; }
.float-num--ach      { color: var(--magic-deep); font-size: 15px; text-shadow: 1px 1px 0 #f8f0ff; }
@keyframes floatUp {
    0%   { opacity: 0; transform: translate(-50%, -50%)        scale(0.6); }
    15%  { opacity: 1; transform: translate(-50%, -65%)        scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, calc(-50% - 50px)) scale(0.95); }
}

.hint { display: none; }

.golden-carrot {
    position: absolute;
    width: 56px;
    height: 56px;
    border: none;
    background: none;
    cursor: pointer;
    animation: goldenPulse 1s ease-in-out infinite;
    filter: drop-shadow(0 0 18px var(--gold)) drop-shadow(0 0 36px var(--gold-deep));
    padding: 0;
}
.golden-carrot svg { width: 100%; height: 100%; }
@keyframes goldenPulse {
    0%, 100% { transform: scale(1)    rotate(-8deg); }
    50%      { transform: scale(1.18) rotate(8deg);  }
}

.wrinkler-layer,
.golden-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.wrinkler-layer > *,
.golden-layer > * { pointer-events: auto; }
.wrinkler {
    position: absolute;
    width: 72px;
    height: 72px;
    border: none;
    background: none;
    cursor: pointer;
    animation: wrinklerWiggle 1.2s ease-in-out infinite;
    filter:
        drop-shadow(0 0 10px rgba(176, 124, 245, 0.55))
        drop-shadow(0 0 20px rgba(176, 124, 245, 0.35))
        drop-shadow(0 6px 12px rgba(45, 18, 85, 0.55));
    padding: 0;
    z-index: 6;
}
@media (max-width: 720px) {
    .wrinkler { width: 64px; height: 64px; }
}
.wrinkler svg { width: 100%; height: 100%; }
@keyframes wrinklerWiggle {
    0%, 100% { transform: rotate(-8deg) scale(1);    }
    50%      { transform: rotate(8deg)  scale(1.06); }
}

.reindeer-layer { position: absolute; top: 28%; left: 0; right: 0; height: 64px; pointer-events: none; }
.reindeer {
    position: absolute;
    width: 64px;
    height: 64px;
    border: none;
    background: none;
    cursor: pointer;
    animation: reindeerRun 8s linear forwards;
    filter: drop-shadow(0 4px 8px rgba(58, 38, 89, 0.25));
    padding: 0;
}
.reindeer svg { width: 100%; height: 100%; }
@keyframes reindeerRun {
    0%   { left: -64px; transform: scaleX(1); }
    100% { left: 110%;  transform: scaleX(1); }
}

.dragon-panel {
    display: none !important;
}
.dragon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #fcefdc 0%, #f4dcb4 100%);
    color: var(--ink);
    padding: 5px 12px 5px 5px;
    border-radius: 22px;
    border: 2.5px solid var(--carrot);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 3px 10px rgba(214, 80, 16, 0.18);
    font-weight: 700;
}
.dragon__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border-radius: 50%;
    padding: 2px;
    border: 2px solid var(--carrot-deep);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.dragon__icon--orbit {
    background: radial-gradient(circle at 35% 30%, #fff5b8 0%, #ffd166 60%, #d68a14 100%);
    padding: 0;
}
.dragon__icon svg { width: 100%; height: 100%; display: block; }
.dragon__info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    gap: 1px;
    padding-right: 4px;
}
.dragon__title {
    font-size: 9px;
    color: var(--ink-soft);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-weight: 700;
}
.dragon__level {
    font-size: 14px;
    color: var(--carrot-deep);
    font-weight: 800;
}
.dragon .btn-action--small { padding: 3px 9px; font-size: 10px; }

@media (max-width: 920px) {
    .dragon-panel { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); right: 8px; }
    .dragon { padding: 4px 10px 4px 4px; }
    .dragon__icon { width: 36px; height: 36px; }
    .dragon__title { font-size: 8px; }
    .dragon__level { font-size: 13px; }
}

.tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
}
.tabs-bar:empty { margin-top: 0; }

.tab-back {
    background: linear-gradient(180deg, #ede0f5 0%, #d8c4eb 100%);
    color: var(--magic-deep);
    border: 2px solid var(--magic-light);
    border-radius: 12px;
    padding: 5px 12px 5px 9px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 2px 0 var(--magic-light);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    outline: none;
}
.tab-back:hover { transform: translateY(-1px); }
.tab-back:active { transform: translateY(1px); box-shadow: inset 0 2px 0 rgba(91, 45, 184, 0.1); }
.tab-back svg { width: 14px; height: 14px; }
.tab-current {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-weight: 800;
    color: var(--magic-deep);
    font-size: 14px;
    padding: 4px 12px 4px 8px;
    background: linear-gradient(180deg, var(--magic-light), var(--magic));
    color: #fff;
    border: 2px solid var(--magic-stroke);
    border-radius: 12px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 2px 0 var(--magic-stroke);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    position: relative;
}
.tab-current .tab__icon { width: 18px; height: 18px; }
.tab-current .tab__icon svg { width: 100%; height: 100%; }

.tile-menu {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 4px 2px;
}
.tile-sections {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tile-section {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(244, 230, 250, 0.55) 100%);
    border: 2px solid var(--panel-bord);
    border-radius: 18px;
    padding: 12px 12px 14px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.55),
        0 3px 8px rgba(58, 38, 89, 0.10);
}
.tile-section__head {
    text-align: center;
    margin-bottom: 10px;
    padding: 4px 4px 10px;
    border-bottom: 2px dashed rgba(91, 74, 120, 0.22);
}
.tile-section__title {
    font-size: 14px;
    font-weight: 800;
    color: var(--magic-deep);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}
.tile-section__sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-top: 2px;
    letter-spacing: 0.3px;
}
.tile-section .tile-menu { padding: 0; }

.tile-card {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, #f3e6f8 0%, #e3d0f0 70%, #c8addf 100%);
    border: 2.5px solid var(--magic-light);
    border-radius: 16px;
    padding: 12px 12px 12px 14px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    text-align: left;
    transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        inset 0 -2px 0 rgba(91, 45, 184, 0.08),
        0 3px 0 rgba(91, 45, 184, 0.20),
        0 5px 12px rgba(91, 45, 184, 0.12);
}
@media (hover: hover) and (pointer: fine) {
    .tile-card:hover {
        transform: translateY(-2px);
        border-color: var(--magic);
        box-shadow:
            inset 0 2px 0 rgba(255, 255, 255, 0.75),
            inset 0 -2px 0 rgba(91, 45, 184, 0.08),
            0 5px 0 rgba(91, 45, 184, 0.25),
            0 8px 16px rgba(91, 45, 184, 0.18);
    }
}
.tile-card:active,
.tile-card.is-pressed {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 1px 0 rgba(91, 45, 184, 0.20),
        0 2px 4px rgba(91, 45, 184, 0.10);
}
.tile-card.has-available {
    border-color: var(--carrot);
    background: linear-gradient(180deg, #ffe7c8 0%, #ffd49a 70%, #f5b87a 100%);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.75),
        inset 0 -2px 0 rgba(214, 80, 16, 0.10),
        0 3px 0 var(--carrot),
        0 5px 14px rgba(214, 80, 16, 0.18);
}
.tile-card__icon {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ece0f5, #d8c2eb);
    border: 2px solid var(--magic);
    border-radius: 13px;
    padding: 5px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 2px 4px rgba(91, 45, 184, 0.15);
}
.tile-card.has-available .tile-card__icon {
    border-color: var(--carrot-deep);
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 2px 4px rgba(214, 80, 16, 0.20);
}
.tile-card__icon svg { width: 100%; height: 100%; display: block; }

.tile-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.tile-card__name {
    font-weight: 800;
    font-size: 16px;
    color: var(--magic-deep);
    text-align: left;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}
.tile-card.has-available .tile-card__name { color: var(--carrot-deep); }
.tile-card__sub {
    font-size: 11.5px;
    color: var(--ink-soft);
    text-align: left;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tile-card__badge {
    position: relative;
    flex-shrink: 0;
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ff8a3d, var(--carrot-deep));
    color: #fff;
    border: 2px solid #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 22px;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 2px 0 var(--carrot-stroke),
        0 3px 8px rgba(214, 80, 16, 0.4);
    animation: badgeBob 1.4s ease-in-out infinite;
}
.tile-card__chev {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--magic-light);
    transition: transform 0.15s ease;
}
.tile-card.has-available .tile-card__chev { color: var(--carrot); }
.tile-card:hover .tile-card__chev { transform: translateX(3px); }

.tab {
    background: linear-gradient(180deg, #ece0f5 0%, #d4c0eb 100%);
    color: var(--ink-soft);
    border: 2px solid var(--panel-bord);
    border-radius: 11px;
    padding: 4px 9px 4px 6px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, color 0.08s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 2px 0 rgba(91, 45, 184, 0.18);
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}
.tab__icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tab__icon svg { width: 100%; height: 100%; display: block; }
.tab__label { white-space: nowrap; }

.tab:hover {
    color: var(--magic-deep);
    border-color: var(--magic-light);
    transform: translateY(-1px);
}
.tab:active { transform: translateY(1px); box-shadow: inset 0 2px 0 rgba(91, 45, 184, 0.1); }
.tab.is-active {
    background: linear-gradient(180deg, var(--magic-light) 0%, var(--magic) 55%, var(--magic-deep) 100%);
    color: #fff;
    border-color: var(--magic-stroke);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18),
        0 3px 0 var(--magic-stroke),
        0 5px 10px rgba(91, 45, 184, 0.25);
}
.tab:focus-visible { outline: 3px dashed var(--carrot); outline-offset: 2px; }

.tabs-content { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

.tab-empty {
    color: var(--ink-faint);
    font-style: italic;
    text-align: center;
    padding: 30px 10px;
}

.upg-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 2px 14px;
}

.upg-panel__head {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(244, 230, 250, 0.78) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 2px 6px rgba(58, 38, 89, 0.10);
}
.upg-panel__title {
    font-size: 14px;
    font-weight: 800;
    color: var(--magic-deep);
    text-transform: uppercase;
    letter-spacing: 1.4px;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px dashed rgba(91, 74, 120, 0.22);
}
.upg-panel__stats {
    display: flex;
    justify-content: space-around;
    gap: 6px;
    flex-wrap: wrap;
}
.upg-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 70px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid rgba(91, 74, 120, 0.18);
}
.upg-stat__num {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
}
.upg-stat__label {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 3px;
}
.upg-stat--available { background: linear-gradient(180deg, #fff5b8, #ffd166); border-color: var(--carrot-deep); }
.upg-stat--available .upg-stat__num   { color: var(--carrot-deep); }
.upg-stat--available .upg-stat__label { color: var(--carrot-stroke); }
.upg-stat--locked    { background: rgba(91, 74, 120, 0.10); }
.upg-stat--locked .upg-stat__num     { color: var(--ink-soft); }
.upg-stat--owned     { background: linear-gradient(180deg, #e8f7e0, #b8f08a); border-color: var(--leaf-deep); }
.upg-stat--owned .upg-stat__num      { color: var(--leaf-deep); }
.upg-stat--owned .upg-stat__label    { color: #1a4a10; }

.upg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.upg-sep {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 2px;
    padding: 8px 12px;
    border-radius: 11px;
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    color: var(--carrot-stroke);
    border: 2px solid var(--carrot-deep);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.upg-sep:first-child { margin-top: 0; }
.upg-sep__icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.upg-sep__icon svg { width: 100%; height: 100%; display: block; }
.upg-sep__title { flex: 1; }
.upg-sep__count {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(94, 63, 13, 0.25);
}
.upg-sep--locked {
    background: rgba(91, 74, 120, 0.15);
    color: var(--ink-soft);
    border-color: var(--panel-bord);
}
.upg-sep--locked .upg-sep__count { border-color: rgba(91, 74, 120, 0.3); }
.upg-sep--owned {
    background: linear-gradient(180deg, #e8f7e0, #b8f08a);
    color: var(--leaf-deep);
    border-color: var(--leaf-deep);
}
.upg-sep--owned .upg-sep__count { border-color: var(--leaf-deep); }

.upg-card {
    position: relative;
    background:
        linear-gradient(180deg, rgba(248, 240, 252, 0.92) 0%, rgba(228, 212, 240, 0.88) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.18s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 1px 3px rgba(58, 38, 89, 0.08);
}
@media (hover: hover) and (pointer: fine) {
    .upg-card:hover { border-color: rgba(176, 124, 245, 0.7); transform: translateY(-1px); }
}

.upg-card.is-affordable {
    background: linear-gradient(180deg, #fff8d8 0%, #ffe8a3 100%);
    border-color: var(--carrot-deep);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 3px 10px rgba(214, 80, 16, 0.28);
}

.upg-card.is-owned {
    background: linear-gradient(180deg, #e8f7e0 0%, #c8eaa6 100%);
    border-color: var(--leaf-deep);
}
.upg-card.is-owned .upg-buy {
    --btn-l: #a8e878;
    --btn-c: #66cc44;
    --btn-d: #2a7a1f;
    --btn-s: #1a4a10;
    cursor: default;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18),
        0 2px 0 var(--btn-s);
}
.upg-card.is-owned:hover { transform: none; }

.upg-card.is-locked {
    opacity: 0.7;
}
.upg-card.is-locked .upg-buy {
    --btn-l: var(--ink-faint);
    --btn-c: var(--ink-soft);
    --btn-d: var(--ink-soft);
    --btn-s: var(--ink-soft);
    cursor: not-allowed;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        0 2px 0 var(--btn-s);
}

.upg-card.is-require-locked {
    opacity: 0.6;
    background: rgba(91, 74, 120, 0.08);
    border-color: var(--panel-bord);
    border-style: dashed;
    filter: grayscale(0.4) saturate(0.6);
}
.upg-card.is-require-locked:hover { transform: none; border-color: var(--panel-bord); }
.upg-card.is-require-locked .upg-name { color: var(--ink-soft); }
.upg-card.is-require-locked .upg-desc { color: var(--magic-deep); font-style: italic; font-weight: 600; }
.upg-card.is-require-locked .upg-buy {
    --btn-l: var(--ink-faint);
    --btn-c: var(--ink-soft);
    --btn-d: var(--ink-soft);
    --btn-s: var(--ink-soft);
    cursor: not-allowed;
    font-size: 10px;
    padding: 6px 10px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        0 2px 0 var(--btn-s);
}

.upg-card__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    border: 2px solid #fff;
}
.upg-card__badge svg { width: 12px; height: 12px; display: block; }
.upg-card__badge--owned  { background: var(--leaf-deep); }
.upg-card__badge--locked { background: var(--ink-soft); }
.upg-card__badge--ready  {
    background: linear-gradient(180deg, #ffd700, #b88a1a);
    color: #5a1700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    animation: upgReadyBounce 1.4s ease-in-out infinite;
}
@keyframes upgReadyBounce {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

.upg-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fff, #f0e6f5);
    border: 2px solid var(--magic);
    border-radius: 12px;
    padding: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 4px rgba(91, 45, 184, 0.15);
}
.upg-card.is-affordable .upg-icon {
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border-color: var(--carrot-deep);
}
.upg-card.is-owned .upg-icon {
    background: linear-gradient(180deg, #fff, #d6f0c5);
    border-color: var(--leaf-deep);
}
.upg-card.is-require-locked .upg-icon {
    border-color: var(--panel-bord);
    background: rgba(255, 255, 255, 0.5);
}
.upg-icon svg { width: 100%; height: 100%; display: block; }

.upg-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.upg-name {
    font-weight: 800;
    font-size: 13.5px;
    color: var(--ink);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upg-desc {
    font-size: 11.5px;
    color: var(--ink-soft);
    line-height: 1.35;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.upg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}
.upg-cost {
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gold-deep);
    padding: 3px 9px;
    background: rgba(255, 245, 184, 0.7);
    border: 1.5px solid rgba(184, 138, 26, 0.35);
    border-radius: 8px;
    flex: 1 1 auto;
    min-width: 0;
}
.upg-cost__val { flex: 1 1 auto; }
.upg-card.is-affordable .upg-cost {
    background: linear-gradient(90deg, #fff8d8, #ffd166);
    border-color: var(--carrot-deep);
    color: var(--carrot-stroke);
}
.upg-card.is-locked .upg-cost { color: var(--ink-soft); background: rgba(255, 255, 255, 0.4); }
.upg-cost--owned {
    color: var(--leaf-deep) !important;
    background: linear-gradient(90deg, #e8f7e0, #b8f08a) !important;
    border-color: var(--leaf-deep) !important;
}
.upg-cost__icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    flex-shrink: 0;
}
.upg-cost__icon svg { width: 100%; height: 100%; display: block; }
.upg-cost__val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upg-buy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.upg-buy svg { width: 14px; height: 14px; }

.upg-buy {
    --btn-l: var(--magic-light);
    --btn-c: var(--magic);
    --btn-d: var(--magic-deep);
    --btn-s: var(--magic-stroke);
    background: linear-gradient(180deg, var(--btn-l) 0%, var(--btn-c) 50%, var(--btn-d) 100%);
    color: #fff;
    border: 2.5px solid var(--btn-s);
    border-radius: 14px;
    padding: 6px 16px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    font-size: 12px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.55),
        inset 0 -3px 0 rgba(0, 0, 0, 0.18),
        0 4px 0 var(--btn-s),
        0 6px 12px rgba(0, 0, 0, 0.18);
    transform: translateY(0);
    transition: transform 0.06s ease, box-shadow 0.06s ease;
    -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
    .upg-buy:hover {
        transform: translateY(-1px);
        box-shadow:
            inset 0 2px 0 rgba(255, 255, 255, 0.6),
            inset 0 -3px 0 rgba(0, 0, 0, 0.18),
            0 5px 0 var(--btn-s),
            0 7px 14px rgba(0, 0, 0, 0.22);
    }
}
.upg-buy:active,
.upg-buy.is-pressed {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18),
        0 1px 0 var(--btn-s),
        0 2px 4px rgba(0, 0, 0, 0.15);
}
.upg-buy:focus-visible { outline: 3px dashed var(--carrot); outline-offset: 3px; }

.ach-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px 14px;
}

.ach-summary {
    background: linear-gradient(180deg, #fff5b8 0%, #ffd166 60%, #b88a1a 100%);
    border: 3px solid var(--gold-deep);
    border-radius: 16px;
    padding: 14px 16px;
    text-align: center;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 5px 14px rgba(184, 138, 26, 0.3);
}
.ach-summary__top {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.ach-summary__count {
    display: flex;
    align-items: baseline;
    gap: 2px;
    color: var(--ink);
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.55);
}
.ach-summary__got   { font-size: 38px; font-weight: 800; color: var(--gold-deep); letter-spacing: -1px; }
.ach-summary__sep   { font-size: 24px; font-weight: 600; color: var(--ink-soft); margin: 0 2px; }
.ach-summary__total { font-size: 22px; font-weight: 700; color: var(--ink-soft); }

.ach-summary__cocktail {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.55);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(94, 63, 13, 0.25);
}
.ach-summary__cocktail-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--ink-soft);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.ach-summary__cocktail-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--carrot-deep);
}

.ach-progress {
    height: 10px;
    background: rgba(94, 63, 13, 0.18);
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid rgba(94, 63, 13, 0.3);
    margin-bottom: 8px;
}
.ach-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #b88a1a, #5e3f0d);
    transition: width 0.4s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.ach-summary__hint {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.ach-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ach-section__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.ach-section__head--earned {
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border: 2px solid var(--gold-deep);
    color: var(--gold-deep);
}
.ach-section__head--locked {
    background: rgba(91, 74, 120, 0.15);
    border: 2px solid var(--panel-bord);
    color: var(--ink-soft);
}
.ach-section__icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ach-section__icon svg { width: 100%; height: 100%; display: block; }
.ach-section__title { flex: 1; }
.ach-section__count {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(91, 74, 120, 0.2);
}
.ach-section__head--earned .ach-section__count {
    border-color: var(--gold-deep);
}

.ach-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.ach-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid var(--panel-bord);
    border-radius: 12px;
    transition: transform 0.1s ease;
}
.ach-card--earned {
    background: linear-gradient(180deg, #fff8e8 0%, #fff5b8 100%);
    border-color: var(--gold-deep);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        0 2px 8px rgba(184, 138, 26, 0.2);
}
.ach-card--locked {
    opacity: 0.78;
    border-style: dashed;
}
.ach-card__icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 5px;
    border: 2px solid;
}
.ach-card__icon svg { width: 100%; height: 100%; display: block; }
.ach-card__icon--earned {
    background: linear-gradient(180deg, #fff8d8, #ffd166);
    border-color: var(--gold-deep);
    box-shadow: 0 2px 6px rgba(184, 138, 26, 0.35);
}
.ach-card__icon--locked {
    background: rgba(91, 74, 120, 0.12);
    border-color: var(--panel-bord);
}
.ach-card__body {
    flex: 1;
    min-width: 0;
}
.ach-card__name {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 2px;
}
.ach-card--locked .ach-card__name { color: var(--ink-soft); }
.ach-card__desc {
    font-size: 11.5px;
    color: var(--ink-soft);
    line-height: 1.35;
    font-weight: 600;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 2px 14px;
}
.stats-group {
    background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(244,230,250,0.55) 100%);
    border: 2px solid var(--panel-bord);
    border-radius: 14px;
    padding: 10px 12px 12px;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.55),
        0 2px 6px rgba(58, 38, 89, 0.10);
}
.stats-group__title {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--magic-deep);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px dashed rgba(91, 74, 120, 0.22);
    text-align: center;
}
.stats-group__rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
    font-size: 12.5px;
}
.stats-row:nth-child(odd) { background: rgba(255, 255, 255, 0.65); }
.stats-row__label {
    color: var(--ink-soft);
    font-weight: 600;
}
.stats-row__value {
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.stats-row--big {
    background: linear-gradient(90deg, rgba(255, 245, 184, 0.6), rgba(255, 209, 102, 0.45));
    border: 1.5px solid rgba(214, 80, 16, 0.25);
    padding: 10px 12px;
}
.stats-row--big .stats-row__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 800;
}
.stats-row--big .stats-row__value {
    font-size: 16px;
}
.stats-row--carrot .stats-row__value { color: var(--carrot-deep); }
.stats-row--gold   .stats-row__value { color: var(--gold-deep); }
.stats-row--magic  .stats-row__value { color: var(--magic-deep); }
.stats-row--carrot.stats-row--big {
    background: linear-gradient(90deg, rgba(255, 245, 184, 0.7), rgba(255, 138, 61, 0.4));
    border-color: var(--carrot-deep);
}
.stats-row--magic.stats-row--big {
    background: linear-gradient(90deg, rgba(216, 196, 255, 0.6), rgba(139, 77, 219, 0.35));
    border-color: var(--magic-deep);
}

.ascend {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px 14px;
}
.ascend__hero {
    text-align: center;
    padding: 4px 4px 8px;
}
.ascend__star {
    width: 90px;
    height: 90px;
    margin: 0 auto 8px;
    filter: drop-shadow(0 8px 18px rgba(91, 45, 184, 0.4));
    animation: ascendStarPulse 2.6s ease-in-out infinite;
}
.ascend__star svg { width: 100%; height: 100%; display: block; }
@keyframes ascendStarPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.06) rotate(8deg); }
}
.ascend__title {
    font-size: 24px;
    font-weight: 800;
    color: var(--magic-deep);
    letter-spacing: -0.3px;
}
.ascend__sub {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    line-height: 1.4;
    margin-top: 4px;
    padding: 0 8px;
}
.ascend__main {
    display: flex;
    justify-content: center;
}
.ascend__earn {
    background: linear-gradient(180deg, #fbf2ff, #d8c4eb);
    border: 3px solid var(--magic-deep);
    border-radius: 16px;
    padding: 14px 18px;
    text-align: center;
    width: 100%;
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.6),
        0 5px 16px rgba(91, 45, 184, 0.25);
}
.ascend__earn-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--magic-deep);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.ascend__earn-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--magic-deep);
    letter-spacing: -0.4px;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.55);
}
.ascend__earn-unit {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-soft);
    letter-spacing: 0.6px;
    margin-top: 2px;
}
.ascend__details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--panel-bord);
    border-radius: 12px;
}
.ascend__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.55);
    font-size: 12.5px;
}
.ascend__row:nth-child(odd) { background: rgba(255, 255, 255, 0.75); }
.ascend__row-label {
    color: var(--ink-soft);
    font-weight: 600;
}
.ascend__row-value {
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.ascend__hint {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink);
    padding: 10px 14px;
    background: rgba(255, 245, 184, 0.6);
    border: 1.5px solid rgba(214, 80, 16, 0.2);
    border-radius: 12px;
    text-align: center;
}
.ascend__hint strong { color: var(--carrot-deep); font-weight: 800; }
.ascend__progress {
    height: 12px;
    background: rgba(91, 74, 120, 0.15);
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid rgba(91, 74, 120, 0.25);
}
.ascend__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--carrot), var(--carrot-deep));
    transition: width 0.4s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.ascend__cta {
    width: 100%;
    padding: 16px 18px;
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(180deg, #d8b8ff, #8a4ddb 60%, #3a1a85);
    border: 3px solid var(--magic-stroke);
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.55),
        inset 0 -3px 0 rgba(45, 18, 85, 0.3),
        0 5px 0 var(--magic-stroke),
        0 8px 22px rgba(91, 45, 184, 0.45);
    transition: transform 0.08s ease;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
    letter-spacing: 0.4px;
}
.ascend__cta:not(.is-disabled):hover { transform: translateY(-2px); }
.ascend__cta:not(.is-disabled):active {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        0 1px 0 var(--magic-stroke);
}
.ascend__cta.is-disabled,
.ascend__cta:disabled {
    background: linear-gradient(180deg, #ddd, #999);
    border-color: #555;
    color: #ddd;
    cursor: not-allowed;
    box-shadow: 0 3px 0 #555, 0 5px 12px rgba(0,0,0,0.18);
    text-shadow: none;
}

.ascend__heavenly-sep {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 4px 6px;
}
.ascend__heavenly-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--magic-light) 30%, var(--magic-light) 70%, transparent 100%);
    border-radius: 2px;
}
.ascend__heavenly-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--magic-deep);
    text-shadow: 1px 1px 0 #f8f0ff;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.btn-action {
    --btn-l: var(--magic-light);
    --btn-c: var(--magic);
    --btn-d: var(--magic-deep);
    --btn-s: var(--magic-stroke);
    background: linear-gradient(180deg, var(--btn-l) 0%, var(--btn-c) 50%, var(--btn-d) 100%);
    color: #fff;
    border: 2.5px solid var(--btn-s);
    border-radius: 14px;
    padding: 10px 18px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.55),
        inset 0 -3px 0 rgba(0, 0, 0, 0.18),
        0 4px 0 var(--btn-s),
        0 6px 14px rgba(0, 0, 0, 0.18);
    transform: translateY(0);
    transition: transform 0.06s ease, box-shadow 0.06s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn-action:hover {
    transform: translateY(-1px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.6),
        inset 0 -3px 0 rgba(0, 0, 0, 0.18),
        0 5px 0 var(--btn-s),
        0 7px 16px rgba(0, 0, 0, 0.22);
}
.btn-action:active,
.btn-action.is-pressed {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18),
        0 1px 0 var(--btn-s),
        0 2px 4px rgba(0, 0, 0, 0.15);
}
.btn-action:disabled {
    --btn-l: var(--ink-faint);
    --btn-c: var(--ink-soft);
    --btn-d: var(--ink-soft);
    --btn-s: var(--ink-soft);
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}
.btn-action--small  { padding: 5px 12px; font-size: 11px; }
.btn-action--danger {
    --btn-l: #ff8888;
    --btn-c: #d44a4a;
    --btn-d: #a02020;
    --btn-s: #5e0d0d;
}
.btn-action--secondary {
    --btn-l: #c9b6e6;
    --btn-c: #8a73c0;
    --btn-d: #5b4a78;
    --btn-s: #2d1255;
}

.settings { display: flex; flex-direction: column; gap: 18px; padding: 4px 2px 12px; }
.settings__section {
    background: linear-gradient(180deg, #f3e8f8 0%, #e0cdef 100%);
    border: 2px solid var(--panel-bord);
    border-radius: 14px;
    padding: 14px 14px 16px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 2px 6px rgba(58, 38, 89, 0.10);
}
.settings__heading {
    font-size: 14px;
    font-weight: 800;
    color: var(--magic-deep);
    margin-bottom: 6px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.settings__hint {
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.4;
    margin-bottom: 12px;
}
.settings__row {
    display: grid;
    grid-template-columns: 90px 1fr 48px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.settings__row:last-child { margin-bottom: 0; }
.settings__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.settings__value {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-soft);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.settings__slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--magic) 0%, var(--magic) var(--fill, 50%), rgba(120, 100, 160, 0.25) var(--fill, 50%), rgba(120, 100, 160, 0.25) 100%);
    outline: none;
    cursor: pointer;
    border: 1.5px solid rgba(91, 74, 120, 0.4);
}
.settings__slider:disabled { opacity: 0.55; cursor: not-allowed; }
.settings__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border: 2px solid var(--carrot-deep);
    box-shadow: 0 2px 4px rgba(214, 80, 16, 0.25);
    cursor: pointer;
}
.settings__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border: 2px solid var(--carrot-deep);
    box-shadow: 0 2px 4px rgba(214, 80, 16, 0.25);
    cursor: pointer;
}
.settings__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.settings__actions .btn-action { flex: 1 1 auto; min-width: 140px; }

.settings__input {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--panel-bord);
    border-radius: 10px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.settings__input:focus {
    border-color: var(--magic);
    background: #fff;
}
.settings__checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 6px;
    margin-bottom: 8px;
    user-select: none;
}
.settings__checkbox input { width: 18px; height: 18px; cursor: pointer; }

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.profile-form__current {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    border: 1.5px solid var(--panel-bord);
    margin-bottom: 14px;
}
.profile-form__avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(58, 38, 89, 0.18);
}
.profile-form__avatar svg { width: 100%; height: 100%; display: block; }
.profile-form__name {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    flex: 1;
    word-break: break-word;
}
.profile-form__placeholder { color: var(--ink-faint); font-style: italic; font-weight: 600; font-size: 14px; }
.profile-form__msg {
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
    min-height: 16px;
}
.profile-form__msg--ok  { color: #2a7a1f; }
.profile-form__msg--err { color: #c84510; }

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    border: 1.5px solid var(--panel-bord);
    margin-bottom: 8px;
}
.avatar-pick {
    width: 100%;
    aspect-ratio: 1;
    padding: 4px;
    background: linear-gradient(180deg, #fff, #f0e6f5);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.1s ease;
}
.avatar-pick svg { width: 100%; height: 100%; display: block; }
.avatar-pick:hover { transform: translateY(-1px); }
.avatar-pick.is-selected {
    border-color: var(--carrot-deep);
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 6px rgba(214, 80, 16, 0.3);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.profile-form__avatar .avatar-img,
.ranking__avatar .avatar-img,
.profile-modal__avatar .avatar-img {
    border-radius: 50%;
}

.avatar-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}
.avatar-upload .btn-action { flex: 0 0 auto; }
.avatar-upload__msg {
    font-size: 12px;
    font-weight: 700;
    flex-basis: 100%;
    min-height: 16px;
    margin-top: 2px;
}
.avatar-upload__msg--ok  { color: #2a7a1f; }
.avatar-upload__msg--err { color: #c84510; }

.ranking { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 10px; }
.ranking__header {
    text-align: center;
    padding: 10px 14px;
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border: 2px solid var(--gold-deep);
    border-radius: 14px;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), 0 3px 8px rgba(184, 138, 26, 0.25);
}
.ranking__warn {
    margin-bottom: 10px;
    padding: 9px 12px;
    background: linear-gradient(180deg, #fff0c8, #ffd5a0);
    border: 1.5px solid #c46a18;
    border-radius: 12px;
    color: #6a3010;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
}
.ranking__title { font-size: 18px; font-weight: 800; color: var(--gold-deep); }
.ranking__sub   { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.ranking__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ranking__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #f3e8f8, #e0cdef);
    border: 2px solid var(--panel-bord);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 4px rgba(58, 38, 89, 0.10);
}
@media (hover: hover) and (pointer: fine) {
    .ranking__row:hover {
        transform: translateY(-1px);
        border-color: var(--magic);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 8px rgba(91, 45, 184, 0.18);
    }
}
.ranking__row--top {
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border-color: var(--gold-deep);
}
.ranking__row--me {
    background: linear-gradient(180deg, #ffe0c0, #ffc890);
    border-color: var(--carrot-deep);
}
.ranking__rank {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    min-width: 44px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ranking__rank svg {
    width: 38px;
    height: 48px;
    filter: drop-shadow(0 2px 4px rgba(58, 38, 89, 0.35));
}
.ranking__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(58, 38, 89, 0.18);
}
.ranking__avatar svg { width: 100%; height: 100%; display: block; }
.ranking__info { flex: 1; min-width: 0; }
.ranking__name {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ranking__you { color: var(--carrot-deep); font-size: 11px; font-weight: 700; }
.ranking__stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.ranking__stat {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-soft);
}
.ranking__stat--prestige { color: var(--magic-deep); }
.ranking__view {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid var(--panel-bord);
    border-radius: 50%;
    color: var(--ink-soft);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.ranking__me-section { margin-top: 4px; }
.ranking__divider {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 12px 0 8px;
    position: relative;
}
.ranking__divider::before, .ranking__divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1.5px;
    background: var(--panel-bord);
}
.ranking__divider::before { left: 0; }
.ranking__divider::after  { right: 0; }

.ranking-loader, .ranking-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--ink-soft);
    font-weight: 700;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    border: 2px dashed var(--panel-bord);
}
.ranking-empty small { display: block; margin-top: 6px; opacity: 0.7; font-size: 11px; font-weight: 600; }
.ranking-empty--cta { color: var(--magic-deep); background: linear-gradient(180deg, #f3e8f8, #e0cdef); border-style: solid; }

.ranking__actions { display: flex; justify-content: center; margin-top: 6px; }

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.profile-modal.is-open { display: flex; animation: pmFadeIn 0.2s ease; }
@keyframes pmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.profile-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(45, 18, 85, 0.55);
    cursor: pointer;
}
.profile-modal__content {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: linear-gradient(180deg, #fbf2fb 0%, #d8c4eb 100%);
    border: 3px solid #5b4a78;
    border-radius: 22px;
    padding: 28px 24px 22px;
    box-shadow: 0 12px 40px rgba(45, 18, 85, 0.5);
    text-align: center;
    animation: pmSlideUp 0.25s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes pmSlideUp { from { opacity: 0; transform: translateY(20px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
.profile-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid var(--panel-bord);
    border-radius: 50%;
    color: var(--magic-deep);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}
.profile-modal__avatar {
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(58, 38, 89, 0.3);
    border: 3px solid #fff;
}
.profile-modal__avatar svg { width: 100%; height: 100%; display: block; }
.profile-modal__name {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 4px;
    word-break: break-word;
}
.profile-modal__rank {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-deep);
    margin-bottom: 18px;
}
.profile-modal__stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.profile-modal__stats > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(91, 74, 120, 0.2);
}
.profile-modal__stats dt {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.profile-modal__stats dd {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.offline-modal {
    position: fixed;
    inset: 0;
    z-index: 9050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.offline-modal.is-open { opacity: 1; visibility: visible; }
.offline-modal__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(255, 220, 130, 0.16) 0%, transparent 65%),
        linear-gradient(180deg, rgba(42, 26, 74, 0.65) 0%, rgba(74, 42, 110, 0.62) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}
.offline-modal__content {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: linear-gradient(180deg, #fef8fc 0%, #ffe8ce 100%);
    border: 3px solid var(--carrot-deep);
    border-radius: 26px;
    padding: 28px 26px 22px;
    text-align: center;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 22px 60px rgba(214, 80, 16, 0.45);
    animation: offlineSlideIn 0.5s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes offlineSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.offline-modal__icon {
    width: 80px;
    height: 80px;
    margin: -10px auto 8px;
    filter: drop-shadow(0 8px 18px rgba(214, 80, 16, 0.4));
    animation: offlineCarrotBob 2.4s ease-in-out infinite;
}
.offline-modal__icon svg { width: 100%; height: 100%; display: block; }
@keyframes offlineCarrotBob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-8px) rotate(3deg); }
}
.offline-modal__title {
    font-size: 26px;
    font-weight: 800;
    color: var(--carrot-deep);
    letter-spacing: -0.4px;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}
.offline-modal__sub {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin: 4px 0 18px;
}
.offline-modal__stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.offline-stat {
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid rgba(214, 80, 16, 0.22);
    border-radius: 14px;
    padding: 10px 14px;
    text-align: center;
}
.offline-stat__label {
    font-size: 11px;
    font-weight: 800;
    color: var(--ink-soft);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.offline-stat__value {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
}
.offline-stat__chip {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: var(--carrot);
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    vertical-align: middle;
    text-transform: uppercase;
}
.offline-stat--big {
    background: linear-gradient(180deg, #fff5b8 0%, #ffd166 100%);
    border-color: var(--carrot-deep);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 4px 14px rgba(214, 80, 16, 0.25);
}
.offline-stat__value--gain {
    font-size: 28px;
    font-weight: 800;
    color: var(--carrot-deep);
    letter-spacing: -0.3px;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}
.offline-modal__hint {
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 16px;
    line-height: 1.4;
}
.offline-modal__hint strong { color: var(--carrot-deep); }
.offline-modal__close {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 800;
    background: linear-gradient(180deg, #fff5b8, #ffd166 60%, #b88a1a);
    border: 2.5px solid var(--carrot-stroke);
    border-radius: 14px;
    color: var(--carrot-stroke);
    cursor: pointer;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        inset 0 -3px 0 rgba(184, 138, 26, 0.25),
        0 4px 0 var(--carrot-stroke),
        0 7px 18px rgba(184, 138, 26, 0.4);
    transition: transform 0.08s ease;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.offline-modal__close:hover { transform: translateY(-1px); }
.offline-modal__close:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 1px 0 var(--carrot-stroke);
}
@media (max-width: 480px) {
    .offline-modal__content { padding: 22px 18px 16px; border-radius: 22px; }
    .offline-modal__title { font-size: 22px; }
    .offline-stat__value--gain { font-size: 24px; }
}

.game-dialog {
    position: fixed;
    inset: 0;
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.game-dialog.is-open { opacity: 1; visibility: visible; }
.game-dialog__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(255, 220, 130, 0.10) 0%, transparent 65%),
        linear-gradient(180deg, rgba(42, 26, 74, 0.78) 0%, rgba(74, 42, 110, 0.74) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.game-dialog__content {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, #fef8fc 0%, #ede0f0 60%, #d4c0e6 100%);
    border: 3px solid #5b4a78;
    border-radius: 22px;
    padding: 22px 22px 18px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 18px 48px rgba(45, 18, 85, 0.55);
    animation: gameDialogIn 0.25s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes gameDialogIn {
    from { opacity: 0; transform: translateY(20px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.game-dialog__title {
    font-size: 19px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.2px;
}
.game-dialog__message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    margin-bottom: 16px;
    text-align: center;
    font-weight: 600;
    word-wrap: break-word;
}
.game-dialog__input {
    width: 100%;
    padding: 11px 13px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(91, 74, 120, 0.25);
    border-radius: 11px;
    outline: none;
    margin-bottom: 14px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.game-dialog__input:focus {
    border-color: var(--magic);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(138, 77, 219, 0.15);
}
.game-dialog__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.game-dialog__actions .btn-action {
    flex: 1 1 auto;
    min-width: 110px;
}
@media (max-width: 480px) {
    .game-dialog__content { padding: 18px 16px 14px; border-radius: 18px; }
    .game-dialog__title { font-size: 17px; }
    .game-dialog__message { font-size: 13px; }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(255, 220, 130, 0.18) 0%, transparent 65%),
        linear-gradient(180deg, #2a1a4a 0%, #4a2a6e 45%, #6b3a82 80%, #8a4a8e 100%);
    transition: opacity 0.45s ease, visibility 0.45s ease;
}
.loading-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-spinner {
    width: 72px;
    height: 72px;
    animation: loadingSpinBob 2s ease-in-out infinite;
    filter: drop-shadow(0 8px 18px rgba(214, 80, 16, 0.4));
}
.loading-spinner svg { width: 100%; height: 100%; display: block; }
@keyframes loadingSpinBob {
    0%, 100% { transform: rotate(-8deg) translateY(0); }
    50%      { transform: rotate(8deg) translateY(-8px); }
}
.loading-text {
    font-family: 'Baloo 2', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff5b8;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.loading-dots {
    display: flex;
    gap: 8px;
}
.loading-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ffd166;
    box-shadow: 0 0 6px rgba(255, 209, 102, 0.6);
    animation: loadingDot 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes loadingDot {
    0%, 100% { transform: scale(0.6); opacity: 0.4; }
    50%      { transform: scale(1.1); opacity: 1; }
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-modal.is-open { display: flex; animation: authFadeIn 0.3s ease; }
@keyframes authFadeIn { from { opacity: 0; } to { opacity: 1; } }
.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(255, 220, 130, 0.12) 0%, transparent 65%),
        linear-gradient(180deg, rgba(42, 26, 74, 0.92) 0%, rgba(74, 42, 110, 0.90) 50%, rgba(107, 58, 130, 0.88) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.auth-modal__content {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, #fef8fc 0%, #ede0f0 60%, #d4c0e6 100%);
    border: 3px solid #5b4a78;
    border-radius: 28px;
    padding: 26px 26px 22px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        0 22px 60px rgba(45, 18, 85, 0.6);
    animation: authSlideUp 0.4s cubic-bezier(.34, 1.4, .64, 1);
    max-height: 92vh;
    overflow-y: auto;
}
@keyframes authSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.auth-hero {
    width: 110px;
    height: 110px;
    margin: -8px auto 4px;
    filter: drop-shadow(0 8px 18px rgba(214, 80, 16, 0.35));
    animation: heroBob 3s ease-in-out infinite;
}
.auth-hero svg { width: 100%; height: 100%; display: block; }
@keyframes heroBob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-6px) rotate(2deg); }
}

.auth-modal__header { text-align: center; margin-bottom: 18px; }
.auth-modal__title {
    font-size: 24px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}
.auth-modal__sub {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    line-height: 1.4;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    background: rgba(91, 74, 120, 0.1);
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1.5px solid rgba(91, 74, 120, 0.15);
}
.auth-tab {
    flex: 1;
    padding: 11px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.1s ease;
}
.auth-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active {
    background: linear-gradient(180deg, #fff, #fff5b8);
    color: var(--carrot-deep);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 3px 8px rgba(214, 80, 16, 0.20);
}
.auth-tab.is-active svg { color: var(--carrot-deep); }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
    animation: formSlideIn 0.25s ease;
}
@keyframes formSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-form[hidden] { display: none; }

.auth-field {
    position: relative;
    display: block;
}
.auth-field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: none;
    opacity: 0.7;
    z-index: 1;
}
.auth-field__icon svg { width: 100%; height: 100%; display: block; }
.auth-field:focus-within .auth-field__icon { opacity: 1; }

.auth-input {
    width: 100%;
    padding: 13px 14px 13px 42px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(91, 74, 120, 0.2);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.auth-input::placeholder { color: var(--ink-faint); font-weight: 500; }
.auth-input:focus {
    border-color: var(--magic);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(138, 77, 219, 0.15);
}

.auth-submit {
    width: 100%;
    margin-top: 6px;
    padding: 13px 16px;
    border: 2.5px solid;
    border-radius: 14px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.08s ease, box-shadow 0.1s ease;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.auth-submit svg { width: 16px; height: 16px; }

.auth-submit--login {
    background: linear-gradient(180deg, #fff5b8, #ffd166 60%, #b88a1a);
    border-color: var(--carrot-stroke);
    color: var(--carrot-stroke);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.7),
        inset 0 -3px 0 rgba(184, 138, 26, 0.25),
        0 4px 0 var(--carrot-stroke),
        0 7px 18px rgba(184, 138, 26, 0.35);
}
.auth-submit--login:hover { transform: translateY(-1px); }
.auth-submit--login:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        0 1px 0 var(--carrot-stroke),
        0 2px 6px rgba(184, 138, 26, 0.25);
}

.auth-submit--register {
    background: linear-gradient(180deg, #b8f08a, #66cc44 60%, #2a7a1f);
    border-color: #0a2a05;
    color: #fff;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        inset 0 -3px 0 rgba(26, 74, 16, 0.3),
        0 4px 0 #0a2a05,
        0 7px 18px rgba(42, 122, 31, 0.35);
}
.auth-submit--register:hover { transform: translateY(-1px); }
.auth-submit--register:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        0 1px 0 #0a2a05,
        0 2px 6px rgba(26, 74, 16, 0.2);
}

.auth-msg {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin-top: 14px;
    min-height: 18px;
    padding: 0 6px;
}
.auth-msg--ok   { color: #2a7a1f; }
.auth-msg--err  { color: #c84510; }
.auth-msg--info { color: var(--magic-deep); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 12px;
    color: var(--ink-faint);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(91, 74, 120, 0.3), transparent);
}

.auth-guest {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(91, 74, 120, 0.25);
    border-radius: 12px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}
.auth-guest svg { width: 14px; height: 14px; opacity: 0.6; }
.auth-guest:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--ink-soft);
    transform: translateY(-1px);
}
.auth-guest:active { transform: translateY(0); }

.auth-hint {
    font-size: 11.5px;
    color: var(--ink-soft);
    line-height: 1.5;
    margin-top: 10px;
    text-align: center;
    opacity: 0.85;
}

@media (max-width: 480px) {
    .auth-modal__content { padding: 22px 18px 18px; border-radius: 22px; }
    .auth-modal__title { font-size: 19px; }
    .auth-modal__sub  { font-size: 12.5px; }
    .auth-hero { width: 88px; height: 88px; }
    .auth-tab span { font-size: 13px; }
    .auth-input { font-size: 14px; padding: 12px 12px 12px 38px; }
    .auth-submit { font-size: 14px; padding: 12px 14px; }
}

.avatar-grid--modal {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    background: rgba(91, 74, 120, 0.08);
    border: 1.5px solid var(--panel-bord);
    border-radius: 11px;
    padding: 8px;
    margin-bottom: 12px;
    max-height: 200px;
    overflow-y: auto;
}
.avatar-grid--modal .avatar-pick {
    aspect-ratio: 1;
    padding: 3px;
    border-width: 2px;
}
@media (max-width: 480px) {
    .avatar-grid--modal { grid-template-columns: repeat(4, 1fr); }
}

.guest-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 14px;
    background: linear-gradient(180deg, #ffd166, #ff9c3a);
    color: #5a1700;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(214, 80, 16, 0.35);
    border-bottom: 2px solid #c84510;
    text-align: center;
    animation: guestBannerSlide 0.4s ease;
}
@keyframes guestBannerSlide {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.guest-banner__icon {
    font-size: 16px;
    color: #c84510;
}
.guest-banner__text {
    flex: 1 1 auto;
    min-width: 200px;
    line-height: 1.3;
}
.guest-banner__text strong { color: #c84510; }
.guest-banner__action {
    flex: 0 0 auto;
    padding: 6px 14px;
    background: #fff;
    border: 1.5px solid #5a1700;
    border-radius: 8px;
    color: #c84510;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease;
}
.guest-banner__action:hover { background: #fff5b8; }

body:has(.guest-banner) .layout {
    padding-top: 44px;
}
@media (max-width: 600px) {
    .guest-banner { font-size: 12px; padding: 6px 10px; }
    .guest-banner__action { padding: 5px 10px; font-size: 11px; }
    body:has(.guest-banner) .layout { padding-top: 56px; }
}

.hud-cell {
    cursor: help;
}
.hud-tooltip {
    position: fixed;
    top: 0; left: 0;
    z-index: 200;
    max-width: 280px;
    min-width: 200px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #fbf2fb 0%, #d8c4eb 100%);
    border: 2px solid #5b4a78;
    border-radius: 14px;
    box-shadow:
        0 6px 20px rgba(58, 38, 89, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.hud-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.hud-tooltip strong {
    display: block;
    font-family: 'Baloo 2', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: var(--magic-deep);
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}
.hud-tooltip span {
    display: block;
    font-family: 'Baloo 2', sans-serif;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ink);
    font-weight: 500;
}

.hud-tooltip.hud-tooltip--simple {
    min-width: 0;
    max-width: 220px;
    padding: 7px 11px;
}
.hud-tooltip__simple {
    display: block;
    font-family: 'Baloo 2', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
    white-space: normal;
    text-align: center;
}

.hud-tooltip::before,
.hud-tooltip::after {
    content: '';
    position: absolute;
    left: var(--arrow-x, 50%);
    transform: translateX(-50%);
    border: 8px solid transparent;
    pointer-events: none;
}

.hud-tooltip[data-arrow="up"]::before {
    top: -10px;
    border-bottom-color: #5b4a78;
}
.hud-tooltip[data-arrow="up"]::after {
    top: -7px;
    border-bottom-color: #fbf2fb;
}

.hud-tooltip[data-arrow="down"]::before {
    bottom: -10px;
    border-top-color: #5b4a78;
}
.hud-tooltip[data-arrow="down"]::after {
    bottom: -7px;
    border-top-color: #d8c4eb;
}

body.is-click-frenzy::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255, 220, 100, 0.55) 0%, rgba(255, 200, 60, 0.30) 45%, transparent 75%),
        radial-gradient(ellipse 60% 80% at 50% 90%, rgba(255, 180, 50, 0.40) 0%, transparent 70%),
        linear-gradient(180deg, rgba(255, 220, 120, 0.25) 0%, rgba(255, 180, 60, 0.20) 100%);
    animation: goldenPulse 1.6s ease-in-out infinite;
    will-change: opacity;
}
@keyframes goldenPulse {
    0%, 100% { opacity: 0.9; }
    50%      { opacity: 1; }
}

.golden-rain {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}
.rain-carrot {
    position: absolute;
    top: -60px;
    width: 30px;
    height: 50px;
    transform: scale(var(--scale, 1));
    animation-name: rainFall;
    animation-timing-function: cubic-bezier(0.4, 0.05, 0.7, 1);
    animation-fill-mode: forwards;
    will-change: transform;
    filter: drop-shadow(0 4px 8px rgba(255, 180, 60, 0.5));
}
.rain-carrot svg { width: 100%; height: 100%; display: block; }
@keyframes rainFall {
    0% {
        transform: translate(0, 0) rotate(var(--rot, 0deg)) scale(var(--scale, 1));
    }
    100% {
        transform: translate(var(--drift, 0px), 110vh) rotate(calc(var(--rot, 0deg) + 360deg)) scale(var(--scale, 1));
    }
}

@media (prefers-reduced-motion: reduce) {
    body.is-click-frenzy::before { animation: none; opacity: 0.95; }
    .rain-carrot { animation-duration: 1.5s !important; }
}

.panel,
.tabs-content,
.panel__list {
    scrollbar-width: thin;
    scrollbar-color: var(--magic) rgba(216, 196, 255, 0.25);
}
.panel::-webkit-scrollbar,
.tabs-content::-webkit-scrollbar,
.panel__list::-webkit-scrollbar { width: 12px; height: 12px; }
.panel::-webkit-scrollbar-track,
.tabs-content::-webkit-scrollbar-track,
.panel__list::-webkit-scrollbar-track {
    background: rgba(216, 196, 255, 0.22);
    border-radius: 8px;
    margin: 6px;
}
.panel::-webkit-scrollbar-thumb,
.tabs-content::-webkit-scrollbar-thumb,
.panel__list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--magic-light), var(--magic));
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.panel::-webkit-scrollbar-thumb:hover,
.tabs-content::-webkit-scrollbar-thumb:hover,
.panel__list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--magic), var(--magic-deep));
}

.panel--left,
.panel--left .panel__list { scrollbar-color: var(--carrot) rgba(255, 220, 200, 0.25); }
.panel--left::-webkit-scrollbar-track,
.panel--left .panel__list::-webkit-scrollbar-track { background: rgba(255, 220, 200, 0.22); }
.panel--left::-webkit-scrollbar-thumb,
.panel--left .panel__list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--carrot-light), var(--carrot));
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.notif-layer {
    position: absolute;
    top: 156px;
    left: 0;
    right: 0;
    bottom: auto;
    pointer-events: none;
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
}
@media (max-width: 720px) {
    .notif-layer { top: 232px; }
}

.event-timers {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    z-index: 7;
    pointer-events: none;
    flex-wrap: wrap;
    max-width: 92vw;
    max-width: 90%;
}
.event-timer {
    background: linear-gradient(180deg, #fff5b8 0%, #ffd966 60%, #b88a1a 100%);
    color: var(--ink);
    padding: 8px 14px 8px 10px;
    border-radius: 18px;
    border: 2.5px solid var(--gold-deep);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.65),
        inset 0 -3px 0 rgba(184, 138, 26, 0.25),
        0 4px 0 var(--gold-deep),
        0 6px 16px rgba(184, 138, 26, 0.4);
    font-weight: 800;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: timerBob 1.6s ease-in-out infinite;
    pointer-events: none;
    white-space: nowrap;
}
.event-timer__icon { width: 22px; height: 22px; display: inline-block; flex-shrink: 0; }
.event-timer__icon svg { width: 100%; height: 100%; display: block; }
.event-timer--clickable {
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, box-shadow 0.12s ease;
}
.event-timer--clickable:hover { transform: translateY(-2px); }
.event-timer--clickable:active { transform: translateY(1px) scale(0.96); }

.event-timer--wrinkler {
    background: linear-gradient(180deg, #b07cf5 0%, #7344c8 55%, #3d1a78 100%);
    color: #fff;
    border-color: #2d0f5a;
    padding: 7px 8px 7px 8px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.30),
        inset 0 -3px 0 rgba(45, 18, 85, 0.45),
        0 4px 0 #2d0f5a,
        0 6px 16px rgba(58, 24, 110, 0.55);
    animation: wrinklerPulse 1.6s ease-in-out infinite;
}
.event-timer--wrinkler .event-timer__icon-stack {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(20, 5, 40, 0.45);
    border-radius: 10px;
    padding: 2px;
}
.event-timer--wrinkler .event-timer__icon { width: 24px; height: 24px; }
.event-timer--wrinkler .event-timer__count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: linear-gradient(180deg, #ff8a3d, #d6500a);
    color: #fff;
    border: 2px solid #5a1700;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(90, 23, 0, 0.5);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}
.event-timer--wrinkler .event-timer__main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.05;
    gap: 2px;
    margin: 0 2px 0 4px;
}
.event-timer--wrinkler .event-timer__title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #f0e0ff;
    opacity: 0.85;
}
.event-timer--wrinkler .event-timer__effect {
    font-size: 14px;
    font-weight: 800;
    color: #fff5b8;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.event-timer--wrinkler .event-timer__cta {
    background: linear-gradient(180deg, #fff5b8, #ffb84a);
    color: #5a1700;
    padding: 4px 10px;
    border-radius: 10px;
    border: 2px solid #5e3f0d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #5e3f0d;
    flex-shrink: 0;
}

@keyframes wrinklerPulse {
    0%, 100% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.30), inset 0 -3px 0 rgba(45, 18, 85, 0.45), 0 4px 0 #2d0f5a, 0 6px 16px rgba(58, 24, 110, 0.55); }
    50%      { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.40), inset 0 -3px 0 rgba(45, 18, 85, 0.55), 0 4px 0 #2d0f5a, 0 6px 22px rgba(176, 124, 245, 0.85), 0 0 0 4px rgba(176, 124, 245, 0.35); }
}

@media (max-width: 920px) {
    .event-timers {
        bottom: calc(86px + env(safe-area-inset-bottom, 0px));
        gap: 6px;
    }
    .event-timer {
        font-size: 12px;
        padding: 6px 12px 6px 8px;
    }
}
.event-timer__mult { color: var(--gold-deep); font-size: 16px; }
.event-timer__time { color: var(--ink-soft); font-size: 12px; font-weight: 700; }

.event-timer--magic {
    background: linear-gradient(180deg, #d8c4ff 0%, #b07cf5 60%, #5b2db8 100%);
    color: #fff;
    border-color: var(--magic-stroke);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        inset 0 -3px 0 rgba(45, 18, 85, 0.25),
        0 4px 0 var(--magic-stroke),
        0 6px 16px rgba(91, 45, 184, 0.4);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.event-timer--magic .event-timer__mult { color: #fff; }
.event-timer--magic .event-timer__time { color: rgba(255, 255, 255, 0.85); }

.event-timer--leaf {
    background: linear-gradient(180deg, #b8f08a 0%, #66cc44 60%, #1a4a10 100%);
    color: #fff;
    border-color: var(--leaf-stroke);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        inset 0 -3px 0 rgba(26, 74, 16, 0.25),
        0 4px 0 var(--leaf-stroke),
        0 6px 16px rgba(42, 122, 31, 0.4);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.event-timer--leaf .event-timer__mult { color: #fff; }
.event-timer--leaf .event-timer__time { color: rgba(255, 255, 255, 0.85); }

@keyframes timerBob {
    0%, 100% { transform: translateY(0)    rotate(-0.5deg); }
    50%      { transform: translateY(-3px) rotate(0.5deg); }
}

@media (max-width: 920px) {
    .event-timers { bottom: 90px; }
}

.notif {
    background: linear-gradient(180deg, #fff8d8 0%, #ffd166 55%, #d68a14 100%);
    color: var(--ink);
    padding: 12px 22px 12px 14px;
    border-radius: 22px;
    border: 3px solid var(--gold-deep);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.75),
        inset 0 -3px 0 rgba(184, 138, 26, 0.35),
        0 5px 0 var(--gold-deep),
        0 9px 24px rgba(184, 138, 26, 0.55);
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    max-width: 380px;
    animation: notifIn 3.4s cubic-bezier(.34, 1.4, .64, 1) forwards;
    will-change: transform, opacity;
    pointer-events: none;
    position: relative;
}

.notif::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 28px;
    background: radial-gradient(ellipse at center, rgba(255, 215, 100, 0.45), transparent 65%);
    z-index: -1;
    filter: blur(4px);
}
.notif__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(180deg, #fff8d8, #ffd166);
    border: 2.4px solid #5e3f0d;
    border-radius: 12px;
    padding: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 4px rgba(94, 63, 13, 0.3);
}
.notif__icon svg { width: 100%; height: 100%; display: block; }
.notif__title {
    font-size: 11px;
    color: #5e3f0d;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    display: block;
    line-height: 1;
    font-weight: 800;
    margin-bottom: 3px;
}
.notif__body  {
    font-size: 15px;
    line-height: 1.2;
    color: var(--ink);
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

@keyframes notifIn {
    0%   { opacity: 0; transform: translateY(-30px) scale(0.7); }
    8%   { opacity: 1; transform: translateY(0)     scale(1.10); }
    14%  { transform: translateY(0) scale(0.97); }
    20%  { transform: translateY(0) scale(1.02); }
    28%  { transform: translateY(0) scale(1); }
    78%  { opacity: 1; transform: translateY(0)     scale(1); }
    100% { opacity: 0; transform: translateY(-24px) scale(0.92); }
}

.notif--gold {
    animation: notifGold 6.4s cubic-bezier(.34, 1.4, .64, 1) forwards;
    border-width: 4px;
    min-width: 280px;
    max-width: 440px;
    padding: 14px 26px 14px 16px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.85),
        inset 0 -4px 0 rgba(184, 138, 26, 0.45),
        0 6px 0 var(--gold-deep),
        0 12px 32px rgba(255, 215, 100, 0.85),
        0 0 0 4px rgba(255, 245, 184, 0.55);
}
.notif--gold .notif__title { font-size: 13px; color: #5e3f0d; }
.notif--gold .notif__body  { font-size: 17px; }
.notif--gold .notif__icon  {
    width: 48px;
    height: 48px;
    animation: goldIconPulse 0.9s ease-in-out infinite;
}
.notif--gold::before {
    inset: -14px;
    background: radial-gradient(ellipse at center, rgba(255, 215, 100, 0.85), transparent 65%);
    filter: blur(8px);
    animation: goldGlow 1.4s ease-in-out infinite;
}
@keyframes notifGold {
    0%   { opacity: 0; transform: translateY(-40px) scale(0.6) rotate(-4deg); }
    6%   { opacity: 1; transform: translateY(0)     scale(1.18) rotate(2deg); }
    12%  { transform: translateY(0) scale(0.95) rotate(-1deg); }
    18%  { transform: translateY(0) scale(1.05) rotate(0); }
    25%  { transform: translateY(0) scale(1) rotate(0); }
    88%  { opacity: 1; transform: translateY(0)     scale(1); }
    100% { opacity: 0; transform: translateY(-24px) scale(0.92); }
}
@keyframes goldIconPulse {
    0%, 100% { transform: scale(1)    rotate(-3deg); }
    50%      { transform: scale(1.18) rotate(3deg); }
}
@keyframes goldGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

.notif--achievement {
    background: linear-gradient(180deg, #d8c4ff 0%, #b07cf5 50%, #5b2db8 100%);
    color: #fff;
    border-color: #2d1255;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.50),
        inset 0 -3px 0 rgba(45, 18, 85, 0.50),
        0 5px 0 #2d1255,
        0 10px 28px rgba(176, 124, 245, 0.65),
        0 0 0 3px rgba(255, 245, 184, 0.40);
    animation: notifAch 4.5s cubic-bezier(.34, 1.4, .64, 1) forwards;
}
.notif--achievement::before {
    background: radial-gradient(ellipse at center, rgba(216, 196, 255, 0.65), transparent 60%);
    inset: -10px;
    filter: blur(6px);
    animation: achGlow 1.6s ease-in-out infinite;
}
.notif--achievement .notif__icon {
    background: linear-gradient(180deg, #fff5b8, #ffd166);
    border-color: #5e3f0d;
    animation: achIconBounce 1.2s ease-in-out infinite;
}
.notif--achievement .notif__title {
    color: #fff5b8;
    text-shadow: 0 1px 0 rgba(45, 18, 85, 0.55);
}
.notif--achievement .notif__body {
    color: #fff;
    text-shadow: 0 1px 0 rgba(45, 18, 85, 0.45);
}
.notif__sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.notif__sparkles span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #fff8d8 0%, #ffd700 60%, transparent 100%);
    border-radius: 50%;
    animation: sparkleTwinkle 1.4s ease-in-out infinite;
}
.notif__sparkles span:nth-child(1) { top: 10%;  left: 8%;   animation-delay: 0s; }
.notif__sparkles span:nth-child(2) { top: 70%;  left: 14%;  animation-delay: -0.4s; }
.notif__sparkles span:nth-child(3) { top: 18%;  right: 12%; animation-delay: -0.8s; }
.notif__sparkles span:nth-child(4) { bottom: 14%; right: 8%; animation-delay: -1.1s; }

@keyframes notifAch {
    0%   { opacity: 0; transform: translateY(-30px) scale(0.7); }
    8%   { opacity: 1; transform: translateY(0)    scale(1.10); }
    16%  { transform: translateY(0) scale(0.97); }
    22%  { transform: translateY(0) scale(1.02); }
    28%  { transform: translateY(0) scale(1); }
    85%  { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-18px) scale(0.95); }
}
@keyframes achGlow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%      { opacity: 0.95; transform: scale(1.06); }
}
@keyframes achIconBounce {
    0%, 100% { transform: rotate(-4deg); }
    50%      { transform: rotate(4deg); }
}

.tab {
    position: relative;
    overflow: visible;
}
.tab.has-available {
    box-shadow: 0 0 0 2px rgba(214, 80, 16, 0.3), 0 2px 6px rgba(214, 80, 16, 0.2);
}
.tab-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ff8a3d, var(--carrot-deep));
    color: #fff;
    border: 2px solid #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(214, 80, 16, 0.35);
    animation: badgeBob 1.5s ease-in-out infinite;
    z-index: 2;
}
@keyframes badgeBob {
    0%, 100% { transform: scale(1) translateY(0); }
    50%      { transform: scale(1.12) translateY(-1px); }
}

.bld-card { position: relative; }
.bld-dot { display: none !important; }
.bld-card.can-afford {
    background:
        linear-gradient(180deg, rgba(255, 235, 200, 0.85) 0%, rgba(255, 220, 170, 0.7) 100%);
    border-color: rgba(255, 138, 61, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 0 0 1px rgba(255, 138, 61, 0.18),
        0 4px 14px rgba(214, 80, 16, 0.18),
        0 0 0 1px rgba(255, 175, 100, 0.15);
}
.bld-card.can-afford .bld-name { color: var(--carrot-deep); }
@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(58, 38, 89, 0.4);
    z-index: 90;
}
.mobile-overlay.is-active { display: block; }

.mobile-toggles { display: none; }
.mobile-toggle { display: none; }

.mobile-nav { display: none; }

@media (max-width: 920px) {
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
        gap: 8px;
        z-index: 100;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(244, 232, 252, 0.95) 100%);
        border-top: 1.5px solid rgba(176, 124, 245, 0.35);
        box-shadow: 0 -8px 24px rgba(58, 38, 89, 0.18);
        align-items: center;
    }
    .mobile-nav-btn {
        position: relative;
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        border: none;
        background: transparent;
        cursor: pointer;
        font-family: var(--font);
        font-weight: 800;
        color: var(--ink-soft);
        transition: color 0.18s ease, background 0.18s ease, transform 0.1s ease;
        border-radius: 14px;
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }
    .mobile-nav-btn:active { transform: scale(0.94); }
    .mobile-nav-btn__icon {
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: transform 0.2s cubic-bezier(.34, 1.4, .64, 1);
    }
    .mobile-nav-btn__icon svg {
        width: 100%;
        height: 100%;
        display: block;
        filter: drop-shadow(0 1px 1px rgba(58, 38, 89, 0.18));
    }
    .mobile-nav-btn__label {
        font-size: 10px;
        line-height: 1;
        letter-spacing: 0.3px;
    }
    .mobile-nav-btn--imperium.is-active {
        color: var(--carrot-deep);
        background: linear-gradient(180deg, rgba(255, 240, 220, 0.85), rgba(252, 220, 180, 0.7));
        box-shadow: inset 0 0 0 1.5px rgba(214, 80, 16, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    }
    .mobile-nav-btn--imperium.is-active .mobile-nav-btn__icon { transform: translateY(-2px) scale(1.08); }
    .mobile-nav-btn--treasure.is-active {
        color: var(--magic-deep);
        background: linear-gradient(180deg, rgba(248, 240, 255, 0.85), rgba(216, 196, 255, 0.7));
        box-shadow: inset 0 0 0 1.5px rgba(91, 45, 184, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    }
    .mobile-nav-btn--treasure.is-active .mobile-nav-btn__icon { transform: translateY(-2px) scale(1.08); }
    .mobile-nav-btn--home {
        flex: 0.85;
    }
    .mobile-nav-btn--home.is-active {
        color: var(--leaf-deep);
        background: linear-gradient(180deg, rgba(232, 247, 224, 0.85), rgba(196, 232, 168, 0.7));
        box-shadow: inset 0 0 0 1.5px rgba(95, 196, 66, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    }
    .mobile-nav-btn__badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 22px);
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: linear-gradient(180deg, #ff8a3d, var(--carrot-deep));
        color: #fff;
        border: 2px solid #fff;
        font-family: var(--font);
        font-size: 10px;
        font-weight: 800;
        line-height: 14px;
        text-align: center;
        box-shadow: 0 2px 5px rgba(214, 80, 16, 0.4);
        animation: badgeBob 1.5s ease-in-out infinite;
        pointer-events: none;
        display: none;
        z-index: 1;
    }
    .mobile-nav-btn__badge.is-visible { display: inline-block; }
}

@media (max-width: 1180px) {
    .layout { grid-template-columns: 280px 1fr 320px; }
}

@media (max-width: 920px), (hover: none) {
    .bg-shooting { display: none; }
    .cloud { animation-duration: 180s !important; }
    .cloud--2, .cloud--4, .cloud--6, .cloud--8, .cloud--10, .cloud--12, .cloud--14, .cloud--16, .cloud--18, .cloud--20, .cloud--22, .cloud--24, .cloud--26, .cloud--28, .cloud--30 { display: none; }
    .hud-wrap { animation: none; }
    .stage__platform::before { animation: none; opacity: 0.7; }
    .carrot-shadow { animation: none; }
    .panel__star { animation: none; }
    .brand__letter { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 920px) {
    .layout { grid-template-columns: 1fr; }
    .brand-header { padding: 8px 14px 4px; }

    .panel {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        max-width: none;
        height: 78svh;
        max-height: calc(100svh - 64px - 70px - env(safe-area-inset-bottom, 0px));
        z-index: 95;
        transition: transform 0.34s cubic-bezier(.22, 1.0, .36, 1), opacity 0.22s ease;
        border-radius: 22px 22px 0 0;
        padding: 12px 14px 18px;
        box-shadow: 0 -8px 32px rgba(58, 38, 89, 0.32);
        background: linear-gradient(180deg, rgba(252, 246, 255, 0.97) 0%, rgba(232, 216, 250, 0.96) 100%);
        border: 1px solid rgba(255, 255, 255, 0.7);
        border-bottom: none;
        transform: translateY(105%);
        opacity: 0;
        pointer-events: none;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        display: block;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
    .panel.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .panel--left,
    .panel--right { padding: 12px 14px 18px; }

    .panel::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 44px;
        height: 4px;
        border-radius: 2px;
        background: rgba(91, 45, 184, 0.25);
        pointer-events: none;
        z-index: 5;
    }

    .panel--right .treasure-shell {
        flex-direction: column;
        gap: 0;
        margin-top: 14px;
        pointer-events: auto;
        flex: 1;
        min-height: 0;
    }
    .panel--right .treasure-sidebar { display: none; }

    .panel--right .treasure-content {
        position: relative;
        top: auto;
        bottom: auto;
        right: auto;
        left: auto;
        width: 100%;
        height: auto;
        transform: none;
        opacity: 1;
        pointer-events: auto;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        z-index: 1;
        overflow: visible;
        display: block;
    }
    .panel--right .treasure-content .tabs-content {
        flex: none;
        height: auto;
        overflow: visible;
        padding: 6px 0 16px;
        min-height: 0;
    }
    .panel--right .treasure-shell {
        display: block;
        margin-top: 14px;
    }
    .panel--left .panel__list {
        flex: none;
        overflow: visible;
        padding-top: 4px;
        padding-bottom: 4px;
        justify-content: flex-start;
    }
    .panel--right .treasure-content__head {
        padding: 4px 6px 8px;
        border-bottom: none;
        background: transparent;
    }
    .panel--right .treasure-content__close { display: none; }

    .panel--left .empire-head { display: none; }

    .stage {
        padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    }
    .hud-wrap { padding: 4px 8px; }
    .stage__platform { min-height: 280px; }

    .mobile-overlay {
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 600px) {
    .brand { font-size: 22px; letter-spacing: 0.3px; }
    .stage__platform { min-height: 280px; }
    .carrot-svg { width: 200px; height: 320px; }
    .panel--left, .panel--right { padding: 10px 12px 16px; }
    .panel__title { font-size: 18px; }
    .bld-card { padding: 8px 10px; gap: 10px; }
    .bld-icon { width: 48px; height: 48px; padding: 4px; border-radius: 12px; }
    .bld-name { font-size: 14px; }
    .bld-count { font-size: 13px; padding: 2px 9px; min-width: 36px; }
    .bld-cps { font-size: 11.5px; }
    .bld-stat__val--total { font-size: 12.5px; }
    .bld-cost { font-size: 13px; }
    .bld-cost__icon { width: 16px; height: 16px; }
    .bld-buy { padding: 7px 16px; font-size: 13px; min-width: 64px; }
    .upg-buy { padding: 5px 11px; font-size: 11px; }
    .upg-card { padding: 8px 10px; gap: 8px; }
    .upg-name { font-size: 12px; }
    .upg-desc { font-size: 10px; }
}

@media (max-width: 480px) {
    .brand { font-size: 18px; }
    .brand-bak { font-size: 24px; }
    .brand-header { padding: 4px 10px 2px; gap: 8px; }
    .hud-wrap { padding: 2px 6px 0; }
    .stage { padding: 2px 8px calc(72px + env(safe-area-inset-bottom, 0px)); }
    .stage__platform { min-height: 240px; }
    .carrot-svg { width: 168px; height: 268px; }
    .carrot-shadow { margin-top: 122px; width: 110px; height: 12px; }
    .mobile-nav { height: calc(60px + env(safe-area-inset-bottom, 0px)); padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px)); }
    .mobile-nav-btn__icon { width: 24px; height: 24px; }
    .mobile-nav-btn__label { font-size: 9.5px; }
    .panel--right .ts-icon { width: 46px; height: 46px; }
}

@media (max-width: 430px) {
    .stage__platform { min-height: 220px; }
    .carrot-svg { width: 156px; height: 250px; }
    .carrot-shadow { margin-top: 112px; width: 100px; height: 11px; }
    .stage { padding: 2px 6px calc(68px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-height: 720px) {
    .stage__platform { min-height: 200px; }
}

@media (max-height: 640px) {
    .carrot-svg { width: 140px; height: 224px; }
    .carrot-shadow { margin-top: 100px; width: 90px; height: 10px; }
    .stage__platform { min-height: 180px; }
    .mobile-nav { height: calc(56px + env(safe-area-inset-bottom, 0px)); }
    .mobile-nav-btn__icon { width: 22px; height: 22px; }
}
