/* Cosmo's Number Blast! — deep-space arcade look on the GameKit palette. */

body {
    background: linear-gradient(180deg, #1B1340 0%, #2E1E63 100%);
    color: #FFF7E6;
    overflow: hidden;
    position: fixed;
    inset: 0;
}

svg text { font-family: var(--gk-font); }

/* ═════════════════════ layered parallax scene ═════════════════════ */

#scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.pxlayer { position: absolute; inset: -4%; }

#l0-stars { animation: drift-x 90s ease-in-out infinite alternate; }
#l1-nebula { animation: drift-x 60s ease-in-out infinite alternate-reverse; }
#l2-landmarks { animation: drift-x 30s ease-in-out infinite alternate; inset: 0; }

@keyframes drift-x {
    from { transform: translateX(-0.9%); }
    to   { transform: translateX(0.9%); }
}

.tw {
    position: absolute;
    border-radius: 50%;
    background: #FFF7E6;
    animation: gk-twinkle 2.4s ease-in-out infinite;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(34px);
    opacity: 0.55;
}
.b1 { width: 46vw; height: 34vh; left: -6vw; top: 6vh;  background: radial-gradient(circle, rgba(255,123,172,0.5), transparent 70%); }
.b2 { width: 52vw; height: 40vh; right: -8vw; top: 30vh; background: radial-gradient(circle, rgba(181,101,216,0.45), transparent 70%); }
.b3 { width: 60vw; height: 36vh; left: 22vw; bottom: -6vh; background: radial-gradient(circle, rgba(124,181,24,0.35), transparent 70%); }
body.zone-1 .b3 { background: radial-gradient(circle, rgba(0,180,216,0.4), transparent 70%); }
body.zone-2 .b3 { background: radial-gradient(circle, rgba(252,191,73,0.32), transparent 70%); }

#zone-wash { position: absolute; inset: 0; transition: background 1s; }
body.zone-0 #zone-wash { background: linear-gradient(180deg, transparent 55%, rgba(124,181,24,0.16)); }
body.zone-1 #zone-wash { background: linear-gradient(180deg, transparent 50%, rgba(0,100,170,0.24)); }
body.zone-2 #zone-wash { background: linear-gradient(180deg, transparent 50%, rgba(130,60,170,0.26)); }

#l2-landmarks svg {
    position: absolute;
    left: -2%;
    right: -2%;
    bottom: 0;
    width: 104%;
    height: 36vh;
}

.lm-wisp { animation: wisp-breathe 7s ease-in-out infinite; }
.lm-wisp.w2 { animation-delay: 3s; }
@keyframes wisp-breathe { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }

.ferris {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: ferris-spin 44s linear infinite;
}
@keyframes ferris-spin { to { transform: rotate(360deg); } }

.comet-fish { animation: fish-swim 13s ease-in-out infinite alternate; }
@keyframes fish-swim {
    from { transform: translateX(0); }
    to   { transform: translateX(90px) translateY(-14px); }
}

.bulb { animation: gk-twinkle 2.2s ease-in-out infinite; }
.lm-lights .b2 { animation-delay: 0.4s; } .lm-lights .b3 { animation-delay: 0.8s; }
.lm-lights .b4 { animation-delay: 1.2s; } .lm-lights .b5 { animation-delay: 1.6s; }
.lm-lights .b6 { animation-delay: 2.0s; }

.mote {
    position: absolute;
    bottom: -12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #FFF7E6;
    box-shadow: 0 0 8px rgba(255,247,230,0.9);
    opacity: 0;
    animation: mote-rise 12s linear infinite;
}
@keyframes mote-rise {
    0%   { transform: translateY(0); opacity: 0; }
    12%  { opacity: 0.7; }
    88%  { opacity: 0.5; }
    100% { transform: translateY(-108vh); opacity: 0; }
}

/* warp-time layer treatments */
body.warping .pxlayer   { transition: transform 2.4s ease-in, filter 2.4s; transform: scale(1.12); filter: blur(1.5px); }
body.launching .pxlayer { transition: transform 2.6s ease-in, filter 2.6s; transform: scale(2.3); filter: blur(6px); }
body.arriving .pxlayer  { animation: arrive-settle 0.9s ease-out; }
@keyframes arrive-settle {
    0%   { transform: scale(1.18) translateY(-16px); opacity: 0.5; }
    62%  { transform: scale(0.985) translateY(4px); opacity: 1; }
    100% { transform: none; }
}
body.arriving .lm-piece { animation: lm-boing 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) backwards; transform-box: fill-box; transform-origin: 50% 100%; }
body.arriving .lm-piece:nth-of-type(2) { animation-delay: 0.12s; }
body.arriving .lm-piece:nth-of-type(3) { animation-delay: 0.24s; }
body.arriving .lm-piece:nth-of-type(4) { animation-delay: 0.36s; }
body.arriving .lm-piece:nth-of-type(5) { animation-delay: 0.46s; }
@keyframes lm-boing {
    0%  { transform: scale(0.2) translateY(30px); }
    70% { transform: scale(1.12); }
    100% { transform: none; }
}

