/* ========================================
   Reset & Design Tokens (shadcn-inspired)
   ======================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background: #09090b;
    --foreground: #fafafa;
    --card: #0c0c0e;
    --card-border: #27272a;
    --muted: #a1a1aa;
    --primary: #e11d48;
    --primary-light: #fb7185;
    --primary-dark: #9f1239;
    --accent: #f43f5e;
    --destructive: #7f1d1d;
    --radius: 0.75rem;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background: var(--background);
    color: var(--foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Mobile Blocker Page
   ======================================== */

#mobile-page {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--background);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.mobile-card {
    text-align: center;
    max-width: 380px;
}

.mobile-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-gif {
    width: 100%;
    max-width: 280px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    margin-bottom: 1.5rem;
}

.mobile-message {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--muted);
}

.mobile-message strong {
    color: var(--foreground);
}

.mobile-subtitle {
    font-size: 0.8rem;
    font-style: italic;
    opacity: 0.5;
}

/* ========================================
   Desktop Content
   ======================================== */

#desktop-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Floating Hearts Background */

#hearts-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.floating-heart {
    position: absolute;
    bottom: -40px;
    color: var(--primary);
    opacity: 0;
    animation: floatUp linear infinite;
    pointer-events: none;
    user-select: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    5% {
        opacity: 0.12;
    }
    90% {
        opacity: 0.12;
    }
    100% {
        transform: translateY(-105vh) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

/* ========================================
   Card (shadcn-style)
   ======================================== */

#main-page {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 2.5rem 3rem;
    max-width: 540px;
    width: 100%;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.card-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--foreground) 30%, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-description {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.card-content {
    margin-bottom: 1.5rem;
}

.card-footer {
    text-align: center;
}

.disclaimer {
    font-size: 0.65rem;
    color: var(--muted);
    opacity: 0.4;
    font-style: italic;
}

/* ========================================
   Valentine Buttons
   ======================================== */

.buttons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    padding: 1.5rem 0;
}

.btn-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Heart wrapper for OUI --- */

.heart-wrapper {
    width: 140px;
    height: 130px;
}

.heart-outline {
    position: absolute;
    width: 140px;
    height: 130px;
    color: var(--primary);
    opacity: 0.35;
    pointer-events: none;
    animation: heartPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(225, 29, 72, 0.2));
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.08); opacity: 0.55; }
}

.btn-oui {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 25px rgba(225, 29, 72, 0.3);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-oui:hover {
    transform: scale(1.12);
    box-shadow: 0 0 40px rgba(225, 29, 72, 0.5);
}

.btn-oui:active {
    transform: scale(1.05);
}

/* OUI button grow animation after NON click */
.btn-oui.grown {
    width: 120px;
    height: 120px;
    font-size: 1.6rem;
    box-shadow: 0 0 50px rgba(225, 29, 72, 0.6);
}

.heart-wrapper.grown-wrapper {
    width: 180px;
    height: 170px;
}

.heart-wrapper.grown-wrapper .heart-outline {
    width: 180px;
    height: 170px;
}

/* --- Circle wrapper for NON --- */

.circle-wrapper {
    width: 110px;
    height: 110px;
}

.circle-outline {
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.btn-non {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--card-border);
    cursor: pointer;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.btn-non:hover {
    border-color: var(--muted);
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.03);
}

.btn-non:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    border-color: var(--card-border);
    color: var(--muted);
    background: transparent;
}

.btn-non:disabled:hover {
    border-color: var(--card-border);
    color: var(--muted);
    background: transparent;
}

/* ========================================
   Rejection Zone
   ======================================== */

#rejection-zone {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeSlideIn 0.5s ease;
}

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

.rejection-gif {
    width: 100%;
    max-width: 250px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    margin-bottom: 0.75rem;
}

.rejection-message {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ========================================
   Hidden utility
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   Windows 98 Popups
   ======================================== */

#popups-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

.win98-popup {
    position: absolute;
    pointer-events: all;
    width: 340px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.4);
    font-family: 'Segoe UI', 'Microsoft Sans Serif', Tahoma, sans-serif;
}

