/* NEW FEATURES CSS */

/* --- GLOBAL NAVIGATION --- */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 500;
    padding: 15px 30px;
    background: rgba(8, 6, 12, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-style: italic;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 20px;
    position: fixed;
    top: 25px;
    right: 40px;
    z-index: 1001;
}

.nav-item {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.3s;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent-primary);
}

.hamburger {
    display: none;
    font-size: 2rem;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
}

/* Mobile Nav */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(8, 6, 12, 0.98);
        backdrop-filter: blur(25px);
        flex-direction: column;
        padding-top: 80px;
        padding-bottom: 120px;
        align-items: center;
        transition: right 0.4s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.8);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 10000;
    }
    .nav-links.open { right: 0; }
    .nav-item { font-size: 1.5rem; padding: 15px 0; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
}

/* --- FLOATING WIDGETS --- */
.floating-widgets {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.widget-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--accent-primary);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 94, 142, 0.3);
}

.widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 94, 142, 0.6);
}

.mood-selector, .gift-box-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(15, 8, 15, 0.9);
    border: 1px solid var(--accent-primary);
    padding: 30px;
    border-radius: 20px;
    z-index: 999;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
}
.mood-selector.show, .gift-box-modal.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.mood-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.mood-btn {
    font-size: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.mood-btn:hover { transform: scale(1.3); }

/* --- OPEN WHEN LETTERS --- */
.letters-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
}
.envelope {
    width: 150px;
    height: 100px;
    background: #ffd700; /* Yellow */
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #333;
    font-weight: bold;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    transition: transform 0.3s;
}
.envelope::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 10px;
    clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
    background: #ffeb3b;
    z-index: 1;
}
.envelope span { z-index: 2; font-size: 0.9rem; pointer-events: none; }
.envelope:hover { transform: translateY(-10px); }

/* --- MEMORY WALL --- */
.masonry-wall {
    column-count: 3;
    column-gap: 20px;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.polaroid {
    background: #fff;
    padding: 10px 10px 30px 10px;
    margin-bottom: 20px;
    break-inside: avoid;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transform: rotate(calc(-3deg + 6deg * var(--rand)));
    transition: transform 0.3s;
    color: #333;
}
.polaroid:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 10;
    position: relative;
}
.polaroid img {
    width: 100%;
    display: block;
}
.polaroid .caption {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-top: 10px;
    color: #333;
}
@media (max-width: 768px) { .masonry-wall { column-count: 2; padding: 20px; } }
@media (max-width: 480px) { .masonry-wall { column-count: 1; } }

/* --- VIRTUAL PET --- */
.pet-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
}
.bunny {
    font-size: 8rem;
    animation: breathe 3s infinite ease-in-out;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    transition: transform 0.2s;
}
.bunny.happy { animation: jump 0.5s 2; }
.pet-stats {
    width: 300px;
    margin-top: 20px;
}
.stat-bar {
    width: 100%;
    height: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}
.stat-fill {
    height: 100%;
    background: var(--accent-primary);
    width: 50%;
    transition: width 0.3s;
}

/* --- DRAW TOGETHER --- */
.draw-container {
    width: 90%;
    max-width: 800px;
    background: #fff;
    border-radius: 15px;
    padding: 10px;
    margin: 40px auto;
    position: relative;
}
#draw-canvas {
    width: 100%;
    height: 400px;
    background: #fff;
    border-radius: 10px;
    cursor: crosshair;
    touch-action: none;
}
.draw-tools {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}
.tool-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
}

/* --- TREASURE HUNT & PROPOSAL --- */
.clue-box {
    background: var(--glass-bg);
    border: 1px dashed var(--accent-primary);
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    margin: 50px auto;
    text-align: center;
    font-size: 1.2rem;
}
.locked-proposal {
    filter: blur(10px) grayscale(100%);
    pointer-events: none;
}
.unlocked-proposal {
    filter: blur(0) grayscale(0%);
    pointer-events: all;
    transition: filter 2s ease;
}

/* --- BACKGROUND ENHANCEMENTS --- */
.shooting-star {
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    animation: shooting 4s linear infinite;
    opacity: 0;
    transform: rotate(-45deg);
    z-index: 1;
}
@keyframes shooting {
    0% { transform: translate(100vw, -100px) rotate(-45deg); opacity: 1; }
    20% { transform: translate(-100px, 100vh) rotate(-45deg); opacity: 0; }
    100% { transform: translate(-100px, 100vh) rotate(-45deg); opacity: 0; }
}

/* --- NEW GAMES --- */
.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    width: 300px;
    height: 300px;
    margin: 20px auto;
    background: rgba(255,255,255,0.1);
}
.puzzle-piece {
    background-size: 300px 300px;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
}

.constellation-area {
    width: 100%;
    height: 300px;
    position: relative;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
}
.c-star {
    position: absolute;
    width: 10px; height: 10px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
    cursor: pointer;
}
.c-star.active { background: var(--accent-primary); box-shadow: 0 0 15px var(--accent-primary); }
.c-line {
    position: absolute;
    background: var(--accent-primary);
    height: 2px;
    transform-origin: 0 0;
}

/* Base Page Padding fix for Global Nav */
.page {
    padding-top: 80px; /* Space for navbar */
}
.hero-content {
    padding-top: 60px;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}
.contact-form input, .contact-form textarea {
    padding: 15px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    color: white;
    font-family: 'Outfit', sans-serif;
}
.contact-form textarea { resize: vertical; min-height: 120px; }

/* Hidden Stars for Secret Messages */
.hidden-star {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.1;
    cursor: pointer;
    z-index: 50;
    transition: opacity 0.3s;
}
.hidden-star:hover { opacity: 1; }

/* --- EXPLORATORY NAVIGATION (DREAM MAP) --- */
.dream-map {
    margin-top: 40px;
    position: relative;
    z-index: 10;
}

.explore-hint {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    animation: float-up-down 3s infinite ease-in-out;
}

.portals-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.portal-orb {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portal-orb .orb-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 20px rgba(255, 94, 142, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    backdrop-filter: blur(10px);
    margin-bottom: 15px;
    transition: all 0.4s ease;
}

.portal-orb:hover {
    transform: translateY(-15px) scale(1.1);
}

.portal-orb:hover .orb-icon {
    box-shadow: 0 0 40px var(--accent-primary);
    background: rgba(255, 255, 255, 0.15);
}

.portal-orb .orb-label {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.portal-orb:hover .orb-label {
    opacity: 1;
    color: var(--accent-primary);
}

@keyframes float-up-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    .portal-orb .orb-icon { width: 60px; height: 60px; font-size: 1.8rem; }
    .portals-container { gap: 15px; }
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.lightbox-modal.show {
    opacity: 1;
    pointer-events: all;
}
.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}
.lightbox-modal.show .lightbox-content {
    transform: scale(1);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    transition: color 0.3s;
}
.lightbox-close:hover { color: var(--accent-primary); }

#lightbox-caption {
    margin-top: 20px;
    color: white;
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
}

/* --- TREASURE HUNT KEYS --- */
.treasure-key {
    position: absolute;
    font-size: 2rem;
    cursor: pointer;
    animation: glow-pulse 2s infinite alternate;
    z-index: 50;
}
@keyframes glow-pulse {
    0% { filter: drop-shadow(0 0 5px gold); transform: scale(1); }
    100% { filter: drop-shadow(0 0 20px gold); transform: scale(1.2); }
}
