/* ===== Elevator Simulator — Playful Cartoon theme ===== */

:root {
    --sky-top: #8ed6ff;
    --sky-bottom: #ffd9a0;
    --building: #fff6e9;
    --building-edge: #ffb86b;
    --interior: #fffaf2;
    --interior-alt: #fdeede;
    --shelf: #e0a96d;
    --car: #ff8b6b;
    --car-dark: #e96b4d;
    --door: #ffd36b;
    --ink: #3a2b2b;
    --lobby-width: 220px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Nunito', system-ui, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 0;
    min-height: 100vh;
    overflow: hidden; /* whole game is scaled to fit the viewport — nothing is clipped */
}

/* The scalable game stage (everything except the fixed sky/clock HUD). */
#stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
}

/* Cartoon city skyline silhouette behind everything */
body::before {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 220px;
    z-index: -2;
    background:
        radial-gradient(circle at 12% 100%, #9fb7c9 0 60px, transparent 61px),
        radial-gradient(circle at 88% 100%, #9fb7c9 0 70px, transparent 71px),
        repeating-linear-gradient(90deg,
            #b3c6d6 0 38px, #a6bccd 38px 44px, transparent 44px 96px);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
    mask-image: linear-gradient(180deg, transparent, #000 60%);
    opacity: 0.3; /* faint far layer behind the cartoon skyline */
}

/* Cartoon city skyline — sits BEHIND the tower (flanking it), rising from the
   street level, scaled with the scene. */
#skyline {
    position: absolute;
    left: -400px;
    bottom: 96px;           /* building bases at the street level */
    width: 1000px;          /* spans well past the tower on both sides */
    height: 260px;
    z-index: -2;            /* behind the street (-1) and the opaque tower */
    pointer-events: none;
    opacity: 0.5;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 42%);
    mask-image: linear-gradient(180deg, transparent, #000 42%);
}

.sky-building {
    position: absolute;
    bottom: 0;
    background:
        repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 228, 150, 0.12) 7px 10px),
        repeating-linear-gradient(90deg, transparent 0 5px, rgba(255, 228, 150, 0.12) 5px 9px),
        linear-gradient(180deg, #8194ad, #66788f);
    border-radius: 5px 5px 0 0;
}

/* ===== Street level: a ground band across both sides of the tower ===== */
#street {
    position: absolute;
    left: -360px;
    bottom: 82px;            /* surface level with the lobby floor */
    width: 960px;            /* extends left AND right of the tower */
    height: 28px;
    background: linear-gradient(180deg, #a6dc78 0%, #7fbd52 55%, #62a03f 100%);
    box-shadow: 0 10px 22px rgba(40, 60, 30, 0.2);
    z-index: -1;             /* behind the tower; shows on both sides */
}

/* Paved path leading up to the lobby door (on the left) */
.walkway {
    position: absolute;
    left: 4px;
    bottom: 4px;
    width: 142px;            /* reaches the lobby door at street-local ~140 */
    height: 13px;
    background: repeating-linear-gradient(90deg, #e2d3b6 0 15px, #d2c1a0 15px 17px);
    border-radius: 4px;
}

.tree {
    position: absolute;
    bottom: 18px;
    width: 7px;
    height: 20px;
    background: linear-gradient(90deg, #8a5a30, #b07b46);
    border-radius: 3px;
}

.tree::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 13px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, #93e26d, #4fa83e);
    box-shadow: -9px 7px 0 -5px #5cb846, 9px 7px 0 -5px #5cb846, 0 -6px 0 -6px #7ed257;
}

/* one by the walkway on the left, the rest on the grass right of the tower */
.tree:nth-child(2) { left: 18px; }
.tree:nth-child(3) { left: 690px; height: 25px; }
.tree:nth-child(4) { left: 748px; }
.tree:nth-child(5) { left: 806px; height: 24px; }
.tree:nth-child(6) { left: 864px; }

/* Animated clouds */
#clouds {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: #fff;
    border-radius: 999px;
    opacity: 0.88;
    animation: cloud-drift linear infinite;
}

/* Each cloud is built from stacked pseudo + box-shadow bumps */
.cloud::before,
.cloud::after {
    content: "";
    position: absolute;
    background: inherit;
    border-radius: 999px;
}

.cloud::before {
    width: 55%;
    height: 130%;
    top: -40%;
    left: 15%;
}

.cloud::after {
    width: 38%;
    height: 110%;
    top: -30%;
    right: 18%;
}

@keyframes cloud-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(var(--travel)); }
}

