:root {
    --primary: #6e8efb;
    --secondary: #a777e3;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --text: #333333;
    --danger: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
}

body { 
    margin: 0; 
    padding: 0; 
    overflow: hidden; 
    background: #2c3e50;
    font-family: 'Arial', sans-serif;
}

.parallax-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.bg-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.layer-1 {
    background: linear-gradient(to bottom, #1a2a3a, #2c3e50);
}

.layer-2 {
    background-image: url('https://www.transparenttextures.com/patterns/dark-mosaic.png');
    opacity: 0.2;
}

.layer-3 {
    background-image: url('https://www.transparenttextures.com/patterns/starfield.png');
    opacity: 0.1;
    animation: starfield 60s linear infinite;
}

@keyframes starfield {
    from { background-position: 0 0; }
    to { background-position: 1000px 1000px; }
}

canvas { 
    display: block; 
    background: transparent;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
}

#ui {
    position: absolute;
    top: 15px;
    left: 20px;
    color: white;
    font-size: 1.1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    padding: 10px 15px;
    border-radius: 20px;
    display: flex;
    gap: 20px;
    backdrop-filter: blur(5px);
}

#level-display {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 1.1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    padding: 10px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

#gameOverScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    animation: fadeIn 0.5s ease;
}

#victoryScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.screen-title {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 0 0 15px currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.game-button {
    padding: 12px 30px;
    font-size: 1.2rem;
    margin-top: 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    pointer-events: auto;
}

.game-button:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(0,0,0,0.3);
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

#controls-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    z-index: 10;
    backdrop-filter: blur(5px);
    display: flex;
    gap: 15px;
}

.control-key {
    background: rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

#damage-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(231, 76, 60, 0);
    pointer-events: none;
    z-index: 5;
    transition: background-color 0.3s;
}

/* Jump effect */
@keyframes jumpEffect {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.jump-effect {
    animation: jumpEffect 0.3s ease-out;
}