/* ==========================================================================
   TACTILE STATIONERY VINTAGE PHOTOBOOTH KEEPSAKE TEMPLATE (CSS)
   Theme: Warm Cream Stationery, Tactile Craft Paper, Organic Keepsake
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,500;1,700&family=Caveat:wght@600;700&family=Plus+Jakarta+Sans:wght@400;600;700&family=Courier+Prime:wght@400;700&display=swap');

/* --- Root Variables for Warm Stationery Aesthetic --- */
:root {
    --cp-bg-cream: #faf7f2;
    --cp-bg-card: #ffffff;
    --cp-bg-craft: #e8ded2;
    --cp-text-main: #2d2420;
    --cp-text-muted: #786c65;
    --cp-terracotta: #c86d56;
    --cp-terracotta-soft: #f4e8e4;
    --cp-gold-seal: #a33835;
    --cp-stamp-border: #d5c8bb;
    --cp-paper-shadow: 0 12px 36px rgba(45, 36, 32, 0.08), 0 2px 8px rgba(45, 36, 32, 0.04);
    --cp-card-shadow: 0 18px 45px rgba(45, 36, 32, 0.12);
}

/* Base Container when Tactile Photobooth Keepsake is Active */
#photoboothKeepsakeContainer {
    display: none;
    width: 100%;
    min-height: 100vh;
    background-color: var(--cp-bg-cream);
    background-image: radial-gradient(rgba(200, 109, 86, 0.04) 1px, transparent 0);
    background-size: 24px 24px;
    color: var(--cp-text-main);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    padding-bottom: 90px;
    position: relative;
    overflow-x: hidden;
}

.cutie-content-wrap {
    max-width: 580px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 5;
}

/* Floating Ambient Flower Petals / Sparkles Canvas */
#cutieAmbientCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* --- Top Step Navigation Bar --- */
.cutie-step-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid var(--cp-stamp-border);
    padding: 6px 14px;
    border-radius: 30px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(45, 36, 32, 0.05);
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cutie-step-nav::-webkit-scrollbar {
    display: none;
}

.cutie-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: transparent;
    border: none;
    color: var(--cp-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.cutie-step-btn.active {
    background: var(--cp-terracotta);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(200, 109, 86, 0.35);
}

.cutie-step-btn i,
.cutie-step-btn svg {
    width: 13px;
    height: 13px;
}

/* --- Step Section Card Panels --- */
.cutie-step-section {
    display: none;
    width: 100%;
    animation: cutieFadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cutie-step-section.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes cutieFadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   STEP 1: WAX-SEALED CRAFT ENVELOPE OPENER
   ========================================================================== */
.cutie-sleeve-box {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: var(--cp-card-shadow);
    border: 1px solid rgba(213, 200, 187, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.cutie-postage-stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 60px;
    border: 1.5px dashed var(--cp-terracotta);
    border-radius: 6px;
    background: #fffdf9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: rotate(4deg);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.cutie-postage-stamp span {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--cp-terracotta);
    letter-spacing: 0.06em;
}

.cutie-postage-stamp .stamp-icon {
    font-size: 1.1rem;
    margin: 2px 0;
}

.cutie-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--cp-terracotta-soft);
    color: var(--cp-terracotta);
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.03em;
}

.cutie-sleeve-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    line-height: 1.3;
    color: var(--cp-text-main);
    margin-bottom: 10px;
    font-weight: 700;
}

.cutie-sleeve-sub {
    font-size: 0.88rem;
    color: var(--cp-text-muted);
    line-height: 1.55;
    margin-bottom: 28px;
    max-width: 320px;
}

