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

body {
    font-family: 'Orbitron', sans-serif;
    background: #050510;
    color: #fff;
    overflow: hidden;
    transition: box-shadow 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    touch-action: none;
}

#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(5,5,16,0.9) 100%);
    padding: 1rem;
}

#start-screen.hidden {
    display: none;
}

.start-content {
    text-align: center;
    animation: fadeIn 1s ease;
    max-width: 90vw;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.title {
    font-size: clamp(2rem, 10vw, 5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #aaccff 0%, #ffffff 50%, #8899cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(136, 170, 255, 0.5);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.subtitle {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 2.5vw, 1.2rem);
    color: #8899bb;
    margin-bottom: 2rem;
    opacity: 0.8;
    padding: 0 1rem;
}

#start-btn, #restart-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(68, 136, 255, 0.2) 0%, rgba(136, 68, 255, 0.2) 100%);
    border: 1px solid rgba(136, 170, 255, 0.5);
    color: #aaccff;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    letter-spacing: 0.1em;
    min-height: 48px;
    min-width: 200px;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(68, 136, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(68, 136, 255, 0.6); }
}

#start-btn:hover, #restart-btn:hover {
    background: linear-gradient(135deg, rgba(68, 136, 255, 0.4) 0%, rgba(136, 68, 255, 0.4) 100%);
    transform: scale(1.05);
}

#start-btn:active, #restart-btn:active {
    transform: scale(0.98);
}

.controls-hint {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.65rem, 2vw, 0.8rem);
    color: #667788;
    margin-top: 1.5rem;
}

.mobile-hint {
    display: none;
}

@media (max-width: 768px) {
    .controls-hint:not(.mobile-hint) {
        display: none;
    }
    .mobile-hint {
        display: block;
    }
}

#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    padding: 1rem;
}

#hud.hidden {
    display: none;
}

#vibe-container {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.hud-label {
    font-size: clamp(0.55rem, 1.5vw, 0.7rem);
    color: #667788;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 0.3rem;
}

#vibe-bar {
    width: clamp(80px, 20vw, 150px);
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

#vibe-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #44ffff 0%, #ff44ff 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(68, 255, 255, 0.5);
}

#distance-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    text-align: right;
}

#distance {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 700;
    color: #aaccff;
}

.unit {
    font-size: clamp(0.6rem, 1.5vw, 0.8rem);
    color: #667788;
    margin-left: 0.3rem;
}

#title-display {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(0.7rem, 2vw, 1rem);
    color: rgba(170, 204, 255, 0.5);
    letter-spacing: 0.3em;
    white-space: nowrap;
}

#control-hints {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #445566;
    white-space: nowrap;
}

#control-hints span {
    color: #667788;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: radial-gradient(ellipse at center, rgba(20, 10, 40, 0.95) 0%, rgba(5, 5, 16, 0.98) 100%);
    animation: fadeIn 0.5s ease;
    padding: 1rem;
}

#game-over.hidden {
    display: none;
}

.game-over-content {
    text-align: center;
    max-width: 90vw;
}

.game-over-content h2 {
    font-size: clamp(1.8rem, 8vw, 3.5rem);
    color: #ff88aa;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.go-subtitle {
    font-family: 'Space Mono', monospace;
    color: #667788;
    margin-bottom: 2rem;
    font-size: clamp(0.75rem, 2vw, 1rem);
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-label {
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    color: #667788;
    letter-spacing: 0.2em;
}

.stat span:nth-child(2) {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 700;
    color: #aaccff;
}

#footer {
    position: fixed;
    bottom: 0.75rem;
    right: 1rem;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.6rem, 1.5vw, 0.7rem);
    color: rgba(102, 119, 136, 0.6);
    z-index: 200;
}

#footer a {
    color: rgba(136, 170, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

#footer a:hover {
    color: rgba(136, 170, 255, 1);
}

@media (max-width: 768px) {
    #title-display {
        display: none;
    }
    
    #control-hints {
        display: none;
    }
    
    #hud {
        padding: 0.75rem;
    }
    
    #vibe-container {
        top: 0.75rem;
        left: 0.75rem;
    }
    
    #distance-container {
        top: 0.75rem;
        right: 0.75rem;
    }
}

@media (max-width: 400px) {
    .title {
        letter-spacing: 0.05em;
    }
    
    #start-btn, #restart-btn {
        padding: 0.875rem 1.5rem;
        min-width: 180px;
    }
}