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

body {
    font-family: 'Courier New', monospace;
    overflow: hidden;
    background: #000;
    touch-action: none;
}

#canvas3d {
    display: block;
    width: 100%;
    height: 100vh;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-content h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
}

.loading-bar {
    width: 400px;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid #fff;
    margin: 0 auto 20px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
}

.loading-text {
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Instructions Screen */
#instructions {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #fff;
    padding: 20px;
}

.instructions-content {
    max-width: 800px;
    text-align: center;
}

.instructions-content h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #00d9ff;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.8);
}

.instructions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.instruction-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #00d9ff;
}

.instruction-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #ffeb3b;
}

.instruction-section p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.city-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #4ecdc4;
    margin-bottom: 30px;
}

.city-info h2 {
    color: #4ecdc4;
    margin-bottom: 10px;
}

#start-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 0 5px 30px rgba(102, 126, 234, 0.5);
    transition: all 0.3s;
}

#start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 40px rgba(102, 126, 234, 0.8);
}

/* Crosshair */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff00;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    pointer-events: none;
    z-index: 1000;
    display: none;
}

/* Info HUD */
.info-hud {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    pointer-events: none;
    max-width: 400px;
}

.hud-item {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #00d9ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-item.health-hud {
    border-left-color: #ff0000;
}

.hud-label {
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
}

.hud-value {
    color: #00ff00;
    font-size: 1.2rem;
    font-weight: bold;
    margin-left: auto;
}

.health-bar-container {
    width: 150px;
    height: 20px;
    background: rgba(255, 0, 0, 0.3);
    border: 2px solid #fff;
    border-radius: 10px;
    overflow: hidden;
}

.health-bar {
    height: 100%;
    width: 100%;
    background: #00ff00;
    transition: width 0.3s, background 0.3s;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    pointer-events: none;
}

.mobile-controls > * {
    pointer-events: auto;
}

/* Virtual Joystick */
.joystick {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.joystick-knob {
    width: 40px;
    height: 40px;
    background: rgba(0, 217, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.6);
    transition: transform 0.1s;
}

/* Action Buttons */
.action-buttons {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 15px;
}

.action-btn {
    width: 70px;
    height: 70px;
    background: rgba(0, 217, 255, 0.3);
    border: 3px solid rgba(0, 217, 255, 0.8);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.4);
    transition: all 0.2s;
}

.action-btn:active {
    transform: scale(0.95);
    background: rgba(0, 217, 255, 0.6);
}

.action-btn span {
    font-size: 1.5rem;
}

.action-btn small {
    font-size: 0.7rem;
    margin-top: 2px;
}

/* Look Area (invisible touch area) */
.look-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Show mobile controls on small screens */
@media (max-width: 768px) {
    .mobile-controls {
        display: block;
    }

    #crosshair {
        display: block;
    }

    .info-hud {
        display: none;
    }

    .instructions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .instructions-content h1 {
        font-size: 1.8rem;
    }

    .instruction-section h2 {
        font-size: 1.2rem;
    }

    .instruction-section p {
        font-size: 0.9rem;
    }

    #start-btn {
        font-size: 1.2rem;
        padding: 12px 30px;
    }

    .loading-content h1 {
        font-size: 2rem;
    }

    .loading-bar {
        width: 90%;
        max-width: 300px;
    }
}

@media (min-width: 769px) {
    #crosshair {
        display: block;
    }
}

/* Pointer Lock Active */
body.pointer-locked {
    cursor: none;
}

body.pointer-locked #crosshair {
    display: block;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 217, 255, 0.8);
    }
}

/* Touch feedback */
@media (hover: none) {
    .action-btn:active {
        animation: pulse 0.3s;
    }
}
