:root {
    --bg-color: #121212;
    --text-light: #ffffff;
    --accent-green: #2ecc71;
    --accent-dark: #27ae60;
    --glass-bg: rgba(18, 18, 18, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dawn"] {
    --bg-color: #2b1d1d;
    --text-light: #fff0e6;
    --accent-green: #ff7e5f;
    --accent-dark: #feb47b;
    --glass-bg: rgba(43, 29, 29, 0.6);
    --glass-border: rgba(255, 220, 180, 0.2);
}

:root[data-theme="dusk"] {
    --bg-color: #1a1025;
    --text-light: #f0e6ff;
    --accent-green: #9d50bb;
    --accent-dark: #6e48aa;
    --glass-bg: rgba(26, 16, 37, 0.6);
    --glass-border: rgba(200, 150, 255, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    width: 100%;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-light);
    overflow: hidden; /* Prevent scrolling on mobile */
}

.hidden {
    display: none !important;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Map specific styling */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 1; /* Leaflet needs to be below overlays */
    background-color: #1a1a1a;
}

/* MapLibre Styling Overrides */
.maplibregl-popup-content {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-light);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    font-family: 'Outfit', sans-serif;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: var(--glass-bg);
}

/* Glassmorphism Header */
.glass-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* Segmented Mode Toggle */
.mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 3px;
    border: 1px solid var(--glass-border);
}

.mode-toggle input[type="radio"] {
    display: none;
}

.mode-toggle label {
    padding: 5px 15px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 17px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

/* Habitat Tabs Container - Responsive Scrolling Fix */
#habitat-tabs-container {
    padding: 24px 20px 14px 20px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    justify-content: flex-start; /* Default left-align for safe scrolling */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    scrollbar-width: thin; /* Thin scrollbar for Firefox */
    scrollbar-color: rgba(116, 198, 157, 0.3) rgba(255, 255, 255, 0.05);
}

#habitat-tabs-container::-webkit-scrollbar {
    display: block; /* Show webkit scrollbar */
    height: 5px;
}

#habitat-tabs-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#habitat-tabs-container::-webkit-scrollbar-thumb {
    background: rgba(116, 198, 157, 0.35);
    border-radius: 10px;
}

#habitat-tabs-container::-webkit-scrollbar-thumb:hover {
    background: rgba(116, 198, 157, 0.6);
}

@media (min-width: 768px) {
    #habitat-tabs-container {
        justify-content: safe center; /* Centered when it fits, start-aligned when it overflows */
    }
}

/* Collection Header Responsive Grid styling */
.collection-header {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 12px 24px;
    margin: 24px auto 0 auto;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    
    /* Default CSS Grid layout for mobile */
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px 12px;
}

.collection-header h2 {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
}

.collection-header .archive-toggle {
    grid-column: 1 / span 2;
    grid-row: 2;
    margin: 0 !important;
    display: flex;
    width: 100%;
}

.collection-header .archive-toggle button {
    flex: 1;
    text-align: center;
}

.collection-header #close-collection-btn {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
}

@media (min-width: 768px) {
    .collection-header {
        display: flex;
        justify-content: space-between;
        padding: 12px 24px;
    }
    
    .collection-header h2 {
        margin: 0;
    }
    
    .collection-header .archive-toggle {
        width: auto;
        margin-left: auto !important;
        margin-right: 15px !important;
    }
    
    .collection-header .archive-toggle button {
        flex: none;
    }
    
    .collection-header #close-collection-btn {
        margin: 0;
    }
}

.mode-toggle input[type="radio"]:checked + label {
    background: var(--accent-green);
    color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.3);
}

.user-stats {
    display: flex;
    gap: 15px;
}

.stat {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.stat svg {
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
}

.hud-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3), 0 0 15px rgba(168, 255, 120, 0.2);
    color: #a8ff78;
}

.hud-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hud-btn.active {
    background: linear-gradient(135deg, rgba(168, 255, 120, 0.25) 0%, rgba(120, 255, 214, 0.25) 100%) !important;
    border-color: #a8ff78 !important;
    color: #a8ff78 !important;
    box-shadow: 0 4px 15px rgba(168, 255, 120, 0.4), inset 0 0 10px rgba(168, 255, 120, 0.2) !important;
    transform: translateY(-1px) !important;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-dark) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(46, 204, 113, 0.6);
}

.primary-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.text-link-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 15px;
    text-decoration: underline;
    font-family: 'Outfit', sans-serif;
    transition: color 0.3s;
}

.text-link-btn:hover {
    color: white;
}

/* Micro-animations */
.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

    /* Filter removed so light tiles render correctly */
    
    .leaflet-bar a, .leaflet-bar a:hover {
    background-color: var(--glass-bg) !important;
    color: var(--text-light) !important;
    border-color: var(--glass-border) !important;
    backdrop-filter: blur(8px);
}

.leaflet-control-zoom-in, .leaflet-control-zoom-out {
    color: white !important;
}

/* Player Marker Styles */
.player-icon-wrapper {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    z-index: 999999999 !important;
}

/* Ensure MapLibre's marker wrapper container also has high z-index */
.maplibregl-marker:has(.player-icon-wrapper) {
    z-index: 999999999 !important;
}

.player-marker-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding-bottom: 10px;
}

.player-marker-dot {
    width: 32px;
    height: 32px;
    background-color: #2ecc71;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.9);
    position: relative;
}

/* Pulsing effect behind player */
.player-marker-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(46, 204, 113, 0.4);
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    z-index: -1;
}