h1 {
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 40px;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow:
        0 2px 0 var(--car-dark),
        0 5px 12px rgba(0, 0, 0, 0.25);
    margin: 0 0 12px;
}

/* Score pill below the caption */
#score {
    font-family: 'Baloo 2', 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: var(--car-dark);
    background: #fff;
    padding: 6px 22px;
    border: 3px solid var(--building-edge);
    border-radius: 999px;
    box-shadow: 0 6px 14px rgba(60, 43, 43, 0.22);
    margin-bottom: 20px;
}

#score-value {
    display: inline-block;
    min-width: 1.2em;
    text-align: center;
}

#score.bump {
    animation: score-bump 0.35s ease;
}

@keyframes score-bump {
    0% { transform: scale(1); }
    45% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* DOUBLE / TRIPLE! combo popups at the floor where people exit */
.combo {
    position: absolute;
    left: 55px;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    font-size: 26px;
    color: #fff;
    -webkit-text-stroke: 2px var(--car-dark);
    text-shadow: 0 3px 6px rgba(60, 43, 43, 0.35);
    pointer-events: none;
    z-index: 40;
    animation: combo-pop 1.3s ease-out forwards;
}

.combo.triple {
    font-size: 30px;
    color: #ffe27a;
}

@keyframes combo-pop {
    0% { transform: translateY(0) scale(0.3); opacity: 0; }
    25% { transform: translateY(-10px) scale(1.25); opacity: 1; }
    45% { transform: translateY(-16px) scale(1); opacity: 1; }
    100% { transform: translateY(-54px) scale(1); opacity: 0; }
}

#container {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

#building {
    position: relative;
    width: 340px;
    height: 630px; /* 6 floors (basement..4) × 105px */
    margin-top: 46px;
    margin-left: var(--lobby-width);
    border: 4px solid var(--building-edge);
    border-radius: 22px;
    background: var(--interior); /* matches the floors so the rounded corner is seamless */
    box-shadow:
        0 18px 40px rgba(60, 43, 43, 0.28),
        inset 0 0 0 3px #ffffff;
    overflow: visible;
    display: flex;
    flex-direction: row;
}

/* Rounded cartoon roof cap — extends left over the top-floor side extension so the
   whole top floor sits under one roof. */
#building::before {
    content: "";
    position: absolute;
    top: -26px;
    left: -66px;            /* reaches out over the left extension */
    width: 376px;           /* across the extension and most of the building */
    height: 30px;
    background: var(--building-edge);
    border-radius: 16px 16px 6px 6px;
    box-shadow: 0 6px 12px rgba(60, 43, 43, 0.2);
    z-index: 2;
}

#floor-area {
    position: relative;
    width: 200px;
    height: 100%;
    border-right: 3px solid #f0d9bd;
    border-radius: 18px 0 0 0; /* round the top-left to follow the building corner */
    background: var(--interior);
    overflow: visible; /* side-door landings stick out to the left */
}

/* ===== Ground-floor hall: lobby + floor 0 merged into one room =====
   Spans from the entrance door (far left) all the way to the elevator shaft,
   sitting behind the people (z-index 2 < .person z-index 15) so it reads as a
   single continuous room with no internal divider. */
#lobby {
    position: absolute;
    left: calc(-1 * var(--lobby-width));
    bottom: 105px; /* floor 0 sits one floor above the basement */
    width: calc(var(--lobby-width) + 200px);
    height: 105px;
    background: var(--interior);
    border: 4px solid var(--building-edge);
    border-right: none;
    border-radius: 18px 0 0 18px;
    box-shadow:
        0 18px 40px rgba(60, 43, 43, 0.28),
        inset 0 3px 0 #ffffff,
        inset 0 -3px 0 #ffffff,
        inset 3px 0 0 #ffffff;
    overflow: hidden;
    z-index: 2;
}

