:root {
    --primary: #e8a0bf;
    --primary-deep: #d4749a;
    --accent: #f2d1dc;
    --bg-start: #fdf2f4;
    --bg-end: #f5e6ea;
    --text-main: #5c3d4e;
    --text-soft: #a08090;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(232, 160, 191, 0.25);
    --card-shadow: 0 8px 32px rgba(212, 116, 154, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Varela Round', sans-serif;
    background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 50%, #f0dde4 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    user-select: none;
    color: var(--text-main);
}

/* ═══════════════════════════════════════
   LOADER
   ═══════════════════════════════════════ */
#loader-section {
    background: linear-gradient(160deg, var(--bg-start), var(--bg-end)) !important;
}

.loader-content {
    text-align: center;
    padding: 2rem;
    z-index: 10;
}

.loader-text {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem !important;
    color: var(--text-main) !important;
    font-weight: 600;
    margin-top: 1rem;
    letter-spacing: 0.5px;
}

.loading-bar-container {
    width: 200px;
    height: 4px;
    background: rgba(232, 160, 191, 0.2);
    border-radius: 10px;
    margin: 25px auto;
    overflow: hidden;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-deep));
    border-radius: 10px;
    transition: width 3s ease-in-out;
}

/* ═══════════════════════════════════════
   DIARY HOMEPAGE
   ═══════════════════════════════════════ */
#diary-section {
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
}

.diary-stickers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.sticker {
    position: absolute;
    font-size: 1.8rem;
    opacity: 0.15;
    animation: stickerFloat 15s infinite ease-in-out;
    pointer-events: none;
}

@keyframes stickerFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(12px, -20px) rotate(5deg);
    }

    50% {
        transform: translate(-8px, -35px) rotate(-3deg);
    }

    75% {
        transform: translate(-18px, -15px) rotate(4deg);
    }
}

.diary-page {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    position: relative;
    z-index: 1;
}

/* Header */
.diary-header {
    text-align: center;
    margin-bottom: 35px;
}

.diary-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-soft);
    display: block;
    margin-bottom: 12px;
}

.diary-title {
    font-family: 'Caveat', cursive;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 8px;
}

.diary-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-soft);
    font-weight: 300;
    font-style: italic;
}

/* Card Grid */
.diary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 30px;
}

.diary-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.diary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(212, 116, 154, 0.18);
}

.diary-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 20px 20px 0 0;
}

.mood-card::after {
    background: linear-gradient(90deg, #ffb3c6, #ff8fab);
}

/* Viral Lizard Tapping */
.mood-card {
    overflow: visible !important;
    position: relative;
}

.lizard-tap {
    position: absolute;
    top: -30px;
    right: -8px;
    width: 65px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    transform: scaleX(-1);
}

.fav-card::after {
    background: linear-gradient(90deg, #ffc8dd, #cdb4db);
}

.quirk-card::after {
    background: linear-gradient(90deg, #bde0fe, #a2d2ff);
}

.note-card::after {
    background: linear-gradient(90deg, #ffd6a5, #fdffb6);
}

/* Screaming Tom Lizard on Note Card */
.note-card {
    overflow: visible !important;
    position: relative;
}

.tom-lizard {
    position: absolute;
    top: -40px;
    right: -8px;
    width: 65px;
    height: auto;
    z-index: 10;
    pointer-events: none;
}

/* Motivation Card */
.motivation-card::after {
    background: linear-gradient(90deg, #c9f0c9, #a8e6cf);
}

.motivation-text {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.4;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.card-icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 6px;
}

.diary-card h3 {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.mood-emoji {
    font-size: 2.5rem;
    margin: 8px 0;
    animation: moodPulse 3s infinite ease-in-out;
}

@keyframes moodPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.card-detail {
    font-size: 0.75rem;
    color: var(--text-soft);
    font-style: italic;
    line-height: 1.4;
}

.fav-list {
    list-style: none;
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.9;
}

.quirk-text {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.4;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.quirk-shuffle {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-deep);
    background: transparent;
    border: 1px solid var(--card-border);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
    box-shadow: none;
}

.quirk-shuffle:hover {
    background: var(--accent);
    border-color: var(--primary);
}

.note-text {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.5;
}

/* Note card spans full width */
.note-card {
    grid-column: 1 / -1;
}

/* Portal CTA */
.diary-portal {
    text-align: center;
    margin: 10px 0 30px;
}

.portal-label {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--text-soft);
    margin-bottom: 14px;
}

.portal-btn {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    border: none;
    border-radius: 50px;
    padding: 14px 36px;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(212, 116, 154, 0.35);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.portal-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 35px rgba(212, 116, 154, 0.45);
}

.portal-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Footer */
.diary-footer {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid rgba(232, 160, 191, 0.15);
}

.diary-footer p {
    font-size: 0.7rem;
    color: var(--text-soft);
    letter-spacing: 0.5px;
}

/* Back Home Button */
.back-home-btn {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
    color: var(--text-soft) !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid var(--card-border) !important;
    padding: 8px 18px !important;
    box-shadow: none !important;
}

.back-home-btn:hover {
    color: var(--primary-deep) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: var(--primary) !important;
}

/* ═══════════════════════════════════════
   ORIGINAL SECTIONS (kept intact)
   ═══════════════════════════════════════ */

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.hidden {
    display: none;
    opacity: 0;
}

/* Floating Hearts */
.floating-hearts-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.heart-bg {
    position: absolute;
    bottom: -10vh;
    font-size: 2rem;
    color: rgba(232, 160, 191, 0.15);
    animation: floatUp 10s linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: 28px;
    box-shadow: var(--card-shadow);
    text-align: center;
    max-width: 90%;
    width: 480px;
    transition: all 0.35s ease;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-3px);
}

.img-container {
    margin-bottom: 1.5rem;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.img-container img,
.gallery img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 15px;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.08));
}

#ask-section .card {
    width: 600px;
    max-width: 95%;
}

#ask-section .img-container {
    height: 300px;
}

