body {
    margin: 0;
    overflow: hidden;
    font-family: 'Orbitron', sans-serif;
    background-color: #050011;
    color: #fff;
}

#game {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, #050011 0%, #1a0b2e 80%, #2d1b4e 100%);
}

/* Synthwave Grid Background */
#background-grid {
    position: absolute;
    width: 200vw;
    height: 100vh;
    bottom: 0;
    left: -50vw;
    background-image: 
        linear-gradient(rgba(255, 0, 255, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 255, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center bottom;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 1s linear infinite;
    z-index: 0;
    opacity: 0.6;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}

/* UI Elements */
#score, #level {
    position: absolute;
    top: 20px;
    font-size: 1.5em;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    z-index: 10;
    letter-spacing: 2px;
}

#score { left: 20px; color: #0ff; }
#level { right: 20px; color: #f0f; }

/* Character: Red Panda (SVG) */
#character {
    width: 60px;
    height: 60px;
    background-color: transparent;
    background-image: url('panda.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    bottom: 100px;
    left: 50px;
    z-index: 5;
    /* Clean look for SVG */
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
    
    /* Running Animation */
    animation: run-bounce 0.3s infinite alternate ease-in-out;
    transform-origin: bottom center; /* Pivot from feet */
}

@keyframes run-bounce {
    0% {
        transform: translateY(0) rotate(-5deg) scaleY(0.95);
    }
    100% {
        transform: translateY(-10px) rotate(5deg) scaleY(1.05);
    }
}

.jump {
    /* Animation handled in JS for physics, or CSS class helper */
    /* We will implement physics-based jump in JS for better control */
}

/* Obstacles */
.obstacle {
    position: absolute;
    bottom: 100px;
    z-index: 5;
}

.obstacle-spike {
    width: 30px;
    height: 60px;
    background: #f0f;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 10px #f0f, 0 0 20px #f0f;
}

.obstacle-wall {
    width: 40px;
    height: 70px;
    background: #2196F3; /* Blue */
    box-shadow: 0 0 10px #2196F3, 0 0 20px #2196F3;
    border: 2px solid #fff;
}

.obstacle-saw {
    width: 50px;
    height: 50px;
    background: #FF0000; /* Red */
    border-radius: 50%;
    border: 4px dashed #fff; /* Saw teeth look */
    box-shadow: 0 0 10px #FF0000, 0 0 20px #FF0000;
    animation: spin 0.2s linear infinite;
}

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

/* Game Over Screen */
#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #f0f;
    padding: 50px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
    z-index: 20;
    backdrop-filter: blur(5px);
}

#game-over h1 {
    font-size: 3em;
    margin: 0 0 20px 0;
    color: #f0f;
    text-shadow: 0 0 10px #f0f;
}

#game-over p {
    font-size: 1.2em;
    color: #fff;
}

#restart-btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.2em;
    font-family: 'Orbitron', sans-serif;
    background: transparent;
    color: #0ff;
    border: 2px solid #0ff;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 0 10px #0ff;
    transition: all 0.3s;
}

#restart-btn:hover {
    background: #0ff;
    color: #000;
    box-shadow: 0 0 30px #0ff;
}

.hidden { display: none; }