* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pastel-red: #ffadad;
    --dark-red: #ff8b94;
    --white: #ffffff;
    --wordle-correct: #b39ddb;
    /* Soft Purple */
    --wordle-present: #f48fb1;
    /* Soft Pink */
    --wordle-absent: #e2e2e2;
    --puzzle-tile: #ffffff;
    --puzzle-bg: #fff0f0;
}

body {
    background-color: var(--white);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 1000px;
    overflow: hidden;
    z-index: 2;
    /* In front of stars */
    pointer-events: none;
    /* Allow clicking through to stars */
}

.container>* {
    pointer-events: auto;
    /* Re-enable for content */
}

/* Intro Animations */
.welcome-text {
    font-family: 'Dancing Script', cursive;
    font-size: 5rem;
    color: var(--pastel-red);
    margin-top: 15vh;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 2.5s ease-out 0.5s forwards;
    will-change: transform, opacity;
}

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.heart-wrapper {
    position: absolute;
    top: 66%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 15rem;
    height: 15rem;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    z-index: 10;
    will-change: transform;
    opacity: 0;
    animation: heartFadeIn 0.8s ease-out forwards;
}

@keyframes heartFadeIn {
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.heart-wrapper:hover {
    transform: translate(-50%, -50%) scale(1.08);
}

.heart-svg {
    width: 100%;
    height: 100%;
    /* Removed drop-shadow for performance */
    overflow: visible;
    transform: translateZ(0);
}

.heart-left,
.heart-right {
    fill: var(--pastel-red);
    stroke: var(--pastel-red);
    stroke-width: 2px;
    stroke-linejoin: round;
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-origin: 100px 100px;
    backface-visibility: hidden;
    will-change: transform;
    transform: translateZ(0);
}

.zoomed {
    animation: smoothZoom 2s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

@keyframes smoothZoom {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(8);
        opacity: 0;
    }
}

.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--pastel-red);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.transition-active .page-transition-overlay {
    opacity: 1;
}

.next-page-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 12vh;
    background: transparent;
    color: var(--white);
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    transition: opacity 1s ease 0.6s;
    will-change: opacity;
}

.transition-active .next-page-content {
    opacity: 1;
    pointer-events: all;
}

.birthday-header {
    text-align: center;
    margin-bottom: 5vh;
    transform: translateY(20px);
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.8s;
}

.transition-active .birthday-header {
    transform: translate3d(0, 0, 0);
}

.birthday-header h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 4.5rem;
    margin-bottom: 0px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.from-text {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    opacity: 0.9;
    display: block;
}

.sections-container {
    display: flex;
    gap: 3rem;
    margin-top: 4vh;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    /* Allow hearts to stack */
    padding: 20px;
}

@media (max-width: 900px) {
    .sections-container {
        gap: 1.5rem;
    }

    .heart-section {
        width: 12rem;
        height: 12rem;
    }

    .heart-section span {
        font-size: 1.1rem;
    }
}

.heart-section {
    position: relative;
    width: 16rem;
    height: 16rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.transition-active .heart-section {
    animation: heartPopIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.transition-active .heart-section:nth-child(1) {
    animation-delay: 1s;
}

.transition-active .heart-section:nth-child(2) {
    animation-delay: 1.15s;
}

.transition-active .heart-section:nth-child(3) {
    animation-delay: 1.3s;
}

@keyframes heartPopIn {
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.heart-section:hover {
    transform: scale(1.08) !important;
}

.heart-section span {
    position: relative;
    z-index: 2;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    text-transform: lowercase;
    font-weight: 700;
    text-align: center;
    max-width: 85%;
    line-height: 1.2;
}

.section-heart-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    fill: rgba(255, 255, 255, 0.15);
    transition: fill 0.3s ease;
}

.heart-section:hover .section-heart-bg {
    fill: rgba(255, 255, 255, 0.25);
}

/* Games Menu Overlays */
.game-menu-overlay,
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.game-menu-overlay {
    background: #fffafa;
    /* Very light pink/white */
}

.game-menu-overlay.active,
.game-overlay.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.menu-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: var(--dark-red);
    margin-bottom: 4rem;
}

.menu-options {
    display: flex;
    gap: 5rem;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-item:hover {
    transform: scale(1.1);
}

.icon-container {
    width: 10rem;
    height: 10rem;
    background: var(--pastel-red);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(255, 173, 173, 0.3);
    color: white;
    padding: 2.2rem;
}

.menu-item span {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-red);
}

/* Wordle Icon Style */
.mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: (1, 1fr);
    gap: 4px;
    width: 100%;
}

.mini-tile {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
}

.mini-tile.correct {
    background: #ffffff;
}

.mini-tile.present {
    background: rgba(255, 255, 255, 0.6);
}

.mini-tile.absent {
    background: rgba(255, 255, 255, 0.2);
}

/* Puzzle UI Styles */
.puzzle-board-container {
    background: var(--pastel-red);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(255, 173, 173, 0.25);
    margin-bottom: 2rem;
}

.puzzle-board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
}

