/* Tailwind Config via CSS Strategy */
@layer base {
    @keyframes fade-out {
        from {
            opacity: 1;
        }

        to {
            opacity: 0;
        }
    }

    .animate-fade-out {
        animation: fade-out 1s forwards;
    }

    :root {
        --paper-texture: url('assets/textures/natural-paper.png');
        --cardboard-texture: url('assets/textures/cardboard-flat.png');

        /* Theme Variables from data.js will override these */
        --primary-accent: #b33939;
        --secondary-accent: #c2a382;
        --paper-bg: #fdfaf1;
        --text-main: #2d2926;
        --tissue-texture: url('assets/textures/pinstriped-suit.png');
        --noise-texture: url('assets/textures/stardust.png');
        --plastic-texture: url('assets/textures/white-diamond.png');
    }

    body {
        background-color: var(--paper-bg);
        background-image: var(--paper-texture);
        color: var(--text-main);
    }

    /* Custom Premium Scrollbar */
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: var(--paper-bg);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--secondary-accent);
        border-radius: 10px;
        border: 2px solid var(--paper-bg);
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-accent);
    }

    #preloader {
        transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

@layer components {
    .cardboard-box {
        background-color: #c2a382;
        background-image: var(--cardboard-texture);
        box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.1), inset -5px -5px 15px rgba(0, 0, 0, 0.1);
    }

    .paper-note {
        background-color: #fff;
        background-image: var(--paper-texture);
        box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.05);
        transform: rotate(-1deg);
    }

    .post-it {
        box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s;
    }

    .vintage-stamp {
        background-color: var(--primary-accent);
        mask-image: url('assets/textures/stardust.png');
        clip-path: polygon(0% 5%, 5% 0%, 10% 5%, 15% 0%, 20% 5%, 25% 0%, 30% 5%, 35% 0%, 40% 5%, 45% 0%, 50% 5%, 55% 0%, 60% 5%, 65% 0%, 70% 5%, 75% 0%, 80% 5%, 85% 0%, 90% 5%, 95% 0%, 100% 5%,
                100% 95%, 95% 100%, 90% 95%, 85% 100%, 80% 95%, 75% 100%, 70% 95%, 65% 100%, 60% 95%, 55% 100%, 50% 95%, 45% 100%, 40% 95%, 35% 100%, 30% 95%, 25% 100%, 20% 95%, 15% 100%, 10% 95%, 5% 100%, 0% 95%);
    }

    .ribbon-texture {
        background: repeating-linear-gradient(45deg,
                var(--primary-accent),
                var(--primary-accent) 10px,
                #a03232 10px,
                #a03232 20px);
    }

    .handwritten-underline {
        border-bottom: 2px solid #2d2926;
        border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    }

    /* Shake Animation */
    @keyframes shake {

        0%,
        100% {
            transform: rotate(0deg);
        }

        25% {
            transform: rotate(2deg) translateX(2px);
        }

        50% {
            transform: rotate(-2deg) translateX(-2px);
        }

        75% {
            transform: rotate(1deg) translateX(1px);
        }
    }

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

    /* Page 2: The Atelier Redesign */
    .inside-box-container {
        perspective: 1000px;
        background-color: #e6dec1;
        background-image:
            radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%),
            url('assets/textures/pinstriped-suit.png');
    }

    /* Desk Theme - Can be toggled on/off */
    .inside-box-container.desk-theme {
        background-image:
            radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.2) 100%),
            url('assets/desk_bg.png');
        background-size: cover;
        background-attachment: fixed;
        /* Makes the table stay static while content moves */
        background-position: center;
        background-repeat: no-repeat;
    }

    .inside-box-container.desk-theme .silk-tissue {
        opacity: 0.3;
        /* Subtle overlay so the wood shows through */
    }

    .silk-tissue {
        position: absolute;
        inset: -10%;
        background-image:
            radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
            url('assets/textures/paper-fibers.png');
        background-color: #e8e4d8;
        transform: rotate(-2deg) skewX(2deg);
        box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.2), 30px 30px 60px rgba(0, 0, 0, 0.3);
        opacity: 0.9;
        pointer-events: none;
        z-index: 1;
        clip-path: polygon(0% 5%, 15% 0%, 35% 8%, 55% 2%, 75% 10%, 100% 5%, 95% 45%, 100% 85%, 85% 100%, 55% 95%, 25% 100%, 0% 90%, 5% 50%);
    }

    .premium-letter {
        position: relative;
        z-index: 10;
        background-color: #fcfaf5;
        background-image: url('assets/textures/handmade-paper.png');
        padding: 4rem;
        width: 100%;
        max-width: 580px;
        min-height: 550px;
        transform: rotateX(5deg) rotateY(-5deg) rotateZ(1deg);
        box-shadow:
            2px 2px 0px #d4af37,
            15px 15px 40px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(0, 0, 0, 0.05);
        border: 20px solid transparent;
        border-image: url('assets/textures/stardust.png') 30 stretch;
        background-clip: padding-box;
    }

    .gold-border {
        position: absolute;
        inset: 15px;
        border: 1px solid #d4af37;
        pointer-events: none;
        opacity: 0.5;
    }

    .wax-seal-premium {
        width: 80px;
        height: 80px;
        background: radial-gradient(circle at 30% 30%, #cd4545, #8a2020);
        border-radius: 50% 48% 52% 49% / 51% 52% 48% 49%;
        position: absolute;
        bottom: -40px;
        left: 50%;
        transform: translateX(-50%) rotate(-5deg);
        box-shadow: 3px 5px 15px rgba(0, 0, 0, 0.3), inset -2px -2px 5px rgba(0, 0, 0, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 20;
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .wax-seal-premium:hover {
        transform: translateX(-50%) rotate(0deg) scale(1.1);
    }

    .wax-seal-premium span {
        font-size: 2rem;
        color: rgba(0, 0, 0, 0.2);
        text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.1);
    }


    .paper-confetti {
        position: absolute;
        pointer-events: none;
        animation: paperFall linear forwards;
    }

    @keyframes paperFall {
        0% {
            transform: translateY(-10vh) rotate(0deg) scale(1);
            opacity: 1;
        }

        100% {
            transform: translateY(110vh) rotate(720deg) scale(0.5);
            opacity: 0;
        }
    }

    /* Box Opening Animation */
    .box-lid {
        position: absolute;
        inset: -2px;
        background-color: #c2a382;
        background-image: var(--cardboard-texture);
        border: 2px border-cardboard-dark/30;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    }

    .lid-open-animation {
        animation: lidFlyOff 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    @keyframes lidFlyOff {
        0% {
            transform: translateZ(0) translateY(0) rotateX(0);
            opacity: 1;
        }

        30% {
            transform: translateZ(100px) translateY(-20px) rotateX(-10deg);
            opacity: 1;
        }

        100% {
            transform: translateZ(500px) translateY(-1000px) rotateX(-90deg);
            opacity: 0;
        }
    }

    .content-reveal {
        animation: contentScaleUp 1s ease-out forwards;
        opacity: 0;
    }

    @keyframes contentScaleUp {
        from {
            transform: scale(0.8);
            opacity: 0;
        }

        to {
            transform: scale(1);
            opacity: 1;
        }
    }
}

/* Tailwind Customization */
/* Tailwind Config handled by CDN in index.html */
/* @tailwind base; */
/* @tailwind components; */
/* @tailwind utilities; */

@layer utilities {
    .font-handwritten {
        font-family: "Shadows Into Light", cursive;
    }

    .font-marker {
        font-family: "Caveat", cursive;
    }

    .font-inter {
        font-family: "Inter", sans-serif;
    }

    .text-vintage-ink {
        color: #2d2926;
    }

    .bg-ribbon-red {
        background-color: #b33939;
    }

    .custom-input {
        caret-color: #2d2926;
    }

    .custom-input:focus {
        outline: none;
    }

    /* Page 3: Lifetime Receipt */
    .crumpled-effect {
        position: fixed;
        inset: 0;
        opacity: 0.15;
        pointer-events: none;
        background-image: url('https://lh3.googleusercontent.com/aida-public/AB6AXuDNVMYV6iw1_AueVoRDSNG_LabHkbwfF9bn8HLaTsTYQ8MAR_zJLssnfr76vGh2QjWX6ycWOn-TK8MTKHfwNcuDcivNdu-7bGHwXYnm0NCTTSUMdlS3M3D4seDJO8yZJxeL7ZedSNe-ttADqNDa63LaK8PikhVIkYC47UJvHP3OCnIp89SfI4LbHTsiFVK5hWQEfOVr3tbCBCZmJDEu7l5is5Hou4A3D_VpGuyEZMGP7MWe-x5OPFf56jXWNqFDRZVBkR9AZ_8ov0dc');
    }

    .receipt-container {
        background-color: #f4f1ea;
        background-image: var(--noise-texture);
        mask-image: linear-gradient(to bottom, black calc(100% - 15px), transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 15px), transparent 100%);
    }

    .jagged-edge {
        background: #f4f1ea;
        height: 12px;
        width: 100%;
        position: absolute;
        left: 0;
        background-image: radial-gradient(circle, transparent 70%, #f4f1ea 75%);
        background-size: 16px 24px;
    }

    .jagged-top {
        top: -6px;
        background-position: 0 -12px;
    }

    .jagged-bottom {
        bottom: -6px;
        background-position: 0 0;
    }

    .printer-body {
        background-color: #e5e1d8;
        background-image: var(--plastic-texture);
        box-shadow:
            inset -3px -3px 8px rgba(0, 0, 0, 0.2),
            inset 3px 3px 8px rgba(255, 255, 255, 0.9),
            0 25px 50px -12px rgba(0, 0, 0, 0.25);
        z-index: 50;
    }

    .printer-slot-inner {
        background: #1a1a1a;
        box-shadow: inset 0 8px 15px rgba(0, 0, 0, 0.9);
        border-top: 2px solid #333;
    }

    .receipt-paper-roll {
        transform-origin: top center;
        transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .receipt-container {
        background-color: #f4f1ea;
        background-image:
            linear-gradient(rgba(0, 0, 0, 0.01) 1px, transparent 1px),
            var(--noise-texture);
        background-size: 100% 3px, auto;
        border-left: 1px solid rgba(0, 0, 0, 0.05);
        border-right: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.1),
            inset 0 30px 30px -30px rgba(0, 0, 0, 0.6);
    }

    @keyframes printerShake {

        0%,
        100% {
            transform: translateY(0);
        }

        25% {
            transform: translateY(0.5px) translateX(0.2px);
        }

        50% {
            transform: translateY(-0.5px);
        }

        75% {
            transform: translateY(0.3px) translateX(-0.2px);
        }
    }

    .printer-vibrating {
        animation: printerShake 0.08s infinite;
    }

    @keyframes thermalFade {
        from {
            opacity: 0;
            filter: blur(4px);
            transform: translateY(-5px) scaleX(0.95);
        }

        to {
            opacity: 1;
            filter: blur(0);
            transform: translateY(0) scaleX(1);
        }
    }

    .thermal-line-fade {
        animation: thermalFade 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .barcode-line {
        display: inline-block;
        height: 40px;
        background-color: #2d2926;
    }

    /* Animations */
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .animate-fade-in-down {
        animation: fadeInDown 0.5s ease-out forwards;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .animate-fade-in {
        animation: fadeIn 1s ease-out forwards;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .animate-fade-in-up {
        animation: fadeInUp 0.8s ease-out forwards;
    }

    @keyframes polaroidFall {
        0% {
            transform: translateY(-120vh) rotate(45deg) scale(2.5);
            opacity: 0;
            filter: blur(15px);
        }

        60% {
            /* Drifting phase: Card starts to settle and clear up */
            transform: translateY(20vh) rotate(calc(var(--card-rot) * 2)) scale(1.2) translateX(30px);
            opacity: 1;
            filter: blur(0);
        }

        85% {
            /* The hit: Reaching the board */
            transform: translateY(0) rotate(var(--card-rot)) scale(1);
        }

        92% {
            /* Small bounce up */
            transform: translateY(-20px) rotate(calc(var(--card-rot) * 0.8)) scale(1.02);
        }

        100% {
            /* Final settlement */
            transform: translateY(0) rotate(var(--card-rot)) translate(var(--card-x), var(--card-y)) scale(1);
            opacity: 1;
        }
    }

    .animate-polaroid-fall {
        animation: polaroidFall 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    /* Page 4: Polaroid Styles */
    .polaroid-stack-container {
        perspective: 1000px;

    }

    .polaroid-frame {
        background-color: #f0e6d2;
        /* Aged Paper / Old Lace */
        background-image: var(--paper-texture);
        padding: 15px 15px 50px 15px;
        box-shadow:
            2px 3px 15px rgba(0, 0, 0, 0.2),
            /* Drop shadow */
            inset 0 0 40px rgba(88, 70, 50, 0.2);
        /* Aging vignette */
        border: 1px solid rgba(0, 0, 0, 0.1);
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
        user-select: none;
        cursor: pointer;
        position: relative;
    }

    /* Sketchy Tape Effect */
    .polaroid-frame::before {
        content: '';
        position: absolute;
        top: -15px;
        left: 50%;
        transform: translateX(-50%) rotate(-2deg);
        width: 80px;
        height: 25px;
        background-color: rgba(245, 235, 210, 0.85);
        /* Masking tape color */
        background-image: url('assets/textures/washi.png');
        opacity: 0.9;
        z-index: 10;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
        clip-path: polygon(2% 5%, 98% 0%, 100% 95%, 0% 100%,
                1% 20%, 99% 22%, 2% 80%, 98% 78%
                /* Irregular edges */
            );
        backdrop-filter: blur(1px);
    }

    /* Stronger inner aging / burnt edge overlay */
    .polaroid-frame::after {
        content: '';
        position: absolute;
        inset: 0;
        box-shadow: inset 0 0 60px rgba(105, 80, 50, 0.15);
        pointer-events: none;
    }

    .polaroid-frame:hover {
        box-shadow:
            0 20px 50px rgba(0, 0, 0, 0.25),
            inset 0 0 40px rgba(88, 70, 50, 0.2);
        z-index: 50;
    }

    /* Apply the lift effect to the whole flip card container instead */
    .polaroid-flip-card {
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .polaroid-flip-card:hover {
        transform: rotate(var(--card-rot)) translate(var(--card-x), var(--card-y)) scale(1.05) translateY(-10px) !important;
        z-index: 100;
    }

    /* Ensure the flipped state still works during hover */
    .polaroid-flip-card.is-flipped:hover {
        transform: rotate(var(--card-rot)) translate(var(--card-x), var(--card-y)) scale(1.05) translateY(-10px) !important;
    }

    .memory-photo {
        width: 100%;
        aspect-ratio: 1/1;
        object-fit: cover;
        background-color: #eee;
        border: 1px solid rgba(0, 0, 0, 0.1);
        /* Slight sepia to match the frame */
        filter: contrast(1.1) sepia(0.1);
    }

    /* --- Scrapbook Board --- */
    .scrapbook-board {
        background-color: #c4a484;
        /* Kraft paper color */
        background-image:
            var(--cardboard-texture),
            linear-gradient(45deg, rgba(0, 0, 0, 0.02) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.02) 50%, rgba(0, 0, 0, 0.02) 75%, transparent 75%, transparent);
        background-size: auto, 100px 100px;
        position: relative;
        padding: 3rem;
        box-shadow:
            0 30px 60px rgba(0, 0, 0, 0.2),
            inset 0 0 100px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(0, 0, 0, 0.1);
        /* Torn edges effect */
        clip-path: polygon(0% 2%, 5% 0%, 12% 3%, 18% 1%, 25% 4%, 35% 0%, 45% 3%, 55% 1%, 65% 5%, 75% 1%, 85% 4%, 95% 0%, 100% 3%,
                100% 25%, 98% 35%, 100% 45%, 97% 55%, 100% 65%, 98% 75%, 100% 85%, 98% 95%, 100% 100%,
                85% 98%, 75% 100%, 65% 97%, 55% 100%, 45% 96%, 35% 100%, 25% 97%, 15% 100%, 5% 98%, 0% 100%,
                2% 85%, 0% 75%, 3% 65%, 1% 55%, 4% 45%, 0% 35%, 2% 25%, 0% 15%);
    }

    .washi-tape-custom {
        position: absolute;
        width: 90px;
        height: 30px;
        background-color: var(--tape-color, rgba(179, 57, 57, 0.4));
        /* Semi-transparent ribbon-red */
        background-image: url('assets/textures/washi.png');
        backdrop-filter: blur(1px);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        z-index: 60;
        pointer-events: none;
        /* Hand-torn ends */
        clip-path: polygon(5% 0%, 95% 0%, 100% 15%, 95% 30%, 100% 45%, 96% 60%, 100% 85%, 95% 100%,
                5% 100%, 0% 85%, 4% 70%, 0% 50%, 3% 30%, 0% 15%);
    }

    .washi-top-left {
        top: -15px;
        left: -20px;
        transform: rotate(-35deg);
    }

    .washi-top-right {
        top: -15px;
        right: -20px;
        transform: rotate(35deg);
    }

    .washi-bottom-right {
        bottom: -10px;
        right: -20px;
        transform: rotate(-15deg);
    }

    /* --- Flip Card Styles --- */
    .polaroid-flip-card {
        background-color: transparent;
        perspective: 1000px;
        cursor: pointer;
    }

    .polaroid-inner {
        position: relative;
        width: 100%;
        height: 100%;
        text-align: center;
        transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        transform-style: preserve-3d;
    }

    .polaroid-flip-card.is-flipped .polaroid-inner {
        transform: rotateY(180deg);
    }

    .polaroid-front,
    .polaroid-back {
        position: absolute;
        width: 100%;
        height: 100%;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        top: 0;
        left: 0;
    }

    .polaroid-back {
        transform: rotateY(180deg);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2.5rem 1.5rem;
    }

    .polaroid-back .scribble-note {
        font-family: "Shadows Into Light", cursive;
        color: #1a365d;
        /* Faded blue ink look */
        line-height: 1.6;
        transform: rotate(-1deg);
    }

    .back-seal {
        position: absolute;
        bottom: 1.5rem;
        right: 1.5rem;
        opacity: 0.1;
        font-size: 2rem;
        user-select: none;
    }

    .flip-hint {
        position: absolute;
        bottom: 12px;
        left: 15px;
        font-size: 9px;
        color: rgba(0, 0, 0, 0.5);
        font-weight: 800;
        font-family: "Inter", sans-serif;
        text-transform: uppercase;
        letter-spacing: 1.2px;
    }



    .handwritten {
        font-family: 'Caveat', cursive;
        color: #333;
    }

    .polaroid-date {
        font-family: 'Shadows Into Light', cursive;
        font-size: 0.8rem;
        color: #999;
    }

    @keyframes scatterIn {
        0% {
            opacity: 0;
            transform: scale(0.5) translateY(100px) rotate(20deg);
        }

        100% {
            opacity: 1;
            transform: scale(1) translateY(0) rotate(var(--rot));
        }
    }

    .animate-scatter {
        animation: scatterIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    /* Page 5: Newspaper Styles */
    .newspaper-paper {
        background-color: #f1ebd5;
        background-image: url('assets/textures/paper-fibers.png');
        background-size: auto;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(0, 0, 0, 0.1);
        color: #2b2b2b;
    }

    .newspaper-main-photo {
        width: 100%;
        max-width: 400px;
        height: auto;
        max-height: 300px;
        object-fit: cover;
        filter: grayscale(100%) contrast(1.2) sepia(0.3) brightness(0.9);
        mix-blend-mode: multiply;
        border: 2px solid #222;
        margin-bottom: 2rem;
        display: block;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .newspaper-headline {
        font-family: 'Playfair Display', serif;
        font-weight: 900;
        text-transform: uppercase;
        border-top: 4px solid #000;
        border-bottom: 2px solid #000;
        line-height: 0.9;
    }

    .news-column {
        column-count: 1;
        column-gap: 2rem;
        column-rule: 1px solid rgba(0, 0, 0, 0.1);
    }

    @media (min-width: 768px) {
        .news-column-split {
            column-count: 2;
        }
    }

    .paper-thud {
        animation: paperThud 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    }

    @keyframes paperThud {
        0% {
            transform: scale(3) rotate(-15deg);
            filter: blur(20px);
            opacity: 0;
        }

        70% {
            transform: scale(0.95) rotate(2deg);
            filter: blur(0);
            opacity: 1;
        }

        100% {
            transform: scale(1) rotate(0deg);
            filter: blur(0);
            opacity: 1;
        }
    }

    @media (min-width: 768px) {
        @keyframes paperThud {
            0% {
                transform: scale(3) rotate(-15deg);
                filter: blur(20px);
                opacity: 0;
            }

            70% {
                transform: scale(0.95) rotate(2deg);
                filter: blur(0);
                opacity: 1;
            }

            100% {
                transform: scale(1) rotate(1deg);
                filter: blur(0);
                opacity: 1;
            }
        }
    }

    .news-grain {
        position: absolute;
        inset: 0;
        opacity: 0.15;
        pointer-events: none;
        background-image: url('assets/textures/stardust.png');
    }

    .border-thick {
        border-width: 3px;
        border-color: #000;
    }

    /* Navigation Buttons */
    .nav-btn {
        background-image: var(--paper-texture);
        cursor: pointer;
    }

    .nav-btn:hover {
        border-color: var(--primary-accent);
        background-color: rgba(253, 250, 241, 0.95);
    }

    .nav-btn:active {
        transform: scale(0.95) !important;
    }

    /* Mobile responsive navigation */
    @media (max-width: 768px) {
        #nav-buttons-container {
            top: auto !important;
            bottom: 1rem !important;
            right: 1rem !important;
        }

        .nav-btn {
            width: 2.5rem !important;
            height: 2.5rem !important;
            background-color: rgba(253, 250, 241, 0.7) !important;
            backdrop-filter: blur(10px);
        }

        .nav-btn span {
            font-size: 1.125rem;
        }
    }

    /* Page 6: Scrapbook Map Specifics */
    .map-perspective {
        perspective: 1512px;
        transform: rotateX(2deg);
        transition: transform 0.5s ease;
    }

    .path-animate {
        stroke-dasharray: 1000;
        stroke-dashoffset: 1000;
        filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.1));
    }

    .pin-group:hover .polaroid-frame {
        border-color: var(--primary-accent);
        transform: rotate(0deg) scale(1.05);
    }

    .polaroid-frame.shadow-2xl {
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }

}

/* ============================================
   JOURNEY MAP MARKER - STABLE & PRECISE
   ============================================ */

/* Marker container - simple and stable (like reference) */
.journey-marker-container {
    background: none !important;
    border: none !important;
}


/* The actual pin - Material Icon based */
.journey-marker-pin {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.journey-marker-pin.animate-in {
    opacity: 1;
    transform: scale(1);
}

.journey-marker-pin .material-symbols-outlined {
    font-size: 32px;
    color: #b33939;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.2s ease;
}

.journey-marker-pin:hover .material-symbols-outlined {
    transform: translateY(-4px) scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Pulse animation */
.pin-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #b33939;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation: journeyPinPulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes journeyPinPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }

    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Journey Map Popup Styling */
.journey-popup .leaflet-popup-content-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.journey-popup .leaflet-popup-content {
    margin: 0 !important;
}

.journey-popup .leaflet-popup-tip {
    background: white !important;
    border: 2px solid #e7e5e4;
    width: 12px !important;
    height: 12px !important;
    margin: -6px auto 0 !important;
}

.journey-popup-content {
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Page 7: Refined Analog Voice Note Player */
.cassette-shell {
    position: relative;
    width: 80vw;
    max-width: 520px;
    height: auto;
    aspect-ratio: 520/330;
    background-color: #e8e4d9;
    border-radius: 16px;
    box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.8), inset 0 -8px 20px rgba(0, 0, 0, 0.15);
    background-image: var(--brushed), var(--grain);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4.5%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.screw {
    position: absolute;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 30% 30%, #dcd8cc, #7a7568);
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(255, 255, 255, 0.6);
}

.screw::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 2px;
    background: rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) rotate(var(--screw-rot, 45deg));
}

.sticker-label {
    width: 88%;
    height: 38%;
    background-color: #fcf9ec;
    border-radius: 4px;
    transform: rotate(-0.5deg);
    box-shadow: 1px 3px 6px rgba(0, 0, 0, 0.15), inset 0 0 30px rgba(139, 115, 85, 0.08);
    background-image: linear-gradient(transparent 27px, rgba(173, 216, 230, 0.3) 28px);
    background-size: 100% 28px;
    padding: 3.5% 8.5%;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.sticker-label::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url(assets/textures/natural-paper.png);
    opacity: 0.4;
    pointer-events: none;
}

.tape-window {
    width: 72%;
    height: 28%;
    background: #080808;
    border-radius: 45px;
    margin-top: 3.5%;
    box-shadow: inset 0 10px 25px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4%;
    position: relative;
    overflow: hidden;
    border: 3px solid #222;
}

.window-reflection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 45%, rgba(255, 255, 255, 0.06) 55%, transparent 100%);
    z-index: 30;
    pointer-events: none;
}

.reel-hub {
    width: 17%;
    height: auto;
    aspect-ratio: 1/1;
    background: #f8f8f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #aaa;
    z-index: 25;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
}

.reel-teeth-complex {
    width: 100%;
    height: 100%;
    position: relative;
    background: radial-gradient(circle, transparent 32%, #222 33%, #222 42%, transparent 43%);
}

.gear-tooth {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 100%;
    background: #222;
    transform-origin: center;
}

.magnetic-tape-path {
    position: absolute;
    bottom: 4%;
    left: 0;
    width: 100%;
    height: 6%;
    background: #141414;
    z-index: 10;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.6);
}

.tape-bulk-left {
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 33%;
    height: auto;
    aspect-ratio: 1/1;
    background: radial-gradient(circle, #222 0%, #1a1a1a 60%, transparent 72%);
    border-radius: 50%;
    z-index: 5;
    opacity: 0.9;
}

.tape-bulk-right {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: 16%;
    height: auto;
    aspect-ratio: 1/1;
    background: radial-gradient(circle, #222 0%, #1a1a1a 60%, transparent 72%);
    border-radius: 50%;
    z-index: 5;
    opacity: 0.9;
}

.hand-arrow-container {
    position: absolute;
    right: -240px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.continue-btn-tape {
    margin-top: 3rem;
    cursor: pointer;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #4a3728;
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.continue-btn-tape:hover {
    opacity: 1;
    letter-spacing: 0.4em;
    color: #1a1a1a;
}

.animate-spin-slow {
    animation: spin-cassette 3s linear infinite;
}

@keyframes spin-cassette {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Mobile adjustments for cassette */
@media (max-width: 640px) {
    .sticker-label {
        height: 32%;
        padding: 2.5% 6%;
    }

    .sticker-label p {
        font-size: 1.5rem !important;
    }

    .screw {
        width: 10px;
        height: 10px;
    }
}

/* ============================================
   TIME CAPSULE - REDESIGNED
   ============================================ */

/* Main Container */
.tc-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 4rem;
}

/* Header */
/* Header - Premium Design */
.tc-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: tc-fade-in-down 0.8s ease;
    position: relative;
}

.tc-header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(179, 57, 57, 0.3), transparent);
}

/* Ornamental divider above title */
.tc-header-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tc-ornament-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(45, 41, 38, 0.2), transparent);
}

.tc-ornament-diamond {
    width: 8px;
    height: 8px;
    border: 1px solid rgba(179, 57, 57, 0.4);
    transform: rotate(45deg);
}

.tc-header-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    color: #b33939;
    opacity: 0.8;
    position: relative;
}

.tc-header-icon::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(179, 57, 57, 0.15);
    border-radius: 50%;
}

.tc-header-icon::after {
    content: '';
    position: absolute;
    inset: -16px;
    border: 1px dashed rgba(179, 57, 57, 0.1);
    border-radius: 50%;
}

.tc-header-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(179, 57, 57, 0.2));
}

