@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #050505; font-family: 'Inter', sans-serif; }

/* ===== LANGUAGE SELECT ===== */
#langSelect {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #0a0a1a 0%, #050508 60%, #000 100%);
    z-index: 200;
    overflow: hidden;
}
#langSelect::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Animated grid background */
.grid-bg {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    pointer-events: none;
    animation: gridPulse 8s ease-in-out infinite;
}
@keyframes gridPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Floating orb particles */
.particle-container {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: floatParticle 15s infinite linear;
}
.particle:nth-child(odd) { background: rgba(59, 130, 246, 0.4); }
.particle:nth-child(even) { background: rgba(168, 85, 247, 0.3); }

@keyframes floatParticle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* Title */
.game-title {
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4.5em;
    font-weight: 700;
    color: #fff;
    letter-spacing: 20px;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-shadow: 0 0 40px rgba(59, 130, 246, 0.3), 0 0 80px rgba(168, 85, 247, 0.15);
}
.game-title .orb-dot {
    display: inline-block;
    width: 12px; height: 12px;
    background: #fff;
    border-radius: 50%;
    vertical-align: middle;
    margin: 0 2px;
    box-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(59, 130, 246, 0.3);
    animation: orbPulse 3s ease-in-out infinite;
}
@keyframes orbPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255,255,255,0.8), 0 0 60px rgba(168, 85, 247, 0.5); }
}

.game-subtitle {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85em;
    font-weight: 300;
    letter-spacing: 6px;
    margin-bottom: 60px;
    text-transform: uppercase;
}

/* Menu buttons */
.menu-btn {
    position: relative;
    display: block;
    width: 280px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    padding: 16px 40px;
    margin: 6px 0;
    font-size: 0.95em;
    font-weight: 500;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-radius: 4px;
}
.menu-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(168, 85, 247, 0.1));
    opacity: 0;
    transition: opacity 0.4s;
}
.menu-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.6s;
}
.menu-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15), 0 0 0 1px rgba(59, 130, 246, 0.1);
}
.menu-btn:hover::before { opacity: 1; }
.menu-btn:hover::after { left: 100%; }
.menu-btn:active { transform: translateY(0); }

/* Separator */
.menu-separator {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    margin: 30px auto;
}

/* Version tag */
.version-tag {
    position: absolute;
    bottom: 30px;
    color: rgba(255, 255, 255, 0.12);
    font-size: 0.7em;
    letter-spacing: 3px;
}

/* ===== MENU (DIFFICULTY) ===== */
#menu {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, #0a0a1a 0%, #050508 60%, #000 100%);
    z-index: 100;
    overflow: hidden;
}
#menu::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(168, 85, 247, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== HUD ===== */
#hud {
    position: fixed; top: 20px; left: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75em;
    font-family: 'Space Grotesk', monospace;
    z-index: 10;
    display: none;
    letter-spacing: 1px;
}
#hud .item {
    margin: 4px 0;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 2px 2px 0;
    transition: all 0.3s;
}
#hud .item.active {
    color: #fff;
    border-left-color: rgba(59, 130, 246, 0.6);
}

/* Crosshair */
#crosshair {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 24px; height: 24px; z-index: 10;
    display: none;
}
#crosshair::before, #crosshair::after {
    content: ''; position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
}
#crosshair::before { width: 2px; height: 100%; left: 50%; transform: translateX(-50%); }
#crosshair::after { height: 2px; width: 100%; top: 50%; transform: translateY(-50%); }

/* Interaction hint */
#interactHint {
    position: fixed;
    top: calc(50% + 30px);
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75em;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    text-align: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 4px;
}
#interactHint.show { opacity: 1; }

/* Carry indicator */
#carryIndicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(59, 130, 246, 0.7);
    font-size: 0.8em;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 3px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    pointer-events: none;
}
#carryIndicator.show { opacity: 1; }

/* ===== NOTIFICATION ===== */
#notification {
    position: fixed; bottom: 40px; left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.85em;
    font-family: 'Space Grotesk', sans-serif;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 10;
    text-align: center;
    letter-spacing: 3px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}
#notification.show { opacity: 1; }