.puzzle-tile {
    width: 100px;
    height: 100px;
    background: var(--white);
    color: var(--dark-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

.puzzle-tile:hover {
    background: #fff8f8;
}

.puzzle-tile.empty {
    visibility: hidden;
}

.reset-btn {
    background: var(--pastel-red);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 173, 173, 0.4);
}

.reset-btn:hover {
    background: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 173, 173, 0.5);
}

/* Back buttons */
.back-btn-top,
.back-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--dark-red);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    z-index: 10;
}

/* Reusing Wordle styles or similar Game Overlays */
.game-overlay h3 {
    font-family: 'Dancing Script', cursive;
    color: var(--dark-red);
    font-size: 3rem;
    position: absolute;
    top: 2.2rem;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 10;
}

/* Wordle Game Layout */
#wordle-game {
    padding-top: 9rem;
}

/* Color Key Dropdown */
.color-key-container {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 15;
}

.color-key-toggle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--pastel-red);
    color: white;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 173, 173, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-key-toggle:hover {
    background: var(--dark-red);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 173, 173, 0.4);
}

.color-key-dropdown {
    position: absolute;
    top: 3.5rem;
    right: 0;
    background: white;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 150px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.color-key-dropdown.active {
    display: flex;
    animation: dropdownSlideIn 0.3s ease forwards;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.key-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.color-blob {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.purple-blob {
    background-color: var(--wordle-correct);
}

.pink-blob {
    background-color: var(--wordle-present);
}

.key-item span {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.wordle-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 2rem;
    align-items: center;
    transition: filter 0.5s ease, opacity 0.5s ease;
}

.wordle-grid.blurred {
    filter: blur(8px);
    opacity: 0.3;
    pointer-events: none;
}

.daily-complete-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 90%;
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.daily-complete-overlay.active {
    display: flex;
}

.daily-final-word {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--dark-red);
    text-transform: uppercase;
    letter-spacing: 5px;
    opacity: 0;
}

.daily-complete-overlay.active .daily-final-word {
    animation: fadeInUpScale 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.daily-final-message {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: #444;
    line-height: 1.4;
    opacity: 0;
}

.daily-complete-overlay.active .daily-final-message {
    animation: fadeInUpScale 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
}

@keyframes fadeInUpScale {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wordle-row {
    display: flex;
    gap: 10px;
}

.tile {
    width: 65px;
    height: 65px;
    border: 2px solid var(--wordle-absent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    color: #444;
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.tile.flip {
    animation: flipTile 0.6s ease-in forwards;
}

@keyframes flipTile {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

.tile.filled {
    border-color: #999;
    transform: scale(1.05);
}

.tile.correct {
    background-color: var(--wordle-correct);
    border-color: var(--wordle-correct);
    color: white;
}

.tile.present {
    background-color: var(--wordle-present);
    border-color: var(--wordle-present);
    color: white;
}

.tile.absent {
    background-color: var(--wordle-absent);
    border-color: var(--wordle-absent);
    color: white;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 500px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    background-color: #eee;
    border: none;
    border-radius: 4px;
    padding: 15px 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    flex-grow: 1;
    min-width: 30px;
    text-transform: uppercase;
}

.key.correct {
    background-color: var(--wordle-correct);
    color: white;
}

.key.present {
    background-color: var(--wordle-present);
    color: white;
}

.key.absent {
    background-color: #787c7e;
    color: white;
}

.message {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--dark-red);
    height: 1.5rem;
    text-align: center;
}

/* --- Memories Carousel & Polaroid Styles --- */
.carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

.polaroid-wrapper {
    perspective: 1000px;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.1));
}

.polaroid {
    background: white;
    padding: 1.2rem;
    padding-bottom: 4rem;
    /* Thick bottom border for caption */
    width: 320px;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid #f0f0f0;
    position: relative;
    user-select: none;
}

.polaroid-image-container {
    width: 100%;
    aspect-ratio: 1;
    background: #fdfdfd;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
}

.polaroid-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blank-placeholder {
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%) !important;
    position: relative;
}

.blank-placeholder::after {
    content: '❤️';
    font-size: 2.5rem;
    opacity: 0.2;
}

.polaroid-caption {
    position: absolute;
    bottom: 0.8rem;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    color: #555;
    font-size: 1.6rem;
    padding: 0 1rem;
}

.carousel-arrow {
    background: white;
    color: var(--pastel-red);
    border: 2px solid var(--pastel-red);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 173, 173, 0.15);
}

.carousel-arrow:hover {
    background: var(--pastel-red);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(255, 173, 173, 0.3);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

/* --- Notebook & Notes Styles --- */
.notes-page-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow: hidden;
    position: relative;
}

.notebook-page {
    background-color: var(--white);
    width: 90%;
    max-width: 900px;
    height: 85vh;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
    position: relative;
    border-radius: 20px;
    overflow-y: hidden;
    scroll-behavior: smooth;
}

.notebook-content {
    width: 100%;
    padding-bottom: 20vh;
    /* space for scrolling */
}

/* Removed the red margin line (.notebook-content::before) */

.note-section {
    min-height: 85vh;
    padding: 8rem 2rem 6rem 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    /* Removed lines background */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* subtle separator */
}

.note-section:last-child {
    border-bottom: none;
    margin-bottom: 20vh;
}

.note-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: var(--dark-red);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
}

.note-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.message.from-ana {
    align-items: flex-start;
}

.message.from-me {
    align-items: flex-end;
}

/* Dense mode for long sections */
.note-section.dense {
    padding-top: 3rem;
    padding-bottom: 2rem;
}

.note-section.dense .message {
    margin-bottom: 2px;
    /* Tighter spacing */
}

.note-section.dense .message-text {
    font-size: 0.95rem;
    padding: 8px 14px;
}

.note-section.dense .note-title {
    margin-bottom: 0.5rem;
}

.note-section.dense .message-sender {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

/* Super dense for REALLY long sections */
.note-section.super-dense {
    padding-top: 8rem;
    padding-bottom: 6rem;
}

.note-section.super-dense .message-text {
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 8px 12px;
}

/* Specific spacing for Forever section */
.note-section.forever-section {
    padding-top: 4rem !important;
    /* Move title down */
}

.note-section.forever-section .note-title {
    margin-bottom: 1.5rem !important;
    /* Space between title and bubbles */
}


.note-section.forever-section .message {
    margin-bottom: 1rem !important;
    /* Space between bubbles */
}

/* Specific spacing for Reassurance section */
.note-section.reassurance-section {
    padding-top: 5rem !important;
}

.note-section.reassurance-section .note-title {
    margin-bottom: 1.5rem !important;
}

.message-sender {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    margin-left: 8px;
    margin-right: 8px;
}

.message-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 75%;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.from-ana .message-text {
    background-color: var(--pastel-red);
    color: white;
    border-bottom-left-radius: 4px;
}

.message.from-me .message-text {
    background-color: #f1f0f0;
    /* Light gray for "Me" */
    color: #333;
    border-bottom-right-radius: 4px;
}

/* Adjusted for blur and arrow placement */
.notes-nav-overlay.top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    height: 8rem;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 60%, transparent 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 1rem;
    pointer-events: none;
    z-index: 20;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    backdrop-filter: blur(4px);
}

.notes-nav-overlay.bottom {
    position: absolute;
    bottom: 7.5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    height: 10rem;
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.8) 60%, transparent 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 2rem;
    pointer-events: none;
    z-index: 20;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    backdrop-filter: blur(4px);
}

