/* ==========================================
   STYLE SHEET: GREETING CARD ANDINI
   Theme: Pastel Pink, Cute, Feminine, Premium
   ========================================== */

/* --- CSS VARIABLES & TOKENS --- */
:root {
    --bg-primary: #FFF5F6;
    --bg-secondary: #FFE5EC;
    --primary-color: #FF8DA1;
    --primary-dark: #FF4D6D;
    --primary-light: #FFC2D1;
    --primary-pale: #FFEBEF;
    --accent-gold: #FFD166;
    --accent-teal: #A8DADC;
    --text-main: #5C3D42;
    --text-muted: #8E6E73;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 183, 197, 0.4);
    --shadow-soft: 0 12px 32px rgba(255, 141, 161, 0.15);
    --shadow-hard: 0 16px 40px rgba(255, 141, 161, 0.25);
    --font-heading: 'Outfit', sans-serif;
    --font-handwriting: 'Playpen Sans', cursive;
    --font-accent: 'Pacifico', cursive;
}

/* --- RESET & BASIC STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-heading);
    color: var(--text-main);
    background: radial-gradient(circle at center, #FFFDFD 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* --- PARTICLE CANVAS --- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- MAIN CONTAINER --- */
#app-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 750px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

/* --- TYPOGRAPHY UTILITIES --- */
.title-font {
    font-family: var(--font-accent);
    color: var(--primary-dark);
    font-weight: normal;
}

h1, h2, h3, h4 {
    font-weight: 800;
}

p {
    line-height: 1.6;
}

/* --- AUDIO CONTROL BUTTON --- */
#audio-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    animation: bounce-gentle 2s infinite ease-in-out;
}

#music-btn {
    background: var(--card-bg);
    border: 2px solid var(--primary-light);
    padding: 10px 18px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#music-btn:hover {
    transform: scale(1.08);
    background: var(--primary-pale);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-hard);
}

#music-btn.playing {
    background: var(--primary-dark);
    color: white;
    border-color: var(--primary-dark);
}

#music-btn.playing .music-note {
    animation: rotate-music 3s linear infinite;
}

/* --- BUTTONS --- */
.btn {
    font-family: var(--font-heading);
    font-weight: 800;
    padding: 14px 28px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 25px rgba(255, 77, 109, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary-dark);
    border: 2px solid var(--primary-pale);
}

.btn-secondary:hover {
    background: var(--primary-pale);
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--shadow-soft);
}

.btn-success {
    background: linear-gradient(135deg, #FF708A 0%, #E63946 100%);
    color: white;
    font-size: 18px;
    padding: 16px 36px;
    animation: heartbeat 1.5s infinite;
}

.btn-success:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.4);
}

.btn-danger {
    background: #E5E5E5;
    color: #777777;
    border: 2px solid #D5D5D5;
}

.btn-gold {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #E9C46A 100%);
    color: #4A3B12;
}

.btn-gold:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 25px rgba(233, 196, 106, 0.4);
}

/* ==========================================
   SECTION 1: COVER PAGE (ENVELOPE)
   ========================================== */

#cover-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    animation: fade-in 1s ease;
}

.welcome-text {
    margin-bottom: 40px;
    padding: 0 16px;
}

.welcome-text h1 {
    font-family: var(--font-accent);
    color: var(--primary-dark);
    font-size: 2.8rem;
    margin-bottom: 12px;
    font-weight: normal;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8);
}

.welcome-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- THE CSS ENVELOPE DRAWING --- */
.envelope-wrapper {
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.envelope {
    position: relative;
    width: 280px;
    height: 180px;
    background: #FFCAD4;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 15px 35px rgba(255, 141, 161, 0.25);
    cursor: pointer;
    transition: transform 0.4s ease;
}

.envelope:hover {
    transform: translateY(-8px);
}

.envelope .flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-top: 100px solid #FFCAD4;
    border-radius: 4px;
    transform-origin: top;
    transition: transform 0.4s ease, border-top-color 0.4s;
    z-index: 30;
}

