/* ============================================
   VIBEMAP — Google Maps / Waze Grade UI
   ============================================ */

:root {
    --bg-primary: #1a1a2e;
    --bg-surface: #1e1e36;
    --bg-card: #252542;
    --bg-elevated: #2a2a4a;
    --bg-glass: rgba(30, 30, 54, 0.92);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-active: rgba(99, 102, 241, 0.15);

    --text-primary: #f0f0f8;
    --text-secondary: #a0a0c0;
    --text-muted: #6b6b90;
    --text-inverse: #1a1a2e;

    --accent: #10b981;
    --accent-light: #34d399;
    --accent-lighter: #6ee7b7;
    --accent-surface: rgba(16, 185, 129, 0.12);

    --blue: #059669;
    --blue-surface: rgba(5, 150, 105, 0.12);
    --green: #34a853;
    --green-surface: rgba(52, 168, 83, 0.12);
    --yellow: #fbbc04;
    --yellow-surface: rgba(251, 188, 4, 0.12);
    --red: #ea4335;
    --red-surface: rgba(234, 67, 53, 0.12);
    --orange: #fa7b17;

    --route-drive: #4285f4;
    --route-cycle: #34a853;
    --route-walk: #fbbc04;

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.6);

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 0.15s;
    --dur-normal: 0.25s;
    --dur-slow: 0.4s;

    /* SDG Brand Colors */
    --goal-1: #e5243b;
    /* No Poverty */
    --goal-2: #dda63a;
    /* Zero Hunger */
    --goal-3: #4c9f38;
    /* Good Health */
    --goal-4: #c5192d;
    /* Quality Education */
    --goal-5: #ff3a21;
    /* Gender Equality */
    --goal-6: #26bde2;
    /* Clean Water */
    --goal-7: #fcc30b;
    /* Clean Energy */
    --goal-8: #a21942;
    /* Decent Work */
    --goal-9: #fd6925;
    /* Innovation */
    --goal-10: #dd1367;
    /* Reduced Inequality */
    --goal-11: #fd9d24;
    /* Sustainable Cities */
    --goal-12: #bf8b2e;
    /* Responsible Consumption */
    --goal-13: #3f7e44;
    /* Climate Action */
    --goal-14: #0a97d9;
    /* Life Below Water */
    --goal-15: #56c02b;
    /* Life on Land */
    --goal-16: #00689d;
    /* Peace & Justice */
    --goal-17: #19486a;
    /* Partnerships */
}

/* ── Reset ────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    /* Use dynamic viewport height so browser chrome doesn't cause vertical overflow on mobile */
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    /* prevent horizontal overflow */
    overflow: hidden;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
    color: inherit;
}

::selection {
    background: var(--accent);
    color: white;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* Override .hidden for panels that use transform transitions */
#directions-panel.hidden {
    display: flex !important;
    transform: translateX(-100%);
    pointer-events: none;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}

#loading-screen.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.loader-logo-img {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
    animation: logoFloat 2s var(--ease) infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.loader-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, var(--blue), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.loader-bar {
    width: 200px;
    height: 3px;
    border-radius: 4px;
    background: var(--bg-elevated);
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    width: 40%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--blue), var(--accent));
    animation: loader-slide 1.2s var(--ease) infinite;
}

@keyframes loader-slide {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(350%);
    }
}

/* ============================================
   MAP
   ============================================ */
#map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.leaflet-control-zoom,
.leaflet-control-attribution {
    display: none !important;
}

/* ============================================
   SEARCH BAR
   ============================================ */
#search-bar {
    position: fixed;
    top: 16px;
    /* Add safe-area inset for notched phones */
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: 16px;
    /* Clamp: never wider than the screen minus FAB stack and padding */
    width: min(420px, calc(100vw - 80px));
    max-width: calc(100vw - 80px);
    z-index: 1000;
    animation: fadeSlideDown 0.5s var(--ease) 0.3s both;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#search-bar-main {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 4px 8px;
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--dur-normal) var(--ease), border-color var(--dur-normal) var(--ease);
}

#search-bar-main:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-xl), 0 0 0 2px rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-xs) var(--radius-xs);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--text-secondary);
    transition: all var(--dur-fast) var(--ease);
    flex-shrink: 0;
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.9);
}

.directions-icon {
    color: var(--blue);
}

.directions-icon:hover {
    background: var(--blue-surface);
    color: var(--blue);
}

#search-go-btn {
    color: var(--accent);
}

#search-go-btn:hover {
    background: var(--accent-surface);
}

#search-locate-btn {
    color: var(--blue);
}

#search-locate-btn:hover {
    background: var(--blue-surface);
}

#search-locate-btn.active {
    animation: pulse-location 1.5s infinite;
    color: var(--accent);
}

@keyframes pulse-location {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.search-divider {
    width: 1px;
    height: 24px;
    background: var(--border-strong);
    margin: 0 2px;
    flex-shrink: 0;
}

#search-input {
    flex: 1;
    height: 44px;
    padding: 0 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
    min-width: 0;
}

#search-input::placeholder {
    color: var(--text-muted);
}

/* Search Results */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 360px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

#search-results.visible {
    display: block;
    animation: fadeIn 0.15s var(--ease);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sr-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background var(--dur-fast);
}

.sr-item:hover {
    background: var(--bg-hover);
}

.sr-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sr-item:hover .sr-icon {
    background: var(--accent-surface);
    color: var(--accent-light);
}

.sr-text {
    flex: 1;
    min-width: 0;
}

.sr-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sr-detail {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* ============================================
   DIRECTIONS PANEL
   ============================================ */
#directions-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    z-index: 2000;
    background: var(--bg-surface);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s var(--ease);
}

#directions-panel.hidden {
    transform: translateX(-100%);
    pointer-events: none;
    display: flex !important;
}

.dir-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Dir Header */
.dir-header {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 8px 12px 4px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.dir-header .icon-btn {
    margin-top: 8px;
}

.dir-inputs {
    flex: 1;
    display: flex;
    gap: 8px;
}

.dir-waypoints-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 4px 14px 0;
    gap: 0;
}

.wp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid;
}

.wp-dot.origin {
    border-color: var(--blue);
    background: var(--blue-surface);
}

.wp-dot.dest {
    border-color: var(--red);
    background: var(--red-surface);
}

.wp-line {
    width: 2px;
    flex: 1;
    min-height: 20px;
    background: repeating-linear-gradient(to bottom, var(--text-muted) 0, var(--text-muted) 4px, transparent 4px, transparent 8px);
}

.dir-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dir-field-wrap {
    position: relative;
}

.dir-field-wrap input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: all var(--dur-fast);
}

.dir-field-wrap input::placeholder {
    color: var(--text-muted);
}

.dir-field-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
    background: var(--bg-card);
}

.dir-field-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#dir-swap-btn {
    font-size: 1rem;
    width: 36px;
    height: 36px;
}

#dir-swap-btn:hover {
    background: var(--bg-hover);
}

/* Dir Autocomplete */
.dir-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 300;
}

.dir-autocomplete.visible {
    display: block;
    animation: fadeIn 0.15s var(--ease);
}

.dir-ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.84rem;
    transition: background var(--dur-fast);
}