.scroll-arrow {
    font-size: 3.5rem;
    color: var(--pastel-red);
    cursor: pointer;
    pointer-events: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: opacity 0.3s ease, transform 0.3s ease;
    user-select: none;
}

.scroll-arrow.up {
    animation: bounceUp 2s infinite;
}

.scroll-arrow.down {
    animation: bounceDown 2s infinite;
}

.scroll-arrow:hover {
    transform: scale(1.2) translateY(0);
    color: var(--dark-red);
}

.scroll-arrow.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* --- Passcode Styles --- */
.passcode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.passcode-overlay.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.passcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    transition: transform 0.1s;
}

.passcode-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--dark-red);
}

.passcode-dots {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dot {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid var(--pastel-red);
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.dot.filled {
    background-color: var(--pastel-red);
    transform: scale(1.1);
}

.passcode-keypad.wordle-style-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    transition: opacity 0.3s ease;
}

.passcode-keypad .keyboard-row {
    display: flex;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

.keypad-btn {
    background-color: #eee;
    border: none;
    border-radius: 4px;
    padding: 18px 0;
    /* Aligned with Wordle key height */
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    min-width: 30px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    transition: background 0.1s ease, transform 0.1s ease;
}

.keypad-btn.wide {
    flex: 1.5;
}

.keypad-btn:active {
    background: #bbb;
    transform: scale(0.95);
}

.passcode-container.shake {
    animation: shakeEffect 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeEffect {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}



/* Icon colors for memories menu */
.pictures-icon {
    background: #ffc2d1;
    /* Softer pink */
}

.notes-icon {
    background: #ffd6a5;
    /* Pastel orange */
}

/* --- Timeline Styles --- */
.timeline-container {
    width: 100%;
    max-width: 1200px;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 4rem;
}

.timeline-view {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    perspective: 1000px;
}

.timeline-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    height: 100%;
    align-items: center;
    padding: 0 10%;
    /* Center the first/last items better */
}

.timeline-event {
    min-width: 450px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform: scale(0.85);
    filter: blur(4px);
    opacity: 0.5;
    pointer-events: none;
}

.timeline-event.active {
    transform: scale(1.1);
    filter: blur(0);
    opacity: 1;
    pointer-events: all;
}

.event-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(255, 173, 173, 0.12);
    width: 85%;
    max-width: 400px;
    text-align: center;
    border: 1px solid #fff5f5;
    position: relative;
}

.event-date {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--pastel-red);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.event-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    color: var(--dark-red);
    margin-bottom: 1.5rem;
}

.event-desc {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

.timeline-arrow {
    background: white;
    color: var(--pastel-red);
    border: 2px solid var(--pastel-red);
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 173, 173, 0.15);
    position: absolute;
    z-index: 10;
}