/* Realistic Craft Stationery Envelope with Stamped Wax Seal */
.cutie-envelope-graphic {
    width: 320px;
    max-width: 100%;
    height: 220px;
    position: relative;
    margin: 36px auto 22px auto;
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cutie-envelope-graphic:hover {
    transform: translateY(-3px) scale(1.01);
}

/* Background Backplate of Envelope (Layer 1) */
.envelope-bg-back {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 155px;
    background: linear-gradient(180deg, #eddcc8, #dfcbaf);
    border-radius: 12px;
    border: 1px solid #d4c1aa;
    z-index: 1;
    box-shadow: 0 14px 35px rgba(45, 36, 32, 0.12), 0 2px 6px rgba(45, 36, 32, 0.06);
}

/* Open Triangular Back Flap (Layer 1 - behind letter) */
.envelope-svg-back-flap {
    position: absolute;
    bottom: 154px;
    left: 0;
    width: 100%;
    height: 55px;
    z-index: 1;
    filter: drop-shadow(0 -3px 4px rgba(45, 36, 32, 0.05));
    display: block;
}

/* Letter Paper Tucked Inside Envelope (Layer 2 - between back and pocket) */
.cutie-envelope-letter-inside {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    max-width: 88%;
    height: 165px;
    background: #fffdfa;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(45, 36, 32, 0.14);
    border: 1px solid #eadbc8;
    z-index: 2;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.65s ease;
}

.mini-letter-photo-thumb {
    width: 72px;
    height: 94px;
    background: #ffffff;
    padding: 4px 4px 14px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
    border: 1px solid #dfd3c3;
    transform: rotate(-4deg);
    flex-shrink: 0;
    position: relative;
    border-radius: 3px;
}

.mini-letter-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.mini-letter-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    text-align: left;
}

.mini-letter-tag {
    font-family: 'Courier Prime', monospace;
    font-size: 0.60rem;
    font-weight: 700;
    color: var(--cp-terracotta);
    letter-spacing: 0.08em;
}

.mini-letter-greeting {
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cp-text-main);
    line-height: 1.2;
}

.mini-letter-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 3px;
}

.mini-letter-line {
    height: 3px;
    background: #ebdcc9;
    border-radius: 2px;
}

/* Front Envelope Pocket (Layer 3 - in front of letter) */
.cutie-envelope-front-pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 135px;
    z-index: 3;
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-shadow: inset 0 -3px 8px rgba(45, 36, 32, 0.06);
}

.envelope-svg-pocket {
    width: 100%;
    height: 100%;
    display: block;
}

.envelope-airmail-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: repeating-linear-gradient(45deg, #c86d56 0, #c86d56 10px, transparent 0, transparent 20px, #3b82f6 20px, #3b82f6 30px, transparent 0, transparent 40px);
    z-index: 5;
}

.envelope-pocket-label {
    position: absolute;
    bottom: 12px;
    left: 16px;
    z-index: 10;
    text-align: left;
    pointer-events: auto !important;
    cursor: text;
    max-width: 220px;
    word-break: break-word;
}

.envelope-to-tag {
    font-family: 'Courier Prime', monospace;
    font-size: 0.60rem;
    font-weight: 700;
    color: var(--cp-terracotta);
    letter-spacing: 0.08em;
    display: inline-block;
    pointer-events: auto !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    border-radius: 3px;
    padding: 1px 3px;
    transition: background 0.15s ease, outline 0.15s ease;
}

.envelope-to-tag:hover,
.envelope-to-tag:focus {
    outline: 1px dashed rgba(197, 109, 86, 0.6);
    background: rgba(197, 109, 86, 0.08);
}

.envelope-recipient-name {
    font-family: 'Caveat', cursive;
    font-size: 1.30rem;
    font-weight: 700;
    color: var(--cp-text-main);
    line-height: 1.2;
    pointer-events: auto !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    display: inline-block;
    min-width: 50px;
    border-bottom: 1px dashed rgba(197, 109, 86, 0.5);
    border-radius: 3px;
    padding: 1px 4px;
    transition: border-color 0.2s ease, background 0.2s ease, outline 0.2s ease;
}

.envelope-recipient-name:hover,
.envelope-recipient-name:focus {
    border-bottom: 1px solid var(--cp-terracotta);
    background: rgba(197, 109, 86, 0.10);
    outline: none;
}

.envelope-heart-decor {
    font-family: 'Caveat', cursive;
    font-size: 1.30rem;
    font-weight: 700;
    color: var(--cp-terracotta);
    pointer-events: none;
    user-select: none;
    margin-left: 2px;
    display: inline-block;
}