@keyframes ping {
    75%, 100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Custom Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* -------------------------------------
   ACTION CAM & MINIMAP UI
   ------------------------------------- */

.minimap {
    position: absolute;
    top: 110px;
    right: 20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 1000;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.minimap:active {
    transform: scale(0.95);
}

.minimap.pulse {
    animation: minimapPulse 1.5s infinite;
}

@keyframes minimapPulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); border-color: #2ecc71; }
    70% { box-shadow: 0 0 0 15px rgba(46, 204, 113, 0); border-color: rgba(255,255,255,0.8); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); border-color: rgba(255,255,255,0.8); }
}

#minimap-map {
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let the container handle clicks */
}

.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2500;
    display: flex;
    flex-direction: column;
}

.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(20, 20, 20, 0.9);
}

.explore-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 1.2rem;
}

#explore-map {
    flex-grow: 1;
    width: 100%;
}

/* -------------------------------------
   MINIGAMES UI
   ------------------------------------- */

.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.minigame-ui {
    width: 90%;
    max-width: 400px;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    color: white;
}

.minigame-ui h2 { margin-top: 0; color: #2ecc71; }
.minigame-ui p { font-size: 0.95rem; color: #ccc; margin-bottom: 20px; }

/* Scratchcard */
#scratch-canvas {
    width: 100%;
    height: 300px;
    background: #2ecc71; /* Reveal color underneath */
    border-radius: 15px;
    touch-action: none; /* Prevent scrolling while scratching */
}

/* Observation (Reticle Alignment) */
.observation-area {
    position: relative;
    width: 100%;
    height: 80px;
    background: rgba(0,0,0,0.5);
    border-radius: 40px;
    margin-bottom: 20px;
    overflow: hidden;
}

.obs-target {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #2ecc71;
    border-radius: 50%;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.obs-reticle {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    top: 25px;
    left: 10px;
}

/* Trivia Quiz */
.quiz-question {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-answer-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}

.quiz-answer-btn:hover {
    background: rgba(255,255,255,0.2);
}

.quiz-answer-btn.correct { background: #2ecc71; border-color: #27ae60; }
.quiz-answer-btn.wrong { background: #e74c3c; border-color: #c0392b; }

#quiz-progress {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #aaa;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    width: 85%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .glass-panel {
    transform: translateY(30px);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-content p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 25px;
    color: #e0e0e0;
}

#modal-body {
    overflow-y: auto;
    flex-grow: 1;
    margin-bottom: 15px;
    padding-top: 12px;
}

.small-btn {
    padding: 12px 30px;
    padding: 10px 15px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin-top: 10px;
    transition: background 0.3s ease;
}

.legend-btn:hover {
    background: rgba(255,255,255,0.1);
}

.legend-panel {
    width: 220px;
    padding: 15px;
    text-align: left;
    margin-bottom: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.legend-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.legend-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 5px;
}

.legend-panel ul {
    list-style: none;
}

.legend-panel li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid rgba(255,255,255,0.5);
}

.color-dot.urban { background-color: #95a5a6; }
.color-dot.woodland { background-color: #27ae60; }
.color-dot.park { background-color: #2ecc71; }

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.auth-overlay.hidden, .auth-input.hidden {
    display: none;
}

.auth-overlay h2 {
    margin-bottom: 10px;
    font-size: 28px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.auth-overlay p {
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

.auth-input {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.5);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.auth-input:focus {
    border-color: #2ecc71;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.auth-buttons button {
    flex: 1;
}

.auth-message {
    margin-top: 15px;
    color: #e74c3c;
    font-weight: bold;
    min-height: 20px;
}

/* Removes seams between Fog of War tiles by controlling opacity at the container level */
.fog-layer-container {
    opacity: 0.6;
}

/* Species Icon Animations */
@keyframes animateWiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}
@keyframes animateBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes animateHover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.species-icon-bug {
    animation: animateWiggle 1.5s ease-in-out infinite;
}
.species-icon-mammal {
    animation: animateBounce 1.2s ease-in-out infinite;
}
.species-icon-bird {
    animation: animateHover 2s ease-in-out infinite;
}
@keyframes animateSway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

.species-icon-static {
    animation: animateSway 3s ease-in-out infinite;
    transform-origin: bottom center;
}

/* Collection Grid Responsiveness */
#collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    align-content: start;
    align-items: start;
    gap: 25px 22px;
}

@media (max-width: 600px) {
    #collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 18px 16px;
    }
}

/* -------------------------------------
   DYNAMIC WEATHER OVERLAY
   ------------------------------------- */

#weather-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500; /* Sits above map (z-index: 1) but below UI (z-index: 1000+) */
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

#weather-overlay.active {
    opacity: 1;
}

/* Rain Effect - Uses inline SVG for discrete angled drops */
.weather-rain {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect x="10" y="0" width="1" height="20" fill="rgba(255,255,255,0.4)" transform="rotate(15 10 0)"/><rect x="60" y="50" width="1.5" height="25" fill="rgba(255,255,255,0.3)" transform="rotate(15 60 50)"/><rect x="30" y="80" width="1" height="15" fill="rgba(255,255,255,0.2)" transform="rotate(15 30 80)"/></svg>');
    animation: weatherRainFall 0.5s linear infinite;
    background-color: rgba(5, 10, 20, 0.2); /* Darken map slightly */
}

@keyframes weatherRainFall {
    0% { background-position: 0px 0px; }
    100% { background-position: 0px 100px; }
}

/* Snow Effect - Uses inline SVG for soft circular flakes */
.weather-snow {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150"><circle cx="20" cy="20" r="2.5" fill="rgba(255,255,255,0.9)"/><circle cx="90" cy="70" r="3" fill="rgba(255,255,255,0.6)"/><circle cx="130" cy="120" r="2" fill="rgba(255,255,255,0.8)"/><circle cx="50" cy="100" r="1.5" fill="rgba(255,255,255,0.5)"/></svg>');
    animation: weatherSnowFall 8s linear infinite;
    background-color: rgba(255, 255, 255, 0.1); /* Brighten map slightly */
}

@keyframes weatherSnowFall {
    0% { background-position: 0px 0px; }
    100% { background-position: 50px 1000px; }
}

/* Cloud/Overcast Effect - Slow drifting large gradients */
.weather-clouds {
    background-color: rgba(80, 90, 100, 0.2); /* Gray out the map softly */
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 40%),
        radial-gradient(circle at 40% 80%, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 60%),
        radial-gradient(circle at 70% 20%, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 45%);
    background-size: 200% 200%;
    animation: weatherCloudDrift 30s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 400; /* Ensure it stays under the UI */
}

@keyframes weatherCloudDrift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 50% 100%; }
}