.timeline-arrow:hover {
    background: var(--pastel-red);
    color: white;
    transform: scale(1.1);
}

.timeline-arrow.prev-btn {
    left: 2rem;
}

.timeline-arrow.next-btn {
    right: 2rem;
}

/* Specific background color for timeline icon */
.timeline-icon {
    background: #9bf6ff;
    /* Pastel blue */
}

.timeline-progress {
    position: relative;
    width: 60%;
    max-width: 600px;
    height: 2px;
    background: #eee;
    margin-top: 4rem;
}

.progress-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--pastel-red);
    width: 0%;
    transition: width 0.6s ease;
}

.progress-dots {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
}

.progress-dot {
    width: 12px;
    height: 12px;
    background: #eee;
    border: 2px solid white;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-dot.active {
    background: var(--pastel-red);
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(255, 173, 173, 0.5);
}

/* Responsiveness for Timeline */
@media (max-width: 768px) {
    .timeline-event {
        min-width: 85vw;
    }

    .event-card {
        padding: 2rem;
    }

    .event-title {
        font-size: 2.2rem;
    }

    .timeline-arrow {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* --- Shooting Stars Styles --- */
.shooting-stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    /* Behind all other content */
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.shooting-stars-container.hidden {
    opacity: 0;
    display: none;
}

.container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 1000px;
    z-index: 10;
}

.shooting-star {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    z-index: 9999;
    pointer-events: auto;
    cursor: pointer;
    transform-origin: center;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 2px;
    width: 60px;
    /* Shorter trail */
    height: 2px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.8), rgba(255, 117, 140, 0.4), transparent);
    transform: translateY(-50%);
    border-radius: 100px;
    filter: blur(1px);
    opacity: 0.6;
    /* Less visible trail */
}

/* Pulsing sparkle effect */
.shooting-star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, #fff 10%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: pulseSparkle 0.4s ease-in-out infinite alternate;
}

@keyframes pulseSparkle {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    to {
        transform: translate(-50%, -50%) scale(2);
        opacity: 1;
    }
}

.transition-active .shooting-star {
    box-shadow: 0 0 12px 3px #fff,
        0 0 20px 6px rgba(255, 255, 255, 0.5);
}

.transition-active .shooting-star::after {
    background: linear-gradient(to left, #fff, rgba(255, 255, 255, 0.6), transparent);
}

@keyframes shoot {
    0% {
        transform: translate(0, 0) rotate(var(--angle)) scale(0.5);
        opacity: 0;
    }

    2% {
        opacity: 1;
        transform: translate(0, 0) rotate(var(--angle)) scale(1.2);
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--dest-x), var(--dest-y)) rotate(var(--angle)) scale(0.5);
        opacity: 0;
    }
}

/* Timeline Event Images */
.event-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Image-based Puzzle Styles */
.puzzle-tile.image-tile {
    background-size: 300px 300px;
    background-repeat: no-repeat;
    font-size: 0;
}

.puzzle-tile.image-tile[data-pos="0"] {
    background-position: 0 0;
}

.puzzle-tile.image-tile[data-pos="1"] {
    background-position: -100px 0;
}

.puzzle-tile.image-tile[data-pos="2"] {
    background-position: -200px 0;
}

.puzzle-tile.image-tile[data-pos="3"] {
    background-position: 0 -100px;
}

.puzzle-tile.image-tile[data-pos="4"] {
    background-position: -100px -100px;
}

.puzzle-tile.image-tile[data-pos="5"] {
    background-position: -200px -100px;
}

.puzzle-tile.image-tile[data-pos="6"] {
    background-position: 0 -200px;
}

.puzzle-tile.image-tile[data-pos="7"] {
    background-position: -100px -200px;
}


.puzzle-tile.image-tile[data-pos="8"] {
    background-position: -200px -200px;
}

/* --- Envelopes Section --- */
.envelopes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
}

.envelope-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.envelope-item:hover {
    transform: scale(1.1);
}

.envelope {
    position: relative;
    width: 120px;
    height: 80px;
    background: #fff;
    /* This is the BACK wall */
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: visible;
}

.pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    /* This is the FRONT wall */
    z-index: 3;
    border-radius: 4px;
    border-top: 1px solid #f0f0f0;
}

.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-top: 55px solid #fff;
    /* Pure white triangle flap */
    z-index: 5;
    transform-origin: top;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
    /* When closing: Wait 0.4s for paper to slide back in, then take 0.4s to flip */
    transition: transform 0.4s ease 0.4s, z-index 0.4s ease 0.4s;
}

.envelope-item:hover .flap {
    transform: rotateX(180deg);
    z-index: 1;
    /* Moves behind everything when open */
    /* When opening: No delay, flip immediately */
    transition: transform 0.4s ease 0s, z-index 0s ease 0s;
}

.heart-seal {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 1;
    /* When closing: Wait 0.8s for paper and flap, then pop in */
    transition: opacity 0.3s ease 0.9s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.9s;
}

.envelope-item:hover .heart-seal {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0);
    /* When opening: hide instantly */
    transition: opacity 0.1s ease 0s, transform 0s ease 0s;
}