#ask-section .img-container img {
    max-height: 400px;
}

/* Valentine Card */
.valentine-card {
    position: relative;
    overflow: hidden;
    width: 650px;
    max-width: 75%;
}

.valentine-card::before {
    content: "❤️";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
    text-shadow:
        50px 30px 0 var(--primary),
        150px 50px 0 var(--primary),
        250px 40px 0 var(--primary),
        350px 60px 0 var(--primary),
        450px 35px 0 var(--primary),
        50px 130px 0 var(--primary),
        150px 150px 0 var(--primary),
        250px 140px 0 var(--primary),
        350px 160px 0 var(--primary),
        450px 135px 0 var(--primary),
        100px 230px 0 var(--primary),
        200px 250px 0 var(--primary),
        300px 240px 0 var(--primary),
        400px 260px 0 var(--primary);
}

.valentine-card h1,
.valentine-card h2,
.valentine-card p,
.valentine-card button {
    position: relative;
    z-index: 1;
}

/* Typography */
h1,
h2 {
    font-family: 'Pacifico', cursive;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h1 {
    font-size: 2.2rem;
}

h2 {
    font-size: 1.8rem;
}

/* Buttons */
.btn-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    min-height: 60px;
    align-items: center;
}

button {
    padding: 12px 28px;
    font-family: 'Varela Round', sans-serif;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06);
    outline: none;
    position: relative;
    z-index: 50;
}

#yes-btn,
.quiz-btn[data-answer="yes"],
#restart-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: white;
}

#yes-btn:hover,
.quiz-btn[data-answer="yes"]:hover,
#restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 116, 154, 0.35);
}

#no-btn,
.quiz-btn[data-answer="no"] {
    background-color: #fff;
    color: var(--text-main);
    border: 1.5px solid rgba(232, 160, 191, 0.3);
}

#no-btn:hover,
.quiz-btn[data-answer="no"]:hover {
    background-color: var(--accent);
}

/* Envelope */
.envelope-container {
    cursor: pointer;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.envelope {
    position: relative;
    width: 280px;
    height: 196px;
    background: var(--primary);
    border-radius: 10px;
    margin: 50px auto;
}

.envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-top: 98px solid var(--primary-deep);
    z-index: 2;
}

.envelope .letter {
    position: absolute;
    top: 20px;
    left: 28px;
    width: 224px;
    height: 168px;
    background: white;
    padding: 15px 10px;
    text-align: center;
    border-radius: 5px;
    transition: transform 0.5s ease;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-family: 'Pacifico', cursive;
    color: var(--primary-deep);
}