/* Fog Effect - Soft drifting misty overlays */
.weather-fog {
    background-color: rgba(200, 210, 220, 0.15); /* Soft white mist layer */
    background-image: 
        radial-gradient(circle at 10% 40%, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 60%),
        radial-gradient(circle at 60% 80%, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 50%),
        radial-gradient(circle at 90% 20%, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    background-size: 200% 200%;
    animation: weatherFogDrift 20s linear infinite alternate;
    filter: blur(8px);
}

@keyframes weatherFogDrift {
    0% { background-position: 0% 0%; }
    50% { background-position: 50% 100%; }
    100% { background-position: 100% 0%; }
}

/* Storm Effect - Intense rain with dramatic lightning flashes */
.weather-storm {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><rect x="5" y="0" width="1.5" height="30" fill="rgba(255,255,255,0.5)" transform="rotate(20 5 0)"/><rect x="40" y="40" width="2" height="35" fill="rgba(255,255,255,0.45)" transform="rotate(20 40 40)"/><rect x="60" y="10" width="1.2" height="25" fill="rgba(255,255,255,0.3)" transform="rotate(20 60 10)"/></svg>');
    animation: weatherRainFall 0.35s linear infinite, weatherStormLightning 8s infinite;
    background-color: rgba(5, 5, 10, 0.45); /* Dark storm clouds blocking sunlight */
}

@keyframes weatherStormLightning {
    0%, 92%, 94%, 98%, 100% {
        background-color: rgba(5, 5, 10, 0.45);
    }
    93%, 97% {
        background-color: rgba(255, 255, 255, 0.85); /* Sudden dramatic lightning bolt flash */
    }
    95% {
        background-color: rgba(180, 220, 255, 0.7); /* Double flash */
    }
}

/* --- Advanced Ambient Card Particles --- */
.ambient-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
    border-radius: 12px;
    overflow: hidden;
}

@keyframes fallWavy {
    0% { background-position: 0px -150px, 0px -200px; }
    50% { background-position: 15px 50px, -20px 0px; }
    100% { background-position: -15px 250px, 10px 200px; }
}

@keyframes floatUp {
    0% { background-position: 0px 300px; }
    100% { background-position: 0px -100px; }
}

@keyframes floatUpWobble {
    0% { background-position: 0px 300px, 0px 400px; }
    50% { background-position: 10px 100px, -15px 150px; }
    100% { background-position: -10px -100px, 20px -50px; }
}

@keyframes blowHorizontal {
    0% { background-position: -100px 50px, -150px 100px; }
    100% { background-position: 300px 50px, 350px 100px; }
}

@keyframes blowDiagonal {
    0% { background-position: -100px 300px; }
    100% { background-position: 300px -100px; }
}

@keyframes swirlUp {
    0% { background-position: 0px 300px, 0px 350px; }
    25% { background-position: 20px 200px, -15px 250px; }
    50% { background-position: -20px 100px, 25px 150px; }
    75% { background-position: 10px 0px, -10px 50px; }
    100% { background-position: 0px -100px, 0px -50px; }
}

.ambient-particles.urban {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22b%22%3E%3CfeGaussianBlur%20stdDeviation%3D%2215%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2230%22%20fill%3D%22rgba(80%2C80%2C80%2C0.4)%22%20filter%3D%22url(%23b)%22%2F%3E%3Ccircle%20cx%3D%22150%22%20cy%3D%22120%22%20r%3D%2240%22%20fill%3D%22rgba(60%2C60%2C60%2C0.3)%22%20filter%3D%22url(%23b)%22%2F%3E%3C%2Fsvg%3E");
    background-size: 200px 200px;
    animation: floatUp 12s linear infinite;
    opacity: 0.8;
}
.ambient-particles.water {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2283%22%20height%3D%2283%22%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2220%22%20r%3D%224%22%20fill%3D%22none%22%20stroke%3D%22rgba(255%2C255%2C255%2C0.6)%22%20stroke-width%3D%221%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2218%22%20r%3D%221.5%22%20fill%3D%22rgba(255%2C255%2C255%2C0.8)%22%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22113%22%20height%3D%22113%22%3E%3Ccircle%20cx%3D%2260%22%20cy%3D%2270%22%20r%3D%226%22%20fill%3D%22none%22%20stroke%3D%22rgba(255%2C255%2C255%2C0.4)%22%20stroke-width%3D%221.5%22%2F%3E%3Ccircle%20cx%3D%2259%22%20cy%3D%2267%22%20r%3D%222%22%20fill%3D%22rgba(255%2C255%2C255%2C0.5)%22%2F%3E%3C%2Fsvg%3E");
    background-size: 83px 83px, 113px 113px;
    animation: floatUpWobble 4s ease-in-out infinite;
}

