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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-overlay > div {
    pointer-events: auto;
}

#scoreboard {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 40px;
    border-radius: 20px;
    border: 3px solid #4ec9b0;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 10;
}

#player-score, #opponent-score {
    display: flex;
    align-items: center;
    gap: 15px;
}

#player-score { color: #3366ff; }
#opponent-score { color: #ff3333; }

.score {
    font-size: 32px;
    background: rgba(255,255,255,0.1);
    padding: 2px 12px;
    border-radius: 8px;
}

#time {
    font-size: 36px;
    color: #fff;
    min-width: 80px;
    text-align: center;
}

#settings-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.75);
    padding: 20px;
    border-radius: 15px;
    width: 300px;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
}

#settings-panel h4 {
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4ec9b0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
}

.setting-item {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-item label {
    font-size: 13px;
    color: #ccc;
}

.setting-item div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item input[type="range"] {
    flex: 1;
    accent-color: #4ec9b0;
    cursor: pointer;
}

.setting-item span {
    min-width: 35px;
    text-align: right;
    font-size: 14px;
    font-family: monospace;
}

#speedometer {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 50% 50% 15px 15px;
    width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 4px solid #ffaa00;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.3);
    z-index: 10;
}

#speed-display {
    font-size: 28px;
    font-weight: bold;
    font-family: monospace;
    margin-bottom: 10px;
}

#boost-bar {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    overflow: hidden;
}

#boost-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff5500, #ffaa00);
    transition: width 0.05s ease-out;
}

#controls-hint {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: rgba(0,0,0,0.6);
    padding: 15px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
}

#controls-hint h3 {
    color: #4ec9b0;
    font-size: 16px;
    margin-bottom: 4px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key {
    background: #fff;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 0 #aaa;
}

#message-display {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #ffaa00;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 5;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 22, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
    pointer-events: auto;
}

#start-screen h1 {
    font-size: 64px;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 8px;
}

#start-screen p {
    font-size: 24px;
    color: #aaa;
    margin-bottom: 40px;
}

#start-btn, #restart-btn {
    font-size: 28px;
    padding: 20px 60px;
    background: linear-gradient(180deg, #4ec9b0 0%, #359a86 100%);
    border: none;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 4px;
    box-shadow: 0 10px 30px rgba(78, 201, 176, 0.4);
    transition: all 0.3s;
}

#start-btn:hover, #restart-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(78, 201, 176, 0.6);
}