/* public/css/landing.css */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Poppins:wght@300;400;600&display=swap');

:root {
    --gold-ancient: #d4af37;
    --gold-bright: #FFD700;
    --stone-dark: #1a0f0a;
    --red-tomb: #8b2500;
    --hud-bg: rgba(26, 15, 10, 0.85);
    --charge-color: #d4af37;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #000; overflow-x: hidden; font-family: 'Poppins', sans-serif; color: #fff; }
::-webkit-scrollbar { width: 0px; background: transparent; }

/* 1. Global Effects & Overlays */
.dust-overlay, .cracked-stone-overlay, #particles-canvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none;
}
.dust-overlay {
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="1.5" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.15; mix-blend-mode: multiply; z-index: 9998;
}
.cracked-stone-overlay {
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.01" numOctaves="2" stitchTiles="stitch"/%3E%3CfeColorMatrix type="matrix" values="1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 5 -2"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)"/%3E%3C/svg%3E');
    opacity: 0.1; mix-blend-mode: overlay; z-index: 9997;
}
#particles-canvas { z-index: 9996; mix-blend-mode: color-dodge; }

/* State-reactive vignette — transitions per game phase */
#state-vignette {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9995;
    background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(80,30,0,0.45) 100%);
    transition: background 0s; /* JS handles transition via gsap */
}

/* 2. Entry Screen */
#entry-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #050302; z-index: 10000;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 12px;
}
#entry-eye {
    font-size: 4rem; opacity: 0;
    filter: drop-shadow(0 0 15px rgba(212,175,55,0.6));
    animation: none; /* JS controls this */
}
#entry-title { font-family: 'Cinzel', serif; font-size: 4rem; color: var(--gold-ancient); letter-spacing: 5px; opacity: 0; text-shadow: 0 0 20px rgba(212,175,55,0.4); margin: 0; }
#entry-tagline { color: #666; font-size: 0.9rem; letter-spacing: 3px; opacity: 0; margin-bottom: 20px; }

/* 3. Game HUD */
#game-hud {
    position: fixed; top: 0; left: 0; width: 100%; padding: 20px 40px;
    display: flex; justify-content: space-between; align-items: flex-start; z-index: 9900;
    opacity: 0; pointer-events: none; transition: opacity 1s;
    --mouse-x: 50%; --mouse-y: 50%;
}
#hud-lighting {
    position: absolute; top:0; left:0; width: 100%; height: 150px; pointer-events: none;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(212,175,55,0.15) 0%, transparent 60%);
    mix-blend-mode: screen; z-index: 10;
}
.hud-panel {
    background: var(--hud-bg);
    background-image: url('/images/landing/stone_hud_1776459950968.png');
    background-size: cover; background-blend-mode: overlay;
    border: 2px solid #3a2211; border-top: 2px solid var(--gold-ancient);
    padding: 15px 30px; border-radius: 6px; display: flex; flex-direction: column;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 10px 20px rgba(0,0,0,0.8);
    position: relative; overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.hud-panel:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: inset 0 0 25px rgba(255,215,0,0.1), 0 15px 30px rgba(0,0,0,0.9);
    border-color: var(--gold-bright);
}
.hud-label { font-size: 0.7rem; color: #a37c4d; font-weight: 600; letter-spacing: 2px; position: relative; z-index: 2; display:block; }
.hud-value { font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--gold-bright); font-weight: 900; position: relative; z-index: 2; text-shadow: 0 0 10px rgba(255,215,0,0.5); display:block; }
.hud-desc { font-size: 0.75rem; color: rgba(255,255,255,0.6); position: relative; z-index: 2; display:block; font-style: italic; margin-top: 2px; }
.hud-hieroglyphs { font-size: 1.5rem; letter-spacing: 5px; }