.dir-ac-item:hover {
    background: var(--bg-hover);
}

.dir-ac-item i {
    color: var(--accent-light);
    font-size: 1rem;
    flex-shrink: 0;
}

.dir-ac-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mode Tabs */
.dir-modes {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.dir-mode-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px 10px;
    font-size: 1.2rem;
    color: var(--text-muted);
    position: relative;
    transition: color var(--dur-fast);
}

.dir-mode-tab .mode-eta {
    font-size: 0.72rem;
    font-weight: 600;
}

.dir-mode-tab:hover {
    color: var(--text-secondary);
}

.dir-mode-tab.active {
    color: var(--blue);
}

.dir-mode-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--blue);
}

.dir-mode-tab[data-mode="cycling"].active {
    color: var(--green);
}

.dir-mode-tab[data-mode="cycling"].active::after {
    background: var(--green);
}

.dir-mode-tab[data-mode="walking"].active {
    color: var(--yellow);
}

.dir-mode-tab[data-mode="walking"].active::after {
    background: var(--yellow);
}

/* Route Summary */
#route-summary {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.route-main-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.route-duration {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue);
}

.route-details {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.route-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Steps */
#steps-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Route Badges on Map */
.route-badge {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    transition: all var(--dur-fast) var(--ease);
    pointer-events: auto;
}

.route-badge:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    transform: scale(1.05);
}

.route-badge.active {
    background: var(--blue);
    color: #ffffff;
    border-color: var(--blue);
    font-size: 0.85rem;
    padding: 5px 10px;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.route-badge.active[data-mode="cycling"] {
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

.route-badge.active[data-mode="walking"] {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(251, 188, 4, 0.3);
}

/* Alternative Routes */
#alternatives-list {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    gap: 8px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.route-card {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
}

.route-card:hover {
    background: var(--bg-card);
    border-color: var(--border-strong);
}

.route-card.active {
    background: var(--bg-active);
    border-color: var(--blue);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.1);
}

.route-card.active[data-mode="cycling"] {
    border-color: var(--green);
    background: var(--green-surface);
}

.route-card.active[data-mode="walking"] {
    border-color: var(--yellow);
    background: var(--yellow-surface);
}

.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.route-card-duration {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.route-card.active .route-card-duration {
    color: var(--blue);
}

.route-card.active[data-mode="cycling"] .route-card-duration {
    color: var(--green);
}

.route-card.active[data-mode="walking"] .route-card-duration {
    color: var(--yellow);
}

.route-card-dist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.route-card-via {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-item {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--dur-fast);
}

.step-item:hover {
    background: var(--bg-hover);
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
}

.step-item:hover .step-icon {
    background: var(--accent-surface);
    color: var(--accent-light);
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-text {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
}

.step-text strong {
    color: var(--text-primary);
}

.step-dist {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: var(--font-mono);
}

#dir-bottom-bar {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg-surface);
}

.start-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius-xl);
    background: var(--blue);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.35);
    transition: all var(--dur-fast);
}

.start-btn:hover {
    background: #5a95f5;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.45);
}

.start-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: all var(--dur-fast);
}

.secondary-btn:hover {
    background: var(--red-surface);
    color: var(--red);
}

/* ============================================
   FABs
   ============================================ */
#fab-stack {
    position: fixed;
    right: 16px;
    top: calc(72px + env(safe-area-inset-top, 0px));
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeSlideDown 0.5s var(--ease) 0.5s both;
}

.fab {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    transition: all var(--dur-fast);
}

.fab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    transform: scale(1.06);
}

.fab:active {
    transform: scale(0.94);
}

.fab.active {
    color: var(--blue);
    background: var(--blue-surface);
    border-color: rgba(66, 133, 244, 0.3);
}

/* ============================================
   LANDING PAGE — Premium Redesign
   ============================================ */
#landing-page {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(160deg, #051a0e 0%, #0a2e18 40%, #063b22 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}

#landing-page.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Immersive Landing Page */
#landing-page {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: #030a06;
    /* Solid dark forest background */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#landing-page.fade-out {
    opacity: 0 !important;
}

#landing-page.hidden {
    opacity: 0;
    pointer-events: none;
}

.lp-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.lp-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    animation: orbDrift 12s ease-in-out infinite;
}

.lp-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #10b981, #059669);
    top: -150px;
    left: -100px;
    animation-delay: 0s;
}

.lp-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #38bdf8, #0284c7);
    bottom: -100px;
    right: -80px;
    animation-delay: -4s;
}

.lp-orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #6ee7b7, #10b981);
    top: 40%;
    left: 60%;
    animation-delay: -8s;
}

@keyframes orbDrift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -40px) scale(1.08);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* ── Content ────────────────────────────── */
.landing-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 1.5rem 1.5rem;
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    flex-shrink: 0;
}

/* ── Logo ────────────────────────────────── */
.landing-logo-wrap {
    position: relative;
    display: inline-flex;
    margin-bottom: 0.8rem;
    animation: fadeSlideDown 0.7s var(--ease-bounce) 0.1s both;
}

.landing-logo-glow {
    position: absolute;
    inset: -18px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.55) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

.landing-logo {
    width: 100px;
    height: 100px;
    border-radius: 28px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1.5px rgba(110, 231, 183, 0.3);
    position: relative;
    z-index: 1;
}

/* ── Badge ───────────────────────────────── */
.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 100px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    color: #6ee7b7;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
    animation: fadeSlideDown 0.6s var(--ease) 0.25s both;
}

/* ── Title & slogan ──────────────────────── */
.landing-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #ffffff 0%, #6ee7b7 60%, #10b981 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeSlideDown 0.65s var(--ease) 0.35s both;
}

.landing-slogan {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 1rem;
    font-weight: 400;
    line-height: 1.6;
    animation: fadeSlideDown 0.65s var(--ease) 0.45s both;
}

/* ── Feature pills ───────────────────────── */
.landing-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
    animation: fadeSlideDown 0.65s var(--ease) 0.55s both;
}

.landing-feature {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    transition: background 0.2s, border-color 0.2s;
}

.landing-feature:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

/* ── CTA button ──────────────────────────── */
.landing-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1rem 2.4rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #051a0e;
    background: linear-gradient(135deg, #6ee7b7 0%, #10b981 50%, #059669 100%);
    border-radius: 100px;
    border: none;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
    margin-bottom: 2rem;
    animation: fadeSlideDown 0.65s var(--ease-bounce) 0.65s both;
}

.landing-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.55), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.landing-btn:active {
    transform: translateY(0) scale(0.98);
}

.landing-btn i {
    font-size: 1.25rem;
}

/* Shimmer sweep across the button */
.landing-btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: btnShimmer 2.5s ease-in-out 1.5s infinite;
    transform: skewX(-20deg);
}

@keyframes btnShimmer {
    0% {
        left: -100%;
    }

    60% {
        left: 160%;
    }

    100% {
        left: 160%;
    }
}

/* ── Stats row ───────────────────────────── */
.landing-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    animation: fadeSlideDown 0.6s var(--ease) 0.75s both;
}

.lstat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.lstat-num {
    font-size: 1.35rem;
    font-weight: 800;
    color: #6ee7b7;
    line-height: 1;
}

