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

body {
    background: #050510;
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
}

#canvas {
    border: 2px solid #1a1a3e;
    border-radius: 8px;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.1),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    cursor: none;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    padding: 20px;
}

#hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#player-score {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #00ffff;
    font-size: 14px;
    text-shadow: 0 0 10px #00ffff;
}

#player-score span {
    font-weight: 900;
    font-size: 18px;
}

#timer {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 3px;
    border: 2px solid #ffd700;
    text-shadow: 0 0 15px #ffd700;
}

#leaderboard {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
    border: 1px solid #333;
}

#hud-bottom {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
}

#dash-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#dash-indicator svg {
    width: 50px;
    height: 50px;
    transform: rotate(-90deg);
}

.dash-bg {
    fill: none;
    stroke: #1a1a3e;
    stroke-width: 4;
}

.dash-fill {
    fill: none;
    stroke: #00ffff;
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s;
    filter: drop-shadow(0 0 5px #00ffff);
}

.dash-fill.ready {
    stroke: #00ff88;
    filter: drop-shadow(0 0 10px #00ff88);
}

#dash-indicator span {
    font-size: 10px;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(5, 5, 20, 0.95);
    padding: 40px 60px;
    border-radius: 16px;
    border: 2px solid #00ffff;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 
        0 0 50px rgba(0, 255, 255, 0.2),
        inset 0 0 30px rgba(0, 255, 255, 0.05);
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

#start-screen h1 {
    font-size: 42px;
    font-weight: 900;
    background: linear-gradient(135deg, #00ffff, #ff6b6b, #b069ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    letter-spacing: 4px;
}

#start-screen h2 {
    font-size: 18px;
    color: #888;
    font-weight: 400;
    margin-bottom: 30px;
    letter-spacing: 6px;
}

#player-name {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    color: #fff;
    padding: 12px 20px;
    font-size: 16px;
    font-family: 'JetBrains Mono', monospace;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

#player-name:focus {
    border-color: #00ffff;
}

#player-name::placeholder {
    color: #555;
}

button {
    background: linear-gradient(135deg, #00ffff, #00cccc);
    color: #000;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.controls-hint {
    margin-top: 30px;
    font-size: 12px;
    color: #666;
    font-family: 'JetBrains Mono', monospace;
    line-height: 2;
}

.high-score {
    margin-top: 20px;
    font-size: 14px;
    color: #ffd700;
}

#countdown-screen {
    background: transparent;
    border: none;
    box-shadow: none;
}

#countdown-text {
    font-size: 120px;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 
        0 0 30px #00ffff,
        0 0 60px #00ffff;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#end-screen h1 {
    font-size: 48px;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 0 0 30px #ffd700;
}

#end-screen h2 {
    font-size: 16px;
    color: #888;
    margin-bottom: 15px;
    letter-spacing: 4px;
}

.final-score-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #222;
    font-size: 14px;
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
    transform: translateX(-20px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.final-score-row .rank {
    font-weight: 900;
    width: 40px;
}

.final-score-row .name {
    flex: 1;
    text-align: left;
    padding-left: 10px;
}

.final-score-row .score {
    font-family: 'JetBrains Mono', monospace;
}

#game-stats {
    margin: 25px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

#game-stats .stat {
    font-size: 12px;
    color: #888;
    padding: 5px 0;
    font-family: 'JetBrains Mono', monospace;
}

#play-again-btn {
    margin-top: 10px;
}

footer {
    padding: 10px;
    text-align: center;
}

footer a {
    color: #555;
    text-decoration: none;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    transition: color 0.3s;
}

footer a:hover {
    color: #00ffff;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #start-screen h1 {
        font-size: 28px;
    }
    
    #start-screen h2 {
        font-size: 12px;
    }
    
    .screen {
        padding: 30px 25px;
        width: 90%;
        max-width: 350px;
    }
    
    #timer {
        font-size: 20px;
        padding: 10px 20px;
    }
    
    #player-score {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    #leaderboard {
        font-size: 10px;
        padding: 8px 10px;
    }
    
    .controls-hint p:nth-child(3) {
        display: none;
    }
    
    .controls-hint::after {
        content: '👆 Double-tap to dash';
        display: block;
        margin-top: 10px;
    }
}

@media (max-height: 600px) {
    #hud-bottom {
        bottom: 10px;
    }
    
    #dash-indicator svg {
        width: 40px;
        height: 40px;
    }
}