/* Fog Effect for World Map */
.fog-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
    opacity: 0.6;
    mix-blend-mode: screen;
}

.fog-cloud {
    position: absolute;
    width: 200vw;
    height: 200vh;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 60%);
    filter: blur(80px);
    animation: fogMove 60s infinite linear;
}

@keyframes fogMove {
    0% { transform: translate(-25%, -25%) rotate(0deg); }
    100% { transform: translate(0%, 0%) rotate(360deg); }
}

/* Modal Glare & Vignette */
.page-window::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
    border-radius: inherit;
    z-index: 10;
}

.page-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
    pointer-events: none;
    border-radius: inherit;
    z-index: 12;
}

/* Mission HUD Enhancement - Hover Reveal */
.mission-scroll {
    background: url('../assets/perkamen.png') center/cover no-repeat !important;
    padding: 15px 40px 15px 15px !important;
    border-radius: 0 15px 15px 0 !important;
    box-shadow: 5px 0 25px rgba(0,0,0,0.7) !important;
    border: none !important;
    min-width: 250px !important;
    max-width: 320px !important;
    height: auto !important;
    position: fixed !important;
    left: -240px !important; /* Tuck most of it away */
    top: 150px !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 5000;
    cursor: pointer;
    opacity: 0.9;
}

.mission-scroll::after {
    content: '📜 MISI';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    color: #3e2723;
    font-weight: 900;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.mission-scroll:hover {
    left: 0 !important;
    opacity: 1;
}

.mission-scroll.ready {
    animation: missionPulse 2s infinite;
    cursor: pointer;
}

@keyframes missionPulse {
    0% { filter: drop-shadow(0 0 5px gold); }
    50% { filter: drop-shadow(0 0 20px gold); }
    100% { filter: drop-shadow(0 0 5px gold); }
}

.mission-scroll-content {
    border-bottom: 2px solid rgba(62,39,35,0.1);
    padding: 8px 0;
    margin-bottom: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
}

.mission-scroll-content:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mission-scroll-content:hover {
    background: rgba(62,39,35,0.05);
}

.ready-item {
    background: rgba(46, 125, 50, 0.1) !important;
    border-left: 3px solid #2e7d32;
}

.mission-cat-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

#mission-title {
    color: #3e2723 !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 1px rgba(255,255,255,0.4) !important;
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

#mission-text {
    color: #000 !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5) !important;
}

.mission-reward {
    font-size: 0.75rem !important;
    color: #2e7d32 !important;
    font-weight: 900 !important;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5) !important;
}

.claim-notif {
    color: #c0392b !important;
    text-shadow: 0 0 10px rgba(192, 57, 43, 0.3) !important;
}
/* Sand Haze / Dust Drift for World Map */
.sand-drift-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    opacity: 0.4;
    mix-blend-mode: overlay;
}

.sand-cloud {
    position: absolute;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(50px);
}

.sand-cloud-1 {
    width: 600px; height: 300px;
    top: 20%; left: -20%;
    animation: drift 45s infinite linear;
}

.sand-cloud-2 {
    width: 800px; height: 400px;
    top: 60%; left: -30%;
    animation: drift 60s infinite linear reverse;
}

@keyframes drift {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    50% { transform: translateX(50vw) translateY(10vh) rotate(10deg); }
    100% { transform: translateX(110vw) translateY(0) rotate(0deg); }
}

/* Heat Shimmer Effect (Kelap-kelip Udara Panas) */
.heat-shimmer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.15;
    background: url('https://www.transparenttextures.com/patterns/pinstriped-suit.png'); /* Subtle grain */
    animation: shimmer 0.5s infinite steps(2);
}

@keyframes shimmer {
    0% { opacity: 0.1; transform: scale(1.0); }
    100% { opacity: 0.2; transform: scale(1.02); }
}

/* Tactile Interaction: Sand Ripple Effect */
.sand-ripple-container {
    position: absolute;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.ripple-circle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border: 3px solid rgba(212, 175, 55, 0.8);
    border-radius: 50%;
    animation: ripplePulse 0.6s ease-out forwards;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.ripple-dust {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: dustExpand 0.5s ease-out forwards;
}

@keyframes ripplePulse {
    0% { width: 0; height: 0; opacity: 1; border-width: 6px; }
    100% { width: 180px; height: 180px; opacity: 0; border-width: 1px; }
}

@keyframes dustExpand {
    0% { width: 0; height: 0; opacity: 0.8; }
    100% { width: 220px; height: 220px; opacity: 0; }
}

/* Day/Night Cycle Effects */
.night-cycle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 15; /* Above map, below UI */
    background: rgba(0, 15, 45, 0.45);
    mix-blend-mode: multiply;
    transition: opacity 2s ease-in-out;
}

.torch-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(8px);
    z-index: -1;
    animation: torchPulse 3s infinite alternate ease-in-out;
}

@keyframes torchPulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
}

/* Floating Resource Text Animation */
.floating-res-text {
    position: fixed;
    pointer-events: none;
    z-index: 100000;
    font-weight: 900;
    font-family: 'Cinzel', serif;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 5px currentColor;
    animation: floatingResAnim 1.5s forwards cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.2rem;
    white-space: nowrap;
}

@keyframes floatingResAnim {
    0% { transform: translateY(0); opacity: 0; scale: 0.5; }
    20% { transform: translateY(-20px); opacity: 1; scale: 1.2; }
    100% { transform: translateY(-100px); opacity: 0; scale: 1.0; }
}

/* Shield Effect (Pelindung) */
.shield-bubble {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    background: radial-gradient(circle, rgba(0, 191, 255, 0.05) 40%, rgba(0, 191, 255, 0.3) 60%, rgba(135, 206, 250, 0.5) 75%, transparent 80%);
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.4);
    animation: shieldPulse 4s infinite ease-in-out;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(1px);
}

@keyframes shieldPulse {
    0% { transform: translate(-50%, -50%) scale(0.98); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(0.98); opacity: 0.4; }
}

/* FIREWORKS & SPARKLES */
.vfx-firework {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 200000;
    box-shadow: 0 0 15px currentColor, 0 0 30px currentColor;
    animation: fireworkAnim 1s ease-out forwards;
}

@keyframes fireworkAnim {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.level-up-vfx {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 210000;
    pointer-events: none;
    text-align: center;
    animation: levelUpPop 2s ease-out forwards;
}

@keyframes levelUpPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; filter: blur(10px); }
    15% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; filter: blur(0); }
    25% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80% { transform: translate(-50%, -80%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -100%) scale(0.8); opacity: 0; }
}

/* SCREEN TRANSITIONS */
.screen-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
}

.screen-transition-overlay.active {
    animation: screenFlash 0.8s ease-in-out forwards;
}

@keyframes screenFlash {
    0% { opacity: 0; backdrop-filter: blur(0px); }
    40% { opacity: 1; backdrop-filter: blur(15px); }
    60% { opacity: 1; backdrop-filter: blur(15px); }
    100% { opacity: 0; backdrop-filter: blur(0px); }
}

/* BUTTON FEEDBACK */
.fx-shake {
    animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeAnim {
    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); }
}

.fx-glow-gold {
    animation: glowGold 1.5s infinite alternate;
}

@keyframes glowGold {
    from { box-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700; }
    to { box-shadow: 0 0 20px #ffd700, 0 0 40px #ff8c00; }
}

.fx-click-fringe {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    animation: clickFringe 0.5s ease-out forwards;
}

@keyframes clickFringe {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(5); opacity: 0; }
}