.lstat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.lstat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.12);
}

/* Mobile tweaks */
@media (max-width: 480px) {
    .landing-title {
        font-size: 2.4rem;
    }

    .landing-logo {
        width: 110px;
        height: 110px;
    }

    .landing-btn {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
}

/* ============================================
   ONBOARDING SCREEN
   ============================================ */
#onboarding-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(160deg, #051a0e 0%, #0a2e18 40%, #063b22 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    animation: obFadeIn 0.4s var(--ease) both;
    transition: opacity 0.6s var(--ease);
}

#onboarding-screen.hidden {
    display: none;
}

#onboarding-screen.leaving {
    opacity: 0;
    pointer-events: none;
}

@keyframes obFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Spinner wrap — positions the rings + logo */
#ob-spinner-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dual counter-rotating arc rings */
.ob-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.ob-ring-outer {
    border-top-color: #10b981;
    border-right-color: rgba(16, 185, 129, 0.3);
    animation: ringSpinCW 0.9s linear infinite;
}

.ob-ring-inner {
    inset: 10px;
    border-bottom-color: #38bdf8;
    border-left-color: rgba(56, 189, 248, 0.3);
    animation: ringSpinCCW 1.1s linear infinite;
}

@keyframes ringSpinCW {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ringSpinCCW {
    to {
        transform: rotate(-360deg);
    }
}

.ob-logo {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Tip text */
.ob-tip {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
    min-height: 3em;
    /* prevent layout shift during swap */
    transition: opacity 0.2s ease;
}

.ob-tip.tip-fade {
    opacity: 0;
}

/* Welcome phase */
#ob-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: obWelcomeIn 0.5s var(--ease-bounce) both;
}

#ob-welcome.hidden {
    display: none;
}

@keyframes obWelcomeIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(16px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ob-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    font-weight: 900;
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.45);
}

.ob-welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.ob-welcome-sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

/* ============================================
   SIDEBAR MENU
   ============================================ */
#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

#sidebar-overlay:not(.hidden) {
    opacity: 1;
}

#sidebar-overlay.hidden {
    display: none;
}

#sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    background: var(--bg-surface);
    z-index: 2600;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.35s var(--ease);
}

#sidebar-menu.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

/* Landing logo */
.landing-logo {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.35);
    margin-bottom: 1.5rem;
    animation: fadeSlideDown 0.7s var(--ease-bounce) both;
}

/* Sidebar brand (logo + name side by side) */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    color: var(--accent-light);
    font-weight: 700;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.categories-list,
.my-places-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item,
.saved-place-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--dur-fast);
}

.saved-place-item {
    justify-content: space-between;
}

.saved-place-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.saved-place-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.saved-place-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-place-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.saved-empty-state {
    padding: 16px 12px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px dashed rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.saved-empty-state i {
    font-size: 1.5rem;
    color: #ef4444;
    margin-bottom: 8px;
    opacity: 0.8;
}

.category-item:hover {
    background: var(--bg-card);
    border-color: var(--border-strong);
}

.category-item.active {
    background: var(--bg-active);
    border-color: var(--accent);
}

.category-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.category-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--dur-fast);
}

.sidebar-link i {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link:hover i {
    color: var(--accent-light);
}

/* ── Streak Widget ── */
.streak-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin: 0 0 12px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.35), rgba(234, 88, 12, 0.15));
    border: 1px solid rgba(251, 146, 60, 0.3);
    box-shadow: 0 0 24px rgba(253, 115, 22, 0.08);
}

.streak-flames {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.streak-count {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.streak-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Streak CTA (Empty State) ── */
.streak-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin: 0 0 12px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.06));
    border: 1px dashed rgba(16, 185, 129, 0.4);
    cursor: pointer;
    transition: all var(--dur-fast);
}

.streak-cta:hover {
    background: rgba(16, 185, 129, 0.18);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.streak-cta-icon {
    font-size: 1.5rem;
    background: var(--bg-primary);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.streak-cta-body {
    flex: 1;
    animation: ctaShake 5s infinite;
}

.streak-cta-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-light);
}

.streak-cta-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.3;
}

.streak-cta i {
    color: var(--text-muted);
    font-size: 1rem;
}

.streak-cta:hover i {
    color: var(--accent-light);
    transform: translateX(3px);
    transition: transform 0.2s;
}

@keyframes ctaShake {

    0%,
    90%,
    100% {
        transform: translateX(0);
    }

    92% {
        transform: translateX(-2px);
    }

    94% {
        transform: translateX(2px);
    }

    96% {
        transform: translateX(-2px);
    }

    98% {
        transform: translateX(2px);
    }
}


.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--dur-fast);
}

.category-item:hover {
    background: var(--bg-card);
    border-color: var(--border-strong);
}

.category-item.active {
    background: var(--bg-active);
    border-color: var(--accent);
}

.category-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.category-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   LAYERS PANEL
   ============================================ */
#layers-panel {
    position: fixed;
    right: 74px;
    top: calc(88px + env(safe-area-inset-top, 0px));
    z-index: 950;
    width: 240px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 16px;
    animation: fadeScaleIn 0.2s var(--ease-bounce);
}

@keyframes fadeScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.layers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.layers-header h3 {
    font-size: 0.88rem;
    font-weight: 600;
}

.layers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.layer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all var(--dur-fast);
    cursor: pointer;
}

.layer-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

.layer-card.active {
    border-color: var(--blue);
    background: var(--blue-surface);
}

.layer-thumb {
    width: 100%;
    aspect-ratio: 1.5;
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.dark-thumb {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.light-thumb {
    background: linear-gradient(135deg, #e8eaf6 0%, #f5f5f5 50%, #c5cae9 100%);
}

.sat-thumb {
    background: linear-gradient(135deg, #1b3a20 0%, #2e6b2e 50%, #3d8b3d 100%);
}

.terrain-thumb {
    background: linear-gradient(135deg, #d4a574 0%, #8fbc8f 50%, #f5f5dc 100%);
}

.layer-card span {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.layer-card.active span {
    color: var(--blue);
}

/* ============================================
   ZOOM CONTROLS
   ============================================ */
#zoom-controls {
    position: fixed;
    right: 16px;
    top: calc(260px + env(safe-area-inset-top, 0px));
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    animation: fadeSlideDown 0.5s var(--ease) 0.6s both;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all var(--dur-fast);
}

.zoom-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.zoom-btn:active {
    background: var(--bg-elevated);
}

.zoom-btn:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.zoom-btn:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border-top: none;
}

/* ============================================
   INFO CARD (bottom card for clicked locations)
   ============================================ */
#info-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 800;
    pointer-events: none;
}

#info-card:not(.hidden) {
    pointer-events: auto;
}

.info-card-content {
    max-width: 420px;
    margin: 0 auto 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 16px 20px;
    animation: slideUp 0.35s var(--ease-bounce);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.info-card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

.info-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 12px;
    font-family: var(--font-mono);
}

.info-card-actions {
    display: flex;
    gap: 16px;
}

.info-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    color: var(--blue);
    transition: all var(--dur-fast);
    cursor: pointer;
}

.info-action span {
    font-size: 0.7rem;
    font-weight: 500;
}

.info-action:hover {
    background: var(--blue-surface);
}

#info-saved-btn.saved-active {
    color: #ef4444;
}

