/* sora.quest - Elegant Hand-Drawn Quest Adventure */
/* Colors: #1a1a2e (deep base), #4a90d9 (primary blue), #f5f0e8 (warm off-white), #e8b84b (accent gold), #6c757d (muted gray) */
/* Fonts: Sora, Lora, Inter, Caveat (handwritten), Patrick Hand */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    background-color: #1a1a2e;
    color: #f5f0e8;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== FOREST BACKGROUND ========== */
.forest-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.forest-svg {
    width: 100%;
    height: 100%;
}

.star {
    animation: twinkle 3s ease-in-out infinite alternate;
}

.star:nth-child(odd) {
    animation-delay: -1.5s;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ========== BUBBLE REWARDS ========== */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(74, 144, 217, 0.3), rgba(232, 184, 75, 0.1));
    border: 1px solid rgba(232, 184, 75, 0.2);
    animation: floatBubble linear infinite;
}

.bubble-1 { width: 20px; height: 20px; left: 10%; animation-duration: 15s; animation-delay: 0s; }
.bubble-2 { width: 35px; height: 35px; left: 25%; animation-duration: 18s; animation-delay: -3s; }
.bubble-3 { width: 15px; height: 15px; left: 40%; animation-duration: 12s; animation-delay: -6s; }
.bubble-4 { width: 28px; height: 28px; left: 55%; animation-duration: 20s; animation-delay: -2s; }
.bubble-5 { width: 22px; height: 22px; left: 70%; animation-duration: 16s; animation-delay: -8s; }
.bubble-6 { width: 40px; height: 40px; left: 85%; animation-duration: 22s; animation-delay: -5s; }
.bubble-7 { width: 18px; height: 18px; left: 15%; animation-duration: 14s; animation-delay: -10s; }
.bubble-8 { width: 25px; height: 25px; left: 60%; animation-duration: 17s; animation-delay: -7s; }

@keyframes floatBubble {
    0% {
        transform: translateY(110vh) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-10vh) scale(1.2);
        opacity: 0;
    }
}

.bubble.collected {
    animation: collectBubble 0.6s ease-out forwards;
}

@keyframes collectBubble {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.8); opacity: 0.9; border-color: #e8b84b; }
    100% { transform: scale(0); opacity: 0; }
}

