* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a15;
    font-family: 'Press Start 2P', monospace;
    touch-action: none;
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

#controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    display: none;
    pointer-events: none;
    z-index: 100;
}

.joystick-area {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50%;
    height: 100%;
    pointer-events: auto;
}

.joystick-base {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0,245,212,0.3) 0%, rgba(0,245,212,0.1) 70%, transparent 100%);
    border: 3px solid rgba(0,245,212,0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.joystick-stick {
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #00f5d4 0%, #00a896 100%);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(0,245,212,0.6);
    transition: transform 0.05s;
}

.button-area {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
}

.action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0,0,0,0.5);
}

.action-btn.active {
    transform: scale(0.9);
}

.punch-btn {
    border-color: #ff006e;
    box-shadow: 0 0 20px rgba(255,0,110,0.5);
}

.punch-btn.active {
    background: rgba(255,0,110,0.5);
    box-shadow: 0 0 30px rgba(255,0,110,0.8);
}

.sprint-btn {
    border-color: #fee440;
    box-shadow: 0 0 20px rgba(254,228,64,0.5);
}

.sprint-btn.active {
    background: rgba(254,228,64,0.5);
    box-shadow: 0 0 30px rgba(254,228,64,0.8);
}

.vehicle-btn {
    border-color: #3a86ff;
    box-shadow: 0 0 20px rgba(58,134,255,0.5);
}

.vehicle-btn.active {
    background: rgba(58,134,255,0.5);
    box-shadow: 0 0 30px rgba(58,134,255,0.8);
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    background: linear-gradient(135deg, rgba(10,10,21,0.95) 0%, rgba(22,33,62,0.95) 100%);
}

.start-screen, .game-over-screen {
    text-align: center;
    padding: 30px;
    max-width: 90%;
}

.title-container {
    margin-bottom: 20px;
}

.game-title {
    font-size: clamp(24px, 8vw, 48px);
    background: linear-gradient(180deg, #ff006e 0%, #9b5de5 50%, #00f5d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(255,0,110,0.5));
    animation: titlePulse 2s ease-in-out infinite;
}

.game-subtitle {
    font-size: clamp(36px, 12vw, 72px);
    color: #00f5d4;
    text-shadow: 0 0 30px rgba(0,245,212,0.8);
    margin-top: -10px;
}

@keyframes titlePulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255,0,110,0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(255,0,110,0.8)); }
}

.neon-sign {
    font-size: clamp(14px, 4vw, 20px);
    color: #ff006e;
    text-shadow: 0 0 10px #ff006e, 0 0 20px #ff006e, 0 0 40px #ff006e;
    padding: 10px 30px;
    border: 2px solid #ff006e;
    display: inline-block;
    margin: 20px 0;
    animation: neonFlicker 3s infinite;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
    }
    20%, 24%, 55% {
        opacity: 0.8;
    }
}

.tap-start {
    font-size: clamp(12px, 3vw, 16px);
    color: #fee440;
    margin: 30px 0;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.high-score {
    font-size: clamp(10px, 2.5vw, 14px);
    color: #00f5d4;
    margin: 15px 0;
}

.sound-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #9b5de5;
    background: rgba(0,0,0,0.5);
    font-size: 24px;
    cursor: pointer;
}

.controls-hint {
    margin-top: 30px;
    font-size: clamp(8px, 2vw, 10px);
    color: #666;
    line-height: 2;
}

.game-over-screen {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.game-over-title {
    font-size: clamp(28px, 10vw, 56px);
    color: #ff006e;
    text-shadow: 0 0 20px #ff006e;
    margin-bottom: 30px;
}

.final-stats {
    font-size: clamp(10px, 2.5vw, 14px);
    color: #fff;
    line-height: 2.5;
}

.final-score {
    font-size: clamp(20px, 6vw, 32px);
    color: #fee440;
    text-shadow: 0 0 15px rgba(254,228,64,0.6);
    margin: 10px 0;
}

.new-record {
    color: #00f5d4 !important;
    animation: rainbowPulse 1s infinite;
}

@keyframes rainbowPulse {
    0%, 100% { color: #00f5d4; }
    33% { color: #ff006e; }
    66% { color: #fee440; }
}

.restart-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(10px, 2.5vw, 14px);
    padding: 15px 30px;
    margin: 30px 0 20px 0;
    background: linear-gradient(135deg, #ff006e 0%, #9b5de5 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    animation: blink 1s ease-in-out infinite;
}

.remix-link {
    display: block;
    font-size: 10px;
    color: #666;
    text-decoration: none;
    margin-top: 20px;
    transition: color 0.3s;
}

.remix-link:hover {
    color: #00f5d4;
}

/* Landscape adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    #controls {
        height: 150px;
    }
    
    .joystick-base {
        width: 80px;
        height: 80px;
    }
    
    .joystick-stick {
        width: 40px;
        height: 40px;
    }
    
    .action-btn {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .button-area {
        flex-direction: row;
        gap: 10px;
    }
}