/* Stamped Wax Seal on Center of Front Pocket (Layer 4) */
.cutie-wax-seal-btn {
    position: absolute;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #be3c38, #821f1c);
    box-shadow: 0 8px 24px rgba(130, 31, 28, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    font-weight: 700;
    z-index: 6;
    cursor: pointer;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    animation: cutieSealPulse 2.4s infinite ease-in-out;
}

.cutie-wax-seal-btn:hover {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 10px 28px rgba(130, 31, 28, 0.65), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.cutie-wax-seal-btn:active {
    transform: translateX(-50%) scale(0.95);
}

@keyframes cutieSealPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 6px 18px rgba(134, 33, 30, 0.45); }
    50% { transform: scale(1.06); box-shadow: 0 10px 26px rgba(134, 33, 30, 0.65); }
}

.cutie-wax-seal-btn:hover {
    transform: scale(1.12);
}

.cutie-open-hint {
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: var(--cp-terracotta);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   STEP 2: WARM GREETING & MUSIC DEDICATION CARD
   ========================================================================== */
.cutie-music-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: var(--cp-card-shadow);
    border: 1px solid var(--cp-stamp-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cutie-vinyl-wrap {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, #2d2420 0%, #15110f 65%, #0d0a09 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25), inset 0 0 0 6px rgba(255, 255, 255, 0.06);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 24px 0;
    transition: transform 0.3s ease;
}

.cutie-vinyl-wrap.spinning {
    animation: cutieSpinVinyl 8s linear infinite;
}

@keyframes cutieSpinVinyl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cutie-vinyl-grooves {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.cutie-vinyl-label {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ffffff;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cutie-vinyl-label img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cutie-music-meta {
    margin-bottom: 20px;
}

.cutie-track-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cp-text-main);
    margin-bottom: 4px;
}

.cutie-track-artist {
    font-size: 0.82rem;
    color: var(--cp-text-muted);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Audio Waveform Equalizer */
.cutie-audio-wave {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 24px;
    margin-bottom: 22px;
}

.cutie-wave-bar {
    width: 3.5px;
    background: var(--cp-terracotta);
    border-radius: 3px;
    height: 6px;
    transition: height 0.2s ease;
}

.spinning ~ .cutie-music-meta + .cutie-audio-wave .cutie-wave-bar {
    animation: cutieWaveBounce 0.8s ease-in-out infinite alternate;
}

.cutie-wave-bar:nth-child(2) { animation-delay: 0.15s; }
.cutie-wave-bar:nth-child(3) { animation-delay: 0.3s; }
.cutie-wave-bar:nth-child(4) { animation-delay: 0.45s; }
.cutie-wave-bar:nth-child(5) { animation-delay: 0.2s; }

@keyframes cutieWaveBounce {
    0% { height: 6px; }
    100% { height: 22px; }
}

.cutie-music-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.btn-cutie-play-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 30px;
    background: var(--cp-terracotta);
    color: #ffffff;
    border: none;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(200, 109, 86, 0.38);
    transition: all 0.22s ease;
}

.btn-cutie-play-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(200, 109, 86, 0.5);
}

.btn-cutie-change-song {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 30px;
    background: #fdfaf6;
    color: var(--cp-text-main);
    border: 1.5px solid var(--cp-stamp-border);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(45, 36, 32, 0.05);
    transition: all 0.22s ease;
}

.btn-cutie-change-song:hover {
    background: #ffffff;
    border-color: var(--cp-terracotta);
    color: var(--cp-terracotta);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(200, 109, 86, 0.2);
}

/* ==========================================================================
   STEP 3: TACTILE 4-CUT PHOTOBOOTH STRIP
   ========================================================================== */
.cutie-photostrip-wrapper {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Live Filter Switcher Toolbar */
.cutie-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--cp-stamp-border);
    padding: 5px 10px;
    border-radius: 24px;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(45, 36, 32, 0.06);
}