body.quake #scene, body.quake .screen { animation: quake 0.32s linear; }
@keyframes quake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-6px, 5px); }
    40% { transform: translate(6px, -4px); }
    60% { transform: translate(-5px, -5px); }
    80% { transform: translate(5px, 4px); }
}
body.warp-intro #scene { animation: micro-shake 0.15s linear infinite; }
@keyframes micro-shake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(1.6px, -1.4px); }
    75% { transform: translate(-1.6px, 1.4px); }
}

/* ═════════════════════ screens ═════════════════════ */

.screen { position: absolute; inset: 0; z-index: 10; }

/* ── TITLE ── */

#screen-title {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#title-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; }

#wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.wm-top {
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    color: #FFB3D0;
    letter-spacing: 2px;
}
.wm-main {
    font-size: clamp(2.7rem, 8vw, 4.6rem);
    color: #FFF7E6;
    text-shadow: 0 4px 0 #B565D8, 0 9px 0 rgba(60, 30, 110, 0.55), 0 0 34px rgba(255, 123, 172, 0.55);
}
#tagline { font-size: clamp(1rem, 2.6vw, 1.3rem); color: #CFE6FF; margin: 2px 0 6px; }
#tagline strong { color: #FCBF49; }

#title-row { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 6vw, 70px); }

#title-cosmo { width: clamp(160px, 24vmin, 220px); aspect-ratio: 200 / 230; }

.round-big {
    width: clamp(150px, 21vmin, 185px);
    height: clamp(150px, 21vmin, 185px);
    border-radius: 50%;
    border: 6px solid #A2D149;
    background: radial-gradient(circle at 35% 28%, #B8E066, #7CB518 60%, #5E8C12);
    color: #FFFFFF;
    font-family: inherit;
    font-size: clamp(1.6rem, 3.4vw, 2rem);
    font-weight: bold;
    line-height: 1.1;
    cursor: pointer;
    box-shadow: 0 10px 34px rgba(124, 181, 24, 0.55), 0 0 0 10px rgba(124, 181, 24, 0.18);
    transition: transform 0.2s;
}
.round-big:hover { transform: scale(1.05); }
.round-big:active { transform: scale(0.94); }
.round-big .btn-inner { display: inline-block; animation: heartbeat 1.3s ease-in-out infinite; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    12% { transform: scale(1.08); }
    24% { transform: scale(1); }
}

#title-ship { width: min(46vw, 320px); animation: ship-hover 3.4s ease-in-out infinite; }
@keyframes ship-hover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}
#title-stars { min-height: 32px; font-size: 1.35rem; letter-spacing: 3px; }

/* ── PICKER ── */

#screen-picker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 3vh, 30px);
    padding: 12px;
}

#picker-head { display: flex; align-items: center; gap: 16px; }
#picker-cosmo { width: clamp(84px, 11vmin, 116px); aspect-ratio: 200 / 230; }
#picker-title {
    font-size: clamp(1.6rem, 4.4vw, 2.4rem);
    color: #FFF7E6;
    text-shadow: 0 3px 0 #B565D8, 0 0 24px rgba(255, 123, 172, 0.5);
}

#planets {
    display: flex;
    gap: clamp(12px, 2.6vw, 34px);
    justify-content: center;
    align-items: stretch;
}

.planet-card {
    position: relative;
    width: clamp(196px, 24vw, 252px);
    padding: 20px 12px 16px;
    border-radius: 28px;
    border: 3px solid rgba(255, 247, 230, 0.28);
    background: rgba(255, 247, 230, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.planet-card:hover:not(.locked) { transform: translateY(-5px) scale(1.03); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); }
.planet-card:active { transform: scale(0.96); }

.p-globe { width: clamp(108px, 13vw, 148px); aspect-ratio: 1; }
.p-globe svg { width: 100%; height: 100%; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4)); }
.p-name { color: #FFF7E6; font-size: clamp(1.05rem, 2.2vw, 1.3rem); font-weight: bold; }
.p-stars { font-size: 1.25rem; }
.pstar { filter: grayscale(1) opacity(0.3); }
.pstar.lit { filter: none; }

.locked .p-globe, .locked .p-name, .locked .p-stars { opacity: 0.35; filter: grayscale(0.7); }
.p-ring { display: none; }
.locked .p-ring {
    display: block;
    position: absolute;
    inset: 6px;
    border-radius: 24px;
    border: 3px dashed rgba(214, 163, 236, 0.75);
    box-shadow: inset 0 0 26px rgba(181, 101, 216, 0.4);
    animation: ring-shimmer 2.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ring-shimmer {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}
.p-lock { position: absolute; top: 10px; right: 12px; font-size: 1.5rem; }

.planet-card.boop { animation: boop-wiggle 0.5s ease; }
@keyframes boop-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-3deg) scale(0.97); }
    75% { transform: rotate(3deg) scale(0.97); }
}
.planet-card.just-unlocked {
    animation: unlock-pop 0.9s cubic-bezier(0.2, 1.5, 0.4, 1);
    box-shadow: 0 0 44px rgba(252, 191, 73, 0.55);
    border-color: #FCBF49;
}
@keyframes unlock-pop {
    0% { transform: scale(0.6) rotate(-6deg); }
    65% { transform: scale(1.1) rotate(2deg); }
    100% { transform: none; }
}

