/* Reset & Base */
:root {
    /* =========================================
       JOYFUL PASTEL / ULTRATHINK LIGHT THEME
       ========================================= */

    /* Glassmorphism & Surface Colors */
    --glass-bg: rgba(255, 255, 255, 0.85); /* Increased opacity for cleaner look */
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-highlight: rgba(255, 255, 255, 0.95);

    /* Gradients */
    --surface-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 245, 248, 0.6) 100%);
    --bg-gradient-mesh: linear-gradient(125deg, #fff1f2, #fffbeb, #f0f9ff, #f5f3ff); /* Pastel Mesh */

    /* Shadows - Soft & Airy */
    --shadow-sm: 0 4px 12px rgba(148, 163, 184, 0.08);
    --shadow-md: 0 12px 24px -6px rgba(148, 163, 184, 0.12);
    --shadow-lg: 0 32px 64px -12px rgba(148, 163, 184, 0.18);
    --shadow-float: 0 20px 40px -10px rgba(50, 50, 93, 0.15), 0 10px 20px -10px rgba(0, 0, 0, 0.1);

    /* Deep ambient shadow */
    --glass-shadow:
        0 40px 80px -20px rgba(50, 50, 93, 0.15),
        0 16px 32px -16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    --mobile-shadow:
        0 -20px 60px -10px rgba(50, 50, 93, 0.1),
        0 -10px 20px -5px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);

    /* Accents - Refined Pastel & Vibrant */
    --primary: #fb7185; /* Rose 400 - slightly brighter */
    --primary-hover: #e11d48; /* Rose 600 */
    --primary-bg: #fff1f2; /* Rose 50 */
    --primary-glow: rgba(251, 113, 133, 0.5);

    --secondary: #a78bfa; /* Violet 400 */
    --secondary-light: #ddd6fe; /* Violet 200 */
    --secondary-bg: #f5f3ff; /* Violet 50 */

    --accent-teal: #2dd4bf; /* Teal 400 */
    --accent-amber: #fbbf24; /* Amber 400 */

    /* Text Colors - High Contrast Slate */
    --text-primary: #1e293b; /* Slate 800 */
    --text-secondary: #475569; /* Slate 600 */
    --text-tertiary: #334155; /* Slate 700 - Enhanced Contrast for A11y */

    /* Animation */
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.25, 0.8, 0.25, 1);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

    --font-sans: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Keyframes */
    @keyframes modal-pop-in {
        0% { transform: scale(0.95) translateY(10px); opacity: 0; }
        100% { transform: scale(1) translateY(0); opacity: 1; }
    }

    @keyframes modal-pop-out {
        0% { transform: scale(1); opacity: 1; }
        100% { transform: scale(0.95); opacity: 0; }
    }

    @keyframes bounce-in {
        0% { transform: scale(0); opacity: 0; }
        60% { transform: scale(1.1); opacity: 1; }
        100% { transform: scale(1); }
    }

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

    @keyframes float {
        0% { transform: translateY(0px); }
        50% { transform: translateY(-6px); }
        100% { transform: translateY(0px); }
    }

    @keyframes pulse-soft {
        0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
        70% { box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); }
        100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-gradient-mesh);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    color: var(--text-primary);
    overflow: hidden;
    text-rendering: optimizeLegibility;
}

/* Grainy Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
}

#loader {
    position: fixed;
    inset: 0;
    background: var(--bg-gradient-mesh);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    box-shadow: var(--shadow-lg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#cursor-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 2000;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 99px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    transform: translate(20px, 20px);
    transition: opacity 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

#cursor-tooltip.hidden {
    opacity: 0;
    transform: translate(20px, 30px);
}

#map-container {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    width: 100vw;
    z-index: 0;
    background: transparent;
    position: relative;
}

/* Map Tiles Adjustment */
.leaflet-layer {
    filter: saturate(1.1) contrast(1.02);
    transition: filter 1.5s var(--ease-smooth);
}