.cutie-filter-btn {
    padding: 5px 12px;
    border-radius: 16px;
    background: transparent;
    border: none;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cp-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cutie-filter-btn.active {
    background: var(--cp-text-main);
    color: #ffffff;
}

/* Authentic 4-Cut Photobooth Strip ("Haru Film / Life 4-Cuts") */
.cutie-photostrip {
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px 14px 20px 14px;
    box-shadow: 0 20px 48px rgba(45, 36, 32, 0.14), 0 2px 6px rgba(45, 36, 32, 0.04);
    border: 1px solid rgba(213, 200, 187, 0.7);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

/* Photobooth Strip Header */
.cutie-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 6px 4px;
    border-bottom: 1px solid #eee8df;
}

.strip-brand-text {
    font-family: 'Courier Prime', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--cp-text-muted);
}

.strip-frame-num {
    font-family: 'Courier Prime', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--cp-terracotta);
}

/* 3D Flip Card Frame */
.cutie-frame-item {
    width: 100%;
    height: 180px;
    perspective: 1000px;
    cursor: pointer;
}

.cutie-flip-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 10px;
}

.cutie-frame-item.flipped .cutie-flip-inner {
    transform: rotateY(180deg);
}

/* Front Side: Photo */
.cutie-flip-front,
.cutie-flip-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
}

.cutie-flip-front {
    background: #ece5dc;
    position: relative;
}

.cutie-flip-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

/* Filter presets */
.filter-bw .cutie-flip-front img {
    filter: grayscale(100%) contrast(110%);
}

.filter-sepia .cutie-flip-front img {
    filter: sepia(45%) contrast(105%) brightness(96%);
}

.cutie-photo-hint-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(45, 36, 32, 0.7);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    pointer-events: none;
}

/* Back Side: Lined Paper Behind the Lens Memory */
.cutie-flip-back {
    background: #fffcee;
    border: 1px solid #ebdcb9;
    transform: rotateY(180deg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    box-shadow: inset 0 0 16px rgba(214, 185, 131, 0.15);
}

.cutie-memory-label {
    font-family: 'Courier Prime', monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    color: var(--cp-terracotta);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.cutie-memory-text {
    font-family: 'Caveat', cursive;
    font-size: 1.18rem;
    line-height: 1.35;
    color: #3b2f28;
}

/* Photobooth Strip Footer */
.cutie-strip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 0 4px;
    border-top: 1px solid #eee8df;
}

.strip-footer-barcode {
    font-family: 'Courier Prime', monospace;
    font-size: 0.64rem;
    color: var(--cp-text-muted);
}

.strip-footer-date {
    font-family: 'Courier Prime', monospace;
    font-size: 0.64rem;
    color: var(--cp-text-muted);
}

/* ==========================================================================
   STEP 4: 3 PICKABLE KEEPSAKE MEMORY TOKENS
   ========================================================================== */
.cutie-tokens-wrap {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cutie-tokens-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.cutie-token-item {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: var(--cp-paper-shadow);
    border: 1.5px solid var(--cp-stamp-border);
    cursor: pointer;
    text-align: left;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.cutie-token-item:hover {
    transform: translateY(-2px);
    border-color: var(--cp-terracotta);
}

.cutie-token-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cutie-token-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cp-text-main);
}

.cutie-token-badge .token-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cp-terracotta-soft);
    color: var(--cp-terracotta);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.cutie-token-status {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--cp-terracotta);
    font-weight: 700;
}

.cutie-token-reveal {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(213, 200, 187, 0.8);
    font-family: 'Playfair Display', serif;
    font-size: 0.96rem;
    line-height: 1.5;
    color: #3b2f28;
    font-style: italic;
    animation: cutieFadeIn 0.35s ease forwards;
}

.cutie-token-item.unsealed {
    background: #fffdfa;
    border-color: var(--cp-terracotta);
    box-shadow: 0 10px 24px rgba(200, 109, 86, 0.12);
}

.cutie-token-item.unsealed .cutie-token-reveal {
    display: block;
}

.cutie-token-item.unsealed .cutie-token-status {
    color: #10b981;
}

/* ==========================================================================
   STEP 5: HANDWRITTEN LETTER ON TEXTURED CREAM PAPER
   ========================================================================== */