/* ========== HUD OVERLAY ========== */
.hud-overlay {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HUD TOP BAR ========== */
.hud-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(180deg, rgba(26,26,46,0.9) 0%, rgba(26,26,46,0.4) 100%);
    backdrop-filter: blur(4px);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.hud-panel {
    position: relative;
}

.hud-frame-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hud-logo-panel {
    min-width: 180px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e8b84b;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

.hud-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.hud-nav-link {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.95rem;
    color: #f5f0e8;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px dashed rgba(108, 117, 125, 0.4);
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.hud-nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 70%;
    height: 2px;
    background: #e8b84b;
    transition: transform 0.3s ease;
}

.hud-nav-link:hover {
    color: #e8b84b;
    border-color: rgba(232, 184, 75, 0.5);
}

.hud-nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.hud-nav-link.active {
    color: #e8b84b;
    border-color: #e8b84b;
    background: rgba(232, 184, 75, 0.08);
}

.hud-status-panel {
    min-width: 160px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 4px 12px;
}

.status-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.75rem;
    color: #6c757d;
    display: block;
    margin-bottom: 4px;
}

.progress-bar {
    width: 120px;
    height: 6px;
    background: rgba(108, 117, 125, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a90d9, #e8b84b);
    border-radius: 3px;
    transition: width 0.8s ease;
}

/* ========== MAIN CONTENT ========== */
.hud-main {
    flex: 1;
    padding: 40px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ========== SECTION HEADINGS ========== */
.section-heading {
    font-family: 'Caveat', cursive;
    font-size: 2.4rem;
    font-weight: 700;
    color: #e8b84b;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-heading::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e8b84b, transparent);
    margin: 8px auto 0;
}

/* ========== QUEST HERO ========== */
.quest-hero {
    margin-bottom: 80px;
    display: flex;
    justify-content: center;
}

.quest-hero-panel {
    position: relative;
    width: 100%;
    max-width: 800px;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hand-drawn-border {
    animation: borderDraw 3s ease-in-out infinite alternate;
}

@keyframes borderDraw {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 20; }
}

.quest-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 40px;
}

.quest-title {
    font-family: 'Caveat', cursive;
    font-size: 3.2rem;
    font-weight: 700;
    color: #f5f0e8;
    margin-bottom: 12px;
    text-shadow: 0 2px 20px rgba(232, 184, 75, 0.2);
}

.quest-subtitle {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.3rem;
    color: #6c757d;
    margin-bottom: 20px;
    font-style: italic;
}

.quest-divider {
    width: 200px;
    margin: 0 auto 20px;
}

.divider-svg {
    width: 100%;
    height: auto;
}

.quest-description {
    font-family: 'Lora', serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(245, 240, 232, 0.8);
    max-width: 560px;
    margin: 0 auto 28px;
}

.quest-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: transparent;
    border: 2px dashed #e8b84b;
    color: #e8b84b;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.quest-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232, 184, 75, 0.15), transparent);
    transition: left 0.6s ease;
}

.quest-btn:hover {
    background: rgba(232, 184, 75, 0.1);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(232, 184, 75, 0.2);
}

.quest-btn:hover::before {
    left: 100%;
}

.quest-btn:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.quest-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* ========== DISCOVERIES GRID ========== */
.discoveries-section {
    margin-bottom: 80px;
}

.discoveries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.discovery-card {
    cursor: pointer;
    transition: transform 0.4s ease;
}

.discovery-card:hover {
    transform: translateY(-6px);
}

.card-inner {
    position: relative;
    min-height: 260px;
}

.card-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.card-content {
    position: relative;
    z-index: 1;
    padding: 28px 20px;
    text-align: center;
}

.discovery-icon {
    margin-bottom: 16px;
    transition: transform 0.4s ease;
}

.discovery-card:hover .discovery-icon {
    transform: scale(1.15) rotate(5deg);
}

.card-title {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    font-weight: 600;
    color: #f5f0e8;
    margin-bottom: 10px;
}

.card-text {
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(245, 240, 232, 0.7);
    margin-bottom: 16px;
}

.card-reward {
    margin-top: auto;
}

.reward-badge {
    display: inline-block;
    font-family: 'Sora', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e8b84b;
    padding: 4px 14px;
    border: 1px dashed rgba(232, 184, 75, 0.5);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.discovery-card:hover .reward-badge {
    background: rgba(232, 184, 75, 0.15);
    border-color: #e8b84b;
    box-shadow: 0 0 12px rgba(232, 184, 75, 0.2);
}

.discovery-card.discovered .card-inner::after {
    content: 'DISCOVERED';
    position: absolute;
    top: 12px;
    right: 16px;
    font-family: 'Patrick Hand', cursive;
    font-size: 0.7rem;
    color: #40916c;
    padding: 2px 8px;
    border: 1px solid #40916c;
    border-radius: 3px;
    z-index: 2;
}

/* ========== WORLD MAP ========== */
.world-map-section {
    margin-bottom: 80px;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.map-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.map-content {
    position: relative;
    padding: 20px;
}

.world-map-svg {
    width: 100%;
    height: auto;
}

.map-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 12px;
    fill: #f5f0e8;
    opacity: 0.7;
}

.compass-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 10px;
    fill: #e8b84b;
}

.map-region {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.map-region:hover .region-glow {
    opacity: 0.8;
    animation: pulseGlow 1.5s ease-in-out infinite;
}

.map-region:hover .map-label {
    opacity: 1;
    fill: #e8b84b;
}

@keyframes pulseGlow {
    0%, 100% { r: 20; opacity: 0.5; }
    50% { r: 28; opacity: 0.8; }
}

.map-path {
    animation: dashFlow 20s linear infinite;
}

@keyframes dashFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -200; }
}

.region-tooltip {
    position: absolute;
    background: rgba(26, 26, 46, 0.92);
    border: 1px dashed #e8b84b;
    border-radius: 4px;
    padding: 12px 16px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 20;
    max-width: 220px;
}

.region-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-title {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: #e8b84b;
    margin-bottom: 4px;
}

.tooltip-desc {
    font-family: 'Lora', serif;
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.7);
    line-height: 1.4;
}

/* ========== JOURNAL ========== */
.journal-section {
    margin-bottom: 80px;
}

.journal-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.journal-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.journal-content {
    position: relative;
    padding: 40px 40px 40px 80px;
}