.ambient-particles.farmland {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2289%22%20height%3D%2289%22%3E%3Crect%20x%3D%2220%22%20y%3D%2220%22%20width%3D%223%22%20height%3D%223%22%20fill%3D%22rgba(241%2C%20196%2C%2015%2C%200.7)%22%2F%3E%3Crect%20x%3D%2260%22%20y%3D%2250%22%20width%3D%222%22%20height%3D%222%22%20fill%3D%22rgba(241%2C%20196%2C%2015%2C%200.4)%22%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22127%22%20height%3D%22127%22%3E%3Crect%20x%3D%2280%22%20y%3D%2290%22%20width%3D%224%22%20height%3D%224%22%20fill%3D%22rgba(241%2C%20196%2C%2015%2C%200.5)%22%2F%3E%3C%2Fsvg%3E");
    background-size: 89px 89px, 127px 127px;
    animation: blowHorizontal 3s linear infinite;
}
.ambient-particles.coastal {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22103%22%20height%3D%22103%22%3E%3Cline%20x1%3D%2210%22%20y1%3D%2290%22%20x2%3D%2230%22%20y2%3D%2270%22%20stroke%3D%22rgba(255%2C%20255%2C%20255%2C%200.6)%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%2F%3E%3Cline%20x1%3D%2260%22%20y1%3D%2250%22%20x2%3D%2270%22%20y2%3D%2240%22%20stroke%3D%22rgba(255%2C%20255%2C%20255%2C%200.3)%22%20stroke-width%3D%221%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E");
    background-size: 103px 103px;
    animation: blowDiagonal 1.5s linear infinite;
}
.ambient-particles.moorland {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22250%22%20height%3D%22150%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22f%22%3E%3CfeGaussianBlur%20stdDeviation%3D%2220%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cellipse%20cx%3D%22100%22%20cy%3D%22120%22%20rx%3D%2260%22%20ry%3D%2230%22%20fill%3D%22rgba(156%2C%2039%2C%20176%2C%200.2)%22%20filter%3D%22url(%23f)%22%2F%3E%3Cellipse%20cx%3D%22200%22%20cy%3D%22100%22%20rx%3D%2240%22%20ry%3D%2220%22%20fill%3D%22rgba(100%2C%20100%2C%20150%2C%200.2)%22%20filter%3D%22url(%23f)%22%2F%3E%3C%2Fsvg%3E");
    background-size: 250px 150px;
    animation: blowHorizontal 15s linear infinite alternate;
    opacity: 0.8;
}


.ambient-particles.scrubland {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2279%22%20height%3D%2279%22%3E%3Cpath%20d%3D%22M20%2C20%20L24%2C22%20L22%2C26%20Z%22%20fill%3D%22rgba(230%2C%20126%2C%2034%2C%200.8)%22%2F%3E%3Cpath%20d%3D%22M60%2C50%20L62%2C51%20L61%2C53%20Z%22%20fill%3D%22rgba(211%2C%2084%2C%200%2C%200.6)%22%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22107%22%20height%3D%22107%22%3E%3Cpath%20d%3D%22M80%2C80%20L85%2C82%20L82%2C86%20Z%22%20fill%3D%22rgba(230%2C%20126%2C%2034%2C%200.5)%22%2F%3E%3C%2Fsvg%3E");
    background-size: 79px 79px, 107px 107px;
    animation: swirlUp 3s linear infinite;
}

@keyframes leafPendulum1 {
    0%   { background-position: 0px -100px, 0px -150px; }
    25%  { background-position: 30px 0px, -40px 0px; }
    50%  { background-position: 0px 100px, 0px 150px; }
    75%  { background-position: -30px 200px, 40px 300px; }
    100% { background-position: 0px 300px, 0px 450px; }
}



@keyframes grassSway {
    0%   { transform: skewX(-4deg); }
    100% { transform: skewX(4deg); }
}



@keyframes leafPendulumSeamless {
    0%   { background-position: 0px 0px, 0px 0px; }
    25%  { background-position: 25px 60px, -25px 60px; }
    50%  { background-position: 0px 120px, 0px 120px; }
    75%  { background-position: -25px 180px, 25px 180px; }
    100% { background-position: 0px 240px, 0px 240px; }
}
.ambient-particles.woodland {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%3E%3Cg%20transform%3D%22rotate(15%2020%2020)%22%3E%3Cpath%20d%3D%22M%2010%2030%20C%2010%2010%2C%2030%2010%2C%2030%2010%20C%2030%2010%2C%2030%2030%2C%2010%2030%20Z%22%20fill%3D%22rgba(46%2C204%2C113%2C0.2)%22%2F%3E%3Cpath%20d%3D%22M%2010%2030%20L%206%2034%22%20stroke%3D%22rgba(46%2C204%2C113%2C0.25)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"), url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2260%22%20height%3D%2260%22%3E%3Cg%20transform%3D%22rotate(-30%2030%2030)%22%3E%3Cpath%20d%3D%22M%2015%2045%20C%2015%2015%2C%2045%2015%2C%2045%2015%20C%2045%2015%2C%2045%2045%2C%2015%2045%20Z%22%20fill%3D%22rgba(211%2C84%2C0%2C0.15)%22%2F%3E%3Cpath%20d%3D%22M%2015%2045%20L%2010%2050%22%20stroke%3D%22rgba(211%2C84%2C0%2C0.2)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
    background-size: 40px 40px, 60px 60px;
    animation: leafPendulumSeamless 6s linear infinite;
}