/* Lobby floor / baseboard */
.lobby-floor {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 12px;
    background: linear-gradient(180deg, #f3c98e, var(--shelf));
    box-shadow: 0 -2px 4px rgba(120, 80, 40, 0.18);
}

.lobby-sign {
    position: absolute;
    top: 14px;
    left: 80px;
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 2px;
    color: var(--car-dark);
    opacity: 0.6;
}

/* Sliding glass entrance door at the far-left of the lobby */
.lobby-door {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 34px;
    height: 100%;
    background: linear-gradient(145deg, var(--door), #ffb84d);
    border-right: 3px solid #fff;
    border-radius: 16px 0 0 14px;
    transition: transform 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
    z-index: 5;
}

.lobby-door.open {
    transform: translateY(-100%);
}

#shafts {
    position: relative;
    width: 100px;
    height: 100%;
    border-left: 3px solid #f0d9bd;
    border-radius: 0 18px 18px 0;
    background: linear-gradient(90deg, #efe4d6, #f7efe4);
    box-shadow: inset 0 0 18px rgba(120, 90, 60, 0.18);
    overflow: hidden;
}

.floor-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e7d2b6;
    border-radius: 3px;
}

/* Alternating soft floor tint bands */
.floor-band {
    position: absolute;
    left: 0;
    width: 100%;
    background: transparent;
}

.floor-band.alt {
    background: var(--interior-alt);
    opacity: 0.6;
}

/* topmost band follows the building's rounded top-left corner */
.floor-band.top {
    border-top-left-radius: 18px;
}

/* The basement is a dark room lit by neon */
.floor-band.basement {
    background:
        radial-gradient(120% 80% at 50% 100%, rgba(120, 60, 200, 0.25), transparent 70%),
        linear-gradient(180deg, #1a1330, #241a3d);
    opacity: 1;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.floor-platform {
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, #f3c98e, var(--shelf));
    border-radius: 0 6px 6px 0;
    box-shadow: 0 3px 5px rgba(120, 80, 40, 0.25);
}

.floor-platform.basement {
    background: linear-gradient(180deg, #2a1f47, #15102b);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.45);
}

/* Call buttons — mounted in the shaft, centered between the two ropes (behind
   the car, which passes in front as it travels). */
.call-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 9px;
    background: radial-gradient(circle at 35% 30%, #ff9a8b, #ff5e62);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 3px 7px rgba(255, 94, 98, 0.45);
    transition: transform 0.12s ease, box-shadow 0.2s, background 0.2s;
    z-index: 3;
}

.call-btn:hover:not(:disabled) {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 5px 12px rgba(255, 94, 98, 0.6);
}

.call-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: translateX(-50%);
    box-shadow: none;
}

.call-btn:active,
.call-btn.active {
    background: radial-gradient(circle at 35% 30%, #ffe27a, #ffb300);
    transform: translateX(-50%) scale(1.1);
}

/* Stays lit and pulses yellow from press until the elevator arrives */
.call-btn.active {
    animation: btn-shine 0.85s ease-in-out infinite alternate;
}

@keyframes btn-shine {
    from {
        box-shadow: 0 0 0 3px rgba(255, 211, 107, 0.45), 0 0 14px #ffd36b;
    }

    to {
        box-shadow: 0 0 0 5px rgba(255, 211, 107, 0.85), 0 0 28px #ffd36b;
    }
}

/* ===== Elevator car ===== */
#elevator {
    position: absolute;
    width: 80px;
    height: 80px;
    left: 10px;
    bottom: 0;
    background: linear-gradient(160deg, var(--car) 0%, var(--car-dark) 100%);
    border: 3px solid #fff;
    border-radius: 14px;
    box-shadow:
        inset 0 0 16px rgba(255, 240, 200, 0.5),
        0 8px 16px rgba(60, 43, 43, 0.3);
    transition: bottom 2s linear;
    z-index: 10;
    overflow: visible;
}

/* Two static ropes running the full shaft height, one at each side of the car */
.shaft-rope {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(90deg, #b9a78f, #8a7457, #b9a78f);
    border-radius: 2px;
    z-index: 1;
    pointer-events: none;
}

.shaft-rope.left {
    left: 15px;
}

.shaft-rope.right {
    right: 15px;
}

/* ===== Per-floor side extension (flush with the floor) + swing door ===== */
.landing {
    position: absolute;
    left: -60px;
    width: 64px; /* right edge overlaps ~4px into the floor, hiding the seam */
    background: var(--interior);
    border-left: 4px solid var(--building-edge);
    z-index: 1;
    overflow: hidden;
}

/* the top extension rounds its top-left to follow the building's corner */
.landing.top {
    border-top-left-radius: 16px;
}

/* the floor shelf continues across the extension, level with the floor platform */
.landing::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(180deg, #f3c98e, var(--shelf));
}

.floor-door {
    position: absolute;
    left: 7px;
    bottom: 10px;
    width: 26px;
    height: calc(100% - 22px);
    background: linear-gradient(160deg, #d49a64, #b1773f);
    border: 2px solid #fff6e9;
    border-radius: 5px;
    transform-origin: left center;
    transform: perspective(160px) rotateY(0deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
    z-index: 2;
}

.floor-door.open {
    transform: perspective(160px) rotateY(-78deg);
}

.door-knob {
    position: absolute;
    right: 4px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: #ffe27a;
}

/* Basement landing + door: dark with neon trim */
.landing.basement {
    background: linear-gradient(180deg, #1a1330, #241a3d);
    border-left-color: #3a2b5c;
}

.landing.basement::after {
    background: linear-gradient(180deg, #2a1f47, #15102b);
}

.landing.basement .floor-door {
    background: linear-gradient(160deg, #3a2b5c, #281d44);
    border-color: #7a5fb0;
    box-shadow: 0 0 8px rgba(150, 90, 255, 0.5);
}

.landing.basement .door-knob {
    background: #c79bff;
    box-shadow: 0 0 6px #c79bff;
}

/* Neon tubes lighting the basement */
.floor-band.basement::before,
.floor-band.basement::after {
    content: "";
    position: absolute;
    height: 4px;
    border-radius: 4px;
}

.floor-band.basement::before {
    left: 14px;
    right: 70px;
    top: 12px;
    background: #ff4db8;
    box-shadow: 0 0 8px #ff4db8, 0 0 16px #ff4db8;
    animation: neon-flicker 5s infinite;
}

.floor-band.basement::after {
    left: 60px;
    right: 16px;
    top: 26px;
    background: #41f3ff;
    box-shadow: 0 0 8px #41f3ff, 0 0 16px #41f3ff;
    animation: neon-flicker 3.5s infinite 0.4s;
}

@keyframes neon-flicker {
    0%, 92%, 100% { opacity: 1; }
    93%, 95% { opacity: 0.4; }
    94%, 96% { opacity: 1; }
}

/* Warm cabin light when doors are open */
#elevator.open {
    box-shadow:
        inset 0 0 22px rgba(255, 230, 160, 0.85),
        0 0 26px rgba(255, 211, 107, 0.55),
        0 8px 16px rgba(60, 43, 43, 0.3);
}

.door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(145deg, var(--door), #ffb84d);
    border: 2px solid #fff;
    transition: transform 1s cubic-bezier(0.34, 1.3, 0.64, 1);
    z-index: 11;
}

.door.left {
    left: 0;
    border-radius: 12px 4px 4px 12px;
    transform-origin: left;
}

.door.right {
    right: 0;
    border-radius: 4px 12px 12px 4px;
    transform-origin: right;
}

.open .door.left {
    transform: translateX(-100%);
}

.open .door.right {
    transform: translateX(100%);
}

/* ===== People — colorful cartoon figures ===== */
.person {
    position: absolute;
    width: 12px;
    height: 34px;
    background: #54a0ff;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 7px 7px 4px 4px;
    transform-origin: bottom center;
    box-shadow: 0 0 0 3px var(--mood, #1dd1a1), 0 0 14px 3px var(--mood, #1dd1a1);
    transition: box-shadow 0.3s;
    z-index: 15;
}

/* Soft ground shadow */
.person::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 6px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 50%;
    z-index: -1;
}

.head {
    position: absolute;
    top: -16px;
    left: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2b6fc2;
    border: 2px solid rgba(0, 0, 0, 0.12);
}

/* Two little eyes */
.head::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 3px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 7px 0 0 var(--ink);
}

/* Mouth — a single curve that gradually drops from a smile (ratio 0)
   through flat (ratio 0.5) to a frown (ratio 1) as patience runs out. */
.mouth {
    position: absolute;
    left: 5px;
    top: 11px;
    width: 9px;
    height: 5px;
    border: 2px solid var(--ink);
    border-top: 0;
    border-radius: 0 0 9px 9px;
    transform: scaleY(calc(1 - 2 * var(--ratio, 0)));
    transform-origin: center;
    transition: transform 0.3s;
}

.target-label {
    position: absolute;
    top: -46px;
    left: -8px;
    min-width: 18px;
    padding: 1px 5px;
    text-align: center;
    color: var(--ink);
    background: #fff;
    border-radius: 8px;
    border: 2px solid #ffd36b;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Speech-bubble tail */
.target-label::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 8px;
    width: 6px;
    height: 6px;
    background: #fff;
    border-right: 2px solid #ffd36b;
    border-bottom: 2px solid #ffd36b;
    transform: rotate(45deg);
}

/* Walk bob — applied only while moving */
@keyframes walkbob {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-3px) rotate(3deg);
    }
}

.person.walking {
    animation: walkbob 0.32s ease-in-out infinite;
}

/* ===== Day cycle: clock, sun, stars ===== */
#clock {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.clock-face {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, #fffefb, #ffe7c2);
    border: 4px solid #fff;
    box-shadow: 0 6px 16px rgba(60, 43, 43, 0.3), inset 0 0 0 2px var(--building-edge);
}

/* four cardinal tick marks */
.clock-face::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 7%, var(--car-dark) 0 2px, transparent 3px),
        radial-gradient(circle at 50% 93%, var(--car-dark) 0 2px, transparent 3px),
        radial-gradient(circle at 7% 50%, var(--car-dark) 0 2px, transparent 3px),
        radial-gradient(circle at 93% 50%, var(--car-dark) 0 2px, transparent 3px);
}

.hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: bottom center;
    border-radius: 4px;
    background: var(--ink);
}

.hand.hour {
    width: 5px;
    height: 21px;
    margin-left: -2.5px;
}

.hand.minute {
    width: 3px;
    height: 29px;
    margin-left: -1.5px;
    background: var(--car-dark);
}

.clock-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px;
    border-radius: 50%;
    background: var(--ink);
    z-index: 2;
}