.paper {
    position: absolute;
    top: 5px;
    left: 10px;
    width: 100px;
    height: 70px;
    background: #fdfdfd;
    background-image: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 100% 10px;
    border: 1px solid #eee;
    z-index: 2;
    transition: transform 0.4s ease 0s;
}

.paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    width: 1px;
    height: 100%;
    background: rgba(255, 100, 100, 0.1);
}

.envelope-item:hover .paper {
    transform: translateY(-40px);
    /* Slides out of the pocket */
    /* When opening: flip first, then slide paper out after 0.2s */
    transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1) 0.2s;
}

.envelope-caption {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-red);
    text-align: center;
    max-width: 150px;
    /* Optional: gives text a box to wrap within if too long */
}

/* --- Locked / Coming Soon Envelopes --- */
.envelope-item.envelope-locked {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
    position: relative;
}

.envelope-item.envelope-locked:hover {
    transform: none;
}

/* Disable all hover animations on locked envelopes */
.envelope-item.envelope-locked:hover .flap {
    transform: none;
    z-index: 5;
    transition: none;
}

.envelope-item.envelope-locked:hover .heart-seal {
    opacity: 1;
    transform: translateX(-50%);
    transition: none;
}

.envelope-item.envelope-locked:hover .paper {
    transform: none;
    transition: none;
}

.envelope-item.envelope-locked .envelope-caption {
    opacity: 0.7;
    font-style: italic;
}

/* Diagonal red ribbon across the envelope */
.envelope-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

/* Main diagonal ribbon strip (bottom-left to top-right) */
.envelope-ribbon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 7px;
    background: linear-gradient(180deg,
            #8b0000 0%,
            #cd2e2e 20%,
            #e84444 45%,
            #ff6b6b 50%,
            #e84444 55%,
            #cd2e2e 80%,
            #8b0000 100%);
    transform: translate(-50%, -50%) rotate(-35deg);
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 1px;
}


/* --- Notepad Component --- */
.notepad-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.notepad-scroll-area {
    background: #fff1f2;
    /* Soft pink-white */
    width: 95%;
    max-width: 1000px;
    height: 85vh;
    border-radius: 12px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.notepad-page-content {
    width: 100%;
    min-height: 100%;
    position: relative;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
}

.notepad-page-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 40px;
    width: 2px;
    height: 100%;
    background: rgba(255, 100, 100, 0.2);
    pointer-events: none;
    z-index: 60;
}

.notepad-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--pastel-red);
    flex-shrink: 0;
}

.notepad-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: var(--dark-red);
    margin-bottom: 0.5rem;
    padding-left: 3rem;
    /* Move title to the right */
}

