/* Labyrinth Explorer 3D - Styles */

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

body {
    font-family: system-ui, sans-serif;
    background: #0a0a0f;
    overflow: hidden;
    color: #e0d5c0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

canvas {
    display: block;
}

/* HUD */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(10, 10, 15, 0.9), transparent);
    z-index: 100;
    pointer-events: none;
}

#hud > div {
    background: rgba(139, 90, 43, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    letter-spacing: 1px;
}

#timer-display {
    color: #ffd700;
    font-size: 18px !important;
}

#timer-display.warning {
    color: #ff6b6b;
    animation: pulse 0.5s ease-in-out infinite;
}

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

/* Minimap */
#minimap-container {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(10, 10, 15, 0.8);
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    padding: 8px;
    z-index: 100;
    pointer-events: none;
}

#minimap {
    display: block;
    border-radius: 4px;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.95);
    z-index: 200;
}

.screen-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

.screen h1 {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.story-intro {
    margin: 30px 0;
    line-height: 1.8;
    font-size: 16px;
}

.highlight {
    color: #ffd700;
    font-weight: bold;
}

.controls-info {
    background: rgba(139, 90, 43, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
}

.controls-info h3 {
    color: #ffd700;
    margin-bottom: 15px;
}

.controls-info p {
    margin: 8px 0;
    font-size: 14px;
}

.stats {
    background: rgba(139, 90, 43, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.stats p {
    margin: 10px 0;
    font-size: 18px;
}

/* Buttons */
.game-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 15px auto;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #0a0a0f;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: all 0.3s;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.game-btn:active {
    transform: translateY(0);
}

.game-btn.secondary {
    background: transparent;
    border: 2px solid rgba(212, 175, 55, 0.5);
    color: #ffd700;
}

.game-btn.secondary:hover {
    background: rgba(212, 175, 55, 0.2);
}

/* Score Popup Animation */
.score-popup {
    position: absolute;
    color: #ffd700;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 150;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.2);
    }
}

/* Treasure collect flash */
.treasure-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 215, 0, 0.2);
    pointer-events: none;
    animation: flash 0.3s ease-out forwards;
    z-index: 150;
}

@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Level complete animation */
@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#level-complete-screen h1 {
    animation: celebrate 0.5s ease-in-out 3;
}

/* Responsive */
@media (max-width: 600px) {
    .screen h1 {
        font-size: 32px;
    }

    .story-intro {
        font-size: 14px;
    }

    #hud > div {
        padding: 6px 10px;
        font-size: 12px;
    }

    #minimap-container {
        top: 60px;
        right: 10px;
        padding: 5px;
    }

    .game-btn {
        font-size: 16px;
        padding: 12px 24px;
    }
}

/* Loading state */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd700;
    font-size: 24px;
    z-index: 300;
}

/* Crosshair for first-person view */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 100;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 215, 0, 0.6);
}

.crosshair::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
}

.crosshair::after {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
}
