/* Base styles */
:root {
    --monkey-size: 100px;
}

html, body {
    margin: 0;
    overflow: hidden;
    background: #050510;
    height: 100%;
    width: 100%;
    font-family: monospace;
    color: white;
    touch-action: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 2s ease;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(80, 20, 50, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 20%, rgba(40, 10, 60, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(20, 5, 30, 0.2) 0%, transparent 70%),
        #050510;
}

#tsparticles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Monkey */
#monkey-container {
    position: absolute;
    width: var(--monkey-size);
    height: var(--monkey-size);
    background-image: url('/assets/monkeyastronaut.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 100;
    animation: floatMonkey 1.5s infinite ease-in-out alternate;
    cursor: grab;
    touch-action: none;
}

@keyframes floatMonkey {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Score */
#score {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2em;
    z-index: 200;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    pointer-events: none;
}

/* Remote players */
.remote-monkey {
    position: absolute;
    z-index: 15;
    pointer-events: none;
    transition: left 0.1s linear, top 0.1s linear, width 0.3s ease, height 0.3s ease;
    animation: floatMonkey 3s ease-in-out infinite;
}
.remote-monkey img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.remote-monkey .remote-name {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.6);
    text-shadow: 0 0 4px currentColor;
}
.remote-monkey .remote-color-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    box-shadow: 0 0 10px currentColor, inset 0 0 8px currentColor;
    pointer-events: none;
}

/* Player list */
#player-list {
    position: absolute;
    top: 60px;
    left: 20px;
    z-index: 200;
    font-size: 14px;
    color: #ccc;
    pointer-events: none;
}
.player-entry {
    margin-bottom: 4px;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.player-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

/* Name input overlay */
#name-input-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,5,16,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#name-input-box {
    text-align: center;
    padding: 30px 40px;
    background: rgba(20,15,40,0.95);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255,215,0,0.15);
}
#player-name {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    padding: 8px 14px;
    border: 1px solid #555;
    border-radius: 6px;
    background: #111;
    color: #ffd700;
    outline: none;
    width: 180px;
    text-align: center;
}
#player-name:focus { border-color: #ffd700; }
#name-ok {
    display: block;
    margin: 12px auto 0;
    padding: 8px 28px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    background: #ffd700;
    color: #111;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
#name-ok:hover { background: #ffe44f; }

/* Planet health bar */
.planet-hp-bar {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: rgba(255,0,0,0.4);
    border-radius: 2px;
    overflow: hidden;
    z-index: 10;
}
.planet-hp-fill {
    height: 100%;
    background: #44ff44;
    border-radius: 2px;
    transition: width 0.2s, background-color 0.3s;
}

/* Laser beam */
#laser-beam {
    position: absolute;
    z-index: 25;
    pointer-events: none;
    width: 3px;
    height: 0px;
    transform-origin: top center;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.1s;
    filter: blur(0.5px);
}
#laser-beam.active {
    opacity: 1;
}
.laser-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 24;
    opacity: 0.9;
    transition: transform 0.35s ease-out, opacity 0.35s ease-out;
}