#info-saved-btn.saved-active:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ============================================
   TOAST
   ============================================ */
#toast-container {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
    /* Prevent the toast from being wider than the screen */
    max-width: calc(100vw - 32px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: auto;
    animation: toastIn 0.35s var(--ease-bounce);
}

.toast.removing {
    animation: toastOut 0.25s var(--ease) forwards;
}

.toast i {
    font-size: 1.15rem;
}

.toast.success i {
    color: var(--green);
}

.toast.error i {
    color: var(--red);
}

.toast.info i {
    color: var(--blue);
}

@keyframes toastIn {
    from {
        transform: translateY(16px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastOut {
    to {
        transform: translateY(16px) scale(0.95);
        opacity: 0;
    }
}

/* ============================================
   ECO CHIP MARKERS (replaces .marker-pin)
   ============================================ */
.eco-chip {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chip-color, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 2.5px rgba(255, 255, 255, 0.9);
    cursor: pointer;
    animation: chipPop 0.4s var(--ease-bounce) both;
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
    position: relative;
    will-change: transform;
}

.eco-chip:hover {
    transform: scale(1.3);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4),
        0 0 0 3px white,
        0 0 0 5.5px var(--chip-color, #10b981);
    z-index: 1000;
}

.eco-chip:active {
    transform: scale(1.1);
}

/* Visited state — green ring + checkmark badge */
.eco-chip.visited {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 2.5px #10b981;
}

.eco-chip.visited::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 900;
    line-height: 14px;
    text-align: center;
    color: white;
    border: 1.5px solid white;
    pointer-events: none;
}

.eco-chip.saved::before {
    content: '❤';
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
    font-size: 9px;
    line-height: 14px;
    text-align: center;
    color: white;
    border: 1.5px solid white;
    pointer-events: none;
    z-index: 2;
}

@keyframes chipPop {
    0% {
        transform: scale(0) translateY(-8px);
        opacity: 0;
    }

    65% {
        transform: scale(1.22) translateY(0);
        opacity: 1;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Keep the red info-marker pin for search results */
.marker-pin.red {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, var(--red), #f06);
    transform: rotate(-45deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 2px solid white;
    animation: markerDrop 0.5s var(--ease-bounce) forwards;
}

@keyframes markerDrop {
    0% {
        transform: rotate(-45deg) translateY(-30px) scale(0.6);
        opacity: 0;
    }

    100% {
        transform: rotate(-45deg) translateY(0) scale(1);
        opacity: 1;
    }
}

/* Origin/Dest nav markers */
.nav-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    animation: markerDrop 0.4s var(--ease-bounce);
}

.nav-marker.origin {
    background: var(--blue);
    border: 3px solid white;
}

.nav-marker.dest {
    background: var(--red);
    border: 3px solid white;
}

.nav-marker-label {
    font-family: var(--font);
    font-weight: 700;
    font-size: 11px;
}

/* User location blue dot */
.user-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--blue);
    border: 3px solid white;
    box-shadow: 0 0 0 6px rgba(66, 133, 244, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: userPulse 2.5s ease-in-out infinite;
}

@keyframes userPulse {

    0%,
    100% {
        box-shadow: 0 0 0 6px rgba(66, 133, 244, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 14px rgba(66, 133, 244, 0.08), 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Leaflet popup restyle */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    font-family: var(--font) !important;
    font-size: 14px !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
}

.popup-inner {
    padding: 14px 16px;
}

.popup-inner h4 {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.popup-inner .popup-coords {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.popup-inner .popup-btns {
    display: flex;
    gap: 8px;
}

.popup-btn {
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.76rem;
    font-weight: 500;
    transition: all var(--dur-fast);
    cursor: pointer;
}

.popup-btn.primary {
    background: var(--blue-surface);
    color: var(--blue);
    border: 1px solid rgba(66, 133, 244, 0.2);
}

.popup-btn.primary:hover {
    background: rgba(66, 133, 244, 0.2);
}

.popup-btn.danger {
    background: var(--red-surface);
    color: var(--red);
    border: 1px solid rgba(234, 67, 53, 0.2);
}

.popup-btn.danger:hover {
    background: rgba(234, 67, 53, 0.2);
}

/* ============================================
   FLAWLESS MARKER POPUPS
   ============================================ */
.leaflet-popup.flawless-popup {
    margin-bottom: 25px;
}

.flawless-popup .leaflet-popup-content-wrapper {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 0;
    overflow: hidden;
    min-width: 260px;
    max-width: 300px;
    border: 1px solid var(--border);
}

.flawless-popup .leaflet-popup-content {
    margin: 0;
    line-height: 1.5;
}

.flawless-popup .leaflet-popup-tip-container {
    overflow: visible;
}

.flawless-popup .leaflet-popup-tip {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.flawless-popup .leaflet-popup-close-button {
    color: var(--text-secondary) !important;
    padding: 12px 12px 0 0 !important;
    font-size: 18px !important;
    transition: color 0.2s;
    z-index: 10;
}

.flawless-popup .leaflet-popup-close-button:hover {
    color: var(--text-primary) !important;
}

.custom-popup {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.custom-popup .popup-meta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.custom-popup .popup-meta i {
    font-size: 1rem;
}

.custom-popup .popup-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    padding-right: 20px;
}

.custom-popup .popup-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    #search-bar {
        width: calc(100vw - 80px);
    }

    #directions-panel {
        width: 100%;
    }

    .info-card-content {
        margin: 0 8px 8px;
        margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    #zoom-controls {
        display: none;
    }

    .flawless-popup .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 48px) !important;
        min-width: 0 !important;
    }

    .landing-title {
        font-size: 2.4rem;
    }

    #layers-panel {
        right: 8px;
        max-width: calc(100vw - 16px);
    }
}

/* ============================================
   ECO SCORE WIDGET (sidebar)
   ============================================ */
#eco-score-widget {
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 4px;
}

.eco-score-level {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.eco-score-count {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.eco-score-bar {
    height: 5px;
    border-radius: 5px;
    background: var(--bg-primary);
    overflow: hidden;
}

.eco-score-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s var(--ease);
}

/* ============================================
   DAILY CHALLENGE WIDGET (sidebar)
   ============================================ */
#daily-challenge-widget {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 13px 15px;
    margin-bottom: 4px;
}

.challenge-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.challenge-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.challenge-text.done {
    text-decoration: line-through;
    opacity: 0.55;
}

.challenge-complete-badge {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--accent-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Visited button in info card — active state */
.info-action.visited-active {
    color: var(--accent-light) !important;
}

.info-action.visited-active i {
    color: var(--accent-light);
}

/* ============================================
   LIVE NAVIGATION HUD
   ============================================ */
#nav-hud {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    font-family: 'Inter', sans-serif;
}

#nav-hud-step {
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    pointer-events: auto;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

#nav-hud-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

#nav-hud-instruction {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

#nav-hud-dist-step {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 3px;
    font-weight: 500;
}

#nav-hud-bottom {
    background: rgba(10, 20, 12, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(76, 175, 80, 0.25);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 20px;
    pointer-events: auto;
}

#nav-hud-eta,
#nav-hud-remain {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
}