.admin-heart-lock {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.admin-heart-lock:hover {
    transform: scale(1.2);
    opacity: 1;
}

.notepad-textarea:read-only {
    cursor: default;
}

.notepad-textarea:not(:read-only),
.notepad-title[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    outline: none;
    cursor: text;
}

.notepad-title[contenteditable="true"]:focus {
    box-shadow: 0 0 0 2px var(--pastel-red);
}

.notepad-lines {
    width: 100%;
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.notepad-textarea {
    width: 100%;
    flex: 1;
    min-height: 200px;
    background: transparent;
    background-image: linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 100% 30px;
    /* Line height */
    border: none;
    outline: none;
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    line-height: 30px;
    /* Match background-size */
    color: #444;
    padding-left: 45px;
    padding-right: 15px;
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.notepad-scroll-area::-webkit-scrollbar {
    width: 8px;
}

.notepad-scroll-area::-webkit-scrollbar-thumb {
    background: var(--pastel-red);
    border-radius: 4px;
}

/* --- Post-it Note Styles --- */
.post-it-note {
    position: fixed;
    width: 220px;
    height: 220px;
    background: #ffc2d1;
    /* Soft pink */
    background: linear-gradient(135deg, #ffe5ec 0%, #ffc2d1 100%);
    padding: 2.2rem 1.5rem 1.5rem;
    box-shadow: 2px 10px 20px rgba(0, 0, 0, 0.15), inset 0 0 10px rgba(0, 0, 0, 0.02);
    z-index: 3000;
    font-family: 'Dancing Script', cursive;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    border-radius: 2px;
    transform-origin: top center;
    animation: stickyPop 5s ease-in-out forwards;
    pointer-events: none;
    border-bottom-right-radius: 60px 5px;
    /* Slight curl effect */
}

/* Red "Tape" at the top */
.post-it-note::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 60px;
    height: 25px;
    background: rgba(255, 107, 107, 0.4);
    backdrop-filter: blur(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.post-it-note span.title {
    font-size: 1.2rem;
    color: var(--dark-red);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
    padding-bottom: 3px;
    letter-spacing: 1px;
}

.post-it-note strong.number {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
}

.post-it-note .reason-text {
    font-size: 1.4rem;
    line-height: 1.2;
    color: #222;
}

@keyframes stickyPop {
    0% {
        transform: scale(0) rotate(-15deg);
        opacity: 0;
    }

    10% {
        transform: scale(1.1) rotate(5deg);
        opacity: 1;
    }

    15% {
        transform: scale(1) rotate(2deg);
        opacity: 1;
    }

    80% {
        opacity: 1;
        transform: scale(1) rotate(2deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.8) translateY(20px) rotate(5deg);
    }
}

/* --- Form Text Box Feature --- */
.add-note-btn {
    display: none;
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    background: linear-gradient(135deg, #ff8fa3, #ff6b81);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-family: 'Dancing Script', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 129, 0.4);
    z-index: 1500;
    transition: all 0.3s ease;
    opacity: 0.9;
}

/* Only show in admin mode */
#personal-note-overlay.admin-mode .add-note-btn {
    display: block;
}

.add-note-btn:hover {
    transform: scale(1.05);
    opacity: 1;
    box-shadow: 0 6px 20px rgba(255, 107, 129, 0.5);
}

/* Form box on the notepad */
.ana-form-box {
    position: absolute;
    width: 200px;
    background: white;
    border: 2px solid #ffccd5;
    border-radius: 14px;
    padding: 12px 14px;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(255, 143, 163, 0.15);
    transition: box-shadow 0.2s ease;
}

.ana-form-box.admin-draggable {
    cursor: grab;
    border: 2px dashed #ff8fa3;
}

.ana-form-box.admin-draggable:active {
    cursor: grabbing;
    box-shadow: 0 8px 25px rgba(255, 143, 163, 0.3);
}

.form-box-label {
    font-family: 'Dancing Script', cursive;
    font-size: 0.95rem;
    color: #ff6b81;
    margin-bottom: 8px;
    font-weight: bold;
    outline: none;
    min-height: 1.2em;
}

.form-box-label:empty::before {
    content: 'Add a prompt...';
    color: #ddd;
    font-style: italic;
}

.form-box-input {
    width: 100%;
    min-height: 50px;
    border: 1.5px solid #ffe0e6;
    border-radius: 10px;
    padding: 8px 10px;
    font-family: 'Dancing Script', cursive;
    font-size: 1rem;
    color: #333;
    background: #fff5f7;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-box-input:focus {
    border-color: #ff8fa3;
    background: #fff;
}

.form-box-input::placeholder {
    color: #ccc;
    font-style: italic;
}

.form-box-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ana-form-box:hover .form-box-delete {
    display: flex;
}

/* Messages inbox button on envelope screen */
.messages-inbox-btn {
    display: none;
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8fa3, #ff6b81);
    color: white;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 107, 129, 0.5);
    z-index: 20;
    transition: all 0.3s ease;
    animation: inboxPulse 2s infinite;
}

.messages-inbox-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 107, 129, 0.6);
}

#surprises-menu.admin-mode .messages-inbox-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.messages-inbox-btn .msg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #ff3366;
    border-radius: 50%;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

@keyframes inboxPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 107, 129, 0.5);
    }

    50% {
        box-shadow: 0 4px 30px rgba(255, 107, 129, 0.8);
    }
}

.messages-panel {
    display: none;
    position: absolute;
    bottom: 5rem;
    right: 1.5rem;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 25;
    overflow: hidden;
}

.messages-panel.active {
    display: block;
}

.messages-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, #ff8fa3, #ff6b81);
    color: white;
}

.messages-panel-header h4 {
    margin: 0;
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem;
}

.messages-panel-header .header-btns {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-messages-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}

.clear-messages-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.messages-panel-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.messages-panel-close:hover {
    opacity: 1;
}

.messages-panel-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
}

.message-item {
    background: linear-gradient(135deg, #fff5f7 0%, #ffe8ed 100%);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 8px;
    font-family: 'Dancing Script', cursive;
    font-size: 1.05rem;
    color: #444;
    border-left: 3px solid #ff8fa3;
}

.message-item .msg-envelope {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message-item .msg-prompt {
    font-size: 0.85rem;
    color: #ff6b81;
    font-weight: bold;
    margin-bottom: 4px;
}

.message-item .msg-response {
    font-size: 1.1rem;
    color: #333;
}

.messages-panel-list::-webkit-scrollbar {
    width: 5px;
}

.messages-panel-list::-webkit-scrollbar-thumb {
    background: #ffccd5;
    border-radius: 10px;
}

.no-messages {
    text-align: center;
    padding: 30px 15px;
    color: #ccc;
    font-family: 'Dancing Script', cursive;
    font-size: 1.1rem;
}

/* --- Scrapbook Sidebar & Elements --- */
.scrapbook-sidebar {
    position: absolute;
    left: 2rem;
    top: 6rem;
    width: 220px;
    height: 70vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateX(-300px);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1500;
    pointer-events: auto;
}

.scrapbook-sidebar.active {
    transform: translateX(0);
}

.sidebar-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: var(--dark-red);
    text-align: center;
    border-bottom: 1px solid var(--pastel-red);
    padding-bottom: 0.5rem;
}

.sidebar-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-y: auto;
    padding-right: 5px;
}

.sidebar-images-grid::-webkit-scrollbar {
    width: 4px;
}