.envelope.open .flap {
    transform: rotateX(180deg);
    z-index: 10;
    border-top-color: #FFB7C5;
}

.envelope .pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 140px solid #FFE5EC;
    border-right: 140px solid #FFE5EC;
    border-bottom: 90px solid #FFD8DF;
    border-top: 90px solid transparent;
    border-radius: 0 0 8px 8px;
    z-index: 20;
}

.envelope .letter-preview {
    position: absolute;
    left: 20px;
    bottom: 10px;
    width: 240px;
    height: 140px;
    background: white;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.4s ease, bottom 0.4s ease;
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.envelope.open .letter-preview {
    transform: translateY(-80px) scale(1.05);
    bottom: 20px;
    z-index: 25;
}

.letter-line-preview {
    height: 10px;
    background: var(--primary-pale);
    border-radius: 20px;
    width: 100%;
}

.letter-line-preview-short {
    height: 10px;
    background: var(--primary-pale);
    border-radius: 20px;
    width: 60%;
}

.envelope .hearts {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    transition: all 0.3s;
}

.envelope.open .hearts {
    transform: translate(-50%, 50px) scale(0.8);
    opacity: 0;
    pointer-events: none;
}

.heart {
    width: 50px;
    height: 50px;
    background: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 15px rgba(255, 77, 109, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
    animation: heartbeat-button 1.2s infinite ease-in-out;
}

.heart i {
    color: white;
    font-size: 22px;
}

.heart:hover {
    background: #E63946;
}

.click-instruction {
    font-size: 0.95rem;
    color: var(--primary-dark);
    font-weight: 600;
    letter-spacing: 1px;
    animation: pulse-slow 1.5s infinite ease-in-out;
}

/* ==========================================
   SECTION 2: MAIN CONTENT & GLASS CARD
   ========================================== */

#main-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fade-in-up 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

/* --- NAVIGATION BAR --- */
.navigation-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 50px;
    padding: 8px;
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-soft);
}

.nav-item {
    background: none;
    border: none;
    outline: none;
    padding: 14px 8px; /* larger tap area */
    border-radius: 40px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    min-height: 48px;
}

.nav-item i {
    font-size: 18px;
    transition: transform 0.3s;
}

.nav-item:hover {
    color: var(--primary-dark);
}

.nav-item:hover i {
    transform: translateY(-2px) scale(1.1);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 6px 15px rgba(255, 77, 109, 0.3);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* --- THE MAIN CARD DISPLAY --- */
.content-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 32px;
    padding: 36px;
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-hard);
    position: relative;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    flex-direction: column;
    flex-grow: 1;
}

.tab-content.active {
    display: flex;
    opacity: 1;
    animation: fade-in-tab 0.5s ease-out forwards;
}

/* ==========================================
   TAB 1: CAKE AND BLOW CANDLES
   ========================================== */

.cake-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: space-between;
    height: 100%;
}

.cake-header h2 {
    font-size: 2.2rem;
    margin-bottom: 12px;
    line-height: 1.2;
}

.cake-header p {
    color: var(--text-muted);
    font-weight: 500;
    max-width: 500px;
    margin: 0 auto;
    font-size: 1rem;
}

/* --- CSS CAKE DRAWING --- */
.cake-box {
    margin: 40px 0;
    position: relative;
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
}

.cake {
    position: relative;
    width: 250px;
    height: 160px;
}

.plate {
    position: absolute;
    bottom: -10px;
    left: -15px;
    width: 280px;
    height: 20px;
    background: #E5E5E5;
    border-bottom: 6px solid #D5D5D5;
    border-radius: 50%;
    z-index: 1;
}

.layer {
    position: absolute;
    width: 230px;
    height: 45px;
    left: 10px;
    border-radius: 50% / 20px;
}