/* Inventory Elements */
.inventory-slots { display: flex; gap: 10px; margin-top: 5px; position: relative; z-index: 2; }
.inv-slot { width: 40px; height: 40px; border: 1px solid rgba(212,175,55,0.3); background: rgba(0,0,0,0.5); border-radius: 5px; display: flex; justify-content: center; align-items: center; font-family: 'Cinzel', serif; font-size: 1.5rem; color: #333; transition: 0.4s; }
.inv-slot.has-item { color: var(--gold-bright); border-color: var(--gold-bright); box-shadow: 0 0 15px rgba(212,175,55,0.5); background: rgba(212,175,55,0.1); }
.inv-slot.has-item::before { content: "𓇳"; font-weight: bold; }

/* Mystical Dial Centerpiece */
.hud-center-ring {
    position: relative; width: 120px; height: 120px;
    background: url('/images/landing/stone_hud_1776459950968.png'); background-size: cover; background-blend-mode: multiply;
    background-color: var(--stone-dark);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    border: 3px solid #3a2211; box-shadow: 0 10px 30px rgba(0,0,0,0.9), inset 0 0 20px rgba(0,0,0,0.9);
    transform-style: preserve-3d; transition: transform 0.3s, box-shadow 0.3s;
}
.hud-center-ring:hover {
    transform: scale(1.05) translateZ(10px);
    box-shadow: 0 15px 40px rgba(212,175,55,0.2), inset 0 0 30px rgba(255,215,0,0.2);
    border-color: var(--gold-ancient);
}
.hud-fog-container {
    position: absolute; top:0; left:0; width:100%; height:100%; border-radius: 50%;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.05" numOctaves="3"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)"/%3E%3C/svg%3E');
    opacity: 0.2; mix-blend-mode: screen; pointer-events: none;
    animation: rotateFog 60s linear infinite;
}
@keyframes rotateFog { 100% { transform: rotate(360deg); } }

.mystic-dial { width: 100%; height: 100%; position: relative; z-index: 2; pointer-events: none; }
.dial-outer { fill: none; stroke: #3a2211; stroke-width: 4; stroke-dasharray: 4 2; }
.dial-track { fill: none; stroke: var(--stone-dark); stroke-width: 8; }
.dial-energy { fill: none; stroke: var(--gold-ancient); stroke-width: 2; opacity: 0.8; stroke-dasharray: 220; stroke-dashoffset: 0; }
.needle-blade { fill: var(--gold-bright); filter: drop-shadow(0 0 5px #ff4500); }
.needle-core { fill: #1a0f0a; stroke: var(--gold-ancient); stroke-width: 2; }
.needle-jewel { fill: #ff4500; }

/* 4. Cinematic Viewport & Layers */
#cinematic-viewport { position: fixed; top:0; left:0; width: 100vw; height: 100vh; overflow: hidden; background: #000; }

.world-layer { position: absolute; top:0; left:0; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; will-change: transform, opacity; }
.world-layer img { position: absolute; object-fit: cover; width: 100%; height: 100%; pointer-events: none; filter: sepia(0.6) saturate(1.8) contrast(1.1) brightness(0.85); }

/* World 1: Desert */
#world-desert { z-index: 100; transform-origin: center center; }
.sun-glow { position: absolute; top: 15%; left: 30%; width: 30vw; height: 30vw; background: radial-gradient(circle, #ff8c00 0%, transparent 60%); mix-blend-mode: screen; animation: flicker 4s infinite alternate; }
#world-desert .w-bg { filter: sepia(0.8) hue-rotate(-20deg) brightness(0.7); }
#world-desert .w-front { bottom: -10vh; height: 50vh; top: auto; }
.puzzle-anomaly {
    position: absolute; bottom: 15vh; right: 20vw;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,0.4) 0%, transparent 70%);
    cursor: pointer; z-index: 50;
    animation: pulseGlow 2.4s ease-in-out infinite;
    display: flex; justify-content: center; align-items: center;
}

/* Charge ring overlaid on the anomaly */
.charge-ring {
    position: absolute; top: 0; left: 0; width: 60px; height: 60px;
    transform: rotate(-90deg); /* SVG starts at 3-o-clock; rotate so it fills from top */
    pointer-events: none;
}
.charge-track { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 3; }
.charge-fill  { fill: none; stroke: var(--gold-bright); stroke-width: 3; stroke-linecap: round;
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.8));
    transition: stroke-dashoffset 0.05s linear;
}

/* World 2: Temple Gate */
#world-gate { z-index: 200; opacity: 0; visibility: hidden; transform: scale(0.5); transform-origin: center center; }
.gate-wrapper { position: absolute; width: 100vw; height: 100vh; display:flex;}
.gate-left, .gate-right { position: relative; width: 50vw !important; height: 100vh !important; object-fit: cover; }
.gate-left { transform-origin: left center; }
.gate-right { transform-origin: right center; }
.gate-seal { position: absolute; width: 60px; height: 60px; background: rgba(0,0,0,0.8); border: 2px solid #5a3211; border-radius: 50%; cursor: pointer; z-index: 60; color: #5a3211; display: flex; justify-content: center; align-items: center; font-size: 2rem; transition: 0.3s; box-shadow: inset 0 0 10px #000; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.gate-seal:hover { background: rgba(212,175,55,0.1); border-color: var(--gold-ancient); box-shadow: 0 0 20px rgba(212,175,55,0.5); }
.seal-active { background: var(--gold-bright) !important; color: #000; box-shadow: 0 0 40px var(--gold-bright); border-color: #fff; transform: translate(-50%, -50%) scale(1.1); pointer-events: none; }

/* World 3: Tomb */
#world-tomb { z-index: 300; opacity: 0; visibility: hidden; transform: scale(0); transform-origin: center center; }
#flashlight-overlay { position: absolute; top:0; left:0; width: 100vw; height: 100vh; pointer-events: none; mix-blend-mode: multiply; z-index: 100;
background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 10%, rgba(0,0,0,0.95) 40%); transition: opacity 1s; }
.pillar-left { left:-5vw; width: 30vw !important; }
.pillar-right { left: 75vw; width: 30vw !important; }
.runic-text { position: absolute; font-family: 'Cinzel', serif; font-size: 3rem; color: var(--gold-ancient); letter-spacing: 15px; top: 50%; width: 100%; text-align: center; text-shadow: 0 0 20px #ff4500; opacity: 0; z-index: 5; }
.tomb-lever {
    position: absolute; width: 70px; height: 70px; top: 55%;
    background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 60%);
    border: 1px solid rgba(212,175,55,0.15); border-radius: 50%;
    cursor: pointer; z-index: 50; transition: background 0.3s, border-color 0.3s;
    display: flex; justify-content: center; align-items: center;
}
.tomb-lever:hover { background: radial-gradient(circle, rgba(212,175,55,0.35) 0%, transparent 60%); border-color: rgba(212,175,55,0.4); }
.lever-label { font-size: 1.8rem; opacity: 0.4; transition: opacity 0.3s; pointer-events: none; }
.tomb-lever:hover .lever-label { opacity: 0.9; }
.false-lever { left: 10vw; }
.true-lever  { right: 10vw; }

/* World 4: RA Chamber */
#world-ra { z-index: 400; opacity: 0; visibility: hidden; transform: scale(0); background: #000; }
.ra-core-bg { width: 100%; height: 100%; filter: none !important; mix-blend-mode: screen; }

/* 5. UI Elements & Runic Buttons */
.game-cta-panel {
    position: relative; z-index: 10; text-align: center;
    background: rgba(10,5,0,0.9); padding: 50px 80px; border: 2px solid var(--gold-ancient); box-shadow: inset 0 0 30px #000, 0 0 50px var(--gold-ancient);
}
.game-cta-panel h3 { font-family: 'Cinzel', serif; font-size: 3rem; color: #fff; margin-bottom: 10px; }
.game-cta-panel p { color: #aaa; margin-bottom: 40px; font-size: 1.2rem; }
.action-runes { display: flex; gap: 20px; justify-content: center; }

.stone-rune-btn {
    background: url('/images/landing/stone_hud_1776459950968.png'); background-size: cover; background-blend-mode: multiply;
    background-color: var(--gold-ancient); color: #000; font-family: 'Cinzel', serif; font-size: 1.2rem; font-weight: 900;
    padding: 15px 40px; border: 2px solid #ffeba1; cursor: pointer; text-decoration: none; display: inline-block;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8); transition: transform 0.1s, box-shadow 0.3s, filter 0.3s;
}
.stone-rune-btn:hover { box-shadow: 0 0 20px var(--gold-bright), 0 0 40px var(--gold-ancient); filter: brightness(1.2); }
.ghost-rune { background-color: #1a0f0a; color: var(--gold-ancient); border-color: var(--gold-ancient); }
.ghost-rune:hover { background-color: var(--gold-ancient); color: #000; }

@keyframes flicker {
    0%   { opacity: 0.8; transform: scale(0.98); }
    20%  { opacity: 1;   transform: scale(1.03); }
    40%  { opacity: 0.85; transform: scale(0.99); }
    60%  { opacity: 1;   transform: scale(1.05); }
    80%  { opacity: 0.9; transform: scale(1.01); }
    100% { opacity: 0.8; transform: scale(0.97); }
}

@keyframes pulseGlow {
    0%   { transform: scale(1);    opacity: 0.3; box-shadow: 0 0 10px rgba(212,175,55,0.2); }
    50%  { transform: scale(1.25); opacity: 0.9; box-shadow: 0 0 30px rgba(212,175,55,0.7); }
    100% { transform: scale(1);    opacity: 0.3; box-shadow: 0 0 10px rgba(212,175,55,0.2); }
}

/* Global Game Toasts */
.game-toast { position: fixed; top: 30%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; text-align: center; font-family: 'Cinzel', serif; background: radial-gradient(circle, rgba(0,0,0,0.9) 0%, transparent 80%); padding: 50px 100px; opacity: 1; pointer-events: none; }
.game-toast h2 { font-size: 3.5rem; letter-spacing: 15px; margin: 0; text-shadow: 0 0 20px currentColor; color: var(--gold-bright); }
.game-toast p { font-family: 'Poppins', sans-serif; font-size: 1rem; color: #ccc; letter-spacing: 3px; font-weight: 300; margin-top: 10px; }
.hidden-toast { opacity: 0; transform: translate(-50%, -40%); }

.error-shake {
    animation: errShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    color: #ff4500 !important;
}
@keyframes errShake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}
