* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #06081a;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #e0e0e0;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

#homeBtn {
    position: fixed; top: 14px; left: 14px; z-index: 100;
    color: #aaa; text-decoration: none; font-size: 14px; font-weight: 600;
    background: rgba(0,0,0,0.5); padding: 6px 14px; border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
#homeBtn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.menu-link {
    display: inline-block; margin-top: 12px;
    color: #aaa; text-decoration: none; font-size: 13px; font-weight: 600;
    transition: color 0.2s;
}
.menu-link:hover { color: #fff; }

#startScreen {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(6,8,26,0.92);
    z-index: 10;
    gap: 16px;
}

#startScreen h1 {
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 12px;
    background: linear-gradient(135deg, #ff6644 0%, #ffaa22 50%, #ff4466 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 15px;
    color: #556;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.controls {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    font-size: 14px; color: #778;
}
.controls b { color: #aac; }

#mapSelect {
    display: flex; gap: 10px; flex-wrap: wrap;
    justify-content: center;
    margin: 16px 0;
}

.map-btn {
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    border: 2px solid rgba(255,102,68,0.2);
    border-radius: 6px;
    background: rgba(255,102,68,0.05);
    color: #887;
    cursor: pointer;
    transition: all 0.2s;
}
.map-btn:hover {
    background: rgba(255,102,68,0.12);
    border-color: rgba(255,102,68,0.4);
}
.map-btn.selected {
    background: rgba(255,102,68,0.15);
    border-color: rgba(255,102,68,0.6);
    color: #ff6644;
}

#playBtn, #retryBtn, #backBtn, #restartBtn {
    margin-top: 14px;
    padding: 14px 48px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 4px;
    border: 2px solid rgba(255,102,68,0.3);
    border-radius: 6px;
    background: rgba(255,102,68,0.08);
    color: #ff6644;
    cursor: pointer;
    transition: all 0.2s;
}
#playBtn:hover, #retryBtn:hover, #backBtn:hover, #restartBtn:hover {
    background: rgba(255,102,68,0.18);
    border-color: rgba(255,102,68,0.5);
    transform: scale(1.04);
}
#backBtn {
    background: rgba(100,100,120,0.08);
    border-color: rgba(100,100,120,0.3);
    color: #889;
}

#hud {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 12px 20px;
    z-index: 5;
    pointer-events: none;
}
#hud.hidden { display: none; }

#timerBox {
    font-size: 32px;
    font-weight: 800;
    color: #ff6644;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(255,102,68,0.4);
    font-variant-numeric: tabular-nums;
}

#mapName {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#bestTime {
    font-size: 14px;
    font-weight: 600;
    color: #448;
    letter-spacing: 1px;
}

#winOverlay, #deathOverlay {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: rgba(6,8,26,0.92);
    z-index: 10;
    gap: 14px;
}
#winOverlay.hidden, #deathOverlay.hidden { display: none; }

#winTitle {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #ffaa22;
}

#winTime {
    font-size: 32px;
    font-weight: 700;
    color: #ff6644;
    letter-spacing: 2px;
}

#winBest {
    font-size: 16px;
    color: #667;
    letter-spacing: 1px;
}

#deathTitle {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #ff4444;
}

#deathTime {
    font-size: 22px;
    color: #667;
}

@media(max-width:640px){
    #startScreen h1 { font-size: 40px; letter-spacing: 8px; }
    #mapSelect { gap: 6px; }
    .map-btn { padding: 8px 14px; font-size: 11px; }
}