@keyframes grassSway {
    0%   { transform: skewX(-4deg); }
    100% { transform: skewX(4deg); }
}



@keyframes leafPendulumSeamless {
    0%   { background-position: 0px 0px, 0px 0px; }
    25%  { background-position: 25px 150px, -25px 150px; }
    50%  { background-position: 0px 300px, 0px 300px; }
    75%  { background-position: -25px 450px, 25px 450px; }
    100% { background-position: 0px 600px, 0px 600px; }
}
.ambient-particles.woodland {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%3E%3Cg%20transform%3D%22translate(10%2C%2020)%20rotate(15)%22%3E%3Cpath%20d%3D%22M%2010%2030%20C%2010%2010%2C%2030%2010%2C%2030%2010%20C%2030%2010%2C%2030%2030%2C%2010%2030%20Z%22%20fill%3D%22rgba(46%2C204%2C113%2C0.3)%22%2F%3E%3Cpath%20d%3D%22M%2010%2030%20L%206%2034%22%20stroke%3D%22rgba(46%2C204%2C113%2C0.4)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(130%2C%2060)%20rotate(-35)%22%3E%3Cpath%20d%3D%22M%2010%2030%20C%2010%2010%2C%2030%2010%2C%2030%2010%20C%2030%2010%2C%2030%2030%2C%2010%2030%20Z%22%20fill%3D%22rgba(211%2C84%2C0%2C0.25)%22%2F%3E%3Cpath%20d%3D%22M%2010%2030%20L%206%2034%22%20stroke%3D%22rgba(211%2C84%2C0%2C0.3)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(60%2C%20150)%20rotate(60)%20scale(0.7)%22%3E%3Cpath%20d%3D%22M%2010%2030%20C%2010%2010%2C%2030%2010%2C%2030%2010%20C%2030%2010%2C%2030%2030%2C%2010%2030%20Z%22%20fill%3D%22rgba(46%2C204%2C113%2C0.25)%22%2F%3E%3Cpath%20d%3D%22M%2010%2030%20L%206%2034%22%20stroke%3D%22rgba(46%2C204%2C113%2C0.3)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(160%2C%20150)%20rotate(-10)%20scale(1.2)%22%3E%3Cpath%20d%3D%22M%2010%2030%20C%2010%2010%2C%2030%2010%2C%2030%2010%20C%2030%2010%2C%2030%2030%2C%2010%2030%20Z%22%20fill%3D%22rgba(139%2C90%2C43%2C0.2)%22%2F%3E%3Cpath%20d%3D%22M%2010%2030%20L%206%2034%22%20stroke%3D%22rgba(139%2C90%2C43%2C0.25)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"), url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22250%22%20height%3D%22250%22%3E%3Cg%20transform%3D%22translate(50%2C%2080)%20rotate(45)%20scale(0.8)%22%3E%3Cpath%20d%3D%22M%2010%2030%20C%2010%2010%2C%2030%2010%2C%2030%2010%20C%2030%2010%2C%2030%2030%2C%2010%2030%20Z%22%20fill%3D%22rgba(46%2C204%2C113%2C0.2)%22%2F%3E%3Cpath%20d%3D%22M%2010%2030%20L%206%2034%22%20stroke%3D%22rgba(46%2C204%2C113%2C0.3)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3Cg%20transform%3D%22translate(160%2C%2030)%20rotate(-70)%20scale(0.9)%22%3E%3Cpath%20d%3D%22M%2010%2030%20C%2010%2010%2C%2030%2010%2C%2030%2010%20C%2030%2010%2C%2030%2030%2C%2010%2030%20Z%22%20fill%3D%22rgba(211%2C84%2C0%2C0.2)%22%2F%3E%3Cpath%20d%3D%22M%2010%2030%20L%206%2034%22%20stroke%3D%22rgba(211%2C84%2C0%2C0.3)%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
    background-size: 200px 200px, 250px 250px;
    animation: leafPendulumSeamless 10s linear infinite;
    opacity: 0.9;
}


@keyframes grassSway {
    0%   { transform: skewX(-4deg); }
    100% { transform: skewX(4deg); }
}


@keyframes grassSway {
    0%   { transform: skewX(-4deg); }
    100% { transform: skewX(4deg); }
}


@keyframes grassSway {
    0%   { transform: skewX(-4deg); }
    100% { transform: skewX(4deg); }
}