#clock-time {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    background: rgba(60, 43, 43, 0.4);
    padding: 2px 12px;
    border-radius: 999px;
}

#stars {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 4px #fff;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

#sun {
    position: fixed;
    left: 50%;
    top: 70%;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 38%, #fff7d6, #ffd24a 60%, #ff9e3d);
    box-shadow: 0 0 55px 20px rgba(255, 210, 90, 0.55);
    transform: translate(-50%, -50%);
    z-index: -2;
    pointer-events: none;
    opacity: 0;
}

/* Moon — rises at night */
#moon {
    position: fixed;
    left: 17%;
    top: 96%;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 35%, #fffdf5, #dfe6ff 65%, #c2cdf0);
    box-shadow: 0 0 34px 10px rgba(210, 224, 255, 0.45);
    transform: translate(-50%, -50%);
    z-index: -2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}

/* Craters */
#moon::before,
#moon::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(150, 165, 210, 0.35);
}

#moon::before {
    width: 12px;
    height: 12px;
    top: 12px;
    left: 13px;
}

#moon::after {
    width: 8px;
    height: 8px;
    bottom: 13px;
    right: 15px;
}

/* Rotating sunbeams behind the sun */
#sun::before {
    content: "";
    position: absolute;
    inset: -70px;
    border-radius: 50%;
    background: repeating-conic-gradient(rgba(255, 228, 150, 0.5) 0deg 5deg, transparent 5deg 22deg);
    -webkit-mask: radial-gradient(circle, #000 26%, transparent 70%);
    mask: radial-gradient(circle, #000 26%, transparent 70%);
    opacity: calc(var(--beam, 0) * 0.85);
    animation: spin 50s linear infinite;
    z-index: -1;
}

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

#closed-banner {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(10, 16, 40, 0.6);
    backdrop-filter: blur(2px);
    font-family: 'Baloo 2', sans-serif;
    font-weight: 800;
    font-size: 44px;
    color: #fff;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

#closed-banner.show {
    display: flex;
}

#closed-score {
    font-size: 22px;
    color: #ffe27a;
}