/* ═════════════════════ GUNNER DECK ═════════════════════ */

#playfield {
    position: absolute;
    left: 0; right: 0; top: 0;
    bottom: 150px;
    overflow: hidden;
}

/* ── targets ── */

.target {
    position: absolute;
    left: 0; top: 0;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    will-change: transform;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
}
.target svg { width: 100%; height: 100%; overflow: visible; display: block; }

.t-art {
    display: block;
    width: 100%;
    height: 100%;
    animation: t-sway 4.2s ease-in-out infinite;
    animation-delay: var(--swd, 0s);
    filter: drop-shadow(0 8px 14px rgba(10, 5, 35, 0.45));
}
.target.spawn .t-art {
    animation: t-spawn 0.45s cubic-bezier(0.2, 1.5, 0.4, 1) backwards, t-sway 4.2s ease-in-out infinite;
    animation-delay: 0s, var(--swd, 0s);
}
@keyframes t-spawn {
    from { transform: scale(0) rotate(-14deg); }
    to   { transform: none; }
}
@keyframes t-sway {
    0%, 100% { transform: rotate(-2.4deg); }
    50% { transform: rotate(2.4deg); }
}

.tent {
    transform-box: fill-box;
    transform-origin: 50% 0%;
    animation: tent-sway 2.5s ease-in-out infinite;
}
.tn2 { animation-delay: 0.3s; } .tn3 { animation-delay: 0.6s; } .tn4 { animation-delay: 0.9s; }
@keyframes tent-sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.cr-orbit {
    transform-box: view-box;
    transform-origin: 50% 55%;
    animation: cr-orbit 6s linear infinite;
}
@keyframes cr-orbit { to { transform: rotate(360deg); } }
.cr-sign { filter: drop-shadow(0 0 8px rgba(252, 191, 73, 0.8)); }

.g-eyes-happy { display: none; }
.target.giggle .g-eyes-happy { display: inline; }
.target.giggle .g-eyes-open { display: none; }
.target.giggle .t-art { animation: t-giggle 0.85s ease; }
@keyframes t-giggle {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(-6deg); }
    30% { transform: rotate(6deg); }
    45% { transform: rotate(-6deg); }
    60% { transform: rotate(6deg); }
    80% { transform: rotate(-3deg); }
}
.target.giggle .g-blush { animation: blush-flash 0.85s ease; }
@keyframes blush-flash {
    0%, 100% { opacity: 0.7; }
    40% { opacity: 1; transform: scale(1.5); transform-box: fill-box; transform-origin: center; }
}

.target.squash .t-art { animation: t-squash 0.14s ease forwards; }
@keyframes t-squash { to { transform: scale(1.16, 0.72); } }

.target.burst { pointer-events: none; }
.target.burst .t-art { animation: t-burst 0.3s ease forwards; }
@keyframes t-burst {
    0% { transform: scale(1.05, 0.8); opacity: 1; }
    45% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.1); opacity: 0; }
}

.target.flee { pointer-events: none; animation: t-flee 1s ease-in forwards; }
@keyframes t-flee { to { transform: translateY(120vh) rotate(24deg); opacity: 0; } }

.target.pulse-once svg { animation: soft-pulse 0.9s ease; }
@keyframes soft-pulse {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.1); filter: drop-shadow(0 0 16px rgba(255, 247, 230, 0.9)); }
}

