:root {
    --primary-color: #00ff88;
    --bg-color: #1a1a2e;
    --ui-text-color: #ffffff;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-family);
    color: var(--ui-text-color);
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to canvas during game */
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: none; 
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.screen.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* Main Menu & Game Over */
h1, h2 {
    font-size: 4rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    margin-bottom: 2rem;
    background: linear-gradient(45deg, #00ff88, #00b8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

input {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    border-radius: 50px;
    border: none;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    margin-bottom: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.2);
}

.color-picker {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
}

.color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.selected {
    border: 2px solid white;
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
    transform: scale(1.15);
}

button {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 50px;
    border: none;
    background: linear-gradient(45deg, #00ff88, #00b8ff);
    color: #1a1a2e;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-family);
}

.cursor-picker {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.cursor-option {
    font-size: 24px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.cursor-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.cursor-option.selected {
    border-color: var(--primary-color);
    background: rgba(0, 255, 136, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

button:active {
    transform: scale(0.95);
}

/* HUD */
#hud {
    background: none;
    pointer-events: none;
    backdrop-filter: none;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
}

#hud.active {
    display: block; /* Override flex */
}

#score-board {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#leaderboard {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 10px;
    min-width: 200px;
}

#leaderboard h3 {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
    font-size: 1.2rem;
}

#leaderboard ul {
    list-style: none;
}

#leaderboard li {
    padding: 5px 0;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
}

#boost-meter-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

#boost-meter-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0055, #ff8800);
    transform-origin: left;
    transition: transform 0.1s linear;
}
