@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* --- Global & Animated Background --- */
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh;
    overflow: hidden;
    color: #333;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- THE EXACT ORIGINAL FLOATING NOTE STYLE --- */
.note, .modal, .reply-bubble {
    background: rgba(255, 255, 255, 0.9) !important; 
    backdrop-filter: blur(5px) !important; 
    -webkit-backdrop-filter: blur(5px) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important; 
    border: 1px solid rgba(255,255,255,0.5) !important;
    border-radius: 16px !important;
    box-sizing: border-box;
}

/* --- Glassmorphism Header --- */
.welcome-banner {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.welcome-banner h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* --- Standard Buttons --- */
.primary-btn, .icon-btn, .cancel-btn {
    background: #fff;
    color: #a6c1ee;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.icon-btn { padding: 10px 15px; }
.cancel-btn { background: #f1f2f6; color: #57606f; }

.primary-btn:hover, .icon-btn:hover, .cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* --- The Board & Floating Note Specifics --- */
.board {
    position: relative;
    width: 100vw;
    height: calc(100vh - 160px); 
    margin-top: 10px;
    padding-bottom: 90px; /* NEW: Keeps notes from hiding under the bottom nav */
}


.note {
    position: absolute;
    width: 280px;
    max-width: 85vw;
    padding: 20px;
    cursor: grab;
    transition: opacity 1.2s ease-in-out, transform 0.2s ease;
    opacity: 1;
}

.note:active { cursor: grabbing; }

.board:not(.grid-view) .note:hover {
    animation-play-state: paused !important;
    transform: scale(1.03) rotate(0deg) !important;
    z-index: 50;
}

/* Floating Animation */
@keyframes subtleFloat {
    0% { transform: translateY(0px) rotate(var(--rot)); }
    50% { transform: translateY(-12px) rotate(var(--rot)); }
    100% { transform: translateY(0px) rotate(var(--rot)); }
}

.board:not(.grid-view) .note.floating-anim { animation: subtleFloat 6s ease-in-out infinite; }
.note.hidden-note { opacity: 0; pointer-events: none; }
.note.is-dragging {
    animation: none !important;
    transform: scale(1.05) rotate(0deg) !important;
    opacity: 0.95 !important;
}

/* Inner Note Content */
.note-header { display: flex; justify-content: space-between; font-size: 0.8em; color: #666; margin-bottom: 15px; font-weight: 500; }
.author-tag { font-size: 0.75em; color: #a0a0a0; margin-top: -10px; margin-bottom: 12px; font-style: italic; }
.content { font-size: 1.05em; line-height: 1.5; margin-bottom: 20px; word-wrap: break-word; }
.note-footer { display: flex; justify-content: space-between; border-top: 1px solid rgba(0,0,0,0.1); padding-top: 10px; }

/* Action Buttons */
.action-btn { background: none; border: none; cursor: pointer; font-size: 1.2em; color: #a0a0a0; transition: color 0.2s, transform 0.2s; display: flex; align-items: center; gap: 5px; }
.action-btn:hover { color: #ff6b81; transform: scale(1.1); }
.action-btn.reacted { color: #ff4757; }

/* --- Modal Specifics ---
   The bottom nav is a floating pill (see core/bottom_nav.php), and its own
   script measures its real on-screen height and publishes it as
   --bottom-nav-clearance on <html>. Modals reserve exactly that much space
   at the bottom (plus a small gap) instead of a guessed pixel value, so
   they never sit underneath the pill and never reserve more room than they
   need to -- on mobile browsers, installed PWA, or desktop alike. Pages
   without the nav (login, admin) just fall back to a small default gap. */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Follows the real visible viewport on mobile browsers as their toolbars show/hide */
    background: rgba(0,0,0,0.15); 
    backdrop-filter: blur(3px);
    z-index: 1200; /* Above the bottom-nav pill (1000) so it can never render on top of an open modal */
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: max(16px, env(safe-area-inset-top)) 16px calc(var(--bottom-nav-clearance, 24px) + 16px) 16px;
}

.modal {
    padding: 30px;
    width: 90%;
    max-width: 400px;
    max-height: 100%; /* Bounded by the overlay's own reserved padding above -- auto-clears the nav on any device */
    overflow-y: auto; /* Enables scrolling for tall forms/comments */
    overscroll-behavior: contain; /* Stops the page/board from scrolling once the modal content hits its own end */
    box-sizing: border-box; /* Prevents padding from breaking the height limit */
    animation: slideUp 0.3s ease-out;
}


@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal h2 { margin-top: 0; color: #333; font-size: 1.5rem; }

.modal input {
    width: 100%; padding: 12px; margin-bottom: 15px;
    border: 1px solid #ddd; border-radius: 8px;
    font-family: 'Poppins', sans-serif; box-sizing: border-box;
    background: #fff;
}

.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; }

/* --- Load More Notifications Button --- */
#loadMoreNotifsBtn {
    background: rgba(116, 185, 255, 0.05);
    color: #74b9ff;
    border: 2px dashed #74b9ff;
    transition: all 0.2s ease;
    font-weight: 600;
    margin-top: 5px;
}

#loadMoreNotifsBtn:hover {
    background: rgba(116, 185, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(116, 185, 255, 0.2);
}

#loadMoreNotifsBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border-style: solid;
}


/* --- PWA Install Banner (slide-down from top) --- */
#pwaInstallBanner {
    position: fixed;
    top: 0; left: 0; right: 0;
    transform: translateY(-110%);
    transition: transform 0.35s ease;
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}
#pwaInstallBanner.show { transform: translateY(0); }
#pwaInstallBanner .pwa-txt {
    flex-grow: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4a3b47;
}
#pwaInstallBanner button {
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}
#pwaInstallBtn { background: #fff; color: #e77ca0; }
#pwaDismissBtn { background: transparent; color: #4a3b47; opacity: 0.7; padding: 7px 8px; }

/* --- Push Notification Opt-in Banner (slide-down from top) --- */
#pushEnableBanner {
    position: fixed;
    top: 0; left: 0; right: 0;
    transform: translateY(-110%);
    transition: transform 0.35s ease;
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: linear-gradient(135deg, #74b9ff 0%, #a29bfe 100%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}
#pushEnableBanner.show { transform: translateY(0); }
#pushEnableBanner .pwa-txt { flex-grow: 1; font-size: 0.85rem; font-weight: 500; color: #fff; }
#pushEnableBanner button {
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}
#pushEnableBtn { background: #fff; color: #74b9ff; }
#pushDismissBtn { background: transparent; color: #fff; opacity: 0.85; padding: 7px 8px; }


/* --- Push Notification Toggle (now lives inside the Notifications modal) --- */
.push-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: rgba(116, 185, 255, 0.08);
    border: 1px solid rgba(116, 185, 255, 0.25);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 15px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    text-align: left;
    box-shadow: none;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.push-toggle-row:hover {
    background: rgba(116, 185, 255, 0.16);
    transform: none;
    box-shadow: none;
}

.push-toggle-row:disabled { opacity: 0.6; cursor: not-allowed; }

.push-toggle-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(116, 185, 255, 0.15);
    color: #74b9ff;
    font-size: 0.95rem;
    transition: background 0.25s ease, color 0.25s ease;
}

.push-toggle-label {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.push-toggle-label strong { font-size: 0.88rem; color: #333; font-weight: 600; }
.push-toggle-status { font-size: 0.75rem; color: #888; }

.push-toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 20px;
    background: #ddd;
    position: relative;
    flex-shrink: 0;
    display: inline-block;
    transition: background 0.25s ease;
}

.push-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.25s ease;
}

.push-toggle-row.is-on { background: rgba(116, 185, 255, 0.18); border-color: rgba(116, 185, 255, 0.4); }
.push-toggle-row.is-on .push-toggle-icon { background: #74b9ff; color: #fff; }
.push-toggle-row.is-on .push-toggle-switch { background: #74b9ff; }
.push-toggle-row.is-on .push-toggle-knob { transform: translateX(18px); }
.push-toggle-row.is-on .push-toggle-status { color: #74b9ff; font-weight: 600; }

/* --- Toast Popups (e.g. push notification enabled/disabled) --- */
#toastContainer {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 90%;
    max-width: 340px;
    pointer-events: none;
}

.toast {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 12px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.88rem;
    color: #333;
    opacity: 0;
    transform: translateY(-14px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast i { font-size: 1rem; color: #74b9ff; }
.toast.toast-off i { color: #a0a0a0; }

/* --- Comments Specifics --- */
.comments-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px;
}

.reply-bubble {
    padding: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #333;
}

.reply-bubble small { display: block; font-size: 0.8em; color: #888; margin-bottom: 3px; }
.reply-bubble p { margin: 0; }
.no-comments { color: #a0a0a0; font-size: 0.9em; text-align: center; font-style: italic; }
.comment-count { font-size: 0.8em; margin-left: 5px; font-weight: 600; }

/* --- Grid View Mode --- */
.board.grid-view {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    align-content: flex-start;
    justify-content: center;
    box-sizing: border-box;
}

/* Creates an invisible block at the bottom to force scroll space */
.board.grid-view::after {
    content: "";
    display: block;
    width: 100%;
    height: 120px; /* Adjust this number if you need even more space! */
}


.board.grid-view .note {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0;
    cursor: default;
    max-width: 320px;
    width: 100%;
}

.board.grid-view .note:active { transform: none !important; }
.board.grid-view::-webkit-scrollbar { width: 8px; }
.board.grid-view::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.6); border-radius: 4px; }

/* --- Mobile Adjustments --- */
@media (max-width: 600px) {
    .welcome-banner { padding: 10px 15px; }
    .welcome-banner h1 { font-size: 1.2rem; }
    .primary-btn { padding: 8px 15px; font-size: 0.9rem; }
    .note { padding: 15px; }

    /* NEW: Force vertical scrolling on mobile for both floating and grid views */
    .board {
        overflow-y: auto;
        overflow-x: hidden; /* Prevents side-to-side scrolling if a note goes off the right edge */
        padding-bottom: 100px !important; /* <-- FIXED: Adds extra space so the bottom notes clear the mobile UI! */
    }

    /* NEW: Apply the custom glass scrollbar to the mobile board */
    .board::-webkit-scrollbar { width: 6px; }
    .board::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.6); border-radius: 4px; }
    
    /* Slightly wider modal on small screens for better text/form fit */
    .modal {
        width: 92%;
    }
}

/* --- NEW: Progress Bar Widget --- */
.progress-wrapper {
    width: 90%;
    max-width: 600px;
    margin: 15px auto 0 auto;
    position: relative;
    z-index: 10;
    
    /* Mirrors the exact glass style of the notes */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 12px 25px;
    box-sizing: border-box;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.progress-bar-glass {
    width: 100%;
    height: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    overflow: hidden;
}

.user1-fill {
    height: 100%;
    background: linear-gradient(90deg, #a1c4fd, #c2e9fb); /* Light Blue */
    transition: width 1s ease-in-out;
}

.user2-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbc2eb, #ffb199); /* Pink / Peach */
    transition: width 1s ease-in-out;
}

/* Smooth zoom animation for the full-screen image */
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Ensure the note-image looks clickable */
.note-image {
    transition: transform 0.2s;
}

.note-image:hover {
    transform: scale(1.02);
    filter: brightness(0.9);
}

/* --- Notification Jump & Pulse Animation --- */
@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(116, 185, 255, 0.7); transform: scale(1); }
    70% { box-shadow: 0 0 20px 15px rgba(116, 185, 255, 0); transform: scale(1.02); }
    100% { box-shadow: 0 0 0 0 rgba(116, 185, 255, 0); transform: scale(1); }
}
.highlight-pulse {
    animation: highlightPulse 1.5s infinite;
    border: 2px solid #74b9ff !important;
    z-index: 9999 !important;
}
.notif-item:hover { 
    background: rgba(0,0,0,0.05) !important; 
}

/* Center the login box on the screen */
        .login-container {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .login-box {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(10px);
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0,0,0,0.1);
            width: 90%;
            max-width: 350px;
            text-align: center;
        }
        .login-box h2 { margin-top: 0; color: #333; font-size: 1.8rem;}
        .login-box input {
            width: 100%; padding: 12px; margin-bottom: 15px;
            border: 1px solid #ddd; border-radius: 8px;
            font-family: 'Poppins', sans-serif; box-sizing: border-box;
        }
        .login-box button { width: 100%; padding: 12px; font-size: 1rem; }
        .error { color: #ff4757; font-size: 0.9em; margin-bottom: 15px; }

        /* --- Custom Popup Styles --- */
        .popup-overlay {
            position: fixed;
            top: 0; left: 0; width: 100vw; height: 100vh;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(6px);
            z-index: 2000;
            display: flex;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.4s ease;
            transition: opacity 0.3s ease;
        }
        .popup-box {
            background: rgba(255, 255, 255, 0.95);
            padding: 35px 25px;
            border-radius: 20px;
            box-shadow: 0 15px 40px rgba(0,0,0,0.2);
            text-align: center;
            max-width: 320px;
            width: 85%;
            animation: slideDown 0.5s ease;
        }
        .popup-box h3 {
            margin-top: 0;
            color: #ff6b81;
            font-size: 1.4rem;
            margin-bottom: 15px;
        }
        .popup-box p {
            color: #555;
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 25px;
        }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        
/* --- Floating Background Shrimps --- */
.bg-shrimps {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; 
    margin: 0;
    padding: 0;
    pointer-events: none; 
}

/* The invisible container that drifts upwards */
.bg-shrimps li {
    position: absolute;
    list-style: none;
    bottom: -100px;
    animation: swimUp 20s infinite linear;
}

/* The shrimp itself - keeping the glowing glass silhouette! */
.bg-shrimps li::after {
    content: "🦐";
    display: block;
    font-size: 2rem;
    /* Turned the grayscale down slightly so a tiny bit of shrimp color bleeds into the glow! */
    filter: grayscale(60%) brightness(250%) opacity(0.4) drop-shadow(0 0 8px rgba(255,255,255,0.8));
    animation: wiggle 0.4s infinite alternate ease-in-out;
}

/* Randomize sizes, start positions, and speeds */
.bg-shrimps li:nth-child(1) { left: 10%; font-size: 1.5rem; animation-duration: 22s; }
.bg-shrimps li:nth-child(1)::after { animation-delay: 0.1s; }

.bg-shrimps li:nth-child(2) { left: 25%; font-size: 0.8rem; animation-duration: 18s; animation-delay: 2s; }
.bg-shrimps li:nth-child(2)::after { animation-delay: 0.3s; animation-duration: 0.5s; }

.bg-shrimps li:nth-child(3) { left: 40%; font-size: 2.2rem; animation-duration: 25s; animation-delay: 5s; }
.bg-shrimps li:nth-child(3)::after { animation-delay: 0.2s; animation-duration: 0.6s; opacity: 0.2; }

.bg-shrimps li:nth-child(4) { left: 55%; font-size: 1.2rem; animation-duration: 20s; }
.bg-shrimps li:nth-child(4)::after { animation-delay: 0.4s; animation-duration: 0.45s; }

.bg-shrimps li:nth-child(5) { left: 70%; font-size: 1.8rem; animation-duration: 24s; animation-delay: 3s; }
.bg-shrimps li:nth-child(5)::after { animation-delay: 0.1s; }

.bg-shrimps li:nth-child(6) { left: 85%; font-size: 1rem; animation-duration: 19s; animation-delay: 7s; }
.bg-shrimps li:nth-child(6)::after { animation-delay: 0.5s; animation-duration: 0.35s; }

.bg-shrimps li:nth-child(7) { left: 15%; font-size: 2rem; animation-duration: 28s; animation-delay: 10s; }
.bg-shrimps li:nth-child(7)::after { animation-delay: 0.2s; animation-duration: 0.55s; }

.bg-shrimps li:nth-child(8) { left: 50%; font-size: 0.9rem; animation-duration: 17s; animation-delay: 12s; }
.bg-shrimps li:nth-child(8)::after { animation-delay: 0.6s; animation-duration: 0.3s; }

.bg-shrimps li:nth-child(9) { left: 80%; font-size: 1.6rem; animation-duration: 23s; animation-delay: 15s; }
.bg-shrimps li:nth-child(9)::after { animation-delay: 0.3s; animation-duration: 0.4s; opacity: 0.5; }

.bg-shrimps li:nth-child(10) { left: 30%; font-size: 1.3rem; animation-duration: 21s; animation-delay: 18s; }
.bg-shrimps li:nth-child(10)::after { animation-delay: 0.4s; animation-duration: 0.5s; }

/* The Drifting Upwards Animation */
@keyframes swimUp {
    0% { transform: translateY(0) translateX(0) rotate(-10deg); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(-60vh) translateX(30px) rotate(10deg); }
    90% { opacity: 1; }
    100% { transform: translateY(-120vh) translateX(-30px) rotate(-10deg); opacity: 0; }
}

/* The Shrimp Wiggle Animation */
@keyframes wiggle {
    0% { transform: rotate(-20deg) scaleY(1); }
    100% { transform: rotate(10deg) scaleY(0.9); }
}

        .react-count { font-size: 0.85em; margin-left: 4px; font-weight: 600; }
        .author-tag { font-size: 0.75em; color: #a0a0a0; margin-top: -10px; margin-bottom: 12px; font-style: italic; }
        .icon-btn { padding: 10px 15px; border-radius: 50px; border: none; cursor: pointer; background: rgba(255,255,255,0.6); color: #333; transition: background 0.2s; }
        .icon-btn:hover { background: rgba(255,255,255,0.9); }
        .details-list p { margin: 10px 0; font-size: 0.95em; color: #444; }
        .details-list i { color: #a6c1ee; width: 20px; text-align: center; margin-right: 5px; }
        .note-image { width: 100%; border-radius: 10px; margin-bottom: 15px; display: block; object-fit: cover; max-height: 200px; cursor: pointer; }

/* =========================================
   ✨ MONTHSARY SURPRISE EVENT STYLES ✨
   ========================================= */

/* 2. The Midnight Takeover Blur */
.monthsary-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out;
}

/* The folded letter sitting inside the pocket */
.envelope-paper {
    position: absolute;
    bottom: 5px; 
    left: 10px; 
    right: 10px; 
    height: 180px;
    background: #fffdf2;
    border-radius: 5px;
    z-index: 2; /* Sits in front of back, behind front pocket */
    box-shadow: 0 -2px 15px rgba(0,0,0,0.15);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* The front pocket of the envelope (Using advanced border hacks for geometry) */
.envelope-front {
    position: absolute;
    bottom: 0; left: 0; right: 0; top: 0;
    z-index: 3;
    border-radius: 8px;
    overflow: hidden;
}
.envelope-front::before {
    content: "";
    position: absolute;
    bottom: 0; left: 0;
    border-left: 160px solid #f6cc61;
    border-right: 160px solid #f6cc61;
    border-bottom: 110px solid #f9d77e;
    border-top: 100px solid transparent;
    z-index: 3;
    filter: drop-shadow(0 -4px 6px rgba(0,0,0,0.05));
}

/* The Top Flap */
.envelope-flap {
    position: absolute;
    top: 0; left: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 115px solid #eab543;
    z-index: 4;
    transform-origin: top;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s 0.3s;
    filter: drop-shadow(0 5px 6px rgba(0,0,0,0.25));
}

/* The Glowing Wax Seal */
.wax-seal {
    position: absolute;
    top: 110px; /* Aligned perfectly with the tip of the flap */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; 
    height: 48px;
    background: radial-gradient(circle, #ff4757 30%, #c0392b 100%);
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 0 4px rgba(255,255,255,0.4);
    display: flex; 
    justify-content: center; 
    align-items: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* =======================================
   ANIMATION SEQUENCE (Triggered by JS) 
   ======================================= */

/* 1. Flap flips into the 3D background */
.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1; /* Drops behind the paper once opened */
}

/* 2. Wax seal shatters/fades instantly */
.envelope.open .wax-seal {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
}

/* 3. The letter physically slides up and out! */
.envelope.open .envelope-paper {
    transform: translateY(-90px);
    transition-delay: 0.4s; /* Waits for the flap to get out of the way first */
}

/* =========================================
   ✨ MONTHSARY SURPRISE GLOBAL STYLES ✨
   ========================================= */

/* The Midnight Takeover Blur (Used by all games) */
.monthsary-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out;
}

/* Cinematic Blur Background with Vignette (Used by Film Roll & Roulette) */
.cinematic-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2) 20%, rgba(0, 0, 0, 0.85) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 101; 
    opacity: 0;
    transition: opacity 2s ease-in-out;
    pointer-events: none;
}

/* Exit Game Button (Used by all games) */
.exit-film-btn {
    position: fixed;
    top: 25px;
    right: 30px;
    background: rgba(255, 71, 87, 0.85);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    z-index: 5500 !important; /* Forces it to the absolute front layer! */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    opacity: 0;
    transition: opacity 1s ease-in-out, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.exit-film-btn:hover {
    background: rgba(255, 71, 87, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

/* =========================================
   ✨ BOTTOM NAVIGATION BAR ✨
   ========================================= */
.bottom-nav-pill {
    position: fixed;
    /* Keeps it floating dynamically above the iPhone gesture bar */
    bottom: max(20px, env(safe-area-inset-bottom)); 
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 400px;
    
    /* Restores your native frosted glass theme */
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    
    /* The rounded pill shape */
    border-radius: 40px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    
    padding: 12px 15px !important;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-sizing: border-box;
}

.bottom-nav-pill .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666 !important;
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.2s, color 0.2s;
    gap: 4px;
    width: 25%;
}

.bottom-nav-pill .nav-item i {
    font-size: 1.3rem;
    color: #888 !important;
    transition: color 0.3s ease;
}

.bottom-nav-pill .nav-item:active {
    transform: scale(0.92) !important;
}
    left: 10px; 
    right: 10px; 
    height: 180px;
    background: #fffdf2;
    border-radius: 5px;
    z-index: 2; /* Sits in front of back, behind front pocket */
    box-shadow: 0 -2px 15px rgba(0,0,0,0.15);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* The front pocket of the envelope (Using advanced border hacks for geometry) */
.envelope-front {
    position: absolute;
    bottom: 0; left: 0; right: 0; top: 0;
    z-index: 3;
    border-radius: 8px;
    overflow: hidden;
}
.envelope-front::before {
    content: "";
    position: absolute;
    bottom: 0; left: 0;
    border-left: 160px solid #f6cc61;
    border-right: 160px solid #f6cc61;
    border-bottom: 110px solid #f9d77e;
    border-top: 100px solid transparent;
    z-index: 3;
    filter: drop-shadow(0 -4px 6px rgba(0,0,0,0.05));
}

/* The Top Flap */
.envelope-flap {
    position: absolute;
    top: 0; left: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 115px solid #eab543;
    z-index: 4;
    transform-origin: top;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s 0.3s;
    filter: drop-shadow(0 5px 6px rgba(0,0,0,0.25));
}

/* The Glowing Wax Seal */
.wax-seal {
    position: absolute;
    top: 110px; /* Aligned perfectly with the tip of the flap */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; 
    height: 48px;
    background: radial-gradient(circle, #ff4757 30%, #c0392b 100%);
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 0 4px rgba(255,255,255,0.4);
    display: flex; 
    justify-content: center; 
    align-items: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* =======================================
   ANIMATION SEQUENCE (Triggered by JS) 
   ======================================= */

/* 1. Flap flips into the 3D background */
.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1; /* Drops behind the paper once opened */
}

/* 2. Wax seal shatters/fades instantly */
.envelope.open .wax-seal {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
}

/* 3. The letter physically slides up and out! */
.envelope.open .envelope-paper {
    transform: translateY(-90px);
    transition-delay: 0.4s; /* Waits for the flap to get out of the way first */
}

/* =========================================
   ✨ MONTHSARY SURPRISE GLOBAL STYLES ✨
   ========================================= */

/* The Midnight Takeover Blur (Used by all games) */
.monthsary-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out;
}

/* Cinematic Blur Background with Vignette (Used by Film Roll & Roulette) */
.cinematic-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.2) 20%, rgba(0, 0, 0, 0.85) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 101; 
    opacity: 0;
    transition: opacity 2s ease-in-out;
    pointer-events: none;
}

/* Exit Game Button (Used by all games) */
.exit-film-btn {
    position: fixed;
    top: 25px;
    right: 30px;
    background: rgba(255, 71, 87, 0.85);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 10px 20px;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    z-index: 5500 !important; /* Forces it to the absolute front layer! */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    opacity: 0;
    transition: opacity 1s ease-in-out, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.exit-film-btn:hover {
    background: rgba(255, 71, 87, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

/* =========================================
   ✨ BOTTOM NAVIGATION BAR ✨
   ========================================= */
.bottom-nav-pill {
    position: fixed;
    /* Keeps it floating dynamically above the iPhone gesture bar */
    bottom: max(20px, env(safe-area-inset-bottom)); 
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 400px;
    
    /* Restores your native frosted glass theme */
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    
    /* The rounded pill shape */
    border-radius: 40px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    
    padding: 12px 15px !important;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-sizing: border-box;
}

.bottom-nav-pill .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666 !important;
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.2s, color 0.2s;
    gap: 4px;
    width: 25%;
}

.bottom-nav-pill .nav-item i {
    font-size: 1.3rem;
    color: #888 !important;
    transition: color 0.3s ease;
}

.bottom-nav-pill .nav-item:active {
    transform: scale(0.92) !important;
}

/* Active State (Coral Pink) */
.bottom-nav-pill .nav-item.active,
.bottom-nav-pill .nav-item.active i {
    color: #ff6b81 !important;
}

.bottom-nav-pill .nav-item.active i {
    animation: iconPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* --- Premium Notifications UI --- */
.notif-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.notif-item.notif-unread {
    background: rgba(116, 185, 255, 0.08);
    border-color: rgba(116, 185, 255, 0.2);
}

.notif-item.notif-unread:hover {
    background: rgba(116, 185, 255, 0.12);
    border-color: rgba(116, 185, 255, 0.3);
}

.notif-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.notif-item:hover .notif-avatar {
    transform: scale(1.08);
}

.notif-avatar.notif-heart {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

.notif-avatar.notif-comment {
    background: rgba(116, 185, 255, 0.12);
    color: #74b9ff;
}

.notif-content {
    flex-grow: 1;
    margin-left: 12px;
    min-width: 0; /* Prevents overflow issues with long text */
}

.notif-title {
    font-size: 0.84rem;
    color: #333;
    line-height: 1.4;
}

.notif-title strong {
    color: #111;
    font-weight: 600;
}

.notif-preview {
    background: rgba(0, 0, 0, 0.035);
    border-radius: 8px;
    padding: 6px 10px;
    margin-top: 5px;
    margin-bottom: 3px;
    font-size: 0.78rem;
    color: #555;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid #ccc;
}

.notif-item.notif-unread .notif-preview {
    border-left-color: #74b9ff;
    background: rgba(116, 185, 255, 0.04);
}

.notif-time {
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Spinner rotation keyframes */
@keyframes spin {
    to { transform: rotate(360deg); }
}