.layer-bottom {
    bottom: 0px;
    background: #E07A5F;
    border-bottom: 4px solid #C9664D;
}

.layer-middle {
    bottom: 30px;
    background: #F4F1DE;
    width: 220px;
    left: 15px;
    height: 40px;
}

.layer-top {
    bottom: 55px;
    background: #F2CC8F;
    width: 210px;
    left: 20px;
    height: 40px;
}

.icing {
    position: absolute;
    bottom: 75px;
    left: 20px;
    width: 210px;
    height: 25px;
    background: #FFB7C5;
    border-radius: 50% / 15px;
    z-index: 5;
    border-bottom: 2px solid #FF8DA1;
}

.drip {
    position: absolute;
    background: #FFB7C5;
    border-radius: 10px;
    z-index: 6;
}

.drip1 {
    width: 14px;
    height: 30px;
    left: 45px;
    bottom: 65px;
}

.drip2 {
    width: 16px;
    height: 36px;
    left: 110px;
    bottom: 55px;
}

.drip3 {
    width: 12px;
    height: 24px;
    left: 175px;
    bottom: 70px;
}

/* --- CANDLE --- */
.candle {
    position: absolute;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 60px;
    background: linear-gradient(to right, #FFF 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    border-radius: 4px;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.candle-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
    font-family: var(--font-heading);
    text-shadow: 1px 1px 0px white;
    user-select: none;
}

.wick {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 12px;
    background: #444;
}

.flame {
    position: absolute;
    top: -38px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 28px;
    background: radial-gradient(circle at bottom, #FFD166 0%, #F4A261 40%, #E76F51 100%);
    border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
    box-shadow: 0 0 15px rgba(244,162,97,0.7), 0 0 30px rgba(244,162,97,0.4);
    animation: flicker 0.1s infinite alternate;
    cursor: pointer;
    transform-origin: bottom center;
}

.flame:hover {
    transform: translateX(-50%) scale(1.15);
}

.cake-instructions {
    font-size: 15px;
    color: var(--primary-dark);
    font-weight: 600;
    margin-top: 10px;
    background: var(--primary-pale);
    padding: 10px 20px;
    border-radius: 20px;
    animation: pulse-slow 1.5s infinite ease-in-out;
}

.cute-alert {
    background: white;
    border: 2px solid var(--primary-light);
    border-radius: 24px;
    padding: 28px;
    margin-top: 10px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    animation: scale-up 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.cute-alert h3 {
    font-family: var(--font-accent);
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 12px;
    font-weight: normal;
}

.cute-alert p {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ==========================================
   TAB 2: LOVE LETTER
   ========================================== */

.letter-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.letter-paper {
    background: #FFFDFC;
    background-image: radial-gradient(rgba(255, 183, 197, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid rgba(255, 183, 197, 0.3);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(92, 61, 66, 0.05);
    position: relative;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.letter-paper::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(255, 77, 109, 0.15);
}

.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px dashed rgba(255, 141, 161, 0.3);
    padding-bottom: 15px;
    margin-bottom: 20px;
    padding-left: 10px;
}

.letter-date {
    font-family: var(--font-handwriting);
    font-size: 14px;
    color: var(--text-muted);
}

.letter-stamp {
    width: 40px;
    height: 40px;
    border: 2px dashed var(--primary-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transform: rotate(12deg);
}

.letter-header h3 {
    font-family: var(--font-handwriting);
    color: var(--primary-dark);
    margin-top: 15px;
    font-size: 1.3rem;
}

.letter-body {
    font-family: var(--font-handwriting);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4A3538;
    white-space: pre-wrap;
    flex-grow: 1;
    padding-left: 10px;
    min-height: 180px;
}

/* Typing cursor */
.letter-body::after {
    content: ' ✍️';
    animation: typing-indicator 0.8s infinite;
}

.letter-body.done-typing::after {
    display: none;
}

.letter-footer {
    border-top: 1px dashed rgba(255, 141, 161, 0.3);
    padding-top: 15px;
    margin-top: 20px;
    text-align: right;
    font-family: var(--font-handwriting);
    animation: fade-in 1s ease forwards;
}

.signature-intro {
    font-size: 14px;
    color: var(--text-muted);
}

.signature-name {
    font-size: 1.8rem;
    color: var(--primary-dark);
    font-family: var(--font-accent);
    margin-top: 5px;
}

.letter-actions {
    animation: fade-in 1s ease forwards;
}

/* ==========================================
   TAB 3: POLAROID MEMORIES
   ========================================== */

.memories-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.memories-header {
    text-align: center;
    margin-bottom: 30px;
}

.memories-header h2 {
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 8px;
}

.memories-header p {
    color: var(--text-muted);
}

/* --- POLAROID DISPLAY --- */
.polaroid-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    width: 100%;
    margin-bottom: 30px;
}

.polaroid {
    background: white;
    padding: 16px 16px 24px 16px;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(92, 61, 66, 0.12);
    width: 180px;
    transform: rotate(var(--rotation));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.1) translateY(-10px);
    box-shadow: 0 15px 35px rgba(255, 77, 109, 0.2);
    z-index: 10;
}

.polaroid-image {
    width: 100%;
    height: auto;
    border-radius: 2px;
    display: block;
}

.polaroid-image-placeholder {
    width: 100%;
    height: 140px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0,0,0,0.04);
}

.img-cat-hug {
    background: linear-gradient(135deg, #FFE5EC 0%, #FFCAD4 100%);
}

.img-code-love {
    background: linear-gradient(135deg, #E8F0FE 0%, #D2E3FC 100%);
}

.img-coffee-date {
    background: linear-gradient(135deg, #FFF4E5 0%, #FFE0B2 100%);
}

.icon-placeholder {
    font-size: 40px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
    animation: bounce-gentle 3s infinite ease-in-out;
}

.pink-color { color: var(--primary-dark); }
.blue-color { color: #4285F4; }
.orange-color { color: #F57C00; }

.polaroid-caption {
    margin-top: 14px;
    text-align: center;
    font-family: var(--font-handwriting);
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-main);
    font-weight: 500;
}

.polaroid-tip {
    font-size: 13px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.5);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--primary-pale);
    margin-bottom: 24px;
    text-align: center;
}

.memories-action {
    display: flex;
    justify-content: center;
}

/* ==========================================
   TAB 4: INTERACTIVE LOVE QUIZ
   ========================================== */

.quiz-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-grow: 1;
    min-height: 380px;
    gap: 30px;
    animation: fade-in 0.5s ease;
}

.cute-badge {
    background: var(--primary-pale);
    color: var(--primary-dark);
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    display: inline-block;
    border: 1.5px solid var(--primary-light);
    margin-bottom: 12px;
}

.quiz-header h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.quiz-question {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    max-width: 500px;
}

.quiz-choices {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    min-height: 120px; /* Crucial to accommodate moving button */
    width: 100%;
    position: relative;
}

#quiz-no-btn {
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1);
}

.quiz-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- SUCCESS PANEL --- */
.quiz-success-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    animation: scale-up-confetti 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.success-illustration {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-illustration > i {
    font-size: 65px;
}

.heartbeat-love {
    color: #ff4d6d; /* Sweet pink-red hot heart */
    animation: heartbeat-love-pulse 0.9s infinite ease-in-out;
    filter: drop-shadow(0 4px 10px rgba(255, 77, 109, 0.45));
}

@keyframes heartbeat-love-pulse {
    0% { transform: scale(1); }
    25% { transform: scale(1.18); }
    45% { transform: scale(1.06); }
    70% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

.text-gold {
    color: var(--accent-gold);
}

.sparkles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sparkle {
    position: absolute;
    color: #ff758f; /* Beautiful soft pink for tiny hearts */
    font-size: 16px;
    animation: sparkle-pulse 1.4s infinite alternate ease-in-out;
}

.s1 { top: 10px; left: 10px; animation-delay: 0.1s; }
.s2 { top: 5px; right: 10px; animation-delay: 0.5s; }
.s3 { bottom: 15px; right: 15px; animation-delay: 0.9s; }

.text-highlight {
    font-size: 2rem;
    line-height: 1.3;
}

.final-love-card {
    background: white;
    border: 2px solid var(--primary-light);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-soft);
    max-width: 550px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.final-love-card p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.love-quote {
    font-family: var(--font-handwriting);
    font-size: 1.15rem !important;
    line-height: 1.8;
    color: var(--primary-dark) !important;
    font-style: italic;
    background: var(--primary-pale);
    padding: 15px 20px;
    border-radius: 16px;
    border-left: 4px solid var(--primary-color);
}

.kicau-congrats {
    font-weight: 600;
    color: #4A5759 !important;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-tab {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scale-up {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scale-up-confetti {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes heartbeat-button {
    0% { transform: scale(1); }
    14% { transform: scale(1.12); }
    28% { transform: scale(1); }
    42% { transform: scale(1.12); }
    70% { transform: scale(1); }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

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

@keyframes pulse-slow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.98); }
}

@keyframes flicker {
    0% { transform: translateX(-50%) rotate(-1deg) scale(1); }
    100% { transform: translateX(-50%) rotate(1deg) scale(1.08); opacity: 0.9; }
}

@keyframes typing-indicator {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

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

@keyframes sparkle-pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 1; }
}

/* ==========================================
   RESPONSIVE DESIGN (MOBILE-FIRST POLISH)
   ========================================== */

@media (max-width: 600px) {

    /* --- FIX: Remove flex centering so page scrolls naturally from top --- */
    body {
        display: block;
    }

    #app-container {
        padding: 16px 10px;
        min-height: auto;
        display: block;
        max-width: 100%;
    }

    /* --- Music button: icon only, small circle, top-right --- */
    #audio-control {
        top: 10px;
        right: 10px;
        animation: none;
    }

    #music-btn {
        padding: 10px;
        font-size: 14px;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        justify-content: center;
    }

    #music-btn .music-text {
        display: none;
    }

    /* --- Navigation bar: normal flow, NOT fixed --- */
    .navigation-bar {
        border-radius: 16px;
        padding: 4px;
        margin-bottom: 16px;
    }

    .nav-item {
        padding: 8px 4px;
        font-size: 10px;
        gap: 2px;
        min-height: 44px;
    }

    .nav-item span {
        white-space: nowrap;
    }

    .nav-item i {
        font-size: 15px;
    }

    /* --- COVER SECTION --- */
    #cover-section {
        padding-top: 50px; /* clear music button */
    }

    .welcome-text {
        margin-bottom: 20px;
    }

    .welcome-text h1 {
        font-size: 2rem;
    }

    .welcome-text p {
        font-size: 0.9rem;
    }

    .envelope-wrapper {
        height: 300px;
        margin-bottom: 16px;
    }

    .envelope {
        width: 240px;
        height: 155px;
    }

    .envelope .flap {
        border-left-width: 120px;
        border-right-width: 120px;
        border-top-width: 85px;
    }

    .envelope .pocket {
        border-left-width: 120px;
        border-right-width: 120px;
        border-bottom-width: 78px;
        border-top-width: 78px;
    }

    .envelope .letter-preview {
        left: 15px;
        width: 210px;
        height: 120px;
    }

    .click-instruction {
        font-size: 0.85rem;
    }

    /* --- Main section --- */
    #main-section {
        gap: 16px;
    }

    /* --- CONTENT CARD --- */
    .content-card {
        padding: 20px 14px;
        border-radius: 20px;
        min-height: auto;
    }

    /* --- CAKE TAB --- */
    .cake-header h2 {
        font-size: 1.5rem;
    }

    .cake-header p {
        font-size: 0.85rem;
    }

    .cake-box {
        margin: 16px 0;
        height: 180px;
    }

    .cake {
        width: 180px;
        height: 120px;
    }

    .plate {
        width: 210px;
        left: -15px;
    }

    .layer {
        width: 170px;
        height: 35px;
    }

    .layer-middle {
        bottom: 20px;
        left: 15px;
    }

    .layer-top {
        bottom: 40px;
        left: 20px;
    }

    .icing {
        bottom: 55px;
        left: 20px;
        width: 170px;
    }

    .drip1 { left: 40px; bottom: 48px; }
    .drip2 { left: 85px; bottom: 42px; }
    .drip3 { left: 130px; bottom: 50px; }

    .candle {
        bottom: 70px;
        height: 48px;
        width: 26px;
    }

    .candle-number {
        font-size: 18px;
    }

    .flame {
        top: -30px;
        width: 14px;
        height: 24px;
    }

    .cake-instructions {
        font-size: 13px;
        padding: 8px 14px;
    }

    .cute-alert {
        padding: 20px 16px;
    }

    .cute-alert h3 {
        font-size: 1.4rem;
    }

    .cute-alert p {
        font-size: 0.9rem;
    }

    /* --- LETTER TAB --- */
    .letter-paper {
        padding: 20px 14px 20px 26px;
        min-height: auto;
    }

    .letter-paper::before {
        left: 18px;
    }

    .letter-date {
        font-size: 12px;
    }

    .letter-stamp {
        width: 30px;
        height: 30px;
    }

    .letter-header h3 {
        font-size: 1rem;
    }

    .letter-body {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .signature-name {
        font-size: 1.4rem;
    }

    /* --- POLAROID TAB --- */
    .memories-header h2 {
        font-size: 1.5rem;
    }

    .memories-header p {
        font-size: 0.85rem;
    }

    .polaroid-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .polaroid {
        width: 85%;
        max-width: 260px;
        padding: 12px 12px 18px 12px;
    }

    .polaroid-image-placeholder {
        height: 140px;
    }

    .polaroid-image {
        height: auto;
    }

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

    .polaroid-caption {
        font-size: 11px;
        margin-top: 10px;
        line-height: 1.4;
    }

    .polaroid-tip {
        font-size: 11px;
        padding: 6px 12px;
    }

    /* --- QUIZ TAB --- */
    .quiz-container {
        min-height: auto;
    }

    .quiz-header h2 {
        font-size: 1.4rem;
    }

    .quiz-question {
        font-size: 1.1rem;
    }

    .quiz-choices {
        flex-direction: column;
        gap: 12px;
        min-height: 160px;
        width: 100%;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
    }

    .btn-success {
        font-size: 15px;
        padding: 14px 22px;
    }

    /* --- QUIZ SUCCESS --- */
    .text-highlight {
        font-size: 1.3rem;
    }

    .final-love-card {
        padding: 16px;
    }

    .love-quote {
        font-size: 0.9rem !important;
        padding: 10px 14px;
    }

    .footer-buttons .btn {
        font-size: 13px;
        padding: 12px 18px;
    }
}