/*
   =========================================
   INFO PANEL - GLASSMORPHISM CORE
   =========================================
*/
.info-panel {
    position: fixed;
    z-index: 1000;
    color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.attraction-modal {
    background: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    box-shadow: var(--glass-shadow);
    border-radius: inherit;
    border: 1px solid var(--glass-border);
    animation: modal-pop-out 0.3s var(--ease-smooth) forwards;
}

.attraction-modal.visible {
    animation: modal-pop-in 0.6s var(--ease-out-back) forwards;
}

.info-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.3;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 150px 150px;
    pointer-events: none;
    mix-blend-mode: soft-light;
    border-radius: inherit;
}

.panel-glare {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        125deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 45%,
        rgba(255,255,255,0.7) 50%,
        rgba(255,255,255,0.4) 55%,
        rgba(255,255,255,0) 100%
    );
    transform: translateX(-100%);
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
    border-radius: inherit;
    opacity: 0.6;
}

.info-panel.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.panel-content {
    position: relative;
    z-index: 2;
    padding-top: 8px;
}

.info-panel h2 {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}

.info-panel p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 450;
    letter-spacing: -0.01em;
}

/* Close Button */
.close-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255,255,255,0.5);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 0;
    z-index: 10;
    transition: all 0.3s var(--ease-smooth);
    box-shadow: var(--shadow-sm);
}

.close-btn:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-md);
}

/* Desktop */
@media (min-width: 769px) {
    .info-panel {
        top: 80px;
        right: 80px;
        width: 380px;
        padding: 40px;
        border-radius: 24px;
        transform-style: preserve-3d;
        perspective: 1500px;
        transform: translate3d(60px, 0, 0) scale(0.9) rotateY(-10deg);
        transition: transform 0.8s var(--ease-out-back), opacity 0.6s ease, visibility 0.6s;
    }
    .info-panel.visible {
        transform: translate3d(0, 0, 0) scale(1) rotateY(0deg);
    }
    .close-btn {
        top: 20px;
        right: 20px;
        opacity: 0;
        transform: scale(0.5);
    }
    .info-panel.visible .close-btn {
        opacity: 1;
        transform: scale(1);
        transition-delay: 0.3s;
    }
    .mobile-handle { display: none; }
}

/* Mobile */
@media (max-width: 768px) {
    .info-panel {
        bottom: 0; left: 0; right: 0; width: 100%;
        border-radius: 32px 32px 0 0;
        padding: 32px 24px;
        padding-top: 48px;
        padding-bottom: max(32px, env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--mobile-shadow);
        transform: translate3d(0, 100%, 0);
        transition: transform 0.6s var(--ease-spring), opacity 0.4s ease, visibility 0.4s;
    }
    .info-panel.visible {
        transform: translate3d(0, 0, 0);
    }
    .mobile-handle {
        position: absolute; top: 12px; left: 50%;
        transform: translateX(-50%);
        width: 40px; height: 5px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 10px;
        cursor: pointer;
        border: none;
        padding: 0;
        margin: 0;
    }
    .mobile-handle:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 4px;
    }
    .mobile-handle::after {
        content: "";
        position: absolute;
        top: -20px; bottom: -20px;
        left: -40px; right: -40px;
    }
    .close-btn {
        top: 24px; right: 24px;
        width: 40px; height: 40px;
        background: rgba(0,0,0,0.05);
    }
}

.hidden { display: none !important; }

/* Map Interactions */
.leaflet-overlay-pane svg {
    /* Gives countries a floating 3D effect above the map tiles */
    filter: drop-shadow(0 8px 24px rgba(30, 41, 59, 0.25));
}

path.leaflet-interactive {
    transition: stroke-width 0.4s var(--ease-elastic), fill 0.3s ease, fill-opacity 0.3s ease;
    cursor: pointer;
}

path.leaflet-interactive:focus {
    outline: none;
    stroke: var(--primary);
    stroke-width: 3px;
    stroke-opacity: 1;
    filter: drop-shadow(0 0 16px var(--primary-glow));
}

/* Search Interface */
.search-container {
    position: fixed;
    top: 24px; left: 24px;
    z-index: 1000;
    width: 340px;
    font-family: var(--font-sans);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 99px; /* Pill shape */
    padding: 12px 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s var(--ease-smooth);
    user-select: none;
}

.search-wrapper:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    margin-right: 12px;
}

#country-search {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    width: 100%;
    outline: none;
    font-family: inherit;
    font-weight: 500;
}