.win98-popup.win98-appear {
    animation: popupAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupAppear {
    from {
        transform: scale(0.3) rotate(-5deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.win98-titlebar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: bold;
    user-select: none;
    height: 20px;
}

.win98-titlebar-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.win98-close {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #404040;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    cursor: pointer;
    color: black;
    font-weight: bold;
    line-height: 1;
    flex-shrink: 0;
}

.win98-close:active {
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}

.win98-body {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: black;
    background: #c0c0c0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.win98-body img {
    width: 100%;
    max-width: 180px;
    margin: 8px auto;
    display: block;
    border-top: 1px solid #404040;
    border-left: 1px solid #404040;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
}

.win98-body .win98-photo {
    max-width: 220px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.win98-body p {
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.5;
}

.win98-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.win98-counter {
    font-size: 9px;
    color: #808080;
    margin-top: 4px;
}

.win98-footer {
    padding: 6px 16px 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
    background: #c0c0c0;
}

.win98-btn {
    padding: 3px 16px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 11px;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #404040;
    border-bottom: 2px solid #404040;
    background: #c0c0c0;
    cursor: pointer;
    min-width: 75px;
    color: black;
}

.win98-btn:active {
    border-top: 2px solid #404040;
    border-left: 2px solid #404040;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}

.win98-btn-oui {
    animation: blink98 0.7s step-end infinite;
    font-weight: bold;
}

@keyframes blink98 {
    0%, 100% { background: #c0c0c0; color: black; }
    50% { background: #000080; color: white; }
}

/* Shake effect when clicking wrong popup */
.win98-shake {
    animation: win98Shake 0.5s ease forwards;
    outline: 3px solid #ff0000;
    outline-offset: -1px;
}

@keyframes win98Shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-12px) rotate(-2deg); }
    30% { transform: translateX(10px) rotate(2deg); }
    45% { transform: translateX(-8px) rotate(-1deg); }
    60% { transform: translateX(6px) rotate(1deg); }
    75% { transform: translateX(-3px); }
}

/* ========================================
   Wait Page (before Feb 14)
   ======================================== */

#wait-page {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--background);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

#wait-page:not(.hidden) {
    display: flex;
    animation: finalReveal 1.2s ease;
}

.wait-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wait-message {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.wait-message strong {
    color: var(--foreground);
}

.wait-subtitle {
    font-size: 0.95rem;
    color: var(--primary-light);
    font-weight: 600;
}

.wait-gif {
    width: 100%;
    max-width: 280px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
}

.countdown-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.countdown-box {
    background: rgba(225, 29, 72, 0.1);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    min-width: 70px;
    text-align: center;
}

.cd-number {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-light);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.cd-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.wait-footer {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--muted);
    opacity: 0.5;
}

/* ========================================
   Final Page
   ======================================== */

#final-page {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--background);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

#final-page:not(.hidden) {
    display: flex;
    animation: finalReveal 1.2s ease;
}

@keyframes finalReveal {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.final-card {
    text-align: center;
    max-width: 480px;
    width: 100%;
}

.final-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light), #fbbf24, var(--primary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease-in-out infinite, heartBeat 1.5s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05); }
    35% { transform: scale(1); }
    45% { transform: scale(1.08); }
    55% { transform: scale(1); }
}

.final-message {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--muted);
    margin-bottom: 2rem;
}

.final-message strong {
    color: var(--foreground);
}

.countdown-highlight {
    color: var(--primary) !important;
    -webkit-text-fill-color: var(--primary);
    font-size: 1.5rem;
    font-weight: 900;
}

.final-small {
    font-size: 0.85rem;
    opacity: 0.5;
    font-style: italic;
}

.final-warning {
    font-size: 0.95rem;
    color: var(--primary-light);
}

.heart-photo-container {
    margin: 1.5rem auto;
    width: 250px;
    height: 250px;
}

.heart-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: path('M125,230 C50,180 0,130 0,80 C0,35 30,0 65,0 C90,0 115,18 125,45 C135,18 160,0 185,0 C220,0 250,35 250,80 C250,130 200,180 125,230Z');
    filter: drop-shadow(0 0 15px rgba(225, 29, 72, 0.4));
}

.final-gif {
    width: 100%;
    max-width: 320px;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    margin-bottom: 1.5rem;
}

.timer-bar-container {
    width: 100%;
    max-width: 320px;
    height: 6px;
    background: var(--card-border);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 1s linear;
}

.timer-bar.urgent {
    background: #ef4444;
}

/* ========================================
   Confetti
   ======================================== */

#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 201;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    opacity: 0.9;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.9;
    }
    100% {
        transform: translateY(110vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* ========================================
   Responsive / Mobile override
   ======================================== */

@media (max-width: 768px) {
    #mobile-page {
        display: flex !important;
    }
    #desktop-content {
        display: none !important;
    }
}

@media (min-width: 769px) {
    #mobile-page {
        display: none !important;
    }
}
