:root {
    --primary: #d4af37;
    --primary-light: #f9d976;
    --primary-dark: #b5952f;
    --bg-dark: #0a0a0f;
    --text-main: #ffffff;
    --text-muted: #bdc1c6;
    --glass-bg: rgba(18, 18, 24, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --success: #00e676;
    --error: #ff3366;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    -webkit-font-smoothing: antialiased;
}

/* Background Gradients */
.bg-gradient-1, .bg-gradient-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.5;
    animation: float 15s infinite alternate ease-in-out;
}

.bg-gradient-1 {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(212,175,55,0.15) 0%, rgba(10,10,15,0) 70%);
}

.bg-gradient-2 {
    bottom: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(144,103,198,0.1) 0%, rgba(10,10,15,0) 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

#fxCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Premium Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 32px;
    padding: 45px 35px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 420px;
    z-index: 10;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
    /* For new screens */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glass-panel.active-screen {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    z-index: 20;
    transform: translateY(0) scale(1);
}

/* Typography */
.moon-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: gentle-rock 4s infinite ease-in-out;
    display: inline-block;
}

.moon-icon.small { font-size: 2rem; }

@keyframes gentle-rock {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.title {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 25px;
    color: var(--primary-light);
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.title span {
    font-size: 3rem;
    font-style: italic;
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-top: 5px;
}

.sm-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 25px;
}

.love-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-weight: 300;
}

/* Images & Media */
.image-wrapper {
    position: relative;
    margin: 0 auto 25px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(135deg, var(--primary), transparent);
}

.hug-gif {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 2;
    position: relative;
    border: 3px solid var(--bg-dark);
}

.glow-effect {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: var(--primary);
    filter: blur(25px);
    opacity: 0.4;
    z-index: 1;
    animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.05); }
}

/* Buttons */
.btn {
    position: relative;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 100px;
    cursor: pointer;
    width: 100%;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-body);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #000;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.4);
}

.btn span { position: relative; z-index: 2; }

.btn-glow {
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.5s;
    z-index: 1;
}

.primary-btn:hover .btn-glow {
    opacity: 1;
    transform: scale(1);
    animation: rotate-glow 3s linear infinite;
}

@keyframes rotate-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.icon-btn {
    position: absolute;
    top: 25px; left: 25px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center; align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 11;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: rgba(255,255,255,0.1); transform: translateX(-3px); }

/* --- QUIZ SCREEN --- */
.quiz-container {
    width: 100%;
    margin-bottom: 20px;
}
.quiz-question {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.4;
}
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.quiz-option {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--primary-dark);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-family: var(--font-body);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s;
}
.quiz-option:hover {
    background: rgba(212,175,55,0.2);
    transform: translateX(5px);
}
.quiz-option.correct {
    background: rgba(0,230,118,0.2);
    border-color: var(--success);
    color: var(--success);
}
.quiz-option.wrong {
    background: rgba(255,51,102,0.2);
    border-color: var(--error);
    color: var(--error);
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
.feedback-text {
    min-height: 24px;
    font-size: 0.95rem;
    color: var(--primary-light);
    font-weight: 500;
    transition: color 0.3s;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- GAME SCREEN --- */
.game-panel { max-width: 500px; }
.game-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-light);
    padding: 0 10px;
}
.mini-game-area {
    width: 100%;
    height: 250px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
.play-game-btn {
    width: auto;
    padding: 12px 30px;
    z-index: 5;
}
.falling-moon {
    position: absolute;
    font-size: 2rem;
    user-select: none;
    cursor: pointer;
    transform-origin: center;
}
.falling-moon:active {
    transform: scale(1.5);
    opacity: 0;
    transition: all 0.1s;
}

/* --- GALLERY SCREEN --- */
.gallery-panel { max-width: 480px; }
.card-carousel {
    position: relative;
    width: 100%;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}
.polaroid {
    position: absolute;
    background: #fff;
    padding: 12px 12px 40px 12px;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    width: 220px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85) translateY(20px) rotate(-5deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.polaroid.active-card {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0) rotate(2deg);
    z-index: 5;
}
.polaroid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #eee;
    border-radius: 4px;
}
.polaroid p {
    color: #333;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.1rem;
    text-align: center;
    margin-top: 12px;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    z-index: 10;
}
.carousel-controls .small-nav {
    position: relative;
    top: 0; left: 0;
    width: 40px; height: 40px;
    font-size: 1.2rem;
}
#cardCounter {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 1.1rem;
}

/* --- SECRET MESSAGE SCREEN --- */
.secret-textarea {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--primary-dark);
    border-radius: 12px;
    color: #fff;
    padding: 15px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    resize: none;
    margin-bottom: 25px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.secret-textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}
.secret-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* --- SCRATCH SCREEN --- */
.scratch-container {
    position: relative;
    margin-top: 10px;
    width: 100%;
}
.scratch-box {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a1a24 0%, #0a0a0f 100%);
    border: 2px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 0 40px rgba(0,0,0,0.8);
    touch-action: none;
}
.scratch-shimmer {
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-20deg);
    animation: shimmer 3s infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes shimmer {
    0% { left: -100%; }
    20%, 100% { left: 200%; }
}

.reward {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 1;
}
.reward h2 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #00ff88, #00b3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    font-family: var(--font-heading);
}
.reward p {
    color: var(--success);
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#scratchCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
    cursor: grab;
}
#scratchCanvas:active { cursor: grabbing; }

/* Popup Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
}
.overlay.active { opacity: 1; pointer-events: auto; }

.popup-content {
    background: linear-gradient(145deg, #181824, #101018);
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 28px;
    padding: 40px 30px;
    text-align: center;
    width: 90%; max-width: 380px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 40px rgba(0, 230, 118, 0.1);
}
.overlay.active .popup-content { transform: scale(1) translateY(0); }

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.popup-title {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin-bottom: 5px;
    background: linear-gradient(to right, #00ff88, #00b3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.popup-desc { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 30px; }

.easypaisa-btn {
    background: linear-gradient(135deg, #00e676, #00c853);
    color: #000;
    box-shadow: 0 10px 25px rgba(0, 230, 118, 0.3);
}
.easypaisa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 230, 118, 0.4);
}
.easypaisa-btn.loading { opacity: 0.8; pointer-events: none; }

.success-msg {
    display: none; margin-top: 25px;
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.success-msg .check-icon {
    display: inline-flex; justify-content: center; align-items: center;
    width: 40px; height: 40px;
    background: rgba(0, 230, 118, 0.2);
    color: var(--success);
    border-radius: 50%;
    font-size: 1.5rem; margin-bottom: 10px;
}
.success-msg p { color: var(--success); font-size: 1.2rem; font-weight: 600; margin-bottom: 5px; }
.success-msg small { color: var(--text-muted); font-size: 0.9rem; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-height: 700px) {
    .glass-panel { padding: 30px 25px; }
    .image-wrapper { width: 140px; height: 140px; margin-bottom: 10px; }
    .title { font-size: 2rem; margin-bottom: 15px; }
    .title span { font-size: 2.5rem; }
    .love-text { font-size: 0.9rem; margin-bottom: 15px; }
    .scratch-box { height: 160px; }
    .mini-game-area { height: 200px; }
    .card-carousel { height: 230px; }
    .polaroid { width: 180px; padding: 10px 10px 30px 10px; }
    .polaroid img { height: 140px; }
}