.envelope .letter img {
    width: 60px;
    margin-bottom: 8px;
}

.envelope.open .letter {
    transform: translateY(-100px);
    z-index: 3;
}

/* Celebration */
.wide-card {
    width: 600px;
}

.gallery {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.gallery img {
    height: 150px;
}

.love-note {
    font-size: 1.2rem;
    color: var(--text-soft);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Music Player */
.music-player {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

#music-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    font-size: 1.3rem;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(212, 116, 154, 0.1);
}

/* Timer */
.timer-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 2rem;
}

.time-box {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 16px;
    min-width: 80px;
    border: 1.5px solid var(--card-border);
}

.time-box span {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    color: var(--primary-deep);
    font-weight: 600;
    display: block;
}

.time-box p {
    font-size: 0.75rem;
    color: var(--text-soft);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Gallery */
#gallery-section {
    touch-action: none;
}

.polaroid-container {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
    touch-action: none;
}

.gallery-title {
    position: absolute;
    top: 20px;
    width: 100%;
    text-align: center;
    z-index: 20;
    pointer-events: none;
}

.polaroid {
    position: absolute;
    background: white;
    padding: 10px 10px 30px 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 180px;
    cursor: grab;
    transition: transform 0.2s, z-index 0s;
    user-select: none;
    z-index: 10;
    touch-action: none;
    border-radius: 4px;
}

.polaroid:active {
    cursor: grabbing;
    z-index: 30 !important;
    transform: scale(1.05);
}

.polaroid img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.polaroid p {
    font-family: 'Caveat', cursive;
    text-align: center;
    color: #555;
    margin-top: 10px;
    font-size: 1.1rem;
}

.instruction-text {
    position: absolute;
    bottom: 80px;
    width: 100%;
    text-align: center;
    color: var(--text-soft);
    font-style: italic;
    opacity: 0.7;
}

/* Wrong Answer Shake */
.shake {
    animation: shake 0.5s;
    border-color: #ff4444 !important;
    background: linear-gradient(45deg, #ff4b2b, #ff416c) !important;
    color: white !important;
    box-shadow: 0 0 20px #ff4b2b;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    12% {
        transform: translateX(-15px);
    }

    25% {
        transform: translateX(15px);
    }

    37% {
        transform: translateX(-15px);
    }

    50% {
        transform: translateX(15px);
    }

    62% {
        transform: translateX(-15px);
    }

    75% {
        transform: translateX(15px);
    }

    100% {
        transform: translateX(0);
    }
}

.quiz-choice-btn {
    transition: all 0.3s ease;
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.reason {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.reason.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reason img {
    height: 180px;
    margin-bottom: 20px;
    border-radius: 15px;
}

.carousel-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

.carousel-controls button {
    padding: 10px 20px;
    background: white;
}

/* ═══════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
    .diary-title {
        font-size: 2.2rem;
    }

    .diary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .diary-card {
        padding: 14px 12px;
    }

    .diary-page {
        padding: 25px 14px 50px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .card {
        width: 95%;
        padding: 1.5rem;
    }

    .img-container {
        height: 160px;
    }

    .gallery img {
        height: 100px;
    }

    .envelope {
        transform: scale(0.8);
    }

    .timer-container {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .time-box {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
    }

    .time-box span {
        font-size: 1.5rem;
    }

    .time-box p {
        margin: 0;
        font-size: 1rem;
    }

    .polaroid {
        width: 140px;
    }

    #gallery-next-btn {
        bottom: 80px !important;
    }

    .polaroid-container {
        height: 75vh !important;
        margin-top: -50px;
    }

    .wide-card {
        padding: 1rem !important;
        max-width: 92% !important;
    }

    .letter-content {
        padding: 1rem !important;
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
    }

    #meeting-countdown-section .card {
        padding: 1.5rem 1rem !important;
    }

    #valentines-timer-2026 {
        margin: 1.5rem 0 !important;
        gap: 10px !important;
    }

    .cute-decor {
        margin: 0.5rem 0 !important;
    }

    .cute-decor p {
        font-size: 1.2rem !important;
    }
}
