html {
    height: 100%;
    overflow-x: hidden;
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: #121212;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #000005;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 100;
}

#player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

#player-status {
    padding: 8px 12px;
    background-color: rgba(0, 200, 0, 0.7);
    border-radius: 6px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

#player-status.dead {
    background-color: rgba(255, 85, 85, 0.7) !important;
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.5);
    animation: pulse 1s infinite alternate;
}

#player-count {
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

#player-score {
    padding: 5px 10px;
    background-color: rgba(255, 215, 0, 0.7);
    border-radius: 4px;
    color: #000;
    font-weight: bold;
}

#player-lives {
    padding: 5px 10px;
    background-color: rgba(0, 128, 0, 0.7);
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#player-lives.last-life {
    background-color: rgba(255, 85, 85, 0.7) !important;
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.5);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

#controls-info {
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* Control indicators */
#control-indicators {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

#movement-indicator, #turning-indicator, #shoot-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    padding: 5px;
}

.key-row {
    display: flex;
    gap: 2px;
}

.key {
    width: 30px;
    height: 30px;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin: 2px;
    position: relative;
    overflow: hidden;
}

.key-space {
    width: 80px;
}

.key-active {
    background-color: rgba(0, 204, 136, 0.8) !important;
    box-shadow: 0 0 15px rgba(0, 204, 136, 0.6), 0 0 30px rgba(0, 204, 136, 0.3) !important;
    transform: translateY(2px);
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Cooldown overlay for space key */
.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 85, 85, 0.6);
    transition: height 0.05s linear;
    z-index: 5;
    backdrop-filter: blur(1px);
}

.label {
    color: white;
    font-size: 10px;
    margin-top: 5px;
}

.key-ARROWLEFT, .key-ARROWRIGHT {
    color: #ffcc00;
}

/* Animations */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(145, 94, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(145, 94, 255, 0.8), 0 0 30px rgba(145, 94, 255, 0.5); }
    100% { box-shadow: 0 0 5px rgba(145, 94, 255, 0.5); }
}

/* Star background animation */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle var(--duration, 4s) infinite var(--delay, 0s);
    opacity: 0.7;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1); }
}

/* Scoreboard enhancement */
.scoreboard-row {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    margin: 2px 0;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.scoreboard-row.current-player {
    background-color: rgba(145, 94, 255, 0.2);
    border-left: 3px solid #915eff;
}

.scoreboard-row:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #050816, #0a0a2e);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-left-color: #915eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Floating text enhancement */
.floating-text {
    position: absolute;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    white-space: nowrap;
}

/* Camping warning enhancement */
.camping-warning {
    background: linear-gradient(to right, rgba(255, 85, 85, 0.1), rgba(255, 85, 85, 0.3), rgba(255, 85, 85, 0.1));
    border: 1px solid rgba(255, 85, 85, 0.4);
    backdrop-filter: blur(4px);
}

/* Color selection on start screen */
.color-option-selected {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 0 10px currentColor;
    z-index: 1;
    position: relative;
}

/* Start screen button animation */
@keyframes pulse-button {
    0% { box-shadow: 0 0 0 0 rgba(145, 94, 255, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(145, 94, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(145, 94, 255, 0); }
}

#start-screen button:hover {
    animation: pulse-button 1.5s infinite;
}

/* Ship preview animation */
.ship-preview {
    transform-origin: center;
    animation: hover-animation 3s ease-in-out infinite;
}

@keyframes hover-animation {
    0% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0); }
}

/* Input focus styles */
input:focus {
    box-shadow: 0 0 0 2px rgba(145, 94, 255, 0.5);
}

/* Ship preview on start screen */
.ship-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.ship-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    animation: float 3s ease-in-out infinite;
}

.ship-preview-shape {
    width: 100%;
    height: 100%;
    position: relative;
}

.ship-preview-shape::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    width: 0;
    height: 0;
    border-left: 25px solid currentColor;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    filter: drop-shadow(0 0 10px currentColor);
}

.ship-preview-flame {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 15px;
    height: 10px;
    background: linear-gradient(to left, #ff9900, transparent);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
    animation: flame 0.5s linear infinite alternate;
}

@keyframes float {
    0% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, -60%); }
    100% { transform: translate(-50%, -50%); }
}

@keyframes flame {
    0% { opacity: 0.5; width: 10px; }
    100% { opacity: 1; width: 15px; }
}

/* Protection shield effects */
@keyframes shield-pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.7; }
    100% { opacity: 0.3; }
}

@keyframes shield-rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.protection-effect {
    position: absolute;
    border: 4px solid rgba(0, 200, 255, 0.6);
    border-radius: 50%;
    transform-origin: center;
    animation: shield-pulse 2s infinite ease-in-out, shield-rotation 10s infinite linear;
    pointer-events: none;
}

/* Game Over Modal Styles */
#game-over-modal .modal-content {
    transform: scale(0.8);
    opacity: 0;
}

.shadow-neon-red {
    box-shadow: 0 0 15px rgba(255, 50, 50, 0.5), 
                0 0 30px rgba(255, 50, 50, 0.3);
}

/* Heartbeat animation for game over text */
@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.05); }
    30% { transform: scale(1); }
    45% { transform: scale(1.05); }
    60% { transform: scale(1); }
}

#game-over-modal h2 {
    animation: heartbeat 2s infinite;
}

/* Pulse animation for restart button */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

#game-over-modal button:first-child {
    animation: pulse 2s infinite;
}

/* Level transition animations */
@keyframes level-pulse {
    0% { text-shadow: 0 0 10px rgba(255, 204, 0, 0.7); }
    50% { text-shadow: 0 0 25px rgba(255, 204, 0, 1), 0 0 40px rgba(255, 204, 0, 0.6); }
    100% { text-shadow: 0 0 10px rgba(255, 204, 0, 0.7); }
}

.level-pulse {
    animation: level-pulse 1.5s infinite ease-in-out;
}

/* Level indicator in UI */
#player-level {
    position: relative;
    transition: all 0.3s ease;
}

#player-level.text-yellow-400 {
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.7);
}

/* Level transition overlay */
#level-transition {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Level background effects - stars move faster at higher levels */
.star {
    transition: opacity 1s ease;
}

/* Asteroid colors by level */
.level-1-asteroid {
    filter: grayscale(0.8);
}

.level-2-asteroid {
    filter: sepia(0.5);
}

.level-3-asteroid {
    filter: hue-rotate(120deg);
}

.level-4-asteroid {
    filter: hue-rotate(240deg);
}

.level-5-asteroid {
    filter: hue-rotate(45deg) saturate(2);
} 