        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            /* Kill the blue/grey tap highlight box on mobile taps */
            -webkit-tap-highlight-color: transparent;
        }

        html, body {
            overflow-x: hidden;
            width: 100%;
            position: relative;
        }

        body {
            font-family: 'Quicksand', 'Comic Sans MS', 'Arial', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, #ff6b9d 0%, #c06c84 50%, #6c5b7b 100%);
            overflow: hidden;
            position: relative;
            padding: 20px;
        }

        /* Background "i love you" text */
        .background-text {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            /* Pinned so the JS width measurement stays exact after the body font change */
            font-family: 'Comic Sans MS', 'Arial', sans-serif;
            font-size: 27px;
            color: rgba(255, 255, 255, 0.15);
            line-height: 24px;
            word-spacing: 0.5px;
            z-index: 1;
            pointer-events: none;
            overflow: hidden;
            white-space: nowrap;
        }

        /* Floating hearts background — soft SVG hearts instead of emoji */
        .heart {
            position: absolute;
            bottom: 0;
            width: 46px;
            height: 42px;
            font-size: 0; /* hide the emoji fallback inside each .heart div */
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 29'%3E%3Cpath d='M16 28.5C16 28.5 2 19.8 2 10.2 2 6 5.2 3 9 3c2.6 0 5 1.5 7 4 2-2.5 4.4-4 7-4 3.8 0 7 3 7 7.2 0 9.6-14 18.3-14 18.3z' fill='%23ffffff' fill-opacity='0.9' stroke='%23ff6b9d' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat center;
            background-size: contain;
            animation: float 6s infinite;
            opacity: 0;
            z-index: 5;
        }

        @keyframes float {
            0% {
                transform: translateY(0) rotate(0deg);
                opacity: 0;
            }
            10% {
                opacity: 0.6;
            }
            90% {
                opacity: 0.6;
            }
            100% {
                transform: translateY(-100vh) rotate(360deg);
                opacity: 0;
            }
        }

        .container {
            text-align: center;
            background: rgba(255, 255, 255, 0.96);
            padding: 40px 30px;
            border-radius: 30px;
            box-shadow: 0 10px 30px rgba(108, 91, 123, 0.25), 0 24px 70px rgba(0, 0, 0, 0.28);
            border: 1px solid rgba(255, 255, 255, 0.6);
            max-width: 90%;
            width: 600px;
            max-height: 90vh;
            overflow-y: auto;
            z-index: 10;
            animation: slideIn 0.6s ease-out;
            margin: auto;
            /* Hide scrollbar for all browsers */
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
        }

        /* Floating text container (no card background) */
        .floating-text-container {
            text-align: center;
            z-index: 10;
            animation: slideIn 0.6s ease-out;
            margin: auto;
        }

        .floating-question {
            font-family: 'Dancing Script', 'Quicksand', cursive;
            font-size: 56px;
            color: white;
            margin-bottom: 40px;
            font-weight: 700;
            text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
        }

        .floating-error {
            font-size: 60px;
            color: white;
            margin-bottom: 30px;
            font-weight: bold;
            text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
        }

        .floating-emoji {
            font-size: 80px;
            margin-bottom: 20px;
            animation: pulse 1.5s infinite;
        }

        /* Floating header text above yes screen card */
        .floating-header {
            font-family: 'Dancing Script', 'Quicksand', cursive;
            font-size: 38px;
            color: white;
            margin-bottom: 30px;
            font-weight: 700;
            text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
            line-height: 1.4;
            z-index: 10;
            text-align: center;
        }

        .container::-webkit-scrollbar {
            display: none; /* Chrome, Safari and Opera */
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .question {
            font-size: 36px;
            color: #c06c84;
            margin-bottom: 25px;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        .emoji {
            font-size: 50px;
            margin-bottom: 15px;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.1);
            }
        }

        .buttons {
            display: flex;
            gap: 20px;
            justify-content: center;
            margin-top: 30px;
        }

        button {
            padding: 18px 40px;
            font-size: 24px;
            font-weight: bold;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: inherit;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        .yes-btn {
            background: linear-gradient(135deg, #ff6b9d, #ff8fab);
            color: white;
        }

        .yes-btn:hover {
            transform: translateY(-5px) scale(1.05);
            box-shadow: 0 10px 25px rgba(255, 107, 157, 0.5);
        }

        .no-btn {
            background: linear-gradient(135deg, #95a5a6, #b2bec3);
            color: white;
        }

        .no-btn:hover {
            transform: translateY(-5px) scale(1.05);
            box-shadow: 0 10px 25px rgba(149, 165, 166, 0.5);
        }

        .try-again-btn {
            background: linear-gradient(135deg, #6c5b7b, #8b7d94);
            color: white;
            margin-top: 25px;
        }

        .try-again-btn:hover {
            transform: translateY(-5px) scale(1.05);
            box-shadow: 0 10px 25px rgba(108, 91, 123, 0.5);
        }

        .click-me-btn {
            background: linear-gradient(135deg, #ff6b9d, #c06c84);
            color: white;
            display: block;
            margin: 0 auto 30px;
            /* Breathe via the glow (box-shadow), leaving transform free for a smooth hover */
            animation: clickGlow 1.8s ease-in-out infinite;
        }

        @keyframes clickGlow {
            0%, 100% { box-shadow: 0 5px 15px rgba(192, 108, 132, 0.35); }
            50%      { box-shadow: 0 9px 26px rgba(255, 107, 157, 0.6); }
        }

        .click-me-btn:hover {
            transform: translateY(-5px) scale(1.05);
        }

        /* "I love you more" rose calculation overlay */
        .rose-overlay {
            position: fixed;
            inset: 0;
            background: rgba(108, 91, 123, 0.55);
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 30px;
            z-index: 1000;
            animation: fadeIn 0.4s ease-in;
        }

        .rose-box {
            position: relative;
            background: rgba(255, 255, 255, 0.97);
            border-radius: 30px;
            padding: 55px 45px;
            width: 460px;
            max-width: 100%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
            text-align: center;
            animation: slideIn 0.6s ease-out;
        }

        .rose-box .calc-text,
        .rose-box .back-btn {
            position: relative;
            z-index: 2;
        }

        .rose-box .calc-text {
            font-size: 30px;
            font-weight: bold;
            color: #c06c84;
            line-height: 1.4;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.08);
        }

        .vine-svg {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            overflow: visible;
            pointer-events: none;
            z-index: 1;
        }

        .vine-path {
            stroke-linejoin: round;
        }

        @keyframes drawVine {
            to { stroke-dashoffset: 0; }
        }

        .bloom {
            transform: scale(0);
            transform-box: fill-box;
            transform-origin: center;
            animation: bloom 0.5s ease-out forwards;
        }

        @keyframes bloom {
            0%   { transform: scale(0); }
            70%  { transform: scale(1.25); }
            100% { transform: scale(1); }
        }

        @media (max-width: 600px) {
            .rose-box { padding: 45px 30px; }
            .rose-box .calc-text { font-size: 23px; }
        }

        .hidden {
            display: none !important;
        }

        .success-message {
            font-size: 18px;
            color: #ff6b9d;
            margin-top: 20px;
            line-height: 1.5;
            animation: fadeIn 0.8s ease-in;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            gap: 8px;
        }
        
        .success-message > * {
            flex: 0 1 auto;
        }
        
        .success-message .final-note {
            font-size: 18px;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .error-message {
            font-size: 32px;
            color: #e74c3c;
            margin-top: 20px;
            font-weight: bold;
        }

        .celebration {
            font-size: 40px;
            margin-top: 15px;
            animation: bounce 0.8s infinite;
            width: 100%;
            text-align: center;
        }

        @keyframes bounce {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-20px);
            }
        }

        /* Options menu styles */
        .options-menu {
            display: grid;
            grid-template-columns: 1;
            gap: 15px;
        }

        .option-btn {
            background: linear-gradient(135deg, #ff6b9d, #ff8fab);
            color: white;
            padding: 15px 20px;
            font-size: 25px;
            border-radius: 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .option-btn:hover {
            transform: translateY(-5px) scale(1.03);
            box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
        }

        .option-btn:focus {
            outline: 2px solid #c06c84;
            outline-offset: 2px;
        }

        .option-icon {
            font-size: 24px;
            line-height: 0;
        }

        .option-icon svg {
            width: 30px;
            height: 30px;
        }

        /* Inline SVG icon used inside buttons (replaces small emoji) */
        .btn-ico {
            width: 1em;
            height: 1em;
            vertical-align: -0.15em;
            margin-left: 6px;
            flex: none;
        }

        /* Send-me-a-message screen */
        .sm-sub {
            text-align: center;
            color: #c06c84;
            font-style: italic;
            margin-bottom: 16px;
        }

        .sm-textarea {
            width: 100%;
            border: 2px solid #ffd0dd;
            border-radius: 16px;
            padding: 14px 16px;
            font-family: inherit;
            font-size: 17px;
            color: #6c5b7b;
            background: #fff7fa;
            resize: vertical;
            min-height: 110px;
            outline: none;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .sm-textarea:focus {
            border-color: #ff6b9d;
            box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
        }

        .sm-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
            margin-top: 16px;
        }

        .sm-actions .yes-btn {
            font-size: 18px;
            padding: 14px 26px;
        }

        .sm-history-btn {
            background: linear-gradient(135deg, #c06c84, #8b7d94);
            color: white;
            padding: 14px 26px;
            font-size: 18px;
            font-weight: bold;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        .sm-history-btn:hover {
            transform: translateY(-3px) scale(1.03);
            box-shadow: 0 8px 20px rgba(108, 91, 123, 0.4);
        }

        .sm-status {
            text-align: center;
            margin-top: 14px;
            min-height: 22px;
            font-weight: 600;
            color: #3f9b53;
        }

        .sm-status.error {
            color: #e5484d;
        }

        .sm-history {
            margin-top: 18px;
            text-align: left;
            border-top: 1px dashed #ffd0dd;
            padding-top: 14px;
            max-height: 260px;
            overflow-y: auto;
        }

        .sm-msg {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            background: #fff7fa;
            border: 1px solid #ffe0ea;
            border-radius: 12px;
            padding: 10px 14px;
            margin-bottom: 10px;
        }

        .sm-msg-main {
            flex: 1;
            min-width: 0;
        }

        .sm-msg-del {
            flex: none;
            background: none;
            border: none;
            color: #d98aa8;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 8px;
            transition: all 0.2s ease;
        }

        .sm-msg-del:hover {
            color: #e5484d;
            background: #ffe0ea;
        }

        .sm-msg-text {
            color: #6c5b7b;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .sm-msg-time {
            display: block;
            font-size: 12px;
            color: #b98aa0;
            margin-top: 4px;
        }

        .sm-history-empty {
            text-align: center;
            color: #b98aa0;
            font-style: italic;
        }

        /* Content display styles */
        .content-display {
            background: white;
            padding: 30px;
            border-radius: 20px;
            margin-top: 20px;
            text-align: left;
            box-shadow: 0 6px 20px rgba(108, 91, 123, 0.15);
            animation: slideIn 0.5s ease-out;
        }

        .content-display h2 {
            color: #c06c84;
            margin-bottom: 15px;
            text-align: center;
        }

        .content-display p, .content-display li {
            color: #333;
            line-height: 1.8;
            font-size: 16px;
        }

        .content-display ul {
            list-style: none;
            padding: 0;
        }

        .content-display li {
            margin-bottom: 12px;
            padding-left: 30px;
            position: relative;
        }

        .content-display li:before {
            content: "";
            position: absolute;
            left: 0;
            top: 0.2em;
            width: 1em;
            height: 1em;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20S4 14 4 8.7A3.7 3.7 0 0 1 12 6a3.7 3.7 0 0 1 8 2.7C20 14 12 20 12 20z' fill='%23ff6b9d'/%3E%3C/svg%3E") no-repeat center;
            background-size: contain;
        }

        #live-timer {
            display: flex;
            flex-wrap: nowrap;
            justify-content: center;
            gap: clamp(8px, 1.6vw, 14px);
            margin-top: 20px;
            font-family: 'Trebuchet MS', 'Arial', sans-serif;
            color: #000;
            text-shadow: none;
            animation: timerGlow 3s ease-in-out infinite;
            max-width: 100%;
        }

        .timer-group {
            display: inline-flex;
            align-items: center;
            flex-wrap: wrap;
            justify-content: center;
            gap: clamp(4px, 0.8vw, 6px);
            padding: clamp(6px, 1.1vw, 8px) clamp(10px, 2vw, 14px);
            border-radius: 16px;
            background: rgba(255, 182, 213, 0.15);
            box-shadow: inset 0 0 12px rgba(255, 182, 213, 0.35);
            min-width: 0;
        }

        .timer-digit {
            display: inline-block;
            min-width: clamp(12px, 1.7vw, 16px);
            font-size: clamp(20px, 3vw, 30px);
            font-weight: 600;
            color: #000;
            text-shadow: none;
        }

        .timer-digit.is-updating {
            animation: digitRise 0.6s ease;
        }

        .timer-label {
            flex-basis: 100%;
            font-size: clamp(11px, 1.6vw, 14px);
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: #000;
        }

        .timer-separator {
            display: inline-flex;
            align-items: center;
            color: #000;
            font-size: 18px;
        }

        @keyframes timerGlow {
            0%, 100% {
                text-shadow: 0 0 8px rgba(255, 182, 213, 0.6), 0 0 18px rgba(255, 105, 180, 0.45);
            }
            50% {
                text-shadow: 0 0 12px rgba(255, 182, 213, 0.9), 0 0 24px rgba(255, 105, 180, 0.7);
            }
        }

        @keyframes digitRise {
            0% {
                transform: translateY(8px) scale(0.92);
                opacity: 0;
            }
            100% {
                transform: translateY(0) scale(1);
                opacity: 1;
            }
        }

        /* Love Meter Styles */
        .love-meter-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
            margin: 30px 0;
        }

        .progress-bar-container {
            width: 100%;
            max-width: 500px;
            height: auto;
            min-height: 60px;
            background: linear-gradient(135deg, rgba(255, 182, 213, 0.3), rgba(255, 182, 213, 0.5));
            border-radius: 30px;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3), inset 0 0 20px rgba(255, 182, 213, 0.4);
            border: 2px solid rgba(255, 107, 157, 0.4);
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px 20px;
        }

        .progress-bar {
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            background: linear-gradient(90deg, #ff6b9d, #ff8fab, #ffa6c1);
            border-radius: 30px;
            transition: width 0.3s ease;
            box-shadow: 0 0 20px rgba(255, 107, 157, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
            animation: progressGlow 2s ease-in-out infinite;
            z-index: 0;
            overflow: hidden;
        }

        @keyframes progressGlow {
            0%, 100% {
                box-shadow: 0 0 20px rgba(255, 107, 157, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
            }
            50% {
                box-shadow: 0 0 30px rgba(255, 107, 157, 1), inset 0 0 15px rgba(255, 255, 255, 0.5);
            }
        }

        .progress-bar::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% {
                transform: translateX(-100%);
            }
            100% {
                transform: translateX(100%);
            }
        }

        .love-counter {
            font-size: 48px;
            font-weight: bold;
            color: #ffdbe6;
            text-shadow: 0 0 10px rgba(192, 108, 132, 0.5);
            font-family: 'Trebuchet MS', 'Arial', sans-serif;
            text-align: center;
            line-height: 1;
            white-space: nowrap;
            transform: translate(-50%, -50%) scale(1);
            position: absolute;
            top: 50%;
            left: 50%;
            z-index: 1;
            max-width: 100%;
            display: inline-block;
        }

        .love-for-me-count {
            text-align: center;
            font-size: 60px;
            font-weight: bold;
            color: #c06c84;
            margin: 20px 0;
            white-space: nowrap;
            display: block;
            transform-origin: center;
        }

        .back-btn {
            background: linear-gradient(135deg, #6c5b7b, #8b7d94);
            color: white;
            padding: 12px 30px;
            font-size: 16px;
            margin-top: 20px;
            display: block;
            width: 100%;
        }

        .back-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(108, 91, 123, 0.4);
        }

        .back-btn:focus {
            outline: 2px solid #c06c84;
            outline-offset: 2px;
        }

        /* Love letter screen with wider container */
        #love-letter-screen {
            width: 800px;
            max-width: 90%;
        }

        /* Photoreel styles - Classic vertical film strip */
        .photoreel-container {
            background: #000;
            background-clip: padding-box;
            padding: 0 40px;
            border-radius: 0;
            margin: 20px auto;
            overflow: visible;
            width: fit-content;
            position: relative;
            /* Smooth scrolling */
            scroll-behavior: smooth;
            /* Hide scrollbar */
            scrollbar-width: none;
            -ms-overflow-style: none;
            /* Film strip border */
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        }

        /* Film sprocket holes on left side */
        .photoreel-container::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 40px;
            background-color: #000;
            background-image: 
                linear-gradient(
                    to bottom,
                    transparent 0px,
                    transparent 6px,
                    #fff 6px,
                    #fff 18px,
                    transparent 18px,
                    transparent 24px
                );
            background-size: 12px 24px;
            background-repeat: repeat-y;
            background-position: center top;
            z-index: 5;
            pointer-events: none;
        }

        /* Film sprocket holes on right side */
        .photoreel-container::after {
            content: '';
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 40px;
            background-color: #000;
            background-image: 
                linear-gradient(
                    to bottom,
                    transparent 0px,
                    transparent 6px,
                    #fff 6px,
                    #fff 18px,
                    transparent 18px,
                    transparent 24px
                );
            background-size: 12px 24px;
            background-repeat: repeat-y;
            background-position: center top;
            z-index: 5;
            pointer-events: none;
        }

        .photoreel-container::-webkit-scrollbar {
            display: none;
        }

        .photoreel {
            display: flex;
            flex-direction: column;
            gap: 15px;
            padding: 15px 0;
            width: fit-content;
            background: #000;
        }

        .photo-item {
            flex: 0 0 auto;
            width: 300px;
            height: 300px;
        }

        .photo-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 10px;
            border: 1px solid #fff;
            display: block;
        }

        .photo-placeholder {
            width: 100%;
            height: 100%;
            background: #000;
            border: 1px solid #fff;
            border-radius: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: all 0.3s ease;
        }

        .photo-placeholder:hover {
            background: #111;
            border-color: #fff;
        }

        .placeholder-icon {
            font-size: 48px;
            opacity: 0.6;
        }

        .placeholder-text {
            color: #888;
            font-size: 16px;
            font-weight: bold;
        }
        @media (min-width: 769px) {
            .timer-digit {
                font-size: 22px;
                min-width: 14px;
            }

            #yes-screen .floating-header {
                font-size: clamp(22px, 3.5vh, 32px);
                margin-bottom: clamp(12px, 2.5vh, 30px);
            }

            #yes-screen .container {
                padding: clamp(18px, 3vh, 40px) 30px;
                width: 720px;
                max-width: 95%;
            }

            #yes-screen .options-menu {
                grid-template-columns: repeat(2, 1fr);
                gap: clamp(8px, 1.8vh, 15px);
            }

            #yes-screen .option-btn {
                font-size: clamp(14px, 2.4vh, 25px);
                padding: clamp(8px, 1.7vh, 15px) 20px;
                gap: clamp(4px, 1.2vh, 8px);
            }

            #yes-screen .option-icon {
                font-size: clamp(14px, 2.4vh, 24px);
            }

            #yes-screen .back-btn {
                margin-top: clamp(12px, 2vh, 20px);
                font-size: clamp(12px, 2vh, 16px);
            }
        }
        /* Mobile responsive styles */
        @media (max-width: 768px) {
            .heart {
                font-size: 35px;
            }
            .love-counter {
                font-size: 28px;
            }

            .progress-bar-container {
                max-width: 100%;
                padding: 10px 12px;
            }

            .floating-question {
                font-size: 32px;
            }

            .floating-error {
                font-size: 40px;
            }

            .floating-header {
                font-size: 22px;
            }

            .content-display p, .content-display li {
                font-size: 13px;
            }

            .content-display h2 {
                font-size: 19px;
            }

            .question {
                font-size: 28px;
            }

            button {
                font-size: 20px;
                padding: 15px 30px;
            }

            .option-btn {
                font-size: 14px;
                padding: 12px 16px;
            }

            .container {
                padding: 30px 20px;
                width: 100%;
                max-width: calc(100% - 40px);
            }

            #live-timer {
                flex-direction: column;
                align-items: center;
            }

            .timer-separator {
                display: none;
            }

            .photo-item {
                width: 220px;
                height: 220px;
            }

            .photoreel-container {
                padding: 0 30px;
            }

            .photoreel-container::before {
                left: 0;
                width: 30px;
                background-image: 
                    linear-gradient(
                        to bottom,
                        transparent 0px,
                        transparent 6px,
                        #fff 6px,
                        #fff 18px,
                        transparent 18px,
                        transparent 24px
                    );
                background-size: 12px 24px;
                background-repeat: repeat-y;
                background-position: center top;
            }

            .photoreel-container::after {
                right: 0;
                width: 30px;
                background-image: 
                    linear-gradient(
                        to bottom,
                        transparent 0px,
                        transparent 6px,
                        #fff 6px,
                        #fff 18px,
                        transparent 18px,
                        transparent 24px
                    );
                background-size: 12px 24px;
                background-repeat: repeat-y;
                background-position: center top;
            }

        }

        @media (max-width: 480px) {
            .content-display p, .content-display li {
                font-size: 11px;
            }

            .content-display h2 {
                font-size: 16px;
            }

            .question {
                font-size: 24px;
            }

            button {
                font-size: 18px;
                padding: 12px 25px;
            }

            .option-btn {
                font-size: 13px;
                padding: 10px 14px;
            }

            .container {
                padding: 25px 15px;
                width: 100%;
                max-width: calc(100% - 40px);
            }

            .photo-item {
                width: 180px;
                height: 180px;
            }

            .photoreel-container {
                padding: 0 25px;
            }

            .photoreel-container::before {
                left: 0;
                width: 25px;
                background-image: 
                    linear-gradient(
                        to bottom,
                        transparent 0px,
                        transparent 6px,
                        #fff 6px,
                        #fff 18px,
                        transparent 18px,
                        transparent 24px
                    );
                background-size: 12px 24px;
                background-repeat: repeat-y;
                background-position: center top;
            }

            .photoreel-container::after {
                right: 0;
                width: 25px;
                background-image: 
                    linear-gradient(
                        to bottom,
                        transparent 0px,
                        transparent 6px,
                        #fff 6px,
                        #fff 18px,
                        transparent 18px,
                        transparent 24px
                    );
                background-size: 12px 24px;
                background-repeat: repeat-y;
                background-position: center top;
            }

            .photoreel {
                padding: 10px 0;
            }

            .placeholder-icon {
                font-size: 36px;
            }

            .placeholder-text {
                font-size: 14px;
            }
        }