/* Comets */
.comet {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255,255,255,0.8);
    animation: cometFly linear forwards;
}
.comet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(to right, rgba(255,255,255,0.8), transparent);
    border-radius: 1px;
}
@keyframes cometFly {
    0% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Pixel Planets — shared base */
.pixel-planet {
    position: relative;
    width: 1px;
    height: 1px;
    image-rendering: pixelated;
    transform: scale(var(--planet-scale, 5));
    transform-origin: top left;
}

/* Planet 1 — Earth (blue/green 8x8) */
.pixel-planet-earth {
    box-shadow:
        3px 0 0 #4a90d9, 4px 0 0 #4a90d9,
        2px 1px 0 #4a90d9, 3px 1px 0 #3cb371, 4px 1px 0 #3cb371, 5px 1px 0 #4a90d9,
        1px 2px 0 #4a90d9, 2px 2px 0 #3cb371, 3px 2px 0 #2e8b57, 4px 2px 0 #4a90d9, 5px 2px 0 #4a90d9, 6px 2px 0 #4a90d9,
        1px 3px 0 #4a90d9, 2px 3px 0 #4a90d9, 3px 3px 0 #3cb371, 4px 3px 0 #3cb371, 5px 3px 0 #4a90d9, 6px 3px 0 #357ab7,
        1px 4px 0 #357ab7, 2px 4px 0 #4a90d9, 3px 4px 0 #4a90d9, 4px 4px 0 #3cb371, 5px 4px 0 #357ab7, 6px 4px 0 #357ab7,
        1px 5px 0 #357ab7, 2px 5px 0 #357ab7, 3px 5px 0 #4a90d9, 4px 5px 0 #4a90d9, 5px 5px 0 #357ab7, 6px 5px 0 #2a5f8f,
        2px 6px 0 #357ab7, 3px 6px 0 #357ab7, 4px 6px 0 #2a5f8f, 5px 6px 0 #2a5f8f,
        3px 7px 0 #2a5f8f, 4px 7px 0 #2a5f8f;
}

/* Planet 2 — Mars (red/orange 8x8) */
.pixel-planet-mars {
    box-shadow:
        3px 0 0 #e8927c, 4px 0 0 #e8927c,
        2px 1px 0 #e8927c, 3px 1px 0 #d4714a, 4px 1px 0 #b5493a, 5px 1px 0 #e8927c,
        1px 2px 0 #d4714a, 2px 2px 0 #b5493a, 3px 2px 0 #6b2020, 4px 2px 0 #d4714a, 5px 2px 0 #e8927c, 6px 2px 0 #d4714a,
        1px 3px 0 #e8927c, 2px 3px 0 #d4714a, 3px 3px 0 #b5493a, 4px 3px 0 #d4714a, 5px 3px 0 #b5493a, 6px 3px 0 #6b2020,
        1px 4px 0 #b5493a, 2px 4px 0 #e8927c, 3px 4px 0 #d4714a, 4px 4px 0 #6b2020, 5px 4px 0 #b5493a, 6px 4px 0 #b5493a,
        1px 5px 0 #6b2020, 2px 5px 0 #b5493a, 3px 5px 0 #b5493a, 4px 5px 0 #d4714a, 5px 5px 0 #6b2020, 6px 5px 0 #6b2020,
        2px 6px 0 #6b2020, 3px 6px 0 #b5493a, 4px 6px 0 #6b2020, 5px 6px 0 #6b2020,
        3px 7px 0 #6b2020, 4px 7px 0 #6b2020;
}

/* Planet 3 — Saturn (yellow/brown with ring 10x8) */
.pixel-planet-saturn {
    box-shadow:
        4px 0 0 #d4a574, 5px 0 0 #d4a574,
        3px 1px 0 #d4a574, 4px 1px 0 #c4956a, 5px 1px 0 #c4956a, 6px 1px 0 #d4a574,
        0px 2px 0 #e8d87c, 1px 2px 0 #e8d87c, 2px 2px 0 #c4956a, 3px 2px 0 #8b6914, 4px 2px 0 #c4956a, 5px 2px 0 #d4a574, 6px 2px 0 #c4956a, 7px 2px 0 #e8d87c, 8px 2px 0 #e8d87c,
        2px 3px 0 #c4956a, 3px 3px 0 #d4a574, 4px 3px 0 #c4956a, 5px 3px 0 #8b6914, 6px 3px 0 #c4956a, 7px 3px 0 #d4a574,
        0px 4px 0 #e8d87c, 1px 4px 0 #e8d87c, 2px 4px 0 #8b6914, 3px 4px 0 #c4956a, 4px 4px 0 #d4a574, 5px 4px 0 #c4956a, 6px 4px 0 #8b6914, 7px 4px 0 #e8d87c, 8px 4px 0 #e8d87c, 9px 4px 0 #e8d87c,
        2px 5px 0 #8b6914, 3px 5px 0 #8b6914, 4px 5px 0 #c4956a, 5px 5px 0 #8b6914, 6px 5px 0 #8b6914,
        3px 6px 0 #8b6914, 4px 6px 0 #8b6914, 5px 6px 0 #8b6914, 6px 6px 0 #8b6914,
        4px 7px 0 #8b6914, 5px 7px 0 #8b6914;
}

/* Planet 4 — Ice (light blue/white 7x7) */
.pixel-planet-ice {
    box-shadow:
        2px 0 0 #b0e0ff, 3px 0 0 #b0e0ff, 4px 0 0 #b0e0ff,
        1px 1px 0 #b0e0ff, 2px 1px 0 #ffffff, 3px 1px 0 #7ec8e8, 4px 1px 0 #b0e0ff, 5px 1px 0 #b0e0ff,
        1px 2px 0 #7ec8e8, 2px 2px 0 #b0e0ff, 3px 2px 0 #ffffff, 4px 2px 0 #7ec8e8, 5px 2px 0 #4a90b5,
        0px 3px 0 #7ec8e8, 1px 3px 0 #b0e0ff, 2px 3px 0 #7ec8e8, 3px 3px 0 #b0e0ff, 4px 3px 0 #4a90b5, 5px 3px 0 #7ec8e8, 6px 3px 0 #4a90b5,
        1px 4px 0 #4a90b5, 2px 4px 0 #7ec8e8, 3px 4px 0 #4a90b5, 4px 4px 0 #7ec8e8, 5px 4px 0 #4a90b5,
        2px 5px 0 #4a90b5, 3px 5px 0 #4a90b5, 4px 5px 0 #4a90b5,
        3px 6px 0 #4a90b5;
}

/* Planet 5 — Lava (dark red/orange 8x8) */
.pixel-planet-lava {
    box-shadow:
        3px 0 0 #ff6348, 4px 0 0 #ff4500,
        2px 1px 0 #ff6348, 3px 1px 0 #ffa500, 4px 1px 0 #ff4500, 5px 1px 0 #ff6348,
        1px 2px 0 #ff4500, 2px 2px 0 #ffa500, 3px 2px 0 #ff6348, 4px 2px 0 #ffa500, 5px 2px 0 #ff4500, 6px 2px 0 #8b0000,
        1px 3px 0 #ff6348, 2px 3px 0 #ff4500, 3px 3px 0 #8b0000, 4px 3px 0 #ffa500, 5px 3px 0 #ff6348, 6px 3px 0 #ff4500,
        1px 4px 0 #8b0000, 2px 4px 0 #ff4500, 3px 4px 0 #ffa500, 4px 4px 0 #ff4500, 5px 4px 0 #8b0000, 6px 4px 0 #8b0000,
        1px 5px 0 #8b0000, 2px 5px 0 #8b0000, 3px 5px 0 #ff4500, 4px 5px 0 #8b0000, 5px 5px 0 #8b0000, 6px 5px 0 #8b0000,
        2px 6px 0 #8b0000, 3px 6px 0 #8b0000, 4px 6px 0 #8b0000, 5px 6px 0 #8b0000,
        3px 7px 0 #8b0000, 4px 7px 0 #8b0000;
}

/* Planet 6 — Purple gas giant (9x9) */
.pixel-planet-purple {
    box-shadow:
        3px 0 0 #d4b8ff, 4px 0 0 #9b59b6, 5px 0 0 #d4b8ff,
        2px 1px 0 #d4b8ff, 3px 1px 0 #ce93d8, 4px 1px 0 #9b59b6, 5px 1px 0 #ce93d8, 6px 1px 0 #d4b8ff,
        1px 2px 0 #9b59b6, 2px 2px 0 #d4b8ff, 3px 2px 0 #6c3483, 4px 2px 0 #ce93d8, 5px 2px 0 #9b59b6, 6px 2px 0 #d4b8ff, 7px 2px 0 #9b59b6,
        1px 3px 0 #ce93d8, 2px 3px 0 #9b59b6, 3px 3px 0 #ce93d8, 4px 3px 0 #6c3483, 5px 3px 0 #d4b8ff, 6px 3px 0 #9b59b6, 7px 3px 0 #6c3483,
        0px 4px 0 #9b59b6, 1px 4px 0 #6c3483, 2px 4px 0 #ce93d8, 3px 4px 0 #9b59b6, 4px 4px 0 #d4b8ff, 5px 4px 0 #6c3483, 6px 4px 0 #9b59b6, 7px 4px 0 #6c3483, 8px 4px 0 #9b59b6,
        1px 5px 0 #6c3483, 2px 5px 0 #9b59b6, 3px 5px 0 #6c3483, 4px 5px 0 #9b59b6, 5px 5px 0 #ce93d8, 6px 5px 0 #6c3483, 7px 5px 0 #6c3483,
        1px 6px 0 #6c3483, 2px 6px 0 #6c3483, 3px 6px 0 #9b59b6, 4px 6px 0 #6c3483, 5px 6px 0 #6c3483, 6px 6px 0 #6c3483, 7px 6px 0 #6c3483,
        2px 7px 0 #6c3483, 3px 7px 0 #6c3483, 4px 7px 0 #6c3483, 5px 7px 0 #6c3483, 6px 7px 0 #6c3483,
        3px 8px 0 #6c3483, 4px 8px 0 #6c3483, 5px 8px 0 #6c3483;
}

/* Explosion particles */
.explosion-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

/* Solar systems */
.solar-system {
    position: absolute;
    z-index: 4;
    pointer-events: none;
}
.pixel-sun {
    position: relative;
    width: 1px;
    height: 1px;
    image-rendering: pixelated;
    transform: scale(var(--sun-scale, 6));
    transform-origin: top left;
}
.pixel-sun-yellow {
    box-shadow:
        3px 0 0 #fff44f, 4px 0 0 #fff44f,
        2px 1px 0 #fff44f, 3px 1px 0 #ffe135, 4px 1px 0 #ffd700, 5px 1px 0 #fff44f,
        1px 2px 0 #fff44f, 2px 2px 0 #ffd700, 3px 2px 0 #ffffff, 4px 2px 0 #ffe135, 5px 2px 0 #ffd700, 6px 2px 0 #ffb300,
        1px 3px 0 #ffe135, 2px 3px 0 #ffffff, 3px 3px 0 #ffe135, 4px 3px 0 #ffffff, 5px 3px 0 #ffe135, 6px 3px 0 #ffd700,
        1px 4px 0 #ffd700, 2px 4px 0 #ffe135, 3px 4px 0 #ffffff, 4px 4px 0 #ffe135, 5px 4px 0 #ffd700, 6px 4px 0 #ffb300,
        1px 5px 0 #ffb300, 2px 5px 0 #ffd700, 3px 5px 0 #ffe135, 4px 5px 0 #ffd700, 5px 5px 0 #ffb300, 6px 5px 0 #ff8c00,
        2px 6px 0 #ffb300, 3px 6px 0 #ffd700, 4px 6px 0 #ffb300, 5px 6px 0 #ff8c00,
        3px 7px 0 #ff8c00, 4px 7px 0 #ff8c00;
}
.pixel-sun-blue {
    box-shadow:
        3px 0 0 #b0d4ff, 4px 0 0 #b0d4ff,
        2px 1px 0 #b0d4ff, 3px 1px 0 #88bbff, 4px 1px 0 #6699ff, 5px 1px 0 #b0d4ff,
        1px 2px 0 #b0d4ff, 2px 2px 0 #6699ff, 3px 2px 0 #ffffff, 4px 2px 0 #88bbff, 5px 2px 0 #6699ff, 6px 2px 0 #4477dd,
        1px 3px 0 #88bbff, 2px 3px 0 #ffffff, 3px 3px 0 #88bbff, 4px 3px 0 #ffffff, 5px 3px 0 #88bbff, 6px 3px 0 #6699ff,
        1px 4px 0 #6699ff, 2px 4px 0 #88bbff, 3px 4px 0 #ffffff, 4px 4px 0 #88bbff, 5px 4px 0 #6699ff, 6px 4px 0 #4477dd,
        1px 5px 0 #4477dd, 2px 5px 0 #6699ff, 3px 5px 0 #88bbff, 4px 5px 0 #6699ff, 5px 5px 0 #4477dd, 6px 5px 0 #3355bb,
        2px 6px 0 #4477dd, 3px 6px 0 #6699ff, 4px 6px 0 #4477dd, 5px 6px 0 #3355bb,
        3px 7px 0 #3355bb, 4px 7px 0 #3355bb;
}
.pixel-sun-red {
    box-shadow:
        3px 0 0 #ff8866, 4px 0 0 #ff8866,
        2px 1px 0 #ff8866, 3px 1px 0 #ff6644, 4px 1px 0 #ff4422, 5px 1px 0 #ff8866,
        1px 2px 0 #ff8866, 2px 2px 0 #ff4422, 3px 2px 0 #ffccaa, 4px 2px 0 #ff6644, 5px 2px 0 #ff4422, 6px 2px 0 #cc2200,
        1px 3px 0 #ff6644, 2px 3px 0 #ffccaa, 3px 3px 0 #ff6644, 4px 3px 0 #ffccaa, 5px 3px 0 #ff6644, 6px 3px 0 #ff4422,
        1px 4px 0 #ff4422, 2px 4px 0 #ff6644, 3px 4px 0 #ffccaa, 4px 4px 0 #ff6644, 5px 4px 0 #ff4422, 6px 4px 0 #cc2200,
        1px 5px 0 #cc2200, 2px 5px 0 #ff4422, 3px 5px 0 #ff6644, 4px 5px 0 #ff4422, 5px 5px 0 #cc2200, 6px 5px 0 #991100,
        2px 6px 0 #cc2200, 3px 6px 0 #ff4422, 4px 6px 0 #cc2200, 5px 6px 0 #991100,
        3px 7px 0 #991100, 4px 7px 0 #991100;
}
.sun-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: sunPulse 2s ease-in-out infinite alternate;
}
@keyframes sunPulse {
    0% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.3); }
}
.orbit-ring {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}
.orbit-planet {
    position: absolute;
    animation: planetOrbit var(--orbit-duration) linear infinite;
}
@keyframes planetOrbit {
    0%   { transform: rotate(0deg) translateX(var(--orbit-r)) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(var(--orbit-r)) rotate(-360deg); }
}