#country-search::placeholder {
    color: var(--text-tertiary);
}

.reset-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    color: var(--primary);
    background-color: var(--primary-bg);
}

.search-results {
    position: absolute;
    top: 100%; left: 0; right: 0;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 16px;
    list-style: none;
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    backdrop-filter: blur(20px);
}

.search-results li {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-results li:hover,
.search-results li.active {
    background-color: var(--primary-bg);
    color: var(--primary);
    transform: translateX(4px);
}

/* Enriched Info Panel Components */
.country-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    margin-top: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.country-flag {
    width: 48px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-right: 16px;
    flex-shrink: 0;
    animation: bounce-in 0.6s var(--ease-spring) backwards;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    font-weight: 600;
}

.stat-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.fun-fact {
    background: linear-gradient(135deg, #fff 0%, #fff1f2 100%);
    border: 1px solid rgba(244, 63, 94, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.6s var(--ease-smooth) 0.3s backwards;
}

.fact-icon {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.fun-fact p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    color: var(--text-secondary);
    font-weight: 500;
}

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

#confetti-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2000;
}

.cultural-highlights {
    margin-top: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.greeting-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 8px 0;
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
    animation: slideUp 0.6s var(--ease-smooth) 0.1s backwards;
}

.cultural-badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.culture-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.6s var(--ease-smooth) 0.2s backwards;
}

.pulse-animation {
    animation: pulse 2s infinite var(--ease-smooth);
    fill: var(--primary) !important;
    stroke: var(--primary) !important;
}

@keyframes pulse {
    0% { stroke-width: 1; stroke-opacity: 0.6; fill-opacity: 0.2; }
    50% { stroke-width: 3; stroke-opacity: 1; fill-opacity: 0.4; }
    100% { stroke-width: 1; stroke-opacity: 0.6; fill-opacity: 0.2; }
}

.toast-notification {
    position: fixed;
    bottom: 40px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    color: var(--text-primary);
    z-index: 2000;
    opacity: 0;
    animation: toast-in 0.8s var(--ease-out-back) 1s forwards;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-notification.fade-out {
    animation: toast-out 0.5s var(--ease-smooth) forwards;
}

@keyframes toast-in {
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

@media (max-width: 768px) {
    .toast-notification { bottom: 120px; }
}

/* Staggered Animations */
[class^="anim-stagger-"] {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.8s var(--ease-out-expo) forwards;
}

.anim-stagger-1 { animation-delay: 0.1s; }
.anim-stagger-2 { animation-delay: 0.2s; }
.anim-stagger-3 { animation-delay: 0.3s; }
.anim-stagger-4 { animation-delay: 0.4s; }
.anim-stagger-5 { animation-delay: 0.5s; }

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Button Active State */
button:active, .reset-btn:active, .close-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.map-feature-lifted {
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
    transform: translateY(-2px);
}

/* Search Wrapper Polish override */
.search-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-glow);
    transform: scale(1.02);
}

/* Enhanced Badge Interaction */
.culture-badge {
    transition: all 0.3s var(--ease-smooth);
    cursor: default;
}

.culture-badge:hover {
    background: white;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.9);
}

/* Navigation Buttons */
.panel-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Quiz Mode Styles */
.quiz-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.quiz-card {
    pointer-events: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px 32px;
    box-shadow: var(--shadow-float), var(--glass-shadow);
    min-width: 300px;
    text-align: center;
    animation: bounce-in 0.6s var(--ease-spring);
    user-select: none;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quiz-score {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.close-btn-mini {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn-mini:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

.quiz-question p {
    font-size: 18px;
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
}

.quiz-question strong {
    color: var(--secondary);
    font-weight: 800;
}

.quiz-feedback {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    animation: slideUp 0.3s ease;
}

.quiz-feedback.success {
    background: #d1fae5;
    color: #059669;
}

.quiz-feedback.error {
    background: #fee2e2;
    color: #b91c1c;
    animation: shake 0.4s var(--ease-elastic);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

#quiz-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.quiz-msg {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .quiz-container {
        top: auto;
        bottom: 40px;
        width: 90%;
    }
}

/* --- ACCESSIBILITY PREFERENCES --- */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 9999;
    transition: top 0.3s;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    top: 0;
}
