@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0a0a12;
    overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
}

.game-container {
    position: relative;
    width: 900px;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 0 60px rgba(255, 200, 50, 0.3),
        0 0 100px rgba(255, 100, 50, 0.2),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        #1a0a2e 0%,
        #2d1b4e 30%,
        #4a1a6b 60%,
        #6b2a8a 100%
    );
    z-index: 0;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 160px 20px, white, transparent),
        radial-gradient(2px 2px at 200px 60px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 250px 50px, white, transparent),
        radial-gradient(2px 2px at 300px 30px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 350px 70px, white, transparent),
        radial-gradient(2px 2px at 400px 20px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 450px 55px, white, transparent),
        radial-gradient(2px 2px at 500px 40px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 550px 25px, white, transparent),
        radial-gradient(2px 2px at 600px 65px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 650px 45px, white, transparent),
        radial-gradient(2px 2px at 700px 35px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 750px 75px, white, transparent),
        radial-gradient(2px 2px at 800px 15px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 850px 55px, white, transparent);
    animation: twinkle 4s ease-in-out infinite;
    z-index: 1;
}

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

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(
        180deg,
        #ff6b35 0%,
        #e55a2b 50%,
        #cc4420 100%
    );
    z-index: 2;
    box-shadow: 0 -5px 30px rgba(255, 107, 53, 0.5);
}

.ground::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        #ffcc00,
        #ff9500,
        #ffcc00,
        #ff9500,
        #ffcc00
    );
    box-shadow: 0 0 20px #ffcc00;
}

.ceiling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(
        180deg,
        #cc4420 0%,
        #e55a2b 50%,
        #ff6b35 100%
    );
    z-index: 2;
    box-shadow: 0 5px 30px rgba(255, 107, 53, 0.5);
}

.ceiling::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        #ffcc00,
        #ff9500,
        #ffcc00,
        #ff9500,
        #ffcc00
    );
    box-shadow: 0 0 20px #ffcc00;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

.ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
    pointer-events: none;
}

.score-display, .high-score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 25px;
    border-radius: 8px;
    border: 2px solid rgba(255, 200, 50, 0.3);
}

.score-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 3px;
}

.score-value, .high-score-value {
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 0 0 20px rgba(255, 200, 50, 0.8);
}

.high-score-value {
    color: #ff6b35;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.8);
}

.start-screen, .game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 18, 0.9);
    z-index: 20;
    animation: fadeIn 0.5s ease;
}

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

.game-title {
    font-family: 'Orbitron', monospace;
    font-size: 56px;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 
        0 0 30px rgba(255, 200, 50, 0.8),
        0 0 60px rgba(255, 200, 50, 0.4),
        0 4px 0 #cc9900;
    margin-bottom: 40px;
    letter-spacing: 4px;
    animation: pulse 2s ease-in-out infinite;
}

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

.instructions {
    margin-bottom: 40px;
}

.key-hint {
    display: flex;
    align-items: center;
    gap: 15px;
}

.key {
    background: linear-gradient(180deg, #3a3a4a, #2a2a3a);
    color: #ffcc00;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 700;
    border: 2px solid #4a4a5a;
    box-shadow: 
        0 4px 0 #1a1a2a,
        0 6px 20px rgba(0, 0, 0, 0.4);
}

.key-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
}

.play-btn, .retry-btn {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 700;
    padding: 18px 60px;
    background: linear-gradient(180deg, #ffcc00, #ff9500);
    color: #1a0a2e;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 6px 0 #cc7700,
        0 10px 30px rgba(255, 150, 0, 0.4);
    transition: all 0.15s ease;
    letter-spacing: 2px;
}

.play-btn:hover, .retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 0 #cc7700,
        0 14px 40px rgba(255, 150, 0, 0.5);
}

.play-btn:active, .retry-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #cc7700,
        0 4px 20px rgba(255, 150, 0, 0.3);
}

.game-over-screen {
    background: rgba(10, 10, 18, 0.95);
}

.game-over-title {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    font-weight: 900;
    color: #ff4444;
    text-shadow: 
        0 0 30px rgba(255, 68, 68, 0.8),
        0 0 60px rgba(255, 68, 68, 0.4);
    margin-bottom: 30px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

.final-score {
    display: flex;
    gap: 15px;
    font-size: 32px;
    color: white;
    margin-bottom: 40px;
}

.final-score span:last-child {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    color: #ffcc00;
    text-shadow: 0 0 20px rgba(255, 200, 50, 0.8);
}

.hidden {
    display: none !important;
}

