/* ===== NEON DASH 3D - MOBILE OPTIMIZED STYLES ===== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #050510;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Mobile-first responsive text */
html {
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 10px;
    }
}

/* Game Container */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#game-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* UI Container */
#ui-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#ui-container > * {
    pointer-events: auto;
}

/* Score Board */
#score-board {
    position: fixed;
    top: 10px;
    right: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    z-index: 100;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 5px;
}

@media (max-width: 768px) {
    #score-board {
        top: 5px;
        right: 5px;
        font-size: 1rem;
        padding: 5px 10px;
    }
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 16, 0.95);
    z-index: 200;
}

#start-screen.hidden {
    display: none;
}

.menu-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 30px;
    max-width: 90vw;
    max-height: 90vh;
    padding: 20px;
}

@media (max-width: 768px), (max-height: 500px) {
    .menu-layout {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        overflow-y: auto;
        padding: 10px;
    }
}

/* Leaderboard Panel */
.leaderboard-panel {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff0055;
    border-radius: 15px;
    padding: 20px;
    min-width: 200px;
    max-width: 300px;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-panel h2 {
    font-family: 'Orbitron', sans-serif;
    color: #ff0055;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #ff0055;
}

.leaderboard-panel ul {
    list-style: none;
}

.leaderboard-panel li {
    color: #fff;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

@media (max-width: 768px), (max-height: 500px) {
    .leaderboard-panel {
        display: none;
    }
}

/* Main Controls */
.main-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.main-controls h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #00ffff;
    text-shadow: 0 0 30px #00ffff, 0 0 60px #00ffff;
    margin-bottom: 20px;
    text-align: center;
}

@media (max-width: 768px), (max-height: 500px) {
    .main-controls h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
}

.glitch-text {
    animation: glitch 1s infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 2px); }
    94% { transform: translate(2px, -2px); }
    96% { transform: translate(-2px, -2px); }
    98% { transform: translate(2px, 2px); }
}

/* Input Group */
.input-group {
    margin-bottom: 15px;
    width: 100%;
    max-width: 250px;
}

.input-group input, #nickname-input, #nickname {
    width: 100%;
    padding: 12px 15px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #00ffff;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 8px;
    outline: none;
    text-align: center;
    text-transform: uppercase;
}

.input-group input::placeholder, #nickname-input::placeholder, #nickname::placeholder {
    color: rgba(0, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .input-group input, #nickname-input, #nickname {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Cyber Button */
.cyber-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    padding: 15px 40px;
    border: 3px solid #ff0055;
    background: transparent;
    color: #ff0055;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    border-radius: 8px;
    min-width: 200px;
    touch-action: manipulation;
}

.cyber-btn:hover, .cyber-btn:active {
    background: #ff0055;
    color: #fff;
    box-shadow: 0 0 30px #ff0055;
    transform: scale(1.02);
}

.cyber-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px), (max-height: 500px) {
    .cyber-btn {
        font-size: 0.9rem;
        padding: 12px 25px;
        min-width: 150px;
    }
}

/* Game Over Screen */
#game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 300;
}

#game-over-screen.hidden {
    display: none;
}

.danger-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: #ff0055;
    text-shadow: 0 0 30px #ff0055;
    margin-bottom: 20px;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#game-over-screen p {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.btn-row {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 768px) {
    .danger-text {
        font-size: 2rem;
    }
    
    #game-over-screen p {
        font-size: 1.2rem;
    }
    
    .btn-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Countdown Overlay */
#countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 400;
}

#countdown-overlay.hidden {
    display: none;
}

#countdown-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 8rem;
    color: #00ffff;
    text-shadow: 0 0 50px #00ffff;
    animation: countPulse 1s infinite;
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@media (max-width: 768px) {
    #countdown-text {
        font-size: 5rem;
    }
}

/* Hype Container */
#hype-container {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 100;
    width: 90%;
}

/* Split Divider (for duel mode) */
#split-divider {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #ff0055;
    z-index: 50;
    display: none;
    box-shadow: 0 0 10px #ff0055;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 3px;
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Safe area insets for notched phones */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}