/* Planet wrapper (float in from offscreen) */
@keyframes planetFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(var(--float-dx), var(--float-dy)) rotate(var(--float-rot)); }
}

/* Lemming walker sprite + orbit */
.lemming-planet-wrapper {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}
.lemming-orbit {
    position: absolute;
    animation: lemmingOrbit var(--orbit-duration) linear infinite;
}
.lemming-walker-sprite {
    width: 1px;
    height: 1px;
    transform: scale(var(--lemming-scale, 4));
    transform-origin: 5px 5px;
    animation: walker 0.65s step-start infinite;
}
@keyframes lemmingOrbit {
    0%   { transform: rotate(0deg) translateX(var(--orbit-r)) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(var(--orbit-r)) rotate(-360deg); }
}
@keyframes walker {
    12% {
        box-shadow: 5px 0px 0 var(--lemming-head), 7px 0px 0 var(--lemming-head), 4px 1px 0 var(--lemming-head), 5px 1px 0 var(--lemming-head), 6px 1px 0 var(--lemming-head), 4px 2px 0 var(--lemming-head), 5px 2px 0 var(--lemming-head), 6px 2px 0 var(--lemming-body), 5px 3px 0 var(--lemming-body), 6px 3px 0 var(--lemming-body), 7px 3px 0 var(--lemming-body), 5px 4px 0 var(--lemming-body), 6px 4px 0 var(--lemming-eyes), 4px 5px 0 var(--lemming-body), 5px 5px 0 var(--lemming-eyes), 6px 5px 0 var(--lemming-eyes), 4px 6px 0 var(--lemming-body), 5px 6px 0 var(--lemming-eyes), 6px 6px 0 var(--lemming-eyes), 8px 6px 0 var(--lemming-body), 5px 7px 0 var(--lemming-eyes), 6px 7px 0 var(--lemming-eyes), 8px 7px 0 var(--lemming-body), 4px 8px 0 var(--lemming-eyes), 5px 8px 0 var(--lemming-eyes), 7px 8px 0 var(--lemming-body), 4px 9px 0 var(--lemming-body), 5px 9px 0 var(--lemming-body);
    }
    25% {
        box-shadow: 4px 1px 0 var(--lemming-head), 6px 1px 0 var(--lemming-head), 4px 2px 0 var(--lemming-head), 5px 2px 0 var(--lemming-head), 6px 2px 0 var(--lemming-head), 5px 3px 0 var(--lemming-head), 6px 3px 0 var(--lemming-body), 5px 4px 0 var(--lemming-body), 6px 4px 0 var(--lemming-body), 7px 4px 0 var(--lemming-body), 4px 5px 0 var(--lemming-body), 5px 5px 0 var(--lemming-body), 6px 5px 0 var(--lemming-eyes), 4px 6px 0 var(--lemming-body), 5px 6px 0 var(--lemming-eyes), 6px 6px 0 var(--lemming-eyes), 3px 7px 0 var(--lemming-body), 4px 7px 0 var(--lemming-body), 5px 7px 0 var(--lemming-eyes), 6px 7px 0 var(--lemming-eyes), 7px 7px 0 var(--lemming-eyes), 4px 8px 0 var(--lemming-eyes), 5px 8px 0 var(--lemming-eyes), 6px 8px 0 var(--lemming-eyes), 7px 8px 0 var(--lemming-eyes), 3px 9px 0 var(--lemming-body), 4px 9px 0 var(--lemming-body), 7px 9px 0 var(--lemming-body), 8px 9px 0 var(--lemming-body);
    }
    37% {
        box-shadow: 5px 1px 0 var(--lemming-head), 6px 1px 0 var(--lemming-head), 4px 2px 0 var(--lemming-head), 5px 2px 0 var(--lemming-head), 6px 2px 0 var(--lemming-body), 7px 2px 0 var(--lemming-head), 4px 3px 0 var(--lemming-head), 5px 3px 0 var(--lemming-body), 6px 3px 0 var(--lemming-body), 7px 3px 0 var(--lemming-body), 5px 4px 0 var(--lemming-body), 6px 4px 0 var(--lemming-eyes), 5px 5px 0 var(--lemming-body), 6px 5px 0 var(--lemming-eyes), 4px 6px 0 var(--lemming-body), 5px 6px 0 var(--lemming-eyes), 6px 6px 0 var(--lemming-eyes), 5px 7px 0 var(--lemming-eyes), 6px 7px 0 var(--lemming-eyes), 3px 8px 0 var(--lemming-body), 4px 8px 0 var(--lemming-eyes), 5px 8px 0 var(--lemming-eyes), 6px 8px 0 var(--lemming-eyes), 7px 8px 0 var(--lemming-eyes), 3px 9px 0 var(--lemming-body), 6px 9px 0 var(--lemming-body), 7px 9px 0 var(--lemming-body);
    }
    50% {
        box-shadow: 4px 1px 0 var(--lemming-head), 5px 1px 0 var(--lemming-head), 6px 1px 0 var(--lemming-head), 7px 1px 0 var(--lemming-head), 4px 2px 0 var(--lemming-head), 5px 2px 0 var(--lemming-head), 6px 2px 0 var(--lemming-body), 5px 3px 0 var(--lemming-body), 6px 3px 0 var(--lemming-body), 7px 3px 0 var(--lemming-body), 5px 4px 0 var(--lemming-body), 6px 4px 0 var(--lemming-eyes), 5px 5px 0 var(--lemming-eyes), 6px 5px 0 var(--lemming-body), 5px 6px 0 var(--lemming-body), 6px 6px 0 var(--lemming-eyes), 5px 7px 0 var(--lemming-eyes), 6px 7px 0 var(--lemming-eyes), 4px 8px 0 var(--lemming-body), 5px 8px 0 var(--lemming-eyes), 6px 8px 0 var(--lemming-eyes), 5px 9px 0 var(--lemming-body), 6px 9px 0 var(--lemming-body);
    }
    62% {
        box-shadow: 5px 0px 0 var(--lemming-head), 7px 0px 0 var(--lemming-head), 4px 1px 0 var(--lemming-head), 5px 1px 0 var(--lemming-head), 6px 1px 0 var(--lemming-head), 4px 2px 0 var(--lemming-head), 5px 2px 0 var(--lemming-head), 6px 2px 0 var(--lemming-body), 5px 3px 0 var(--lemming-body), 6px 3px 0 var(--lemming-body), 7px 3px 0 var(--lemming-body), 5px 4px 0 var(--lemming-body), 6px 4px 0 var(--lemming-eyes), 5px 5px 0 var(--lemming-eyes), 6px 5px 0 var(--lemming-body), 5px 6px 0 var(--lemming-eyes), 6px 6px 0 var(--lemming-body), 8px 6px 0 var(--lemming-body), 5px 7px 0 var(--lemming-eyes), 6px 7px 0 var(--lemming-eyes), 8px 7px 0 var(--lemming-body), 4px 8px 0 var(--lemming-eyes), 5px 8px 0 var(--lemming-eyes), 7px 8px 0 var(--lemming-body), 4px 9px 0 var(--lemming-body), 5px 9px 0 var(--lemming-body);
    }
    75% {
        box-shadow: 4px 1px 0 var(--lemming-head), 6px 1px 0 var(--lemming-head), 4px 2px 0 var(--lemming-head), 5px 2px 0 var(--lemming-head), 6px 2px 0 var(--lemming-head), 5px 3px 0 var(--lemming-head), 6px 3px 0 var(--lemming-body), 5px 4px 0 var(--lemming-body), 6px 4px 0 var(--lemming-body), 7px 4px 0 var(--lemming-body), 5px 5px 0 var(--lemming-eyes), 6px 5px 0 var(--lemming-body), 5px 6px 0 var(--lemming-eyes), 6px 6px 0 var(--lemming-body), 5px 7px 0 var(--lemming-eyes), 6px 7px 0 var(--lemming-eyes), 7px 7px 0 var(--lemming-body), 4px 8px 0 var(--lemming-eyes), 5px 8px 0 var(--lemming-eyes), 6px 8px 0 var(--lemming-eyes), 7px 8px 0 var(--lemming-eyes), 3px 9px 0 var(--lemming-body), 4px 9px 0 var(--lemming-body), 7px 9px 0 var(--lemming-body), 8px 9px 0 var(--lemming-body);
    }
    87% {
        box-shadow: 5px 1px 0 var(--lemming-head), 6px 1px 0 var(--lemming-head), 4px 2px 0 var(--lemming-head), 5px 2px 0 var(--lemming-head), 6px 2px 0 var(--lemming-body), 7px 2px 0 var(--lemming-head), 4px 3px 0 var(--lemming-head), 5px 3px 0 var(--lemming-body), 6px 3px 0 var(--lemming-body), 7px 3px 0 var(--lemming-body), 5px 4px 0 var(--lemming-body), 6px 4px 0 var(--lemming-eyes), 5px 5px 0 var(--lemming-body), 6px 5px 0 var(--lemming-eyes), 5px 6px 0 var(--lemming-eyes), 6px 6px 0 var(--lemming-body), 5px 7px 0 var(--lemming-eyes), 6px 7px 0 var(--lemming-eyes), 3px 8px 0 var(--lemming-body), 4px 8px 0 var(--lemming-eyes), 5px 8px 0 var(--lemming-eyes), 6px 8px 0 var(--lemming-eyes), 7px 8px 0 var(--lemming-eyes), 3px 9px 0 var(--lemming-body), 6px 9px 0 var(--lemming-body), 7px 9px 0 var(--lemming-body);
    }
}
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: rgba(0,0,0,0.85);
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #fff;
    border-left: 3px solid #ffd700;
    opacity: 0;
    transition: opacity 0.5s;
    max-width: 280px;
}

