:root {
    --bg-color: #0f0f1a;
    --text-color: #e0e0e0;
    --accent-color: #00ffcc;
    --secondary-color: #ff00ff;
    --card-bg: #1a1a2e;
    --border-color: #2a2a40;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
    text-align: center;
}

header {
    margin-bottom: 30px;
}

h1 {
    font-family: 'Press Start 2P', cursive;
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
    line-height: 1.5;
}

.status-message {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.sub-message {
    color: #a0a0b0;
    font-size: 0.9rem;
}

.game-container {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 30px;
    border: 4px solid var(--accent-color);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
    aspect-ratio: 16/10;
    overflow: hidden;
}

.canvas-wrapper::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 5;
    pointer-events: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.mute-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-color);
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    z-index: 20;
    padding: 0;
}

.mute-toggle:hover {
    background: rgba(0, 255, 204, 0.2);
    transform: scale(1.1);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    z-index: 10;
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.controls {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #aaa;
}

#score-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

input {
    padding: 10px;
    border-radius: 5px;
    border: 2px solid var(--accent-color);
    background: #000;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    text-align: center;
    outline: none;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: var(--accent-color);
    color: #000;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

button:hover {
    transform: scale(1.05);
    background: #00ffaa;
}

#restart-btn {
    background: transparent;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
}

#restart-btn:hover {
    background: var(--secondary-color);
    color: #fff;
}

.leaderboard-section {
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-section h3 {
    font-family: 'Press Start 2P', cursive;
    color: #ffcc00;
    margin-bottom: 20px;
    font-size: 1rem;
}

.leaderboard-table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto', sans-serif;
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--accent-color);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td:first-child {
    font-weight: bold;
    color: #ffcc00;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

footer {
    margin-top: 40px;
    font-size: 0.8rem;
    color: #555;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1rem;
    }
    .canvas-wrapper {
        border-width: 2px;
    }
}