.target.hint-glow svg { animation: hint-pulse 2s ease-in-out infinite; }
@keyframes hint-pulse {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 18px #FCBF49); }
}
.target.hint-big svg { animation: hint-gold 1.2s ease-in-out infinite; }
@keyframes hint-gold {
    0%, 100% { transform: scale(1.15); filter: drop-shadow(0 0 10px #FCBF49); }
    50% { transform: scale(1.24); filter: drop-shadow(0 0 26px #FFD700); }
}

.hint-arrow {
    position: absolute;
    left: 50%;
    top: -44px;
    transform: translateX(-50%);
    font-size: 38px;
    color: #FCBF49;
    text-shadow: 0 0 14px #FFD700, 0 0 4px #FFF7E6;
    animation: arrow-bob 0.6s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes arrow-bob {
    from { transform: translateX(-50%) translateY(0); }
    to   { transform: translateX(-50%) translateY(10px); }
}

/* ── ship rail ── */

#ship-rail {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 150px;
    z-index: 20;
    transition: transform 0.9s ease;
}
body.warp-intro #ship-rail { transform: translateY(-14px); }

#rail-hull {
    position: absolute;
    left: -12px; right: -12px;
    top: 30px; bottom: -80px;
    background: linear-gradient(180deg, #3E4668, #2A3050 70%);
    border-radius: 46px 46px 0 0;
    border-top: 4px solid #59638C;
    box-shadow: 0 -10px 40px rgba(5, 2, 20, 0.55);
}
#rail-stripe {
    position: absolute;
    left: 4%; right: 4%;
    top: 12px;
    height: 13px;
    border-radius: 7px;
    background: linear-gradient(90deg, #E63946, #F77F00, #FCBF49, #7CB518, #00B4D8, #B565D8);
    opacity: 0.95;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.25);
}
#rail-rivets {
    position: absolute;
    left: 5%; right: 5%;
    top: 34px;
    height: 12px;
    background-image: radial-gradient(circle, #8FA0CF 2.4px, transparent 3px);
    background-size: 52px 12px;
    opacity: 0.6;
}
.eng {
    position: absolute;
    bottom: -30px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(252, 191, 73, 0.9), rgba(247, 127, 0, 0.35) 55%, transparent 72%);
    filter: blur(5px);
    opacity: 0.3;
}
.eng.e1 { left: 26%; } .eng.e2 { right: 26%; }
body.warp-intro .eng, body.warping .eng { animation: eng-pulse 0.5s ease-in-out infinite alternate; }
@keyframes eng-pulse {
    from { opacity: 0.5; transform: scale(1); }
    to   { opacity: 1; transform: scale(1.35); }
}

/* cockpit + Cosmo */

#cockpit {
    position: absolute;
    left: 12px;
    bottom: 2px;
    width: 152px;
    height: 158px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 4;
}
#cockpit-glass {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.4), rgba(160, 220, 255, 0.12) 55%, rgba(120, 180, 255, 0.06));
    border: 3px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4), inset 0 0 26px rgba(255, 255, 255, 0.12);
}
#cockpit:active #cockpit-glass { box-shadow: 0 0 0 6px rgba(255, 247, 230, 0.35); }
#cosmo-cockpit { position: absolute; inset: 8px 12px 4px; }

/* mission badge */

#badge-wrap {
    position: absolute;
    left: 184px;
    bottom: 12px;
    width: 124px;
    height: 124px;
    perspective: 600px;
    z-index: 3;
}
#badge {
    width: 100%;
    height: 100%;
    background: #FFF7E6;
    border: 5px solid #FCBF49;
    border-radius: 22px;
    box-shadow: 0 8px 20px rgba(5, 2, 20, 0.5), inset 0 0 0 3px rgba(184, 121, 27, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#badge.flip-out { animation: flip-out 0.15s ease-in forwards; }
#badge.flip-in  { animation: flip-in 0.18s ease-out forwards; }
@keyframes flip-out { to { transform: rotateY(88deg); } }
@keyframes flip-in { from { transform: rotateY(-88deg); } to { transform: rotateY(0); } }
#badge.wiggle { animation: badge-wiggle 0.6s ease; }
@keyframes badge-wiggle {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-5deg) scale(1.06); }
    55% { transform: rotate(5deg) scale(1.06); }
    80% { transform: rotate(-2deg); }
}
#badge-face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.badge-num { font-size: 72px; font-weight: 900; color: #241A3E; line-height: 1; }
#badge-face svg { width: 100px; height: 100px; }