/* ---- Memories: add / delete controls ---- */
.mem-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.mem-btn {
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 50px;
    padding: 10px 16px;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.mem-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.mem-add {
    background: linear-gradient(135deg, #ff6b9d, #ff8fab);
}

.mem-delete {
    background: linear-gradient(135deg, #c06c84, #8b7d94);
}

.mem-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.25);
}

.mem-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.mem-note {
    text-align: center;
    margin: 8px 0;
    min-height: 20px;
    font-weight: 600;
    color: #3f9b53;
}

.mem-note.error {
    color: #e5484d;
}

/* ---- Generic modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(108, 91, 123, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.modal-box {
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    width: 460px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: slideIn 0.4s ease-out;
}

.modal-title {
    color: #c06c84;
    font-weight: bold;
    font-size: 22px;
    margin-bottom: 8px;
}

.modal-sub {
    color: #6c5b7b;
    font-size: 15px;
    margin-bottom: 14px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.modal-btn {
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 50px;
    padding: 12px 22px;
    font-size: 16px;
    color: #fff;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.modal-btn:hover {
    transform: translateY(-2px);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #ff6b9d, #ff8fab);
}

.modal-btn.danger {
    background: linear-gradient(135deg, #e5484d, #c0392b);
}

.modal-btn.ghost {
    background: linear-gradient(135deg, #95a5a6, #b2bec3);
}

/* ---- Crop ---- */
.crop-viewport {
    width: 300px;
    height: 300px;
    max-width: 78vw;
    max-height: 78vw;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    touch-action: none;
}

.crop-viewport canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

.crop-zoom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: #6c5b7b;
    font-weight: 600;
}

.crop-zoom input[type=range] {
    flex: 1;
    accent-color: #ff6b9d;
}

.crop-hint {
    color: #b98aa0;
    font-size: 13px;
    margin-top: 8px;
}

/* ---- Delete grid ---- */
.del-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
    max-height: 52vh;
    overflow-y: auto;
    padding: 4px;
}

.del-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.del-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.del-thumb.selected {
    border-color: #ff6b9d;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.35);
}

@media (max-width: 480px) {
    .del-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