.journal-entry {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px dashed rgba(232, 184, 75, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.journal-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.journal-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.entry-date {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.85rem;
    color: #4a90d9;
    display: block;
    margin-bottom: 6px;
}

.entry-title {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    font-weight: 600;
    color: #e8b84b;
    margin-bottom: 10px;
}

.entry-text {
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(245, 240, 232, 0.75);
    font-style: italic;
}

/* ========== HUD BOTTOM BAR ========== */
.hud-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(0deg, rgba(26,26,46,0.9) 0%, rgba(26,26,46,0.4) 100%);
    backdrop-filter: blur(4px);
    position: sticky;
    bottom: 0;
    z-index: 100;
    gap: 16px;
}

.hud-inventory {
    min-width: 200px;
    height: 36px;
    display: flex;
    align-items: center;
}

.inventory-items {
    display: flex;
    gap: 8px;
    padding: 4px 12px;
    position: relative;
    z-index: 1;
}

.inv-slot {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(108, 117, 125, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.inv-slot:hover {
    border-color: #e8b84b;
    background: rgba(232, 184, 75, 0.08);
    transform: scale(1.1);
}

.inv-slot.empty {
    opacity: 0.3;
}

.hud-coordinates {
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    gap: 6px;
    align-items: center;
}

.coord-label {
    opacity: 0.6;
}

.coord-value {
    font-family: 'Inter', sans-serif;
    color: #4a90d9;
    font-variant-numeric: tabular-nums;
}

.hud-xp {
    min-width: 160px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xp-content {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
    padding: 0 12px;
}

.xp-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.85rem;
    color: #e8b84b;
    font-weight: 600;
}

.xp-value {
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f5f0e8;
    transition: color 0.3s ease;
}

.xp-value.gained {
    color: #e8b84b;
    animation: xpPulse 0.5s ease;
}

@keyframes xpPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.xp-separator {
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    color: #6c757d;
}

.xp-max {
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    color: #6c757d;
}

/* ========== ZOOM FOCUS OVERLAY ========== */
.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
}

.zoom-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.zoom-content {
    position: relative;
    max-width: 600px;
    width: 90%;
    background: rgba(26, 26, 46, 0.8);
    border: 2px dashed #e8b84b;
    border-radius: 8px;
    padding: 40px;
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

.zoom-overlay.active .zoom-content {
    transform: scale(1);
}

.zoom-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 1px dashed rgba(245, 240, 232, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-close:hover {
    border-color: #e8b84b;
    background: rgba(232, 184, 75, 0.1);
}

.zoom-inner {
    text-align: center;
}

.zoom-inner h3 {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    color: #e8b84b;
    margin-bottom: 12px;
}

.zoom-inner p {
    font-family: 'Lora', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(245, 240, 232, 0.8);
    margin-bottom: 16px;
}

.zoom-inner .zoom-reward {
    font-family: 'Sora', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e8b84b;
    padding: 8px 24px;
    border: 2px dashed #e8b84b;
    border-radius: 24px;
    display: inline-block;
    animation: rewardGlow 2s ease-in-out infinite alternate;
}

@keyframes rewardGlow {
    0% { box-shadow: 0 0 10px rgba(232, 184, 75, 0.2); }
    100% { box-shadow: 0 0 25px rgba(232, 184, 75, 0.5); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hud-top {
        flex-wrap: wrap;
        justify-content: center;
        padding: 12px 16px;
    }

    .hud-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .hud-nav-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .quest-title {
        font-size: 2.4rem;
    }

    .quest-hero-content {
        padding: 32px 20px;
    }

    .discoveries-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
    }

    .journal-content {
        padding: 24px 20px 24px 40px;
    }

    .hud-bottom {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 16px;
    }

    .section-heading {
        font-size: 2rem;
    }

    .map-content {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .quest-title {
        font-size: 2rem;
    }

    .quest-subtitle {
        font-size: 1.05rem;
    }

    .quest-description {
        font-size: 0.9rem;
    }

    .hud-logo-panel {
        min-width: 140px;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .discoveries-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== SCROLL ANIMATIONS ========== */
.discovery-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.discovery-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.discovery-card:nth-child(2) { transition-delay: 0.1s; }
.discovery-card:nth-child(3) { transition-delay: 0.2s; }
.discovery-card:nth-child(4) { transition-delay: 0.3s; }

/* ========== QUEST STARTED STATE ========== */
.quest-hero-panel.quest-started .quest-title {
    animation: questActivate 0.8s ease;
}

@keyframes questActivate {
    0% { transform: scale(1); }
    30% { transform: scale(1.05); text-shadow: 0 0 30px rgba(232, 184, 75, 0.6); }
    100% { transform: scale(1); }
}

.quest-hero-panel.quest-started .quest-btn {
    background: rgba(232, 184, 75, 0.15);
    border-style: solid;
    color: #f5f0e8;
}