#nav-hud-eta {
    color: var(--accent-light, #81c784);
}

#nav-stop-btn {
    background: rgba(255, 80, 80, 0.15);
    border: 1px solid rgba(255, 80, 80, 0.4);
    color: #ff6b6b;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, border-color 0.2s;
}

#nav-stop-btn:hover {
    background: rgba(255, 80, 80, 0.3);
    border-color: #ff6b6b;
}

/* live user position arrow during navigation */
.nav-arrow-dot {
    width: 22px;
    height: 22px;
    background: #4285f4;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.35), 0 2px 10px rgba(0, 0, 0, 0.4);
    animation: nav-pulse 2s ease-in-out infinite;
}

@keyframes nav-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.35), 0 2px 10px rgba(0, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(66, 133, 244, 0.12), 0 2px 10px rgba(0, 0, 0, 0.4);
    }
}

/* ============================================
   SUGGEST A SPOT FAB & MODAL
   ============================================ */
#suggest-btn {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 16px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 18px 10px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.02em;
    pointer-events: auto;
}

#suggest-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.6);
}

#suggest-btn i {
    font-size: 1rem;
}

/* ── Base Modal Styles ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    transition: opacity 0.3s var(--ease);
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(0) scale(1);
    transition: transform 0.3s var(--ease-bounce);
    display: flex;
    flex-direction: column;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px) scale(0.96);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 20px 24px 24px;
    overflow-y: auto;
}

/* ── Suggest Modal ── */
.suggest-modal-content {
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.suggest-intro {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-group .req {
    color: #f87171;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px 12px;
    outline: none;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group select option {
    background: var(--bg-surface);
}

.suggest-status {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.suggest-status.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.suggest-status.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.suggest-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 13px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    letter-spacing: 0.02em;
}

.suggest-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.suggest-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   FEATURED CAROUSEL
   ============================================ */
#featured-carousel {
    position: absolute;
    bottom: 24px;
    left: 48px;
    right: 48px;
    z-index: 1000;
    overflow: hidden;
    pointer-events: auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#featured-carousel.hidden {
    opacity: 0;
    transform: translateY(32px);
    pointer-events: none;
}

/* Inner scrolling track — driven by JS */
#fc-track {
    display: flex;
    gap: 14px;
    padding: 12px 4px 16px;
    /* Reduced vertical padding */
    width: max-content;
    will-change: transform;
}

/* Pause scroll on hover */
#featured-carousel:hover #fc-track {
    animation-play-state: paused;
}

/* ── Carousel Controls ────────────────── */
.fc-control-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    opacity: 0.8 !important;
    /* Always visible but slightly transparent on top of content */
    transition: all 0.2s;
}

#featured-carousel:hover .fc-control-btn {
    opacity: 1 !important;
    transform: scale(1);
}

#fc-pause-btn {
    right: 48px;
    /* Offset from X button inside the card */
    background: var(--accent);
}

.fc-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

#featured-carousel:hover .fc-nav-btn {
    opacity: 1;
}

.fc-nav-btn.prev {
    left: 4px;
}

.fc-nav-btn.next {
    right: 4px;
}

#fc-show-btn {
    position: fixed;
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    pointer-events: auto;
    background: var(--bg-surface);
    color: var(--accent);
    box-shadow: var(--shadow-xl);
    display: flex;
    /* Ensure it overrides any default hidden styles when visible */
}