/* Title with elegant styling */
.tc-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.75rem;
    font-weight: 400;
    font-style: italic;
    color: #2d2926;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
    position: relative;
    display: inline-block;
}

/* Decorative underline for title */
.tc-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(179, 57, 57, 0.4) 20%,
            rgba(179, 57, 57, 0.6) 50%,
            rgba(179, 57, 57, 0.4) 80%,
            transparent 100%);
}

/* Small decorative dots under title */
.tc-title-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.tc-title-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(179, 57, 57, 0.3);
}

.tc-title-dot:nth-child(2) {
    width: 6px;
    height: 6px;
    background: rgba(179, 57, 57, 0.5);
}

.tc-subtitle {
    font-family: 'Crimson Pro', serif;
    font-size: 1rem;
    color: #2d2926;
    opacity: 0.55;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* Stage */
.tc-stage {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    margin-bottom: 2rem;
}

/* Memory Box */
.tc-box {
    position: relative;
    width: 320px;
    height: 200px;
    transform-style: preserve-3d;
    animation: tc-box-enter 0.8s ease 0.3s both;
    z-index: 10;
}

@keyframes tc-box-enter {
    from {
        opacity: 0;
        transform: perspective(1000px) rotateX(15deg) translateY(30px);
    }

    to {
        opacity: 1;
        transform: perspective(1000px) rotateX(8deg) translateY(0);
    }
}

.tc-box-inner {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #d4b483 0%, #c4a473 100%);
    border-radius: 4px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tc-box-opening {
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 20px;
    background: linear-gradient(to bottom, #2d2926 0%, #1a1815 100%);
    border-radius: 0 0 10px 10px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tc-box-shadow {
    position: absolute;
    bottom: -30px;
    left: 10%;
    right: 10%;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    filter: blur(20px);
}

.tc-box-flap {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(145deg, #c4a473 0%, #b49463 100%);
    transform-origin: top center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tc-flap-left {
    left: 0;
    transform-origin: left;
    transform: rotateY(-110deg);
    border-radius: 4px 0 0 4px;
}

.tc-flap-right {
    right: 0;
    transform-origin: right;
    transform: rotateY(110deg);
    border-radius: 0 4px 4px 0;
}

.tc-box.is-closed-left .tc-flap-left {
    transform: rotateY(-8deg);
}

.tc-box.is-closed-right .tc-flap-right {
    transform: rotateY(8deg);
}

.tc-box.is-hovered {
    animation: tc-box-shake 0.4s ease infinite;
}

@keyframes tc-box-shake {

    0%,
    100% {
        transform: perspective(1000px) rotateX(8deg) translateX(0);
    }

    25% {
        transform: perspective(1000px) rotateX(8deg) translateX(-2px);
    }

    75% {
        transform: perspective(1000px) rotateX(8deg) translateX(2px);
    }
}

.tc-box-tape {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.tc-box.is-taped .tc-box-tape {
    height: 100%;
    opacity: 1;
}

.tc-box-label {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    color: #2d2926;
    opacity: 0.4;
}

.tc-box-year {
    font-weight: 600;
}

.tc-box-divider {
    opacity: 0.5;
}

/* Envelope */
.tc-envelope-wrap,
.tc-envelope-container,
#tc-drag-envelope {
    position: absolute;
    z-index: 20;
    animation: tc-envelope-enter 0.6s ease 0.6s both;
}

@keyframes tc-envelope-enter {
    from {
        opacity: 0;
        transform: translateY(20px) rotate(3deg);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(2deg);
    }
}

.tc-envelope {
    position: relative;
    width: 220px;
    height: 140px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.tc-envelope:hover {
    transform: translateY(-4px) rotate(1deg);
}

.tc-envelope-paper {
    position: absolute;
    inset: 8px;
    background: linear-gradient(135deg, #fefefe 0%, #f8f6f3 100%);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

.tc-envelope-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    opacity: 0.2;
}

.tc-line {
    width: 60px;
    height: 2px;
    background: #2d2926;
    border-radius: 1px;
}

.tc-line-short {
    width: 40px;
}

.tc-envelope-hint {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: #2d2926;
    opacity: 0.4;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tc-hint-icon {
    font-size: 0.875rem;
}

.tc-envelope-body {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tc-envelope-fold {
    position: absolute;
    background: linear-gradient(145deg, #e8e4dc 0%, #dcd6cc 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tc-fold-left {
    left: 0;
    top: 0;
    bottom: 0;
    width: 55%;
    clip-path: polygon(0 0, 100% 35%, 100% 65%, 0 100%);
}

.tc-fold-right {
    right: 0;
    top: 0;
    bottom: 0;
    width: 55%;
    clip-path: polygon(0 35%, 100% 0, 100% 100%, 0 65%);
}

.tc-fold-bottom {
    left: 0;
    right: 0;
    bottom: 0;
    height: 60%;
    clip-path: polygon(0 40%, 50% 0, 100% 40%, 100% 100%, 0 100%);
}

.tc-envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    z-index: 5;
}

.tc-flap-triangle {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #e0dcd4 0%, #d4cfc4 100%);
    clip-path: polygon(0 0, 50% 55%, 100% 0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tc-envelope-shadow {
    position: absolute;
    bottom: -15px;
    left: 10%;
    right: 10%;
    height: 15px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    filter: blur(10px);
}

/* Seal Area */
.tc-seal-area,
.tc-wax-seal-area,
#tc-seal-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.tc-wax-blob,
#tc-wax-blob-static {
    position: absolute;
    inset: 0;
    background: #b33939;
    border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
    opacity: 0;
    transform: scale(0);
    box-shadow:
        inset -3px -3px 6px rgba(0, 0, 0, 0.2),
        0 3px 8px rgba(179, 57, 57, 0.3);
}

.tc-stamped-seal,
#tc-stamped-seal-final {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #8b2a2a 0%, #6b1f1f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    box-shadow:
        inset 2px 2px 4px rgba(255, 255, 255, 0.15),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.tc-stamped-seal::before,
#tc-stamped-seal-final::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.tc-monogram {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.tc-liquid-wax-container,
.tc-wax-seal-area .tc-liquid-wax-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-wax-drop,
#tc-wax-drop {
    width: 0;
    height: 0;
    background: #b33939;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Physical Letter */
.tc-letter,
.tc-letter-physical {
    position: absolute;
    width: 260px;
    height: 340px;
    background: linear-gradient(135deg, #fffefc 0%, #faf8f5 100%);
    border-radius: 2px;
    padding: 1.5rem;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    display: none;
    z-index: 30;
    transform: rotate(-1deg);
}

.tc-letter.active {
    display: block;
    animation: tc-letter-appear 0.5s ease;
}

@keyframes tc-letter-appear {
    from {
        opacity: 0;
        transform: scale(0.9) rotate(-3deg) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(-1deg) translateY(0);
    }
}

.tc-letter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tc-letter-date {
    font-family: 'Courier Prime', monospace;
    font-size: 0.625rem;
    color: #2d2926;
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tc-letter-stamp-placeholder {
    width: 24px;
    height: 28px;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.tc-letter-content {
    position: relative;
}

.tc-letter-text {
    font-family: 'Caveat', cursive;
    font-size: 1.125rem;
    line-height: 1.6;
    color: #2d2926;
    opacity: 0.7;
    min-height: 60px;
}

.tc-letter-lines {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.tc-l-line,
.tc-letter-line {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
}

.tc-letter-signature {
    margin-top: 1.5rem;
    text-align: right;
}

.tc-sig-line {
    width: 80px;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
    margin: 0 0 0.5rem auto;
}

.tc-letter-signature span {
    font-family: 'Caveat', cursive;
    font-size: 0.875rem;
    color: #2d2926;
    opacity: 0.5;
}

/* Controls */
.tc-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    min-height: 80px;
}

.tc-seal-control {
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.tc-seal-control[style*="opacity: 1"],
#tc-ritual-controls[style*="opacity: 1"] {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.tc-seal-btn {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #b33939 0%, #8b2a2a 100%);
    cursor: pointer;
    box-shadow:
        0 4px 15px rgba(179, 57, 57, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tc-seal-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 6px 20px rgba(179, 57, 57, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tc-seal-btn:active {
    transform: scale(0.95);
}

.tc-seal-btn-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(179, 57, 57, 0.3) 0%, transparent 70%);
    animation: tc-seal-pulse 2s ease-in-out infinite;
}

@keyframes tc-seal-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.tc-seal-btn-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.tc-seal-btn-inner svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.tc-seal-btn-inner span {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
    opacity: 0.9;
}

.tc-seal-hint {
    font-family: 'Crimson Pro', serif;
    font-size: 0.75rem;
    color: #2d2926;
    opacity: 0.4;
    font-style: italic;
}

.tc-finish-wrap,
.tc-finish-btn-container {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.tc-finish-wrap[style*="opacity: 1"],
.tc-finish-btn-container[style*="opacity: 1"] {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.tc-finish-btn,
#tc-finish-btn {
    position: relative;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f1eb 100%);
    border: 1px solid rgba(179, 57, 57, 0.3);
    border-radius: 50px;
    font-family: 'Playfair Display', serif;
    font-size: 0.875rem;
    font-style: italic;
    color: #b33939;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.tc-finish-btn:hover,
#tc-finish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(179, 57, 57, 0.5);
}

.tc-finish-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.tc-finish-btn:hover .tc-finish-shine,
#tc-finish-btn:hover .tc-finish-shine {
    left: 100%;
}

/* Delivery Message */
.tc-delivery-message {
    text-align: center;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease 0.2s;
}

.tc-delivery-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.tc-delivery-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    color: #b33939;
    opacity: 0.6;
}

.tc-delivery-icon svg {
    width: 100%;
    height: 100%;
}

.tc-delivery-text {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-style: italic;
    color: #2d2926;
    margin-bottom: 0.25rem;
}

.tc-delivery-date {
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    color: #2d2926;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.tc-delivery-date span {
    color: #b33939;
    font-weight: 600;
}

/* Footer */
.tc-footer {
    margin-top: auto;
    padding-top: 3rem;
}

.tc-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #2d2926;
    opacity: 0.3;
}

.tc-brand-icon {
    font-size: 0.5rem;
}

/* Modal */
.tc-modal,
.tc-letter-popup {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.tc-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.tc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(45, 41, 38, 0.3);
    backdrop-filter: blur(8px);
}

.tc-modal-content {
    position: relative;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    background: linear-gradient(135deg, #fffefc 0%, #faf8f5 100%);
    border-radius: 12px;
    padding: 2rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
}

.tc-modal.active .tc-modal-content {
    transform: scale(1) translateY(0);
}

.tc-modal-close,
.tc-letter-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #2d2926;
    opacity: 0.4;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-modal-close:hover {
    opacity: 0.8;
}

.tc-modal-close svg {
    width: 18px;
    height: 18px;
}

.tc-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tc-modal-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.tc-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 400;
    font-style: italic;
    color: #2d2926;
    margin-bottom: 0.25rem;
}

.tc-modal-subtitle {
    font-family: 'Crimson Pro', serif;
    font-size: 0.875rem;
    color: #2d2926;
    opacity: 0.5;
}

.tc-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tc-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tc-field-grow {
    flex: 1;
}

.tc-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Courier Prime', monospace;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2d2926;
    opacity: 0.5;
}

.tc-label-icon {
    font-size: 0.75rem;
}

.tc-input,
.tc-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-family: 'Crimson Pro', serif;
    font-size: 1rem;
    color: #2d2926;
    transition: all 0.2s ease;
}

.tc-input:focus,
.tc-textarea:focus {
    outline: none;
    background: white;
    border-color: rgba(179, 57, 57, 0.3);
    box-shadow: 0 0 0 3px rgba(179, 57, 57, 0.05);
}

.tc-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.tc-modal-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.tc-done-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(145deg, #b33939 0%, #8b2a2a 100%);
    border: none;
    border-radius: 50px;
    font-family: 'Playfair Display', serif;
    font-size: 0.875rem;
    font-style: italic;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(179, 57, 57, 0.3);
}

.tc-done-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(179, 57, 57, 0.4);
}

.tc-done-btn svg {
    width: 16px;
    height: 16px;
}

/* Animations */
@keyframes tc-fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 640px) {
    .tc-title {
        font-size: 2.25rem;
    }

    .tc-title::after {
        width: 60px;
    }

    .tc-header-icon {
        width: 48px;
        height: 48px;
    }

    .tc-header-icon::before {
        inset: -6px;
    }

    .tc-header-icon::after {
        inset: -12px;
    }

    .tc-ornament-line {
        width: 40px;
    }

    .tc-stage {
        height: 280px;
    }

    .tc-box {
        width: 260px;
        height: 160px;
    }

    .tc-envelope {
        width: 180px;
        height: 115px;
    }

    .tc-letter {
        width: 220px;
        height: 280px;
        padding: 1rem;
    }

    .tc-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}

/* Legacy support for JS functions */
.tc-finish-btn-container {
    display: contents;
}

#tc-seal-toggle {
    display: none;
}

/* Cinematic Outro Overlay */
.cinematic-overlay {
    position: fixed;
    inset: 0;
    background-color: #000;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cinematic-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cinematic-text {
    font-family: 'Playfair Display', serif;
    color: white;
    font-size: 2.5rem;
    font-style: italic;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.5s ease-out 1s;
    /* Delay text fade-in so screen goes black first */
    white-space: pre-line;
    /* Allows \n for line breaks */
    line-height: 1.6;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.cinematic-overlay.active .cinematic-text {
    opacity: 1;
    transform: translateY(0);
}

/* Map Journey Polaroid Styles */
.journey-popup .leaflet-popup-content-wrapper {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.journey-popup .leaflet-popup-content {
    margin: 0;
    width: auto !important;
}

.journey-popup .leaflet-popup-tip-container {
    display: none;
}

.map-polaroid {
    position: relative;
    padding: 10px;
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.2));
}

.map-polaroid-inner {
    background: #fdfaf1;
    background-image: var(--paper-texture);
    padding: 10px 8px 18px 8px;
    width: 150px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    transform: rotate(1deg);
    transition: transform 0.3s ease;
}

.map-polaroid:hover .map-polaroid-inner {
    transform: rotate(0deg) scale(1.1);
    z-index: 100;
}

.map-polaroid-tape {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 35px;
    height: 12px;
    background: rgba(255, 245, 157, 0.4);
    backdrop-filter: blur(2px);
    border-left: 1px dashed rgba(0, 0, 0, 0.1);
    border-right: 1px dashed rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.map-polaroid-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #eee;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.map-polaroid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.05) brightness(1.02);
}

.map-polaroid-sheen {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%, rgba(0, 0, 0, 0.05) 100%);
    pointer-events: none;
}

.map-polaroid-header {
    margin-bottom: 6px;
    padding: 2px 4px 0 2px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.map-polaroid-label {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e40af;
    line-height: 1.1;
    position: relative;
    transform: rotate(-1deg);
    flex: 1;
    word-break: break-word;
    text-align: left;
}

.map-polaroid-content {
    margin-top: 8px;
    text-align: left;
}

.map-polaroid-note {
    font-family: 'Nanum Pen Script', cursive;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.05;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.map-polaroid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    padding-top: 6px;
}

.map-polaroid-date {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(45, 41, 38, 0.4);
    font-weight: 600;
}

/* ==========================================
   MAP PIN NAVIGATOR STYLES
   ========================================== */

#map-pin-navigator {
    z-index: 40;
}

.map-nav-btn {
    color: #2d2926;
    cursor: pointer;
}

.map-nav-btn:active {
    transform: scale(0.95);
}

.map-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.map-nav-counter {
    min-width: 80px;
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #map-pin-navigator {
        gap: 0.75rem;
    }

    .map-nav-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    .map-nav-counter {
        padding: 0.375rem 0.75rem;
        min-width: 60px;
    }

    .map-nav-counter span {
        font-size: 0.75rem;
    }
}