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

body {
    background: #000;
    overflow: hidden;
    font-family: 'Press Start 2P', cursive;
    color: #fff;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gameCanvas {
    background: #0a0a0f;
    display: block;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    pointer-events: none;
    z-index: 10;
}

#score-display, #level-display, #lives-display, #high-score-display {
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
}

/* Audio Controls */
#audio-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    pointer-events: auto;
}

#mute-btn {
    font-size: 20px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #0ff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

#mute-btn:hover {
    background: rgba(0, 255, 255, 0.2);
}

.volume-sliders {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #333;
}

.volume-sliders label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #888;
}

.volume-sliders input[type="range"] {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    border-radius: 2px;
    cursor: pointer;
}

.volume-sliders input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #0ff;
    border-radius: 50%;
    cursor: pointer;
}

.volume-sliders input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #0ff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#lives span:last-child {
    color: #ff4466;
    letter-spacing: 4px;
}

/* Overlay Screens */
.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    text-align: center;
    padding: 20px;
}

.overlay-screen.hidden {
    display: none;
}

.overlay-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #0ff, #f0f, #ff0);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    text-shadow: none;
}

.overlay-screen h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #0ff;
    text-shadow: 0 0 20px #0ff;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    font-size: 10px;
    color: #888;
    margin-bottom: 30px;
}

.instructions {
    margin-bottom: 25px;
}

.instructions p {
    font-size: 10px;
    margin: 8px 0;
    color: #aaa;
}

.key {
    display: inline-block;
    background: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 8px;
    color: #0ff;
    font-size: 9px;
}

.letter-info {
    margin-bottom: 30px;
}

.letter-info p {
    font-size: 10px;
    margin: 8px 0;
}

.letter-e {
    color: #ff4444;
    text-shadow: 0 0 10px #ff4444;
}

.letter-r {
    color: #4488ff;
    text-shadow: 0 0 10px #4488ff;
}

.letter-p {
    color: #44ff88;
    text-shadow: 0 0 10px #44ff88;
}

.powerup-info {
    margin-bottom: 20px;
}

.powerup-info p {
    font-size: 9px;
    color: #888;
}

.powerup-w {
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

.powerup-s {
    color: #ff66aa;
    text-shadow: 0 0 10px #ff66aa;
}

.powerup-a {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.powerup-d {
    color: #aa66ff;
    text-shadow: 0 0 10px #aa66ff;
}

.score-decay {
    color: #ff6666;
    font-size: 8px;
    margin-top: 8px;
}

button {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    padding: 15px 40px;
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

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

#final-score, #final-high-score, #completed-level, #level-bonus {
    color: #ff0;
    text-shadow: 0 0 10px #ff0;
}

.continue-text {
    margin-top: 20px;
    font-size: 12px;
    color: #666;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* CRT Scanline Effect (subtle) */
#game-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Vignette Effect */
#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 999;
}

/* Name Entry */
#name-entry {
    margin: 20px 0;
}

#name-entry.hidden {
    display: none;
}

.new-high {
    color: #ff0 !important;
    font-size: 14px !important;
    animation: pulse 0.5s ease infinite;
    margin-bottom: 10px !important;
}

#name-input {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.initial-input {
    width: 50px;
    height: 60px;
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    text-align: center;
    text-transform: uppercase;
    background: #111;
    border: 2px solid #0ff;
    color: #0ff;
    outline: none;
}

.initial-input:focus {
    border-color: #ff0;
    box-shadow: 0 0 15px #ff0;
}

#submit-score-btn {
    margin-top: 10px;
    font-size: 10px;
    padding: 10px 25px;
}

/* Leaderboard */
#leaderboard {
    margin: 25px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 280px;
}

#leaderboard h3 {
    font-size: 12px;
    color: #0ff;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #0ff;
}

#score-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#score-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 10px;
    border-bottom: 1px solid #222;
}

#score-list li:last-child {
    border-bottom: none;
}

#score-list li .rank {
    color: #888;
    width: 30px;
}

#score-list li .name {
    color: #0ff;
    width: 60px;
    text-align: left;
}

#score-list li .score {
    color: #ff0;
    text-align: right;
    flex: 1;
}

#score-list li.current {
    background: rgba(255, 255, 0, 0.1);
    border-radius: 4px;
    padding: 8px 5px;
}