/* Weapon multiplier badge */
#multiplier-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    font-family: monospace;
    font-size: 1.6em;
    font-weight: bold;
    padding: 8px 18px;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s;
    text-shadow: 0 0 12px currentColor;
}
#multiplier-badge.active {
    opacity: 1;
    transform: scale(1);
    animation: multPulse 0.8s ease-in-out infinite alternate;
}
@keyframes multPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.1); filter: brightness(1.3); }
}
#multiplier-bar {
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    transition: width 0.1s linear;
}

/* Boosted laser */
#laser-beam.boosted {
    filter: brightness(1.5) saturate(1.3);
    animation: laserPulse 0.15s ease-in-out infinite alternate;
}
#laser-beam[data-tier="nova"] {
    filter: brightness(1.6) saturate(1.5);
    animation: laserPulse 0.12s ease-in-out infinite alternate;
}
#laser-beam[data-tier="inferno"] {
    filter: brightness(1.8) saturate(1.6);
    animation: laserPulse 0.1s ease-in-out infinite alternate;
}
#laser-beam[data-tier="devastator"] {
    filter: brightness(2) saturate(1.8);
    animation: laserPulse 0.08s ease-in-out infinite alternate;
}
#laser-beam[data-tier="supernova"] {
    filter: brightness(2.5) saturate(2);
    animation: laserPulse 0.06s ease-in-out infinite alternate;
}
@keyframes laserPulse {
    from { opacity: 0.85; }
    to { opacity: 1; }
}

.laser-trail {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 23;
    opacity: 0.7;
    animation: trailFade 0.6s ease-out forwards;
}
@keyframes trailFade {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.5); opacity: 0; }
}

.laser-impact {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 26;
    opacity: 0.9;
    animation: impactFlash 0.3s ease-out forwards;
}
@keyframes impactFlash {
    0% { transform: scale(0.5); opacity: 0.9; }
    50% { transform: scale(1.5); opacity: 0.6; }
    100% { transform: scale(2); opacity: 0; }
}