.cutie-letter-wrap {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 28px 40px 28px;
    box-shadow: var(--cp-card-shadow);
    border: 1px solid var(--cp-stamp-border);
    position: relative;
    background-image: radial-gradient(rgba(213, 200, 187, 0.25) 1px, transparent 0);
    background-size: 20px 20px;
}

.cutie-letter-fold-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(213, 200, 187, 0.35);
    pointer-events: none;
}

.cutie-letter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.cutie-letter-date {
    font-family: 'Courier Prime', monospace;
    font-size: 0.72rem;
    color: var(--cp-text-muted);
}

.cutie-letter-greeting {
    font-family: 'Caveat', cursive;
    font-size: 1.7rem;
    color: var(--cp-text-main);
    font-weight: 700;
    margin-bottom: 16px;
}

.cutie-letter-body {
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    line-height: 1.55;
    color: #3b2e27;
    margin-bottom: 24px;
    white-space: pre-line;
}

/* Polaroid / Keepsake Photo Pinned to the Handwritten Letter */
.cutie-letter-photo-card {
    width: 210px;
    margin: 8px auto 26px auto;
    background: #ffffff;
    padding: 10px 10px 18px 10px;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(45, 36, 32, 0.12), 0 2px 6px rgba(45, 36, 32, 0.06);
    border: 1px solid #e3d5c6;
    transform: rotate(-2deg);
    position: relative;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.cutie-letter-photo-card:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 14px 30px rgba(45, 36, 32, 0.18);
}

/* Washi Tape Accent */
.cutie-washi-tape {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 20px;
    background: rgba(200, 109, 86, 0.65);
    border-left: 2px dashed rgba(255, 255, 255, 0.6);
    border-right: 2px dashed rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

.cutie-letter-photo-img-wrap {
    width: 100%;
    height: 165px;
    background: #f0e8dc;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.cutie-letter-photo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-letter-photo-camera {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(45, 36, 32, 0.8);
    backdrop-filter: blur(6px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 4;
}

.btn-letter-photo-camera:hover {
    background: var(--cp-terracotta);
    transform: scale(1.05);
}

.cutie-letter-photo-caption {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    color: var(--cp-text-main);
    font-weight: 600;
}

.cutie-letter-signoff {
    text-align: right;
    font-family: 'Caveat', cursive;
    font-size: 1.45rem;
    color: var(--cp-terracotta);
    font-weight: 700;
}

/* --- Floating Bottom Control Bar --- */
.cutie-bottom-action-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border: 1px solid var(--cp-stamp-border);
    padding: 8px 16px;
    border-radius: 36px;
    box-shadow: 0 8px 24px rgba(45, 36, 32, 0.12);
    z-index: 50;
}

.btn-cutie-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cutie-nav.prev {
    background: #f2ece4;
    color: var(--cp-text-main);
}

.btn-cutie-nav.prev:hover {
    background: #e7dfd5;
}

.btn-cutie-nav.next {
    background: var(--cp-terracotta);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(200, 109, 86, 0.35);
}

.btn-cutie-nav.next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200, 109, 86, 0.45);
}