@keyframes grassSway {
    0%   { transform: skewX(-4deg); }
    100% { transform: skewX(4deg); }
}
.ambient-particles.parkgreenspace {
    background-image: none;
    animation: none;
}
.ambient-particles.parkgreenspace::before {
    content: '';
    position: absolute;
    top: 0; left: -20px; right: -20px; bottom: 0;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22220%22%20viewBox%3D%220%200%20200%20220%22%3E%3Cpath%20d%3D%22M%20-23.331534053967328%20220%20Q%20-12.61495662254839%20130.84609875202597%20-31.813222270853032%2041.692197504051904%20Q%20-6.673828515662027%20130.84609875202597%20-17.390405947080964%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.13)%22%2F%3E%3Cpath%20d%3D%22M%20-15.661219644065843%20220%20Q%20-27.28784878498451%20115.4062233372623%20-37.54199449444513%2010.812446674524608%20Q%20-19.45669855558862%20115.4062233372623%20-7.830069414669952%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.19)%22%2F%3E%3Cpath%20d%3D%22M%20-9.950151608998983%20220%20Q%20-27.167871697325815%20124.99237746367291%20-10.453477988858353%2029.98475492734582%20Q%20-20.141515386552065%20124.99237746367291%20-2.9237952982252313%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.08)%22%2F%3E%3Cpath%20d%3D%22M%202.5007314524781954%20220%20Q%2015.158551036118372%20117.57464590951108%20-11.137283546360239%2015.149291819022153%20Q%2019.694952613948537%20117.57464590951108%207.037133030308362%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.13)%22%2F%3E%3Cpath%20d%3D%22M%2011.96027109057216%20220%20Q%2027.083585974375076%20146.15232633661623%2035.44553771535831%2072.30465267323243%20Q%2033.69721333852475%20146.15232633661623%2018.57389845472183%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.18)%22%2F%3E%3Cpath%20d%3D%22M%2017.457951510198455%20220%20Q%2027.06285376810588%20145.27945548670345%2025.44552939367749%2070.55891097340688%20Q%2031.20902014320012%20145.27945548670345%2021.604117885292695%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.07)%22%2F%3E%3Cpath%20d%3D%22M%2019.546095593131938%20220%20Q%2023.16305305197152%20145.71121500188337%20-2.684689323369099%2071.42243000376675%20Q%2027.834637277000052%20145.71121500188337%2024.21767981816047%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.16)%22%2F%3E%3Cpath%20d%3D%22M%2026.58509700788845%20220%20Q%2016.724464152963748%20124.87066086867374%2036.35817511815672%2029.741321737347477%20Q%2023.15562988659923%20124.87066086867374%2033.01626274152393%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.10)%22%2F%3E%3Cpath%20d%3D%22M%2034.28666659651534%20220%20Q%2042.633449336480425%20151.69439202152398%2033.43757856343191%2083.38878404304796%20Q%2049.28595555196506%20151.69439202152398%2040.939172811999974%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.06)%22%2F%3E%3Cpath%20d%3D%22M%2044.00358276082613%20220%20Q%2024.173671399206604%20138.35851578945903%2033.037490978806886%2056.71703157891804%20Q%2029.234642159267793%20138.35851578945903%2049.064553520887316%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.15)%22%2F%3E%3Cpath%20d%3D%22M%2046.773892306708326%20220%20Q%2050.85949154244861%20139.31075840890412%2049.19223022875724%2058.621516817808214%20Q%2057.626025405305136%20139.31075840890412%2053.54042616956485%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.18)%22%2F%3E%3Cpath%20d%3D%22M%2060.15927843382249%20220%20Q%2077.43068952135184%20150.7123542008173%2071.9609369496641%2081.4247084016346%20Q%2084.16810182203346%20150.7123542008173%2066.89669073450412%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.17)%22%2F%3E%3Cpath%20d%3D%22M%2060.7750859015291%20220%20Q%2057.89188639939872%20123.77827953252623%2069.50654488191486%2027.556559065052454%20Q%2065.54185461123818%20123.77827953252623%2068.42505411336856%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.11)%22%2F%3E%3Cpath%20d%3D%22M%2073.57495701170691%20220%20Q%2070.39707224586068%20126.3284183698273%2054.27207802890436%2032.65683673965461%20Q%2076.47617058936734%20126.3284183698273%2079.65405535521357%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.07)%22%2F%3E%3Cpath%20d%3D%22M%2080.59502493867356%20220%20Q%2062.09160722774471%20115.1224479618109%2091.84718759059655%2010.244895923621812%20Q%2069.61544578246068%20115.1224479618109%2088.11886349338954%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.13)%22%2F%3E%3Cpath%20d%3D%22M%2084.16790611858023%20220%20Q%2089.65421407586315%20133.13074511724605%2061.674021849421216%2046.2614902344921%20Q%2093.67240106727414%20133.13074511724605%2088.18609310999122%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.06)%22%2F%3E%3Cpath%20d%3D%22M%2092.14540450344543%20220%20Q%2081.56469135395403%20139.72164096413644%2081.61434404644608%2059.44328192827285%20Q%2089.49762252309431%20139.72164096413644%20100.07833567258571%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.18)%22%2F%3E%3Cpath%20d%3D%22M%2099.56358158070277%20220%20Q%2085.08934985567247%20154.87135317158507%2084.9365765102133%2089.74270634317014%20Q%2091.59392793524847%20154.87135317158507%20106.06815966027878%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.08)%22%2F%3E%3Cpath%20d%3D%22M%20102.31749481888463%20220%20Q%2092.14688187029061%20142.8947429587891%20109.95160375892698%2065.78948591757822%20Q%2098.9973192833111%20142.8947429587891%20109.16793223190511%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.17)%22%2F%3E%3Cpath%20d%3D%22M%20112.32385640803736%20220%20Q%20129.2463368872887%20145.4641503013172%20116.84458171993803%2070.92830060263438%20Q%20136.35474982539247%20145.4641503013172%20119.43226934614115%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.17)%22%2F%3E%3Cpath%20d%3D%22M%20118.5256958484659%20220%20Q%20108.37891825444362%20153.40085428691077%2097.6656715366295%2086.80170857382157%20Q%20114.86585911646795%20153.40085428691077%20125.01263671049023%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.05)%22%2F%3E%3Cpath%20d%3D%22M%20127.63251180085786%20220%20Q%20127.78235309106287%20114.93505278684152%20150.3083540308247%209.870105573683048%20Q%20135.16239197667966%20114.93505278684152%20135.01255068647464%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.11)%22%2F%3E%3Cpath%20d%3D%22M%20136.86982759787142%20220%20Q%20151.8304249069215%20114.47582797406511%20140.92049003769196%208.951655948130224%20Q%20158.30754156929996%20114.47582797406511%20143.34694426024987%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.10)%22%2F%3E%3Cpath%20d%3D%22M%20138.20029151817215%20220%20Q%20147.26990705709716%20147.19108922041363%20114.09526397830741%2074.38217844082726%20Q%20154.3798536493575%20147.19108922041363%20145.3102381104325%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.08)%22%2F%3E%3Cpath%20d%3D%22M%20150.32674492538408%20220%20Q%20165.74647314061656%20146.28027266502545%20175.77394389775125%2072.56054533005093%20Q%20172.84664577256285%20146.28027266502545%20157.42691755733037%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.20)%22%2F%3E%3Cpath%20d%3D%22M%20156.2299592169985%20220%20Q%20145.62287675105355%20152.69124234432132%20159.84804164249124%2085.38248468864268%20Q%20151.82980826557065%20152.69124234432132%20162.4368907315156%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.07)%22%2F%3E%3Cpath%20d%3D%22M%20159.890328016415%20220%20Q%20159.19124200355787%20146.2632554370366%20182.41204937668672%2072.52651087407318%20Q%20164.01419245024482%20146.2632554370366%20164.71327846310194%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.07)%22%2F%3E%3Cpath%20d%3D%22M%20172.6827833577361%20220%20Q%20155.5425319179652%20139.77081326904306%20201.25161061332267%2059.54162653808609%20Q%20162.66929673315647%20139.77081326904306%20179.80954817292738%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.12)%22%2F%3E%3Cpath%20d%3D%22M%20172.01314500193698%20220%20Q%20175.96219678197204%20152.8857284077009%20195.3024108894494%2085.77145681540179%20Q%20182.24709834744868%20152.8857284077009%20178.29804656741362%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.09)%22%2F%3E%3Cpath%20d%3D%22M%20180.1490054562543%20220%20Q%20196.88101134624364%20146.68378456517303%20189.20807726588006%2073.36756913034608%20Q%20202.27290721006955%20146.68378456517303%20185.5409013200802%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.09)%22%2F%3E%3Cpath%20d%3D%22M%20190.4557212612142%20220%20Q%20208.60444893038405%20130.6722768203406%20175.31241523205904%2041.34455364068123%20Q%20214.34706876093128%20130.6722768203406%20196.19834109176142%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.09)%22%2F%3E%3Cpath%20d%3D%22M%20199.40096923744287%20220%20Q%20203.21128609084067%20116.96387270303302%20213.91342929654894%2013.927745406066038%20Q%20207.59129985318395%20116.96387270303302%20203.78098299978615%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.06)%22%2F%3E%3Cpath%20d%3D%22M%20207.74846581376346%20220%20Q%20192.5857097531537%20112.81113689981049%20217.9385516964084%205.622273799620984%20Q%20198.52184688484928%20112.81113689981049%20213.68460294545903%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.19)%22%2F%3E%3Cpath%20d%3D%22M%20210.30400583098535%20220%20Q%20230.07092590216678%20134.65752922846264%20210.07894346864484%2049.3150584569253%20Q%20237.69348615643707%20134.65752922846264%20217.92656608525564%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.18)%22%2F%3E%3Cpath%20d%3D%22M%20216.62770744432387%20220%20Q%20206.54770300071087%20123.91017620252485%20196.9336962775946%2027.820352405049704%20Q%20212.0101410264525%20123.91017620252485%20222.0901454700655%20220%20Z%22%20fill%3D%22rgba(46%2C%20204%2C%20113%2C%200.07)%22%2F%3E%3C%2Fsvg%3E");
    background-position: center 20px;
    background-size: 200px 220px;
    background-repeat: repeat-x;
    transform-origin: center 240px;
    animation: grassSway 4s ease-in-out infinite alternate;
}