/* ===== TUTORIAL OVERLAY ===== */
#tutorialOverlay {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s;
    width: 90%;
    max-width: 600px;
}
#tutorialOverlay.show { opacity: 1; }

.tuto-message {
    color: #fff;
    font-size: 1.3em;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 1px;
    padding: 24px 36px;
    background: rgba(10, 10, 30, 0.85);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(15px);
    line-height: 1.8;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.15), inset 0 0 30px rgba(59, 130, 246, 0.05);
}
.tuto-message .key-hint {
    display: inline-block;
    background: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.6);
    color: #7cb8ff;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    margin: 0 3px;
    font-weight: 700;
    letter-spacing: 2px;
}
.tuto-step-icon {
    font-size: 2em;
    margin-bottom: 10px;
    display: block;
}
.tuto-progress {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75em;
    letter-spacing: 3px;
}
.tuto-progress-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px auto 0;
    border-radius: 2px;
    overflow: hidden;
}
.tuto-progress-fill {
    height: 100%;
    background: rgba(59, 130, 246, 0.7);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Tutorial arrow indicator */
.tuto-arrow-3d {
    position: fixed;
    z-index: 12;
    pointer-events: none;
    color: rgba(59, 130, 246, 0.8);
    font-size: 2em;
    animation: arrowBounce 1.5s ease-in-out infinite;
}
@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-8px); opacity: 1; }
}

/* ===== DOOR ROOM UI ===== */
#doorRoomUI {
    position: fixed; inset: 0;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 50;
}
#doorRoomUI .doors-container {
    display: flex; gap: 30px;
}
#doorRoomUI .door {
    width: 120px; height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8em;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.3s;
    flex-direction: column; gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
}
#doorRoomUI .door:hover {
    border-color: rgba(59, 130, 246, 0.5);
    color: #fff;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.1);
}
#doorRoomUI .door.locked { opacity: 0.3; cursor: not-allowed; }
#doorRoomUI .door.completed { border-color: rgba(34, 197, 94, 0.5); color: rgba(34, 197, 94, 0.8); }
#doorRoomUI .close-btn {
    position: absolute; top: 30px; right: 30px;
    color: rgba(255, 255, 255, 0.3); cursor: pointer; font-size: 1.5em;
    transition: color 0.3s;
}
#doorRoomUI .close-btn:hover { color: #fff; }

/* ===== UNLOCK MODE ===== */
#unlockMode {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: none; z-index: 50;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 40px 50px;
    background: rgba(5, 5, 10, 0.95);
    backdrop-filter: blur(20px);
    text-align: center;
    border-radius: 6px;
}
#unlockMode .combo-display {
    color: #fff;
    font-size: 2.2em;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 12px;
    margin: 20px 0;
    min-height: 50px;
}
#unlockMode .combo-hint {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8em;
    letter-spacing: 2px;
}
#unlockMode .combo-result {
    color: rgba(255, 255, 255, 0.5);
    margin-top: 15px;
    font-family: 'Space Grotesk', sans-serif;
}

/* ===== INVENTORY PANEL ===== */
#inventoryPanel {
    position: fixed; right: 20px; top: 20px;
    display: none; z-index: 10;
    text-align: right;
}
#inventoryPanel .inv-item {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.7em;
    font-family: 'Space Grotesk', sans-serif;
    margin: 4px 0;
    letter-spacing: 2px;
    padding: 3px 10px;
    transition: all 0.3s;
}
#inventoryPanel .inv-item.collected {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* ===== MAP OVERLAY ===== */
#mapOverlay {
    position: fixed; inset: 0;
    display: none; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 50;
}
#mapOverlay canvas {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#langSelect .game-title { animation: fadeInUp 1s ease-out; }
#langSelect .game-subtitle { animation: fadeInUp 1s ease-out 0.2s both; }
#langSelect .menu-btn:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.5s both; }
#langSelect .menu-btn:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.65s both; }

#menu .game-title { animation: fadeInUp 0.8s ease-out; }
#menu .game-subtitle { animation: fadeInUp 0.8s ease-out 0.15s both; }
#menu .menu-btn:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.3s both; }
#menu .menu-btn:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.4s both; }
#menu .menu-btn:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.5s both; }