.btn-cutie-nav.share {
    background: linear-gradient(135deg, #ff2d75, #9333ea);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(255, 45, 117, 0.35);
}

/* Edit Mode Highlighting in Tactile Keepsake */
.editing-active #photoboothKeepsakeContainer [contenteditable="true"] {
    outline: 1.5px dashed var(--cp-terracotta) !important;
    outline-offset: 3px;
    border-radius: 4px;
    background: rgba(200, 109, 86, 0.05);
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN (SMARTPHONES & TABLETS)
   ========================================================================== */
@media (max-width: 600px) {
    #photoboothKeepsakeContainer {
        padding-bottom: 85px;
    }

    .cutie-content-wrap {
        padding: 14px 12px;
        width: 100%;
    }

    /* Top Step Nav */
    .cutie-step-nav {
        gap: 5px;
        padding: 5px 10px;
        margin-bottom: 18px;
        border-radius: 24px;
        justify-content: flex-start;
    }

    .cutie-step-btn {
        padding: 5px 9px;
        font-size: 0.72rem;
        gap: 4px;
    }

    .cutie-step-btn i,
    .cutie-step-btn svg {
        width: 12px;
        height: 12px;
    }

    /* Step 1: Envelope Opener */
    .cutie-sleeve-box {
        padding: 22px 14px 26px 14px;
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
    }

    .cutie-postage-stamp {
        width: 38px;
        height: 50px;
        top: 12px;
        right: 12px;
        padding: 3px;
        font-size: 0.54rem;
        gap: 1px;
    }

    .cutie-postage-stamp .stamp-icon {
        font-size: 0.95rem;
    }

    .cutie-tag-pill {
        font-size: 0.62rem;
        padding: 3px 9px;
        margin-bottom: 10px;
    }

    .cutie-sleeve-title {
        font-size: 1.48rem;
        line-height: 1.25;
        margin-top: 6px;
        margin-bottom: 6px;
        padding: 0 4px;
    }

    .cutie-sleeve-sub {
        font-size: 0.82rem;
        line-height: 1.45;
        margin-bottom: 18px;
        padding: 0 4px;
    }

    /* The Envelope Graphic */
    .cutie-envelope-graphic {
        width: 100%;
        max-width: 305px;
        height: 205px;
        margin: 24px auto 16px auto;
    }

    .envelope-bg-back {
        height: 145px;
    }

    .envelope-svg-back-flap {
        bottom: 144px;
        height: 50px;
    }

    .cutie-envelope-letter-inside {
        width: 88%;
        max-width: 265px;
        height: 155px;
        padding: 10px 12px;
        gap: 10px;
        bottom: 16px;
    }

    .mini-letter-photo-thumb {
        width: 66px;
        height: 86px;
        padding: 3px 3px 12px 3px;
    }

    .mini-letter-greeting {
        font-size: 1.22rem;
    }

    .mini-letter-tag {
        font-size: 0.56rem;
    }

    .cutie-envelope-front-pocket {
        height: 128px;
    }

    .envelope-pocket-label {
        bottom: 10px;
        left: 14px;
    }

    .envelope-recipient-name {
        font-size: 1.20rem;
    }

    .cutie-wax-seal-btn {
        width: 58px;
        height: 58px;
        font-size: 1.05rem;
        bottom: 70px;
    }

    .cutie-open-hint {
        font-size: 1.05rem;
    }

    /* Step 2: Music Card */
    .cutie-music-card {
        padding: 24px 16px;
        border-radius: 20px;
    }

    .cutie-vinyl-wrap {
        width: 135px;
        height: 135px;
        margin: 14px 0 18px 0;
    }

    .cutie-vinyl-label {
        width: 54px;
        height: 54px;
    }

    .cutie-track-name {
        font-size: 1.22rem;
    }

    .btn-cutie-play-toggle {
        padding: 9px 20px;
        font-size: 0.8rem;
    }

    .btn-cutie-change-song {
        padding: 8px 15px;
        font-size: 0.76rem;
    }

    /* Step 3: Photobooth Strip */
    .cutie-photostrip-wrapper {
        max-width: 100%;
        width: 100%;
    }

    .cutie-filter-toolbar {
        padding: 4px 8px;
        gap: 4px;
        margin-bottom: 14px;
    }

    .cutie-filter-btn {
        padding: 4px 10px;
        font-size: 0.68rem;
    }

    .cutie-photostrip {
        padding: 12px 10px 18px 10px;
        border-radius: 16px;
        gap: 10px;
    }

    .cutie-frame-item {
        height: 165px;
    }

    .cutie-memory-text {
        font-size: 1.1rem;
    }

    /* Step 4: Keepsake Tokens */
    .cutie-tokens-wrap {
        width: 100%;
    }

    .cutie-token-item {
        padding: 15px 16px;
        border-radius: 16px;
    }

    .cutie-token-badge {
        font-size: 0.78rem;
    }

    .cutie-token-reveal {
        font-size: 0.90rem;
    }

    /* Step 5: Handwritten Letter */
    .cutie-letter-wrap {
        padding: 26px 18px 32px 18px;
        border-radius: 18px;
    }

    .cutie-letter-greeting {
        font-size: 1.45rem;
        margin-bottom: 12px;
    }

    .cutie-letter-body {
        font-size: 1.2rem;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .cutie-letter-photo-card {
        width: 195px;
        margin: 6px auto 20px auto;
    }

    .cutie-letter-photo-img-wrap {
        height: 150px;
    }

    .cutie-letter-signoff {
        font-size: 1.35rem;
    }

    /* Bottom Action Bar */
    .cutie-bottom-action-bar {
        bottom: 14px;
        padding: 6px 12px;
        gap: 8px;
        max-width: calc(100vw - 24px);
        width: auto;
    }

    .btn-cutie-nav {
        padding: 8px 14px;
        font-size: 0.76rem;
    }
}

/* Extra Compact Phones (iPhone SE, Galaxy Mini, width <= 380px) */
@media (max-width: 380px) {
    .cutie-content-wrap {
        padding: 10px 8px;
    }

    .cutie-sleeve-box {
        padding: 18px 10px 22px 10px;
    }

    .cutie-sleeve-title {
        font-size: 1.32rem;
    }

    .cutie-envelope-graphic {
        max-width: 275px;
        height: 185px;
        margin: 20px auto 14px auto;
    }

    .envelope-bg-back {
        height: 130px;
    }

    .envelope-svg-back-flap {
        bottom: 129px;
        height: 46px;
    }

    .cutie-envelope-letter-inside {
        width: 90%;
        max-width: 245px;
        height: 140px;
        padding: 8px 10px;
        gap: 8px;
    }

    .mini-letter-photo-thumb {
        width: 58px;
        height: 76px;
        padding: 2px 2px 10px 2px;
    }

    .mini-letter-greeting {
        font-size: 1.1rem;
    }

    .mini-letter-tag {
        font-size: 0.52rem;
    }

    .cutie-envelope-front-pocket {
        height: 115px;
    }

    .envelope-recipient-name {
        font-size: 1.12rem;
    }

    .cutie-wax-seal-btn {
        width: 52px;
        height: 52px;
        font-size: 0.95rem;
        bottom: 60px;
    }

    .cutie-vinyl-wrap {
        width: 120px;
        height: 120px;
    }

    .cutie-frame-item {
        height: 145px;
    }

    .cutie-letter-wrap {
        padding: 20px 14px 26px 14px;
    }

    .cutie-letter-greeting {
        font-size: 1.3rem;
    }

    .cutie-letter-body {
        font-size: 1.1rem;
    }

    .cutie-letter-photo-card {
        width: 175px;
    }

    .cutie-letter-photo-img-wrap {
        height: 135px;
    }

    .btn-cutie-nav {
        padding: 7px 11px;
        font-size: 0.72rem;
    }
}

/* ==========================================================================
   PHOTOBOOTH UNIVERSAL INLINE EDITING & VIEWER MODE STYLES
   ========================================================================== */
#photoboothKeepsakeContainer .editable-text {
    pointer-events: auto !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

#photoboothKeepsakeContainer .editable-text[contenteditable="true"]:hover {
    outline: 1px dashed rgba(197, 109, 86, 0.55);
    background: rgba(197, 109, 86, 0.06);
    border-radius: 4px;
}

#photoboothKeepsakeContainer .editable-text[contenteditable="true"]:focus {
    outline: 2px solid var(--cp-terracotta);
    background: rgba(255, 255, 255, 0.75);
    border-radius: 4px;
}

.viewer-mode #photoboothKeepsakeContainer .editable-text,
#photoboothKeepsakeContainer .editable-text[contenteditable="false"] {
    outline: none !important;
    border: none !important;
    background: transparent !important;
    cursor: default !important;
    user-select: auto;
}

.viewer-mode #photoboothKeepsakeContainer .envelope-recipient-name,
#photoboothKeepsakeContainer .envelope-recipient-name[contenteditable="false"] {
    border-bottom: none !important;
    background: transparent !important;
    cursor: default !important;
}

.viewer-mode #photoboothKeepsakeContainer .envelope-to-tag,
#photoboothKeepsakeContainer .envelope-to-tag[contenteditable="false"] {
    outline: none !important;
    background: transparent !important;
    cursor: default !important;
}