.sidebar-images-grid::-webkit-scrollbar-thumb {
    background: var(--pastel-red);
    border-radius: 4px;
}

.sidebar-img-item {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.sidebar-img-item:hover {
    transform: scale(1.05);
    border-color: var(--pastel-red);
}

.sidebar-toggle {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--pastel-red);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 173, 173, 0.4);
    display: none;
    /* Only show in admin mode */
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: all 0.3s ease;
}

.sidebar-toggle.visible {
    display: flex;
}

.sidebar-toggle:hover {
    background: var(--dark-red);
    transform: scale(1.1);
}

.scrapbook-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.scrapbook-item {
    position: absolute;
    min-width: 50px;
    min-height: 50px;
    pointer-events: auto;
    user-select: none;
}

.admin-mode .scrapbook-item {
    cursor: move;
}

.scrapbook-item img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

/* Handles for resizing and rotating (Only in admin mode) */
.scrapbook-item .handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--pastel-red);
    border-radius: 50%;
    display: none;
}

.scrapbook-item.selected .handle {
    display: block;
}

.scrapbook-item .resizer {
    right: -6px;
    bottom: -6px;
    cursor: nwse-resize;
}

.scrapbook-item .rotator {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
}

.scrapbook-item .rotator::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 2px;
    height: 10px;
    background: var(--pastel-red);
    transform: translateX(-50%);
}

.scrapbook-item .delete-btn,
.scrapbook-item .lock-btn {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--dark-red);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    pointer-events: auto;
}

.scrapbook-item .delete-btn {
    top: -10px;
    right: -10px;
}

.scrapbook-item .lock-btn {
    top: -10px;
    left: -10px;
    background: #444;
}

.admin-mode .scrapbook-item.selected .delete-btn,
.admin-mode .scrapbook-item.selected .lock-btn,
.admin-mode .scrapbook-item.locked .lock-btn {
    display: flex;
}

.scrapbook-item.locked {
    pointer-events: none;
}

.scrapbook-item.locked img {
    opacity: 1;
}

.scrapbook-item.locked .handle {
    display: none !important;
}

.scrapbook-item.locked .lock-btn {
    opacity: 0.3;
}

.admin-mode .scrapbook-item.locked .lock-btn:hover {
    opacity: 1;
}

/* Hide admin icons globally when not in admin mode */
#personal-note-overlay:not(.admin-mode) .delete-btn,
#personal-note-overlay:not(.admin-mode) .lock-btn,
#personal-note-overlay:not(.admin-mode) .handle {
    display: none !important;
}

/* --- Memory Game Styles --- */
.memory-icon {
    background: var(--pastel-red);
}

#memory-difficulty-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#memory-difficulty-screen.active {
    display: flex;
}

.difficulty-buttons {
    display: flex;
    gap: 2rem;
}

.difficulty-btn {
    padding: 2rem 3rem;
    font-size: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: white;
    background: var(--pastel-red);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 20px rgba(255, 173, 173, 0.3);
    text-align: center;
    line-height: 1.4;
}

.difficulty-btn:hover {
    transform: translateY(-5px);
    background: var(--dark-red);
    box-shadow: 0 15px 25px rgba(255, 173, 173, 0.4);
}

/* --- Memory Game 3D Room Styles --- */
#memory-game-overlay {
    background: #e0e0e0;
    overflow: hidden;
    perspective: 1200px;
}

/* Remove old pseudo-elements */
#memory-game-overlay::before,
#memory-game-overlay::after {
    display: none;
}

.room-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.room-wall {
    position: absolute;
    top: 0;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.1);
}

.room-wall.back {
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, #fdfbf7 0%, #eceae6 100%);
    z-index: 1;
}

.room-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25%;
    background: #d7ccc8;
    background-image: repeating-linear-gradient(90deg, transparent 0, transparent 40px, rgba(0, 0, 0, 0.05) 41px, transparent 42px);
    transform-origin: bottom;
    z-index: 1;
    box-shadow: inset 0 20px 50px rgba(0, 0, 0, 0.2);
}

#memory-difficulty-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Above background */
    position: relative;
}

#memory-difficulty-screen.active {
    display: flex;
}

/* Ensure back btn and title are above the game screens */
#memory-game-overlay>.back-btn,
#memory-game-overlay>h3 {
    z-index: 20;
}

#memory-game-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    padding-bottom: 0;
    background: transparent;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s ease;
    z-index: 10;
    /* Above background */
}

/* Add Wall texture/lighting */
/* Remove old pseudo-elements on screen if they exist */

#memory-game-screen.zoom-out {
    transform: scale(0.5);
    opacity: 0;
}

/* Timer Bar */
.timer-bar-container {
    width: 80%;
    max-width: 600px;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.timer-bar {
    width: 100%;
    height: 100%;
    background: var(--dark-red);
    transform-origin: left;
    transform: scaleX(1);
    transition: transform linear;
}

#memory-message {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    /* Larger text */
    font-weight: 700;
    text-transform: lowercase;
    /* Match hearts style */
    color: var(--dark-red);
    margin-top: 1rem;
    z-index: 5;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    position: absolute;
    /* Float above or centered */
    top: 5rem;
    /* Consistently at top */
}