/* Sanctuary Modal Advanced Filters */
.tilt-shift-blur {
    position: absolute; inset: 0; z-index: 6; pointer-events: none; transform: translateZ(0);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    mask-image: linear-gradient(to bottom, black 0%, transparent 25%, transparent 75%, black 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 25%, transparent 75%, black 100%);
}


/* Responsive HUD Layout */
.top-hud-container { position: absolute; top: calc(48px + env(safe-area-inset-top)); left: 15px; right: 15px; z-index: 3000; pointer-events: none; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; transition: opacity 0.3s ease, transform 0.3s ease; }
.hud-profile-btn { pointer-events: auto; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); position: relative; }
.hud-center-title { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 10; top: 8px; }
.hud-right-box { pointer-events: auto; display: flex; align-items: center; height: 48px; box-sizing: border-box; flex-shrink: 0; }
@media (max-width: 600px) {
    .top-hud-container { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; left: 10px; right: 10px; top: calc(48px + env(safe-area-inset-top)); }
    .hud-profile-btn { width: 80px; height: 80px; justify-content: flex-start; }
    .hud-right-box { flex-shrink: 0; width: auto; height: 48px; padding: 0; justify-content: center; }
}

/* Archive View Toggle Buttons */
.archive-toggle button {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    border-radius: 17px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

.archive-toggle button.active {
    background: var(--accent-green) !important;
    color: var(--bg-color) !important;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.archive-toggle button:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Premium Top-Right Buttons */
.hud-right-btn {
    pointer-events: auto;
    background: rgba(10, 25, 47, 0.6);
    border: 1.5px solid rgba(116, 198, 157, 0.3);
    color: #74c69d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.hud-right-btn:hover {
    background: rgba(116, 198, 157, 0.15);
    border-color: #74c69d;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 198, 157, 0.3), 0 0 15px rgba(116, 198, 157, 0.2);
}

.hud-right-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Persistent Activity Feed Panel */
#activity-feed-panel {
    position: fixed;
    top: 140px;
    right: 15px;
    width: 320px;
    max-height: calc(100vh - 280px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 2500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: none;
    pointer-events: none; /* Let clicks pass through the empty areas */
}

#activity-feed-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px) scale(0.95);
}

.activity-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    pointer-events: auto; /* Enable clicks for Clear button */
}

