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

html, body {
    background: #0a0a0a;
    font-family: 'Courier New', monospace;
    color: #33ff33;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* CRT scanlines */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 1000;
}

/* Menu / game over overlay */
#menu, #game-over {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 40px;
    border: 3px solid #33ff33;
    background: rgba(0, 20, 0, 0.95);
    box-shadow: 0 0 30px rgba(51, 255, 51, 0.3), inset 0 0 50px rgba(51, 255, 51, 0.1);
    border-radius: 10px;
    z-index: 50;
}

#menu h1, #game-over h1 {
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px #33ff33;
}

.subtitle { font-size: 14px; opacity: 0.7; margin-bottom: 30px; }
.difficulty-select h3 { margin-bottom: 20px; font-size: 16px; }

.difficulty-btn {
    background: transparent;
    border: 2px solid #33ff33;
    color: #33ff33;
    padding: 15px 40px;
    margin: 8px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    cursor: pointer;
    text-transform: uppercase;
}
.difficulty-btn:hover { background: #33ff33; color: #0a0a0a; }

.copyright { font-size: 14px; margin-top: 25px; opacity: 0.7; }
.github-link { font-size: 14px; margin-top: 8px; opacity: 0.8; }
.github-link a { color: #33ff33; border-bottom: 1px dashed rgba(51, 255, 51, 0.5); text-decoration: none; }

/* Game layout - fixed margins, flex column */
#game-container {
    position: fixed;
    top: 10px; left: 50px; right: 50px; bottom: 10px;
    display: flex;
    flex-direction: column;
}

#scoreboard {
    font-size: 36px;
    text-align: center;
    text-shadow: 0 0 15px #33ff33;
    padding: 5px 0;
    flex-shrink: 0;
}

#gameCanvas {
    border: 3px solid #33ff33;
    background: #0a1a0a;
    box-shadow: 0 0 30px rgba(51, 255, 51, 0.3), inset 0 100px rgba(51, 255, 51, 0.05);
    border-radius: 5px;
    flex: 1 1 0;
    min-height: 0;
}

#controls {
    text-align: center;
    font-size: 14px;
    opacity: 0.7;
    padding: 5px 0;
    flex-shrink: 0;
}
#controls p { margin-bottom: 5px; }

button {
    background: transparent;
    border: 2px solid #33ff33;
    color: #33ff33;
    padding: 8px 25px;
    margin: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
}
button:hover { background: #33ff33; color: #0a0a0a; }

#game-over #final-score { font-size: 18px; margin-bottom: 25px; opacity: 0.8; }
#game-over #game-result { font-size: 42px; margin-bottom: 15px; text-shadow: 0 0 20px #33ff33; }

#paused-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 10, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
#paused-overlay h1 { font-size: 48px; margin-bottom: 30px; text-shadow: 0 0 30px #33ff33; }

.game-copyright {
    position: fixed;
    bottom: 12px; right: 15px;
    font-size: 14px;
    opacity: 0.7;
}

.hidden { display: none !important; }

/* Welcome message */
.welcome-msg {
    font-size: 16px;
    color: #aaffaa;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(51, 255, 51, 0.5);
}

/* Leaderboard */
.leaderboard {
    margin: 15px auto;
    max-width: 400px;
}
.leaderboard h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #66ff66;
    text-shadow: 0 0 10px #33ff33;
}
#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
#leaderboard-table th, #leaderboard-table td {
    padding: 4px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(51, 255, 51, 0.3);
}
#leaderboard-table th {
    color: #66ff66;
    font-size: 12px;
    text-transform: uppercase;
}

/* Initials input */
.new-high-score {
    font-size: 20px;
    color: #ffff33;
    text-shadow: 0 0 15px #ffff33;
    margin-bottom: 10px;
}
#initials-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}
.initial-input {
    width: 50px;
    height: 60px;
    background: transparent;
    border: 2px solid #33ff33;
    color: #33ff33;
    font-family: 'Courier New', monospace;
    font-size: 36px;
    text-align: center;
    text-transform: uppercase;
    caret-color: #33ff33;
}
.initial-input:focus {
    outline: none;
    background: rgba(51, 255, 51, 0.1);
    box-shadow: 0 0 15px rgba(51, 255, 51, 0.5);
}
#save-score-btn {
    margin-top: 10px;
    font-size: 16px;
    padding: 10px 30px;
}