/* Shelves */
/* Shelves */
/* Shelves */
.shelves-container {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    /* Increased spacing */
    perspective: 800px;
    z-index: 2;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-top: -5vh;
    flex-grow: 1;
}

.shelf {
    position: relative;
    width: 600px;
    /* Smaller width to reduce clutter */
    height: 18px;
    background: #8b5a2b;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
}

/* Visual 3D top of shelf */
.shelf::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #a06b39, #8b5a2b);
    transform-origin: top;
    transform: rotateX(0deg);
    /* Just a flat bar for now as we view from front, maybe add depth later if needed */
    border-radius: 4px;
}

/* Shadow underneath */
.shelf::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    height: 15px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
}

.shelf-slot {
    width: 100px;
    height: 100px;
    bottom: 20px;
    /* Sit ON TOP of shelf */
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shelf-slot.drag-over {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Images */
.memory-game-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: grab;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
    border: 3px solid white;
}

.memory-game-img:active {
    cursor: grabbing;
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.memory-game-img.placed {
    opacity: 1;
}

.memory-game-img.correct {
    border-color: #4CAF50;
    /* Green */
    box-shadow: 0 0 15px #4CAF50;
}

.memory-game-img.incorrect {
    border-color: #F44336;
    /* Red */
    box-shadow: 0 0 15px #F44336;
}

/* Bottom Tray */
/* Bottom Tray */
/* Bottom Tray - Floor Area */
/* Bottom Tray - Floor Area */
.collection-tray-container {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    /* Stack button ON TOP of images */
    align-items: center;
    background: transparent;
    backdrop-filter: none;
    padding: 1rem;
    border-top: none;
    position: absolute;
    bottom: 0;
    left: 0;
    height: auto;
    min-height: 160px;
    transition: transform 0.3s ease;
    z-index: 10;
    gap: 15px;
    /* Space between button and images */
}

.collection-tray-container.hidden {
    transform: translateY(100%);
}

.collection-tray {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    min-height: 110px;
    padding: 10px;
    background: transparent;
    /* Transparent */
    border-radius: 0;
    border: none;
    /* No border */
    overflow-y: visible;
    /* Allow pop-out */
}

.action-btn {
    padding: 10px 25px;
    background: var(--dark-red);
    color: white;
    border: none;
    border-radius: 20px;
    font-family: 'Montserrat';
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Check Order button positioned above tray */
#memory-check-btn {
    position: absolute;
    bottom: 180px;
    /* Sit above the tray area */
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
}

/* Stopwatch */
.memory-stopwatch {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--dark-red);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 8px 18px;
    border-radius: 30px;
    z-index: 15;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 173, 173, 0.4);
}

/* Info Button */
.memory-info-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    z-index: 20;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark-red);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 8px 18px;
    border-radius: 30px;
    border: 2px solid rgba(255, 173, 173, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.memory-info-btn:hover {
    background: var(--pastel-red);
    color: white;
    transform: scale(1.05);
}

/* Info Panel */
.memory-info-panel {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2rem;
    z-index: 200;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 173, 173, 0.3);
}

.memory-info-panel.active {
    display: block;
}

.memory-info-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.memory-info-close:hover {
    color: var(--dark-red);
}

.memory-stats-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 173, 173, 0.1), rgba(255, 214, 214, 0.2));
    border-radius: 15px;
    padding: 1.2rem;
    border: 1px solid rgba(255, 173, 173, 0.2);
}

.stat-emoji {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.3rem;
}

.stat-card h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark-red);
    margin-bottom: 0.4rem;
}

.stat-card p {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

/* Door Animation Overlay */
.door-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 300;
    pointer-events: none;
    display: flex;
}

.door-panel {
    width: 50%;
    height: 100%;
    background: #5d4037;
    /* Dark wood color */
    position: relative;
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%236d4c41' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.door-panel.left {
    transform: translateX(-100%);
    border-right: 5px solid #3e2723;
}

.door-panel.right {
    transform: translateX(100%);
    border-left: 5px solid #3e2723;
}

/* Panels active state (Closed) */
.door-overlay.doors-closed .door-panel.left {
    transform: translateX(0);
}

.door-overlay.doors-closed .door-panel.right {
    transform: translateX(0);
}

.door-overlay.doors-closed {
    pointer-events: auto;
    /* Block input while closed */
}

/* Door Details */
.door-panel-inner {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 60%;
    height: 30%;
    border: 3px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset 2px 2px 10px rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.1);
}

.door-panel-inner.bottom {
    top: 55%;
}

.door-knob {
    position: absolute;
    top: 50%;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
    /* Gold */
    border-radius: 50%;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
}

.door-panel.left .door-knob {
    right: 20px;
}

.door-panel.right .door-knob {
    left: 20px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .shelf {
        width: 95%;
    }

    .shelf-slot {
        width: 60px;
        height: 60px;
    }

    .memory-game-img {
        width: 60px;
        height: 60px;
    }

    .collection-tray-container {
        height: 180px;
    }
}