:root {
    --bg-color: #0D1B2A;
    --primary-color: #0984E3;
    --secondary-color: #74B9FF;
    --accent-color: #E17055;
    --text-color: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.hud {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.score-board {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.value {
    font-size: 1.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.canvas-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(9, 132, 227, 0.2);
    border: 2px solid var(--primary-color);
    background-color: #050b12;
}

canvas {
    display: block;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(6px);
    transition: opacity 0.3s ease;
    z-index: 10;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 85%;
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    font-weight: 800;
}

.text-accent {
    color: var(--accent-color);
}

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

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

.controls-hint {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.key-hint {
    display: flex;
    gap: 6px;
}

.key {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: bold;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    font-size: 1.1rem;
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 5px;
}

button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

button:active {
    transform: translateY(0);
}

.final-score {
    display: flex;
    flex-direction: column;
    margin: 5px 0;
}

.high-scores-container {
    margin-top: 15px;
    width: 100%;
}

h3 {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--secondary-color);
    margin-bottom: 12px;
    text-transform: uppercase;
}

#high-scores-list {
    list-style: none;
    width: 100%;
}

#high-scores-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
    background: rgba(255,255,255,0.02);
}

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

#high-scores-list li .rank {
    font-weight: 800;
    color: var(--primary-color);
    margin-right: 10px;
}

#high-scores-list li .score-val {
    font-weight: 700;
    color: var(--text-color);
}