.badge-add { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.add-row { display: flex; align-items: center; gap: 7px; }
.grp { display: flex; gap: 4px; }
.badge-add .dot, .fly-dots .dot { width: 14px; height: 14px; border-radius: 50%; }
.grp-a .dot, .dots-a .dot { background: #33C4E0; box-shadow: 0 0 6px rgba(51, 196, 224, 0.7); }
.grp-b .dot, .dots-b .dot { background: #FF7BAC; box-shadow: 0 0 6px rgba(255, 123, 172, 0.7); }
.plus { font-size: 26px; font-weight: 900; color: #B565D8; }
.badge-add .sum {
    position: absolute;
    font-size: 62px;
    font-weight: 900;
    color: #E8A828;
    text-shadow: 0 0 14px rgba(252, 191, 73, 0.8);
    opacity: 0;
}
.badge-add .grp-a { animation: ba-a 3.2s ease-in-out infinite; }
.badge-add .grp-b { animation: ba-b 3.2s ease-in-out infinite; }
.badge-add .plus  { animation: ba-plus 3.2s ease-in-out infinite; }
.badge-add .sum   { animation: ba-sum 3.2s ease-in-out infinite; }
@keyframes ba-a {
    0%, 30% { transform: none; opacity: 1; }
    48%, 60% { transform: translateX(19px); opacity: 1; }
    64%, 88% { transform: translateX(19px); opacity: 0; }
    96%, 100% { transform: none; opacity: 1; }
}
@keyframes ba-b {
    0%, 30% { transform: none; opacity: 1; }
    48%, 60% { transform: translateX(-19px); opacity: 1; }
    64%, 88% { transform: translateX(-19px); opacity: 0; }
    96%, 100% { transform: none; opacity: 1; }
}
@keyframes ba-plus {
    0%, 34% { opacity: 1; }
    46%, 88% { opacity: 0; }
    96%, 100% { opacity: 1; }
}
@keyframes ba-sum {
    0%, 56% { opacity: 0; transform: scale(0.3); }
    66% { opacity: 1; transform: scale(1.25); }
    74%, 86% { opacity: 1; transform: scale(1); }
    94%, 100% { opacity: 0; transform: scale(0.8); }
}

/* cannon */

.gk-celebrate-card, #info-card { color: var(--gk-text); }

#cannon {
    position: absolute;
    left: 332px;
    bottom: 34px;
    width: 96px;
    height: 114px;
    z-index: 3;
}
#cannon svg { width: 100%; height: 100%; overflow: visible; }
.cn-barrel { transform-box: fill-box; transform-origin: 50% 90%; }
#cannon.recoil .cn-barrel { animation: recoil 0.24s ease-out; }
@keyframes recoil {
    0% { transform: translateY(0) scaleY(1); }
    30% { transform: translateY(9px) scaleY(0.82); }
    100% { transform: translateY(0) scaleY(1); }
}
.cn-muzzle { filter: drop-shadow(0 0 6px #FFF7E6); animation: muzzle-glow 2.4s ease-in-out infinite; }
@keyframes muzzle-glow {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

/* combo meter */

#combo {
    position: absolute;
    right: 14px;
    bottom: 48px;
    display: flex;
    gap: 9px;
    z-index: 3;
}
.socket {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(10, 6, 30, 0.45);
    border: 2.5px solid #59638C;
    display: flex;
    align-items: center;
    justify-content: center;
}
.socket svg { width: 36px; height: 36px; overflow: visible; }
.socket-star { fill: #454E74; stroke: #59638C; stroke-width: 2; }
.socket.filled { border-color: #E8A828; box-shadow: 0 0 14px rgba(252, 191, 73, 0.55); }
.socket.filled .socket-star { fill: #FCBF49; stroke: #E8A828; }
.socket.landed svg { animation: socket-ping 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes socket-ping {
    0% { transform: scale(1.9); }
    100% { transform: scale(1); }
}
.socket.flare { animation: socket-flare 0.6s ease; }
@keyframes socket-flare {
    0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(252, 191, 73, 0.55); }
    45% { transform: scale(1.35); box-shadow: 0 0 34px #FFD700; }
}

/* ═════════════════════ Cosmo the space-pup ═════════════════════ */

.cosmo { display: block; width: 100%; height: 100%; overflow: visible; }
.cosmo .c-all, .cosmo .c-head, .cosmo .c-tail, .cosmo .c-ear,
.cosmo .c-lid, .cosmo .c-paw-l, .cosmo .c-paw-r, .cosmo .c-goggles { transform-box: fill-box; }

.cosmo .c-lid {
    transform-origin: 50% 0%;
    transform: scaleY(0);
    animation: c-blink 4.4s infinite;
}
@keyframes c-blink {
    0%, 91%, 97%, 100% { transform: scaleY(0); }
    93%, 95% { transform: scaleY(1); }
}
.cosmo.mood-soft .c-lid { animation: none; transform: scaleY(0.5); }

.cosmo .m-pant, .cosmo .m-awe { display: none; }
.cosmo.mood-happy .m-pant { display: inline; }
.cosmo.mood-happy .m-smile { display: none; }
.cosmo.mood-awe .m-awe { display: inline; }
.cosmo.mood-awe .m-smile { display: none; }

.cosmo .c-tail {
    transform-origin: 100% 100%;
    animation: tail-sway 2.8s ease-in-out infinite;
}
@keyframes tail-sway {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(8deg); }
}
.cosmo.wag .c-tail { animation: tail-wag 0.25s ease-in-out infinite; }
@keyframes tail-wag {
    0%, 100% { transform: rotate(-17deg); }
    50% { transform: rotate(14deg); }
}
.cosmo .c-spark { opacity: 0; animation: spark-tw 2.8s ease-in-out infinite; }
.cosmo .cs2 { animation-delay: 0.9s; } .cosmo .cs3 { animation-delay: 1.7s; }
.cosmo.wag .c-spark { animation-duration: 0.7s; }
@keyframes spark-tw {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.cosmo .c-ear-l { transform-origin: 90% 10%; animation: ear-twitch 7.5s ease-in-out infinite; }
.cosmo .c-ear-r { transform-origin: 10% 10%; animation: ear-twitch 8.5s ease-in-out infinite 2s; }
@keyframes ear-twitch {
    0%, 90%, 100% { transform: rotate(0); }
    93%, 96% { transform: rotate(-9deg); }
}

.cosmo.bounce .c-all { animation: c-bounce 0.7s cubic-bezier(0.3, 1.6, 0.4, 1); }
@keyframes c-bounce {
    0% { transform: translateY(0) scale(1, 1); }
    25% { transform: translateY(6px) scale(1.08, 0.88); }
    55% { transform: translateY(-16px) scale(0.95, 1.08); }
    80% { transform: translateY(2px) scale(1.03, 0.96); }
    100% { transform: none; }
}
.cosmo.tilt .c-head { animation: head-tilt 1.1s ease; transform-origin: 50% 85%; }
@keyframes head-tilt {
    0%, 100% { transform: rotate(0); }
    30%, 70% { transform: rotate(-8deg); }
}
.cosmo.point .c-paw-r { animation: paw-point 1.2s ease; }
@keyframes paw-point {
    0%, 100% { transform: translate(0, 0); }
    30%, 70% { transform: translate(9px, -26px); }
}

.cosmo .c-goggles { display: none; }
.cosmo.goggles-on .c-goggles { display: inline; animation: goggles-down 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes goggles-down {
    from { transform: translateY(-26px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* title entrance + wave */
.cosmo-title.fly-in { animation: cosmo-fly 0.9s cubic-bezier(0.3, 1.3, 0.5, 1) backwards; }
@keyframes cosmo-fly {
    0% { transform: translate(-46vw, 26vh) rotate(-24deg); }
    70% { transform: translate(2vw, -2vh) rotate(6deg); }
    100% { transform: none; }
}
.cosmo-title .c-paw-r { animation: paw-wave 2.6s ease-in-out infinite 1s; }
@keyframes paw-wave {
    0%, 24%, 100% { transform: translate(0, 0); }
    6% { transform: translate(10px, -28px) rotate(10deg); }
    12% { transform: translate(12px, -22px) rotate(-6deg); }
    18% { transform: translate(10px, -28px) rotate(10deg); }
}
.cosmo-title .c-all { animation: gk-bob 3.2s ease-in-out infinite; }
.cosmo-mini .c-all { animation: gk-bob 3s ease-in-out infinite; }

/* ═════════════════════ fx: laser, pops, star flights, counting ═════════════════════ */

#fx-layer {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.laser {
    position: absolute;
    height: 9px;
    margin-top: -4.5px;
    border-radius: 5px;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, #E63946, #F77F00, #FCBF49, #7CB518, #00B4D8, #B565D8);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.75), 0 0 5px #FFF7E6;
    animation: laser-grow 0.18s ease-out forwards;
}
@keyframes laser-grow {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}
.laser.gone { transition: opacity 0.16s; opacity: 0; }

.pop-ring {
    position: absolute;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    border: 6px solid #FFF7E6;
    box-shadow: 0 0 18px rgba(255, 247, 230, 0.9);
    animation: ring-out 0.6s ease-out forwards;
}
@keyframes ring-out {
    0% { transform: scale(0.4); opacity: 1; }
    100% { transform: scale(5.4); opacity: 0; }
}

.pop-star {
    position: absolute;
    margin: -13px 0 0 -13px;
    font-size: 26px;
    text-shadow: 0 0 8px currentColor;
    animation: pop-star-fly 0.75s ease-out forwards;
}
@keyframes pop-star-fly {
    0% { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0.2) rotate(120deg); opacity: 0; }
}

.star-fly {
    position: absolute;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    filter: drop-shadow(0 0 10px #FFD700);
    will-change: transform;
}
.star-fly svg { width: 100%; height: 100%; overflow: visible; }

.count-row {
    position: fixed;
    left: 50%;
    top: 30%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 55;
    pointer-events: none;
    transition: opacity 0.4s;
}
.count-star { width: 54px; height: 54px; opacity: 0.22; transform: scale(0.6); }
.count-star svg { width: 100%; height: 100%; overflow: visible; }
.count-star.lit { opacity: 1; animation: count-pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes count-pop {
    0% { transform: scale(0.6); }
    55% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.count-row.done { opacity: 0; }

#count-big {
    position: fixed;
    left: 50%;
    top: 47%;
    transform: translate(-50%, -50%);
    font-size: clamp(7rem, 26vmin, 14rem);
    font-weight: 900;
    color: #FFF7E6;
    text-shadow: 0 7px 0 #B8791B, 0 0 44px rgba(252, 191, 73, 0.65);
    z-index: 54;
    pointer-events: none;
    line-height: 1;
}
#count-big.tick { animation: count-tick 0.45s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes count-tick {
    0% { transform: translate(-50%, -50%) scale(1.5); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.fly-dots { position: fixed; display: flex; gap: 5px; z-index: 56; pointer-events: none; }

.sum-pop {
    position: fixed;
    transform: translate(-50%, -50%);
    font-size: clamp(6rem, 20vmin, 11rem);
    font-weight: 900;
    color: #FCBF49;
    text-shadow: 0 5px 0 #B8791B, 0 0 34px rgba(255, 215, 0, 0.75);
    z-index: 56;
    pointer-events: none;
    animation: sum-in 0.55s cubic-bezier(0.2, 1.5, 0.4, 1);
    line-height: 1;
}
@keyframes sum-in {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ═════════════════════ WARP-JUMP overlay ═════════════════════ */

#warp-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
}

#warp-tunnel {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}
#warp-tunnel.on { opacity: 1; }

.wstreak {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36vmax;
    height: 5px;
    border-radius: 3px;
    transform-origin: 0 50%;
    animation: wstreak-fly var(--d, 0.6s) linear infinite;
    opacity: 0;
    will-change: transform;
}
@keyframes wstreak-fly {
    0%   { transform: rotate(var(--a)) translateX(2vmax) scaleX(0.08); opacity: 0; }
    18%  { opacity: 1; }
    100% { transform: rotate(var(--a)) translateX(78vmax) scaleX(1.5); opacity: 0.9; }
}
#warp-tunnel.snap .wstreak { animation: wstreak-snap 0.24s ease-in forwards; }
@keyframes wstreak-snap {
    to { transform: rotate(var(--a)) translateX(0) scaleX(0.02); opacity: 0; }
}

#warp-tint {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 2.2s;
}
#warp-tint.foreshadow { opacity: 1; }

#warp-orbit { position: absolute; left: 50%; top: 60%; width: 0; height: 0; display: none; }
#warp-orbit.on { display: block; }
.orb-star {
    position: absolute;
    left: -20px;
    top: -20px;
    width: 40px;
    height: 40px;
    animation: orbit-star 1.7s linear infinite;
    filter: drop-shadow(0 0 9px #FFD700);
}
.orb-star svg { width: 100%; height: 100%; overflow: visible; }
@keyframes orbit-star {
    from { transform: rotate(var(--oa)) translateX(140px); }
    to   { transform: rotate(calc(var(--oa) + 360deg)) translateX(140px); }
}

#warp-comet {
    position: absolute;
    left: -170px;
    top: 26%;
    width: 150px;
    opacity: 0;
}
#warp-comet svg { width: 100%; overflow: visible; }
#warp-comet.zip { animation: comet-zip 1.5s ease-in-out forwards; }
@keyframes comet-zip {
    0% { transform: translate(0, 0); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translate(125vw, 12vh); opacity: 0; }
}
.comet-eye { transform-box: fill-box; transform-origin: 50% 50%; }
#warp-comet.zip .comet-eye { animation: comet-wink 1.5s linear; }
@keyframes comet-wink {
    0%, 42%, 62%, 100% { transform: scaleY(1); }
    48%, 56% { transform: scaleY(0.12); }
}

#warp-btn {
    position: absolute;
    left: calc(50% - 110px);
    bottom: 16%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 7px solid #B8791B;
    background: radial-gradient(circle at 35% 28%, #FFE9A8, #FCBF49 58%, #E8A828);
    box-shadow: 0 0 60px rgba(252, 191, 73, 0.65), 0 14px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    pointer-events: auto;
    z-index: 5;
    font-family: inherit;
    transform: translateY(70vh);
}
#warp-btn.rise { animation: wb-rise 0.8s cubic-bezier(0.2, 1.2, 0.4, 1) forwards; }
@keyframes wb-rise {
    from { transform: translateY(70vh); }
    to   { transform: translateY(0); }
}
#warp-btn.slam {
    animation: wb-slam 0.3s ease-out forwards;
    opacity: 0;
    transition: opacity 0.4s ease 0.5s;
    pointer-events: none;
}
@keyframes wb-slam {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(8px) scale(0.88); }
    100% { transform: translateY(4px) scale(0.93); }
}
#warp-btn.bounce-x .wb-inner { animation: wb-bounce 0.55s cubic-bezier(0.2, 1.6, 0.4, 1), wb-heart 1.15s ease-in-out 0.55s infinite; }
@keyframes wb-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.28); }
    100% { transform: scale(1); }
}
.wb-ring {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: conic-gradient(#E63946, #F77F00, #FCBF49, #7CB518, #00B4D8, #B565D8, #E63946);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px));
    animation: wb-spin 2.6s linear infinite, wb-ring-pulse 1.15s ease-in-out infinite;
    pointer-events: none;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }
@keyframes wb-ring-pulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}
.wb-inner {
    display: inline-block;
    font-size: 46px;
    font-weight: 900;
    color: #4A2B00;
    text-shadow: 0 2px 0 rgba(255, 247, 230, 0.7);
    animation: wb-heart 1.15s ease-in-out infinite;
}
@keyframes wb-heart {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
}

#warp-digit-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(18, 12, 48, 0) 30%, rgba(18, 12, 48, 0.45) 100%);
}
#warp-digit-wrap.gk-hidden { display: none; }
#warp-digit {
    font-size: clamp(9rem, 38vmin, 19rem);
    font-weight: bold;
    color: #FFF7E6;
    text-shadow: 0 7px 0 #B565D8, 0 14px 0 rgba(90, 40, 130, 0.4), 0 22px 50px rgba(0, 0, 0, 0.5);
    line-height: 1;
}
#warp-digit.zoom { animation: num-zoom 0.72s cubic-bezier(0.2, 1, 0.4, 1); }
@keyframes num-zoom {
    0%   { transform: scale(3); opacity: 0; }
    35%  { opacity: 1; }
    100% { transform: scale(1); opacity: 0.96; }
}
#warp-ring {
    position: absolute;
    width: 34vmin;
    height: 34vmin;
    border-radius: 50%;
    border: 9px solid rgba(255, 247, 230, 0.85);
    opacity: 0;
}
#warp-ring.flash { animation: warp-ring-out 0.7s ease-out; }
@keyframes warp-ring-out {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.6); opacity: 0; }
}

#warp-flash {
    position: absolute;
    inset: 0;
    background: #FFF7E6;
    opacity: 0;
}
#warp-flash.go { animation: flash-out 0.5s ease-out; }
@keyframes flash-out {
    0% { opacity: 0; }
    16% { opacity: 1; }
    100% { opacity: 0; }
}

/* ═════════════════════ grown-ups ═════════════════════ */

#info-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 905;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #B565D8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    font-size: 1.7rem;
    font-weight: bold;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s;
}
#info-btn:hover { transform: scale(1.1); }
body.scr-play #info-btn { display: none; }

#info-overlay {
    position: fixed;
    inset: 0;
    z-index: 930;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 12, 50, 0.6);
    animation: gk-fade-in 0.25s ease-out;
    padding: 16px;
}
#info-card { max-width: min(92vw, 560px); max-height: 88vh; overflow-y: auto; }
#info-card h2 { color: var(--gk-purple); margin-bottom: 10px; }
#info-card p { margin: 10px 0; font-size: clamp(0.95rem, 2.4vw, 1.05rem); line-height: 1.45; }
#info-card .gk-btn { margin-top: 6px; width: 100%; }