.featured-card {
    flex: 0 0 auto;
    width: 250px;
    background: rgba(8, 28, 14, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
    animation: fcSlideUp 0.5s ease both;
}

@keyframes fcSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Colored accent strip at the top */
.fc-accent {
    height: 5px;
    width: 100%;
    border-radius: 0;
}

.fc-body {
    padding: 13px 15px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.fc-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.fc-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.fc-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0;
}

.fc-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   SETTINGS MODAL
   ============================================ */
.settings-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.st-options {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.st-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.st-btn:hover {
    color: var(--text-primary);
}

.st-btn.active {
    background: var(--bg-elevated);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.danger-zone {
    margin-top: 10px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.danger-zone label {
    color: #f87171;
}

.st-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.st-danger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.st-danger-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

@media (max-width: 768px) {
    #nav-hud-instruction {
        font-size: 1rem;
    }

    #nav-hud-step {
        padding: 14px 18px;
    }

    #featured-carousel {
        left: 12px;
        right: 12px;
        bottom: 16px;
    }

    .featured-card {
        width: 190px;
    }

    .fc-desc {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .fc-body {
        padding: 10px 12px;
    }

    .fc-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .fc-title {
        font-size: 0.85rem;
    }

    .fc-control-btn,
    .fc-nav-btn {
        opacity: 1;
        /* Always visible on mobile touch */
        background: rgba(0, 0, 0, 0.6);
    }
}

/* ── Education Modal ── */
.edu-modal-content {
    max-width: 600px;
    max-height: 85vh;
}

.edu-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--accent-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.edu-section p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sdg-track-container {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
    margin-bottom: 24px;
    padding: 10px 0 20px 0;
    cursor: grab;
    scroll-snap-type: x mandatory;
}

.sdg-track-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.sdg-track {
    display: flex;
    gap: 16px;
    width: max-content;
}

.sdg-card {
    width: 180px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    scroll-snap-align: center;
    cursor: pointer;
}

.sdg-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.sdg-num {
    font-weight: 900;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--sdg-color, #fff);
}

.sdg-card h4 {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
}

.sdg-card p {
    font-size: 0.78rem;
    margin: 0;
    line-height: 1.4;
    color: var(--text-secondary);
    opacity: 0.9;
}

/* SDG Global Goal Colors */
.goal-1  { --sdg-color: #e5243b; }
.goal-2  { --sdg-color: #dda63a; }
.goal-3  { --sdg-color: #4c9f38; }
.goal-4  { --sdg-color: #c5192d; }
.goal-5  { --sdg-color: #ff3a21; }
.goal-6  { --sdg-color: #26bde2; }
.goal-7  { --sdg-color: #fcc30b; }
.goal-8  { --sdg-color: #a21942; }
.goal-9  { --sdg-color: #fd6925; }
.goal-10 { --sdg-color: #dd1367; }
.goal-11 { --sdg-color: #fd9d24; }
.goal-12 { --sdg-color: #bf8b2e; }
.goal-13 { --sdg-color: #3f7e44; }
.goal-14 { --sdg-color: #0a97d9; }
.goal-15 { --sdg-color: #56c02b; }
.goal-16 { --sdg-color: #00689d; }
.goal-17 { --sdg-color: #19486a; }

.edu-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.swiss-levels {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.swiss-level {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.sl-icon {
    width: 32px;
    height: 32px;
    background: #e30613;
    /* Swiss Red */
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.sl-text {
    font-size: 0.85rem;
    line-height: 1.4;
}

.sl-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: center;
}

.edu-close-action {
    background: var(--accent);
    color: white;
    padding: 12px 32px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.edu-close-action:hover {
    transform: scale(1.05);
}

#info-sdg-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sdg-mini-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.sdg-mini-icon:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.info-card-content {
    padding: 0 1.2rem 1.4rem 1.2rem;
}

@media (max-width: 600px) {
    .sdg-grid {
        grid-template-columns: 1fr;
    }

    .landing-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
}

.landing-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.landing-btn.outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent-light);
}

.landing-btn.outline:hover {
    background: var(--accent-surface);
}

/* ── SDG Badges ── */
.info-sdg-row {
    display: flex;
    gap: 8px;
    margin: 8px 0 12px;
}

.sdg-badge {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Shared Goal Colors */
.goal-11 {
    background-color: #f99d26;
}

.goal-12 {
    background-color: #cf8d2c;
}

.goal-13 {
    background-color: #48773e;
}

/* ── Mini Lessons ── */
.lessons-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.lesson-goal {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
}

.lesson-content h4 {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
}

.lesson-content p {
    line-height: 1.4;
    margin: 0 0 10px 0;
    color: var(--text-secondary);
}

.lesson-fact {
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--accent-light);
    margin-bottom: 12px;
    font-style: italic;
    border-left: 3px solid var(--accent);
}

.lesson-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
}

.lesson-btn:hover:not(:disabled) {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.lesson-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: default;
}

/* ── Landing Page SDG Extension ── */
/* ── Landing Page Social Extension ── */
.lp-social-wrap {
    margin-top: 10px;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.lp-social-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s var(--ease);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.lp-social-btn i {
    font-size: 1.5rem;
}

.lp-social-btn.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(220, 39, 67, 0.3);
}

.lp-social-btn.x:hover {
    background: #000;
    border-color: #555;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.lp-social-btn span {
    letter-spacing: 0.01em;
}

/* SDG Goal Colors */
.goal-1 {
    background-color: #e5243b;
}

.goal-2 {
    background-color: #dda63a;
}

.goal-3 {
    background-color: #4c9f38;
}

.goal-4 {
    background-color: #c5192d;
}

.goal-5 {
    background-color: #ff3a21;
}

.goal-6 {
    background-color: #26bde2;
}

.goal-7 {
    background-color: #fcc30b;
}

.goal-8 {
    background-color: #a21942;
}

.goal-9 {
    background-color: #fd6925;
}

.goal-10 {
    background-color: #dd1367;
}

.goal-11 {
    background-color: #fd9d24;
}

.goal-12 {
    background-color: #bf8b2e;
}

.goal-13 {
    background-color: #3f7e44;
}

.goal-14 {
    background-color: #0a97d9;
}

.goal-15 {
    background-color: #56c02b;
}

.goal-16 {
    background-color: #00689d;
}

.goal-17 {
    background-color: #19486a;
}

/* Full Education Section */
.landing-edu-section {
    width: 100%;
    background: linear-gradient(to bottom, #051a0e, #0c2b18);
    padding: 100px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.edu-section-header {
    text-align: center;
    max-width: 700px;
}

.edu-tag {
    background: var(--accent-surface);
    color: var(--accent-light);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    display: inline-block;
}

.edu-section-header h2 {
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #6ee7b7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.edu-section-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Updated SDG & Swisstainable Styling */
.sdg-full-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1100px;
}

.sdg-grid-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sdg-grid-item:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.sdg-grid-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.4s ease;
}

.sdg-grid-item:hover img {
    transform: rotate(-2deg);
}

.sdg-learn-tip {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sdg-lesson-body .highlight-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    transition: background 0.3s ease;
}

.sdg-lesson-body .highlight-box:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sdg-lesson-body h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 0.03em;
}

.sdg-lesson-body p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

/* Swisstainable Badge Contrast */
.swiss-level {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    border-left: 4px solid var(--accent);
}

/* Modal Readability */
.modal-content {
    background: var(--bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-xl);
}

.sdg-lesson-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#sdg-lesson-complete-btn {
    padding: 18px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 16px;
    text-transform: none;
    letter-spacing: 0;
}

.edu-lessons-wrap h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 32px;
    text-align: center;
    background: linear-gradient(to right, #6ee7b7, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.edu-swisstainable-highlight {
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(255, 255, 255, 0.98);
    padding: 40px 60px;
    border-radius: 28px;
    max-width: 900px;
    color: #111;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.edu-swisstainable-highlight img {
    height: 80px;
}

.edu-swisstainable-highlight h4 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.edu-swisstainable-highlight p {
    font-size: 1.1rem;
    line-height: 1.5;
    opacity: 0.9;
}

@media (max-width: 1000px) {
    .sdg-full-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .sdg-full-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .landing-edu-section {
        padding: 60px 24px;
    }

    .edu-section-header h2 {
        font-size: 2.6rem;
    }

    .edu-swisstainable-highlight {
        flex-direction: column;
        text-align: center;
        padding: 32px;
    }

    .edu-lessons-wrap {
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {
    .sdg-full-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .edu-section-header h2 {
        font-size: 2rem;
    }
}

/* ── Highlight FAB ── */
.fab.highlight {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent-light);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.fab.highlight:hover {
    background: var(--accent-light);
    transform: scale(1.1) rotate(5deg) !important;
}

/* ── SDG Lesson Modal ── */
.sdg-lesson-content {
    max-width: 500px;
    background: white;
    padding: 0;
    overflow: hidden;
    border-radius: 24px;
}

.sdg-lesson-header {
    background: #fdfdfd;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 5px solid #eee;
}

.sdg-lesson-brand {
    display: flex;
    gap: 20px;
    align-items: center;
}

#sdg-lesson-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.sdg-lesson-titles span {
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #888;
    display: block;
    letter-spacing: 0.05em;
}

.sdg-lesson-titles h2 {
    font-size: 1.8rem;
    color: #111;
    margin: 4px 0 0 0;
    font-weight: 800;
    line-height: 1.2;
}

.sdg-lesson-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.highlight-box {
    background: #f9fafb;
    border-radius: 16px;
    padding: 24px;
    border-left: 6px solid var(--accent);
}

.highlight-box h4 {
    margin: 0 0 8px 0;
    color: #111;
    font-size: 1.1rem;
    font-weight: 800;
}

.highlight-box p {
    font-size: 1rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

.sdg-grid-item {
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sdg-grid-item:hover {
    transform: scale(1.08) translateY(-6px);
    z-index: 10;
}

.sdg-grid-item img {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Header border colors for all 17 goals */
.sdg-lesson-header.goal-1 {
    border-bottom-color: #e5243b;
}

.sdg-lesson-header.goal-2 {
    border-bottom-color: #dda63a;
}

.sdg-lesson-header.goal-3 {
    border-bottom-color: #4c9f38;
}

.sdg-lesson-header.goal-4 {
    border-bottom-color: #c5192d;
}

.sdg-lesson-header.goal-5 {
    border-bottom-color: #ff3a21;
}

.sdg-lesson-header.goal-6 {
    border-bottom-color: #26bde2;
}

.sdg-lesson-header.goal-7 {
    border-bottom-color: #fcc30b;
}

.sdg-lesson-header.goal-8 {
    border-bottom-color: #a21942;
}

.sdg-lesson-header.goal-9 {
    border-bottom-color: #fd6925;
}

.sdg-lesson-header.goal-10 {
    border-bottom-color: #dd1367;
}

.sdg-lesson-header.goal-11 {
    border-bottom-color: #fd9d24;
}

.sdg-lesson-header.goal-12 {
    border-bottom-color: #bf8b2e;
}

.sdg-lesson-header.goal-13 {
    border-bottom-color: #3f7e44;
}

.sdg-lesson-header.goal-14 {
    border-bottom-color: #0a97d9;
}

.sdg-lesson-header.goal-15 {
    border-bottom-color: #56c02b;
}

.sdg-lesson-header.goal-16 {
    border-bottom-color: #00689d;
}

.sdg-lesson-header.goal-17 {
    border-bottom-color: #19486a;
}

/* ── Edu Challenge CTA ── */
.edu-challenge-cta {
    width: 100%;
    max-width: 900px;
    background: linear-gradient(135deg, #10b981, #059669);
    padding: 32px 48px;
    border-radius: 32px;
    margin-top: 48px;
    box-shadow: 0 20px 50px rgba(16, 185, 129, 0.4);
}

.cta-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    color: white;
}

.cta-inner i {
    font-size: 3rem;
    opacity: 0.9;
}

.cta-inner h4 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.cta-inner p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0 !important;
}

#guide-start-game-btn {
    background: white;
    color: #111;
    margin-left: auto;
    font-size: 1rem;
    padding: 16px 32px;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .cta-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    #guide-start-game-btn {
        margin-left: 0;
    }

    .edu-challenge-cta {
        padding: 32px 24px;
    }
}

/* ============================================
   FULL-PAGE LESSON INTERFACE
   ============================================ */
#lesson-page {
    position: fixed;
    inset: 0;
    z-index: 7000;
    background: #030a06;
    overflow-y: auto;
    color: white;
    font-family: var(--font);
}

.lesson-page-nav {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 16px 32px;
    background: rgba(3, 10, 6, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10;
}

.lesson-page-brand {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

#lesson-page-back {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

#lesson-page-back:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lesson-page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 100px;
}

.lp-hero {
    padding: 100px 48px 60px;
    background: linear-gradient(to bottom, var(--hero-color, #10b981) 0%, #030a06 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.lp-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

#lp-goal-icon {
    width: 140px;
    height: 140px;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: white;
    padding: 4px;
}

.lp-hero-titles span {
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 8px;
}

#lp-goal-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.lp-main {
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.lp-section {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.lp-section-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent);
    flex-shrink: 0;
}

.lp-section-text h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: white;
}

.lp-section-text p {
    font-size: 1.25rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.lp-section.highlight {
    background: rgba(255, 255, 255, 0.03);
    padding: 48px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lp-targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.lp-target-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 24px;
    border-radius: 20px;
    border-left: 4px solid var(--accent);
}

.lp-target-card h5 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 8px;
}

.lp-target-card p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin: 0;
}

.lp-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.lp-section.half {
    flex-direction: column;
    gap: 24px;
}

.lp-section.action {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
    padding: 40px;
    border-radius: 32px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.lp-footer {
    text-align: center;
    padding: 100px 48px 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lp-footer p {
    margin-top: 24px;
    font-size: 1.1rem;
    opacity: 0.6;
}

#lp-complete-btn {
    padding: 20px 48px;
    font-size: 1.2rem;
    font-weight: 800;
}

.lp-progress-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--accent-light);
    background: rgba(16, 185, 129, 0.05);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.lp-challenges-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lp-challenges-list li {
    font-size: 1.1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    gap: 12px;
}

.lp-challenges-list li::before {
    content: "✕";
    color: var(--red);
    font-weight: 800;
    flex-shrink: 0;
}

@media (max-width: 800px) {
    .lp-hero {
        padding: 60px 24px;
    }

    .lp-main {
        padding: 24px;
    }

    .lp-section {
        flex-direction: column;
        gap: 20px;
    }

    .lp-split {
        grid-template-columns: 1fr;
    }

    .lp-section.highlight {
        padding: 24px;
    }
}

/* ── Landing Page Global Footer ── */
.landing-page-footer {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 60px 24px;
    width: 100%;
    text-align: center;
    margin-top: 100px;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
}

.footer-mini-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.footer-social {
    display: flex;
    gap: 20px;
}

.footer-sc-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 24px;
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: lowercase;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s var(--ease);
}

.footer-sc-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.footer-cr {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ── Mobile Optimization (Core App & Map UI) ── */
@media (max-width: 600px) {

    /* Map UI Overrides */
    #search-bar {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
    }

    #fab-stack {
        bottom: 24px;
        right: 16px;
        gap: 12px;
    }

    .fab {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    #directions-panel {
        width: 100% !important;
        border-radius: 0;
    }

    /* Landing Page Overrides */
    .landing-title {
        font-size: 2.2rem;
    }

    .landing-features {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 10px;
    }

    .landing-feature {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .landing-actions {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
    }

    .landing-btn {
        width: 100%;
        justify-content: center;
    }

    .lp-social-wrap {
        margin-bottom: 40px;
        /* Tighter for mobile */
    }

    /* Lesson Page & Education Overrides */
    .lp-hero-content h1 {
        font-size: 2.2rem !important;
    }

    .lp-hero-content p {
        font-size: 1rem !important;
    }

    .lp-main {
        padding: 24px 16px;
        gap: 32px;
    }

    .lp-section {
        flex-direction: column;
        gap: 16px;
    }

    .lp-section-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .lp-section-text h3 {
        font-size: 1.3rem;
    }

    .lp-section-text p,
    .lp-progress-text,
    .lp-challenges-list li {
        font-size: 1rem;
    }

    .lp-targets-grid {
        grid-template-columns: 1fr;
    }

    .lp-footer {
        padding: 60px 20px 40px;
    }

    #lp-complete-btn {
        width: 100%;
        padding: 16px;
    }

    .sdg-full-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 columns on mobile */
        gap: 10px;
    }

    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* ============================================
   Sustainability Guide: Eco Challenge Game
   ============================================ */

#game-timer-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--accent);
    color: white;
    z-index: 10000;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transform: translateY(-120%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#game-timer-bar.active {
    transform: translateY(0);
}

.game-timer-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

#game-countdown {
    background: rgba(0,0,0,0.2);
    padding: 4px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.3rem;
    min-width: 80px;
    text-align: center;
}

#game-modal.hidden, #game-recall-panel.hidden {
    display: none;
}

#game-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.game-modal-card {
    background: var(--bg-surface);
    width: 90%;
    max-width: 500px;
    padding: 40px;
    border-radius: 32px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

#game-recall-panel {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: 90%;
    max-width: 600px;
    background: var(--bg-surface);
    padding: 24px;
    border-radius: 24px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: transform 0.4s var(--ease);
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

#game-recall-panel.active {
    transform: translateX(-50%) translateY(0);
}

.game-recall-inputs {
    overflow-y: auto;
    flex: 1;
    margin-bottom: 20px;
    padding-right: 8px;
}

.recall-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.recall-input-group span {
    font-weight: 700;
    color: var(--accent);
    min-width: 24px;
}

.recall-input-group input {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
}

.recall-input-group input:focus {
    border-color: var(--accent);
    outline: none;
}

.game-score-card {
    padding: 24px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    border: 2px solid var(--accent);
    margin-bottom: 24px;
}

.game-score-num {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-light);
    display: block;
}

.game-score-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Hide map UI during game memorization phase if needed */
.game-active #search-bar,
.game-active #fab-stack,
.game-active #zoom-controls,
.game-active .sidebar-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* ── Guide Game CTA ── */
.edu-challenge-cta {
    width: 100%;
    max-width: 900px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(30, 30, 54, 0.8) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 28px;
    padding: 40px;
    margin: 40px auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.edu-challenge-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    z-index: 0;
}

.cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 32px;
}

.cta-inner i {
    font-size: 3.5rem;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    flex-shrink: 0;
}

.cta-inner div {
    flex: 1;
}

.cta-inner h4 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
}

.cta-inner p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0px;
}

@media (max-width: 768px) {
    .cta-inner {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
}

/* ── Sidebar Widgets Header Containers ── */
#eco-score-widget,
#daily-challenge-widget {
    margin: 0 0 12px 0;
}

#eco-score-widget:empty,
#daily-challenge-widget:empty,
#streak-widget:empty {
    display: none;
}

/* Eco Score Card */
#eco-score-widget:not(:empty) {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.eco-score-level {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.eco-score-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.eco-score-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.eco-score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s var(--ease);
}

/* Daily Challenge Card */
#daily-challenge-widget:not(:empty) {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.challenge-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.challenge-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.challenge-text.done {
    color: var(--text-muted);
    text-decoration: line-through;
}

.challenge-complete-badge {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sidebar Notification Pulse */
.icon-btn.has-notification {
    position: relative;
    animation: attentionPulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn.has-notification::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes attentionPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ── Persistent Gamification Strip ── */
#progress-strip {
    position: fixed;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hide strip when modals/panels are open */
#progress-strip.strip-hidden {
    opacity: 0;
    pointer-events: none !important;
    transform: translateY(-50%) translateX(-100%);
}

.strip-card {
    background: rgba(20, 20, 45, 0.88);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 14px 16px;
    pointer-events: auto;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}

.strip-card:hover {
    transform: scale(1.03);
    border-color: var(--accent);
}

.strip-card:empty {
    display: none;
}

/* Eco Score in the strip */
.strip-eco-level {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.strip-eco-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.strip-eco-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.strip-eco-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

/* Streak in the strip */
.strip-streak-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strip-streak-flame {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.strip-streak-count {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fb923c;
}

.strip-streak-sub {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* CTA Card */
.strip-cta-card {
    border-color: rgba(239, 68, 68, 0.3);
    animation: stripCtaPulse 3s infinite ease-in-out;
}

.strip-cta-card.urgency-high {
    border-color: rgba(239, 68, 68, 0.5);
    animation: stripCtaPulse 1.5s infinite ease-in-out;
}

.strip-cta-card.urgency-low {
    border-color: rgba(16, 185, 129, 0.3);
    animation: none;
}

.strip-cta-icon {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.strip-cta-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.strip-cta-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.3;
}

@keyframes stripCtaPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 0 rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Mobile: move to bottom horizontal bar */
@media (max-width: 768px) {
    #progress-strip {
        left: 8px;
        right: 8px;
        top: auto;
        bottom: 80px;
        transform: none;
        flex-direction: row;
        gap: 6px;
    }

    .strip-card {
        min-width: 0;
        flex: 1;
        padding: 10px 12px;
        border-radius: 14px;
    }
}

/* ── Immersive Lesson Page ── */
#lesson-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2500;
    background: #080810;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.6s var(--ease);
    opacity: 0;
    pointer-events: none;
    transform: translateY(100vh);
}

#lesson-page:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#lesson-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, var(--hero-color, var(--accent)) 0%, transparent 60%);
    opacity: 0.08;
    z-index: -1;
    filter: blur(80px);
}

.lesson-page-nav {
    padding: 24px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 20, 30, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lesson-page-brand {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.lesson-page-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Fixed Hero (Left) */
.lp-hero {
    width: 40%;
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    background: linear-gradient(to right, rgba(255,255,255,0.02), transparent);
}

#lp-goal-icon {
    width: 160px;
    height: 160px;
    border-radius: 30px;
    margin-bottom: 40px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5);
    animation: floatingIcon 6s infinite ease-in-out;
}

@keyframes floatingIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

#lp-goal-num {
    display: inline-block;
    padding: 8px 18px;
    background: var(--hero-color, var(--accent));
    color: white;
    border-radius: 10px;
    font-weight: 900;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

#lp-goal-title {
    font-size: 5rem;
    font-weight: 950;
    line-height: 0.9;
    letter-spacing: -0.05em;
    color: #fff;
    margin: 0;
}

/* Horizontal Slides (Right) */
.lp-main {
    flex: 1;
    display: flex;
    gap: 40px;
    padding: 60px 80px 100px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.lp-main::-webkit-scrollbar { display: none; }

.lp-section {
    min-width: 520px;
    max-width: 520px;
    height: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 40px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    scroll-snap-align: center;
    transition: transform 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.lp-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 6px;
    background: var(--hero-color, var(--accent));
    opacity: 0.6;
}

.lp-section:hover {
    border-color: var(--hero-color, var(--accent));
}

.lp-section-icon {
    width: 60px;
    height: 60px;
    background: var(--hero-color, var(--accent));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.lp-section h3 {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    margin: 0;
}

.lp-section p {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.lp-fact-text {
    font-size: 1.5rem !important;
    font-weight: 500;
    color: var(--accent-light) !important;
    line-height: 1.4 !important;
}

.lp-progress-text {
    background: rgba(255, 255, 255, 0.05);
    border-left: 6px solid #ef4444;
    padding: 30px;
    border-radius: 20px;
    font-style: italic;
    color: #fca5a5 !important;
}

.lp-challenges-list {
    margin: 0; padding: 0; list-style: none;
    display: flex; flex-direction: column; gap: 15px;
}

.lp-challenges-list li {
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    font-weight: 600;
    display: flex; align-items: center; gap: 15px;
}

.lp-challenges-list li::before {
    content: '→';
    color: var(--hero-color, var(--accent));
    font-weight: 900;
}

/* Action Slide Footer */
.action-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
    justify-content: space-between;
}

#lp-complete-btn {
    width: 100%;
    padding: 24px;
    border-radius: 20px;
    background: #10b981;
    color: white;
    font-weight: 900;
    font-size: 1.4rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3);
    transition: all 0.3s var(--ease);
}

#lp-complete-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(16, 185, 129, 0.4);
}

/* Mobile Overrides */
@media (max-width: 1024px) {
    .lp-hero { padding: 40px; }
    #lp-goal-title { font-size: 3.5rem; }
    .lp-section { min-width: 400px; }
}

@media (max-width: 768px) {
    .lesson-page-container { flex-direction: column; overflow-y: auto; }
    .lp-hero { width: 100%; height: auto; padding: 60px 24px; border-right: none; text-align: center; align-items: center; }
    #lp-goal-title { font-size: 3rem; }
    #lp-goal-icon { width: 120px; height: 120px; }
    .lp-main { width: 100%; flex-direction: column; overflow-x: visible; padding: 0 20px 100px; }
    .lp-section { min-width: 0; max-width: 100%; height: auto; }
    .lesson-page-nav { padding: 20px; position: sticky; top: 0; }
}
