/* ============================================
   BIRTHDAY RIDDLE — Colorful & Ceria Theme
   Fonts: Fredoka One (display) + Nunito (body)
   ============================================ */

:root {
    --pink:     #FF6B9D;
    --orange:   #FF9F43;
    --yellow:   #FFC312;
    --green:    #0BE881;
    --cyan:     #00D2D3;
    --purple:   #A29BFE;
    --blue:     #74B9FF;
    --red:      #FF6B6B;
    --white:    #FFFFFF;
    --dark:     #2D3436;
    --soft:     #F9F5FF;

    --card-bg:  rgba(255,255,255,0.92);
    --shadow:   0 8px 32px rgba(80,40,120,0.13);
    --radius:   22px;
    --radius-sm:12px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #FFE0F0 0%, #E0F7FF 35%, #FFF6D3 65%, #E8F5E9 100%);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
}

/* ---- Animated confetti background ---- */
.bg-confetti {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255,107,157,0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(116,185,255,0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(162,155,254,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.page-wrapper {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
}

/* ==========================================
   LANDING PAGE
   ========================================== */
.landing-page {
    width: 100%; min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

/* Floating emojis */
.floaties { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floatie {
    position: absolute;
    font-size: clamp(1.2rem, 3vw, 2rem);
    animation: floatUp linear infinite;
    opacity: 0.55;
}
.floatie-1  { left: 5%;  animation-duration: 8s;  animation-delay: 0s; }
.floatie-2  { left: 12%; animation-duration: 11s; animation-delay: 1s; }
.floatie-3  { left: 22%; animation-duration: 9s;  animation-delay: 2.5s; }
.floatie-4  { left: 35%; animation-duration: 13s; animation-delay: 0.5s; }
.floatie-5  { left: 48%; animation-duration: 10s; animation-delay: 3s; }
.floatie-6  { left: 60%; animation-duration: 7s;  animation-delay: 1.5s; }
.floatie-7  { left: 70%; animation-duration: 12s; animation-delay: 0s; }
.floatie-8  { left: 78%; animation-duration: 9s;  animation-delay: 4s; }
.floatie-9  { left: 85%; animation-duration: 11s; animation-delay: 2s; }
.floatie-10 { left: 92%; animation-duration: 8s;  animation-delay: 1s; }
.floatie-11 { left: 18%; animation-duration: 14s; animation-delay: 3.5s; }
.floatie-12 { left: 55%; animation-duration: 10s; animation-delay: 0.8s; }

@keyframes floatUp {
    0%   { transform: translateY(110vh) rotate(0deg);   opacity: 0; }
    10%  { opacity: 0.55; }
    90%  { opacity: 0.55; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

.landing-card {
    position: relative; z-index: 2;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 0 2px rgba(255,107,157,0.1);
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 5vw, 4rem);
    max-width: 560px; width: 100%;
    text-align: center;
    animation: cardPop 0.7s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes cardPop {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.birthday-badge {
    display: inline-block;
    background: linear-gradient(90deg, var(--pink), var(--orange));
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 0.95rem;
    padding: 0.3rem 1.2rem;
    border-radius: 99px;
    margin-bottom: 1.2rem;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 12px rgba(255,107,157,0.3);
}

.landing-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--dark);
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.name-highlight {
    background: linear-gradient(90deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 1.05rem;
    color: #636e72;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Teaser boxes */
.gift-teaser {
    display: flex; justify-content: center; gap: 0.6rem;
    flex-wrap: wrap; margin-bottom: 1.5rem;
}

.teaser-box {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #f8f0ff, #ffe0f0);
    border-radius: var(--radius-sm);
    border: 2px dashed var(--purple);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-size: 1.3rem;
    position: relative;
    animation: teaserBob 3s ease-in-out infinite;
}

.teaser-box:nth-child(2) { animation-delay: 0.3s; }
.teaser-box:nth-child(3) { animation-delay: 0.6s; }
.teaser-box:nth-child(4) { animation-delay: 0.9s; }
.teaser-box:nth-child(5) { animation-delay: 1.2s; }
.teaser-box:nth-child(6) { animation-delay: 1.5s; }

.teaser-num {
    font-family: 'Fredoka One', cursive;
    font-size: 0.65rem;
    color: var(--purple);
    opacity: 0.7;
}

@keyframes teaserBob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-5px); }
}

.landing-hint {
    font-size: 0.9rem; color: #888;
    margin-bottom: 2rem;
}

.btn-start {
    display: inline-flex; align-items: center; gap: 0.7rem;
    background: linear-gradient(90deg, var(--pink), var(--orange));
    color: white;
    font-family: 'Fredoka One', cursive;
    font-size: 1.25rem;
    padding: 0.85rem 2.5rem;
    border-radius: 99px;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(255,107,157,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative; overflow: hidden;
}

.btn-start::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-start:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(255,107,157,0.45); }
.btn-start:hover::after { transform: translateX(100%); }
.btn-start:active { transform: translateY(0); }

.btn-arrow { font-size: 1.4rem; }

.landing-footer {
    position: relative; z-index: 2;
    margin-top: 2rem; color: #aaa; font-size: 0.85rem;
}

/* ==========================================
   GIFT PAGE
   ========================================== */
.gift-page {
    width: 100%; min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 3rem;
    position: relative;
}

/* Progress nav */
.progress-nav {
    display: flex; gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    border-radius: 99px;
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow);
}

.progress-step {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.progress-step.done   { background: #e8fff4; }
.progress-step.active { background: linear-gradient(135deg, var(--yellow), var(--orange)); transform: scale(1.15); box-shadow: 0 2px 12px rgba(255,195,18,0.4); }
.progress-step.locked { background: #f0f0f0; opacity: 0.6; }

/* Gift card */
.gift-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 560px; width: 100%;
    animation: cardPop 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
    position: relative;
}

.gift-badge {
    display: flex; align-items: center; gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.gift-emoji { font-size: 2rem; }

.gift-label {
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    color: var(--purple);
    background: #f3f0ff;
    padding: 0.2rem 0.8rem;
    border-radius: 99px;
}

/* Timer */
.timer-wrap {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 1.2rem;
}

.timer-ring {
    position: relative;
    width: 80px; height: 80px;
}

.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.timer-track {
    fill: none; stroke: #ece8ff; stroke-width: 7;
}

.timer-fill {
    fill: none;
    stroke: var(--purple);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 213.6; /* 2π×34 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.5s;
}

.timer-fill.warning { stroke: var(--orange); }
.timer-fill.danger  { stroke: var(--red); }

.timer-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: var(--dark);
}

.timer-label {
    font-size: 0.75rem; color: #aaa;
    margin-top: 0.3rem;
}

/* Riddle box */
.riddle-box {
    background: linear-gradient(135deg, #f8f0ff 0%, #ffe9f3 100%);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--pink);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.riddle-deco {
    font-size: 2rem;
    position: absolute; top: -16px; left: 16px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.riddle-text {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #4a3f6b;
    padding-top: 0.5rem;
}

/* Hints */
.hints-area {
    display: flex; flex-direction: column; gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 0;
}

.hint-item {
    background: linear-gradient(90deg, #fffde7, #fff9c4);
    border-left: 3px solid var(--yellow);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.92rem;
    color: #7c6200;
    animation: slideIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Answer section */
.answer-section { margin-bottom: 1rem; }

.input-wrap {
    position: relative; margin-bottom: 0.8rem;
}

.answer-input {
    width: 100%;
    font-family: 'Nunito', sans-serif;
    font-size: 1.05rem;
    padding: 0.8rem 3rem 0.8rem 1.2rem;
    border: 2px solid #e0d6ff;
    border-radius: var(--radius-sm);
    background: white;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.answer-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(162,155,254,0.15);
}

.answer-input.shake {
    animation: shake 0.4s;
}

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

.input-icon {
    position: absolute; right: 1rem; top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem; pointer-events: none;
}

.action-buttons {
    display: flex; gap: 0.8rem;
}

.btn-hint {
    display: flex; align-items: center; gap: 0.4rem;
    background: linear-gradient(90deg, #fff9c4, #ffe0a0);
    border: 2px solid var(--yellow);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.2rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem; font-weight: 700;
    color: #7c5c00; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.btn-hint:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(255,195,18,0.3); }
.btn-hint:disabled { opacity: 0.5; cursor: not-allowed; }

.hint-count {
    background: var(--yellow);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 99px;
    font-weight: 800;
}

.btn-submit {
    flex: 1;
    background: linear-gradient(90deg, var(--pink), var(--purple));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.5rem;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(255,107,157,0.25);
}

.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,107,157,0.35); }
.btn-submit:active { transform: translateY(0); }

/* Feedback */
.feedback-area {
    min-height: 2rem;
    text-align: center;
    font-size: 1rem; font-weight: 700;
    color: var(--red);
    transition: opacity 0.3s;
}

.feedback-area.correct { color: var(--green); }

/* ==========================================
   SUCCESS OVERLAY
   ========================================== */
.success-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(255,240,255,0.96);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2rem;
    opacity: 0; pointer-events: none;
    transition: opacity 0.5s;
    padding: 2rem;
}

.success-overlay.visible {
    opacity: 1; pointer-events: all;
}

/* Gift box animation */
.gift-box-anim {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 160px; height: 160px;
}

.gift-box {
    position: relative;
    width: 100px; height: 90px;
    transform-origin: bottom center;
}

.gift-body {
    position: absolute; bottom: 0;
    width: 100px; height: 70px;
    background: linear-gradient(135deg, var(--pink), var(--orange));
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.gift-ribbon {
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 14px; height: 100%;
    background: rgba(255,255,255,0.4);
}

.gift-lid {
    position: absolute; top: 0;
    width: 110px; height: 28px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    border-radius: 6px;
    left: -5px;
    transform-origin: right center;
    transition: transform 0.7s cubic-bezier(0.34,1.56,0.64,1);
}

.gift-lid.open {
    transform: rotate(-60deg) translateY(-20px);
}

.burst-particles {
    position: absolute; inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    top: 50%; left: 50%;
    animation: burst 0.8s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}

@keyframes burst {
    from { transform: translate(-50%,-50%) scale(1); opacity: 1; }
    to   { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.success-msg {
    text-align: center;
    animation: cardPop 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.4s both;
}

.success-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    background: linear-gradient(90deg, var(--pink), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.success-subtitle {
    font-size: 1.1rem; color: #636e72;
    margin-bottom: 1.5rem;
}

.btn-next {
    display: inline-block;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    color: var(--dark);
    font-family: 'Fredoka One', cursive;
    font-size: 1.15rem;
    padding: 0.8rem 2rem;
    border-radius: 99px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,210,211,0.3);
    transition: transform 0.2s;
}

.btn-next:hover { transform: translateY(-3px); }

/* ==========================================
   CONGRATS PAGE
   ========================================== */
.congrats-page {
    width: 100%; min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

.confetti-burst {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
}

.congrats-card {
    position: relative; z-index: 2;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 5vw, 3.5rem);
    max-width: 640px; width: 100%;
    text-align: center;
    animation: cardPop 0.7s cubic-bezier(0.34,1.56,0.64,1) both;
}

.congrats-trophy { font-size: 4rem; margin-bottom: 0.8rem; animation: trophyBounce 1s cubic-bezier(0.34,1.56,0.64,1) 0.3s both; }

@keyframes trophyBounce {
    from { opacity: 0; transform: scale(0) rotate(-20deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.congrats-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 0.8rem;
}

.congrats-name {
    background: linear-gradient(90deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.congrats-subtitle {
    font-size: 1.05rem; color: #636e72;
    line-height: 1.7; margin-bottom: 2rem;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.gift-reveal-card {
    background: linear-gradient(135deg, #f8f0ff, #ffe9f3);
    border-radius: var(--radius-sm);
    border: 2px solid rgba(162,155,254,0.3);
    padding: 1rem 0.8rem;
    animation: cardPop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
    transition: transform 0.2s;
}

.gift-reveal-card:hover { transform: translateY(-4px); }

.gift-reveal-emoji { font-size: 2rem; margin-bottom: 0.3rem; }

.gift-reveal-num {
    font-size: 0.7rem; font-weight: 800;
    color: var(--purple); opacity: 0.7;
    text-transform: uppercase; letter-spacing: 0.05em;
}

.gift-reveal-name {
    font-size: 0.85rem; font-weight: 700;
    color: var(--dark);
    margin-top: 0.2rem;
}

.love-message {
    background: linear-gradient(135deg, #fff0f5, #f0f0ff);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--pink);
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
    color: #6c4f7c;
    line-height: 1.8;
}

.btn-replay {
    display: inline-block;
    background: linear-gradient(90deg, var(--green), var(--cyan));
    color: var(--dark);
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    border-radius: 99px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(11,232,129,0.3);
    transition: transform 0.2s;
}

.btn-replay:hover { transform: translateY(-3px); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    .action-buttons { flex-direction: column; }
    .gifts-grid { grid-template-columns: repeat(2, 1fr); }
    .progress-nav { gap: 0.3rem; padding: 0.4rem 0.6rem; }
    .progress-step { width: 34px; height: 34px; font-size: 0.9rem; }
}