/* --- PREMIUM MUSIC PLAYER CARD --- */
.music-player-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    padding: 20px;
    margin: 20px auto 10px auto;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 12px 35px rgba(255, 77, 109, 0.12);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.music-player-card:hover {
    box-shadow: 0 16px 40px rgba(255, 77, 109, 0.2);
    transform: translateY(-2px);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.album-art-container {
    width: 60px;
    height: 60px;
    position: relative;
    perspective: 100px;
}

.album-art {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff758f, #ff4d6d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 77, 109, 0.3);
    color: white;
}

.album-art .disc-icon {
    font-size: 26px;
}

.album-art.spinning {
    animation: spinDisc 3.5s linear infinite;
}

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

.track-meta {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.track-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #ff4d6d;
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.track-artist {
    font-family: 'Playpen Sans', sans-serif;
    font-size: 11px;
    color: #880d1e;
    margin: 0;
}

/* Timeline & Seek Range */
.player-timeline {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.time-display {
    font-size: 11px;
    color: #ff4d6d;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    min-width: 32px;
}

.seek-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 4px;
    background: rgba(255, 77, 109, 0.15);
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

.seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff4d6d;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 77, 109, 0.4);
    transition: transform 0.1s ease;
}

.seek-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.player-btn {
    background: none;
    border: none;
    outline: none;
    color: #ff758f;
    font-size: 16px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.player-btn:hover {
    background: rgba(255, 77, 109, 0.08);
    color: #ff4d6d;
}

.player-btn.active-loop {
    color: #ff4d6d;
    background: rgba(255, 77, 109, 0.1);
}

.play-pause-btn {
    background: linear-gradient(135deg, #ff758f, #ff4d6d);
    color: white;
    width: 48px;
    height: 48px;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.3);
}

.play-pause-btn:hover {
    background: linear-gradient(135deg, #ff8da1, #ff5e7e);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(255, 77, 109, 0.4);
}

/* --- PASSWORD MODAL STYLES --- */
.password-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

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

.password-modal-card {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 50px rgba(255, 77, 109, 0.25);
    border-radius: 28px;
    padding: 30px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.password-modal-overlay.active .password-modal-card {
    transform: scale(1);
}

.password-modal-icon {
    font-size: 45px;
    color: #ff4d6d;
}

.password-modal-card h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #ff4d6d;
    margin: 0;
}

.password-modal-card p {
    font-family: 'Playpen Sans', sans-serif;
    font-size: 13px;
    color: #880d1e;
    margin: 0;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

#password-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border-radius: 16px;
    border: 2px solid rgba(255, 77, 109, 0.3);
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.2s;
}

#password-input:focus {
    border-color: #ff4d6d;
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.2);
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ff758f;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.password-error {
    font-size: 12px !important;
    color: #d90429 !important;
    font-weight: 600;
    margin: 0;
    animation: shake-error 0.4s ease;
}

@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.password-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn-cancel {
    flex: 1;
    background: #f0f0f0;
    border: none;
    padding: 12px;
    border-radius: 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e4e4e4;
}

.btn-submit {
    flex: 2;
    background: linear-gradient(135deg, #ff758f, #ff4d6d);
    border: none;
    padding: 12px;
    border-radius: 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.3);
    transition: all 0.2s;
}

.btn-submit:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 77, 109, 0.4);
}