.activity-feed-header span {
    font-size: 0.75rem;
    font-weight: 800;
    color: #ffd571;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

#clear-feed-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    cursor: pointer;
    font-weight: 700;
    transition: color 0.2s;
    padding: 2px 6px;
}

#clear-feed-btn:hover {
    color: #ff6b6b;
}

#activity-feed-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100%;
    pointer-events: none;
}

/* Custom Scrollbar for activity list */
#activity-feed-list::-webkit-scrollbar {
    width: 4px;
}
#activity-feed-list::-webkit-scrollbar-track {
    background: transparent;
}
#activity-feed-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}
#activity-feed-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.feed-empty-state {
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    font-size: 0.8rem;
    padding: 20px 0;
    font-style: italic;
}

.feed-item {
    background: transparent;
    border-left: 3px solid #ffd571;
    border-radius: 0;
    padding: 6px 12px;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #e2e8f0;
    animation: slideInFeed 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    pointer-events: auto;
}

@keyframes slideInFeed {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide custom compass and top ticker if any fullscreen or auth overlay is open */
body:has(.fullscreen-modal:not(.hidden)) #custom-compass,
body:has(.fullscreen-modal:not(.hidden)) #top-discovery-ticker,
body:has(.fullscreen-modal:not(.hidden)) #hud-container,
body:has(.auth-overlay:not(.hidden)) #custom-compass,
body:has(.auth-overlay:not(.hidden)) #top-discovery-ticker,
body:has(.auth-overlay:not(.hidden)) #hud-container,
body:has(.fullscreen-overlay:not(.hidden)) #custom-compass,
body:has(.fullscreen-overlay:not(.hidden)) #top-discovery-ticker,
body:has(.fullscreen-overlay:not(.hidden)) #hud-container {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-30px) !important;
}

body:has(.fullscreen-modal:not(.hidden)) #bottom-action-panel,
body:has(.auth-overlay:not(.hidden)) #bottom-action-panel,
body:has(.fullscreen-overlay:not(.hidden)) #bottom-action-panel {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, 40px) scale(0.95) !important;
}

/* Custom Floating Compass */
#custom-compass {
    position: fixed;
    left: 33px;
    top: calc(148px + env(safe-area-inset-top));
    z-index: 3000;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.3s ease, top 0.3s ease;
}

#custom-compass:hover {
    transform: scale(1.08);
}

#custom-compass:active {
    transform: scale(0.95);
}

/* Disabled/Faded Recenter Button State */
#recenter-btn:disabled {
    opacity: 0.35 !important;
    cursor: default !important;
    pointer-events: none !important;
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.25) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Bottom Action Panel Container */
#bottom-action-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 0);
    width: calc(100% - 30px);
    max-width: 450px;
    height: 72px;
    background: rgba(10, 18, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 3000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    box-sizing: border-box;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel Controls Layout (Flex-grow with space alignment) */
.panel-left-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-start;
}

.panel-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

.panel-center-action {
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -28px;
    flex-shrink: 0;
}

/* Panel Buttons Styling */
.panel-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
    font-weight: bold;
}

.panel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.panel-btn:active {
    transform: translateY(1px);
}

/* Search Button Circular Format Override */
#search-btn {
    width: 96px !important;
    height: 96px !important;
    border-radius: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    line-height: 1.15 !important;
    text-transform: uppercase !important;
    padding: 8px !important;
    text-align: center !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
    transition: all 0.2s ease !important;
    white-space: normal !important;
    box-sizing: border-box !important;
}

#search-btn svg {
    margin-right: 0 !important;
    margin-bottom: 3px !important;
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
}

/* Spinner adjustment for circular button */
#search-btn .spinner {
    margin-right: 0 !important;
    margin-bottom: 4px !important;
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
}

/* Top Discovery Ticker */
#top-discovery-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    padding-top: env(safe-area-inset-top);
    background: rgba(10, 20, 30, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
}

#top-discovery-ticker:hover {
    background: rgba(116, 198, 157, 0.15);
    border-bottom-color: rgba(116, 198, 157, 0.4);
    box-shadow: 0 4px 20px rgba(116, 198, 157, 0.15);
}

#top-discovery-ticker:active {
    background: rgba(116, 198, 157, 0.25);
}

#ticker-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    letter-spacing: 0.3px;
}

/* Pulsing Green Dot */
.ticker-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #2ecc71;
    display: inline-block;
    flex-shrink: 0;
    transition: background-color 0.3s;
}

.ticker-pulse-dot.pulse {
    animation: tickerDotPulse 2s infinite;
}

@keyframes tickerDotPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(46, 204, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}


/* --- Unerf Garden Game Overlay Styles --- */
#garden-overlay {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#garden-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#garden-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.garden-card-item {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    pointer-events: auto;
}
.garden-card-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}
.garden-card-item.selected {
    background: rgba(116, 198, 157, 0.2);
    border-color: #74c69d;
    box-shadow: 0 0 12px rgba(116, 198, 157, 0.4);
}
.garden-card-emoji {
    font-size: 1.8rem;
    line-height: 1;
}
.garden-card-count {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #ffd571;
    color: #111;
    font-weight: 800;
    font-size: 0.75rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #111;
}