/* ═════════════════════ responsive ═════════════════════ */

@media (max-width: 900px) {
    #cockpit { width: 138px; height: 146px; }
    #badge-wrap { left: 164px; width: 112px; height: 112px; bottom: 16px; }
    .badge-num { font-size: 62px; }
    #cannon { left: 296px; width: 74px; height: 86px; }
    #combo { gap: 6px; }
    .socket { width: 44px; height: 44px; }
}

@media (max-width: 820px) {
    #title-row { gap: 18px; }
    #planets { gap: 10px; }
    .planet-card { width: clamp(180px, 30vw, 230px); }
}

/* ═════════════════════ reduced motion ═════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .tw, .mote, .blob, .lm-wisp, .bulb { animation: none !important; }
    .pxlayer { animation: none !important; }
    body.quake #scene, body.quake .screen,
    body.warp-intro #scene { animation: none !important; }
    body.warping .pxlayer, body.launching .pxlayer { transition: opacity 1.5s; transform: none; filter: none; opacity: 0.4; }
    body.arriving .pxlayer { animation: none; }
    .wstreak { display: none; }
    #warp-digit.zoom { animation: gk-fade-in 0.6s ease-out; }
    .cosmo-title.fly-in { animation: none; }
    .round-big .btn-inner, .wb-inner, .wb-ring { animation: none; }
    .t-art, .target.spawn .t-art { animation: none; }
    .tent, .cr-orbit, .ferris { animation: none; }
    .orb-star { animation: none; opacity: 0; }
    #warp-comet.zip { animation: comet-zip 2.4s ease-in-out forwards; }
}