/* --- LETTER VERSION TOGGLE --- */
.letter-version-toggle {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.5);
    padding: 6px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.version-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    border-radius: 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #ff758f;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.version-btn.active {
    background: linear-gradient(135deg, #ff758f, #ff4d6d);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 77, 109, 0.2);
}

/* --- LETTER PHOTOS VERSION --- */
.letter-photos-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    animation: scale-up 0.5s ease forwards;
}

.letter-photos-scroll {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 480px;
}

.letter-photo-card {
    position: relative;
    background: white;
    padding: 12px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 77, 109, 0.1);
    transition: transform 0.3s ease;
}

.letter-photo-card:hover {
    transform: translateY(-4px);
}

.letter-photo-zoomable {
    width: 100%;
    height: auto;
    border-radius: 14px;
    cursor: zoom-in;
    display: block;
    transition: filter 0.2s;
}

.letter-photo-zoomable:hover {
    filter: brightness(0.95);
}

.page-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 77, 109, 0.85);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.zoom-hint {
    font-family: 'Playpen Sans', sans-serif;
    font-size: 12px;
    color: #880d1e;
    text-align: center;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

/* --- LIGHTBOX MODAL STYLES --- */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 20000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.lightbox-modal.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 20001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #ff4d6d;
    text-decoration: none;
}

.lightbox-caption {
    margin: 15px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    font-family: 'Playpen Sans', sans-serif;
    font-size: 14px;
}
