/* ======================================================
   HAPPY BIRTHDAY BEST FRIEND - STYLESHEET
   Aesthetic: Midnight Velvet, Rose Gold & Gold Sparkles
   Site Security PIN (15012005) & Discrete Master Lock
   ====================================================== */

:root {
    --bg-dark: #0f0814;
    --bg-gradient: linear-gradient(135deg, #130a1c 0%, #25102a 50%, #0d0612 100%);
    --primary: #ff4081;
    --primary-glow: rgba(255, 64, 129, 0.45);
    --secondary: #ffb74d;
    --accent: #e040fb;
    --rose-gold: #e8b4b8;
    --gold: #ffd700;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
    --text-main: #ffffff;
    --text-muted: #d0c0d8;
    --font-heading: 'Outfit', sans-serif;
    --font-hand: 'Dancing Script', cursive;
    --font-serif: 'Playfair Display', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    font-family: var(--font-heading);
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Floating Photo Orbs */
.floating-photo-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.photo-orb {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    opacity: 0.25;
    animation: orbFloat 18s linear infinite;
}

.photo-orb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

@keyframes orbFloat {
    0% { transform: translateY(110vh) rotate(0deg) scale(0.8); }
    100% { transform: translateY(-20vh) rotate(360deg) scale(1.1); }
}

/* Floating Balloons */
.floating-balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -100px;
    width: 38px;
    height: 48px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    opacity: 0.6;
    animation: floatUp 14s linear infinite;
}

.balloon::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 14px;
    background: rgba(255, 255, 255, 0.4);
}

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

/* Top Floating Control Bar */
.audio-control-bar {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 10, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.icon-btn {
    background: linear-gradient(135deg, #ff4081, #e040fb);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 0 12px var(--primary-glow);
}

.photo-count-badge {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: var(--gold);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Screen Management */
.screen {
    display: none !important;
    position: relative;
    z-index: 10;
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.screen.active {
    display: flex !important;
    flex-direction: column !important;
}

/* ========================================== */
/* 0. GLOBAL SITE SECURITY PIN SCREEN         */
/* ========================================== */
#security-pin-screen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 60px 15px 30px;
    width: 100%;
}

.pin-gate-box {
    max-width: 450px !important;
}

.lock-avatar-icon {
    width: 65px;
    height: 65px;
    margin: 15px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4081, #7c4dff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    box-shadow: 0 0 25px var(--primary-glow);
}

.pin-input-group {
    position: relative;
    margin: 20px 0 15px;
}

.pin-input-group input {
    width: 100%;
    padding: 14px 45px 14px 18px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.45);
    color: var(--gold);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    outline: none;
    transition: border 0.3s;
}

.pin-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.pin-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.pin-error-text {
    color: #ff4081;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
    animation: shake 0.4s ease;
}

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

.full-width-btn {
    width: 100%;
    max-width: 100%;
}

/* ========================================== */
/* 1. GIFT LOCK ENTRANCE SCREEN               */
/* ========================================== */
#gift-lock-screen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 60px 15px 30px;
    width: 100%;
}

.entrance-box {
    max-width: 620px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: clamp(25px, 5vw, 45px) clamp(16px, 4vw, 30px);
    border-radius: 24px;
    background: rgba(30, 15, 45, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), 0 0 40px rgba(255, 64, 129, 0.15);
    position: relative;
}

.sparkle-badge {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: var(--gold);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.glow-title {
    font-family: var(--font-serif);
    font-size: clamp(24px, 6vw, 36px);
    background: linear-gradient(135deg, #fff 30%, var(--rose-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    font-size: clamp(13px, 3.5vw, 15px);
    line-height: 1.5;
    margin-bottom: 25px;
}

/* Countdown Clock */
.countdown-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.5vw, 10px);
    margin-bottom: 30px;
}

.time-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: clamp(8px, 2.5vw, 12px) clamp(10px, 3vw, 16px);
    border-radius: 14px;
    min-width: clamp(55px, 16vw, 75px);
    text-align: center;
}

.time-val {
    display: block;
    font-size: clamp(20px, 6vw, 32px);
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.time-label {
    font-size: clamp(9px, 2.5vw, 11px);
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.time-colon {
    font-size: clamp(16px, 4vw, 24px);
    font-weight: 700;
    color: var(--primary);
}

/* 3D Gift Box & Photo Surprise */
.gift-box-3d-wrapper {
    margin: 15px 0 30px;
    perspective: 1000px;
}

.gift-box {
    width: clamp(120px, 32vw, 150px);
    height: clamp(120px, 32vw, 150px);
    margin: 0 auto;
    position: relative;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.box-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 75%;
    background: linear-gradient(135deg, #ff4081, #c2185b);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(255, 64, 129, 0.5);
    overflow: hidden;
    z-index: 2;
}

.box-lid {
    position: absolute;
    top: 15px;
    left: -5%;
    width: 110%;
    height: 25px;
    background: linear-gradient(135deg, #ff5c93, #d81b60);
    border-radius: 8px;
    z-index: 4;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.8s ease-in-out;
}

.box-surprise-photo {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%) scale(0.5);
    width: 85px;
    height: 95px;
    background: #fff;
    padding: 5px 5px 15px 5px;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    opacity: 0;
    z-index: 3;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.box-surprise-photo img {
    width: 100%;
    height: 65px;
    object-fit: cover;
    object-position: center top;
    border-radius: 4px;
}

.box-surprise-photo span {
    display: block;
    font-family: var(--font-hand);
    color: #222;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    margin-top: 2px;
}

.gift-box.opening .box-lid {
    transform: translateY(-90px) rotate(-15deg);
    opacity: 0;
}

.gift-box.opening .box-surprise-photo {
    transform: translateX(-50%) translateY(-65px) scale(1.3) rotate(5deg);
    opacity: 1;
}

.ribbon-v {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 100%;
    background: linear-gradient(135deg, #ffd700, #ffb300);
}

.ribbon-h {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 22px;
    background: linear-gradient(135deg, #ffd700, #ffb300);
}

.box-bow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 25px;
}

.bow-left, .bow-right {
    position: absolute;
    width: 22px;
    height: 18px;
    border: 4px solid #ffd700;
    border-radius: 50% 50% 0 50%;
}

.bow-left { left: 0; transform: rotate(-30deg); }
.bow-right { right: 0; transform: scaleX(-1) rotate(-30deg); }

.bow-center {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #ffd700;
    border-radius: 50%;
}

.box-heart-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    z-index: 3;
    animation: heartBeat 1.5s infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.lock-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
}

.primary-glow-btn {
    background: linear-gradient(135deg, #ff4081, #e040fb);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 35px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 25px var(--primary-glow);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

/* Discrete Master Lock Button */
.discrete-lock-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
}

.discrete-lock-icon:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* ========================================== */
/* 2. MAIN CARD DASHBOARD                     */
/* ========================================== */
#main-card-screen {
    padding-bottom: 60px;
    width: 100%;
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* HERO SECTION */
.hero-section {
    padding: 65px 15px 25px;
    text-align: center;
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
}

.hero-profile-container {
    margin-bottom: 18px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.profile-avatar-glow {
    position: relative;
    width: 115px;
    height: 115px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #ffd700, #ff4081, #e040fb);
    box-shadow: 0 0 30px rgba(255, 64, 129, 0.6);
    animation: avatarPulse 3s infinite alternate;
}

@keyframes avatarPulse {
    0% { box-shadow: 0 0 20px rgba(255, 64, 129, 0.5); }
    100% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.9); }
}

.profile-avatar-glow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    border: 3px solid #130a1c;
}

.avatar-crown {
    position: absolute;
    top: -16px;
    right: -5px;
    color: var(--gold);
    font-size: 24px;
    transform: rotate(20deg);
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.main-bday-title {
    font-family: var(--font-serif);
    font-size: clamp(30px, 7.5vw, 50px);
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.15;
    text-align: center;
}

.gradient-text {
    background: linear-gradient(135deg, #ff4081 0%, #ffb74d 50%, #e040fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-quote {
    max-width: 620px;
    margin: 0 auto 22px;
    font-family: var(--font-hand);
    font-size: clamp(19px, 4.8vw, 25px);
    color: var(--rose-gold);
    line-height: 1.4;
    text-align: center;
}

.quick-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

/* Sticky Nav Bar */
.sticky-nav {
    position: sticky;
    top: 10px;
    z-index: 100;
    width: calc(100% - 30px);
    max-width: 850px;
    margin: 20px auto;
    background: rgba(20, 10, 30, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 6px;
    border-radius: 30px;
    display: flex;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

@media (max-width: 800px) {
    .sticky-nav {
        justify-content: flex-start;
    }
}

.sticky-nav::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.nav-tab.active {
    background: linear-gradient(135deg, #ff4081, #e040fb);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Card Sections */
.card-section {
    width: calc(100% - 30px);
    max-width: 1100px;
    margin: 25px auto;
    padding: clamp(20px, 4vw, 35px) clamp(14px, 3.5vw, 25px);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

.section-header {
    margin-bottom: 22px;
    width: 100%;
}

.section-header.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header.center {
    text-align: center;
}

.section-header h2 {
    font-size: clamp(20px, 5vw, 28px);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-mode-switch {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.switch-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.switch-btn.active {
    background: var(--primary);
    color: white;
}

/* POLAROID GRID */
.polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 4px;
    width: 100%;
}

@media (min-width: 500px) {
    .polaroid-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 900px) {
    .polaroid-grid {
        grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
        gap: 24px;
    }
}

.polaroid-card {
    perspective: 1000px;
    height: clamp(230px, 55vw, 310px);
    cursor: pointer;
    position: relative;
    transform: rotate(calc(var(--rot) * 1deg));
}

.polaroid-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

.polaroid-card.flipped .polaroid-inner {
    transform: rotateY(180deg);
}

.polaroid-front, .polaroid-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.polaroid-front {
    background: #ffffff;
    padding: 8px 8px 16px 8px;
    display: flex;
    flex-direction: column;
}

.polaroid-img-wrapper {
    width: 100%;
    flex: 1;
    overflow: hidden;
    border-radius: 5px;
    background: #111;
    position: relative;
}

.polaroid-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.4s ease;
}

.polaroid-caption {
    font-family: var(--font-hand);
    color: #222;
    font-size: clamp(13px, 3.8vw, 19px);
    font-weight: 700;
    text-align: center;
    margin-top: 8px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.polaroid-flip-hint {
    font-size: 9px;
    color: #888;
    text-align: center;
    margin-top: 2px;
}

.polaroid-tape {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 45px;
    height: 16px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 5;
}

.polaroid-back {
    background: linear-gradient(135deg, #230b32, #47154f);
    border: 1px solid var(--primary);
    transform: rotateY(180deg);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    color: var(--rose-gold);
}

.polaroid-back-badge {
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.polaroid-back-text {
    font-family: var(--font-hand);
    font-size: clamp(16px, 4vw, 21px);
    line-height: 1.3;
    color: #fff;
    margin: 8px 0;
}

.polaroid-zoom-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* STARRY NIGHT CONSTELLATION SECTION */
/* STARRY NIGHT CONSTELLATION SECTION */
.night-sky-constellation-wrapper {
    position: relative;
    width: 100%;
    max-width: 650px;
    height: 360px;
    margin: 0 auto;
    background: linear-gradient(to bottom, #050b1a 0%, #0c1833 60%, #15274d 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(21, 39, 77, 0.4);
    overflow: hidden;
}

#star-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.photo-star-node {
    position: absolute;
    z-index: 5;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Positions matching starData coordinates */
.star-node-1 { left: 16%; top: 32%; }
.star-node-2 { left: 36%; top: 22%; }
.star-node-3 { left: 54%; top: 58%; }
.star-node-4 { left: 74%; top: 28%; }
.star-node-5 { left: 88%; top: 68%; }

.photo-star-node:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.star-photo-frame {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #ffd700, #ff4081);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}

.star-photo-frame img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 20% !important;
    border-radius: 50% !important;
    border: 2px solid #050b1a !important;
}

.star-halo-pulse {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    opacity: 0.8;
    animation: pulse 1.8s infinite;
    pointer-events: none;
}

.star-mini-icon {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: var(--gold);
    color: #000;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.photo-star-node.active-star .star-photo-frame {
    background: linear-gradient(135deg, #ff4081, #e040fb);
    box-shadow: 0 0 25px rgba(255, 64, 129, 0.9);
}

.constellation-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 12px;
    border-radius: 12px;
    pointer-events: none;
}

.star-secret-popup {
    margin-top: 20px;
    background: rgba(25, 10, 38, 0.95);
    border: 1px solid var(--gold);
    padding: 22px 20px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.star-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

.star-modal-icon {
    font-size: 32px;
    color: var(--gold);
    margin-bottom: 8px;
    animation: starPulse 1.5s infinite alternate;
}

@keyframes starPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px var(--gold)); }
    100% { transform: scale(1.2); filter: drop-shadow(0 0 15px var(--gold)); }
}

.star-secret-popup h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
}

.star-secret-popup p {
    font-family: var(--font-hand);
    font-size: 22px;
    color: var(--rose-gold);
    line-height: 1.4;
}

/* SPIN WHEEL SECTION STYLING */
.wheel-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    position: relative;
    width: 100%;
}

.wheel-pointer {
    font-size: 32px;
    color: var(--gold);
    z-index: 10;
    margin-bottom: -15px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.wheel-outer {
    width: clamp(260px, 75vw, 320px);
    height: clamp(260px, 75vw, 320px);
    position: relative;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(135deg, #ffd700, #ff4081);
    box-shadow: 0 0 30px rgba(255, 64, 129, 0.5);
    transition: transform 4s cubic-bezier(0.15, 0.85, 0.35, 1.05);
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.spin-btn-adjust {
    margin-top: 25px;
}

.wheel-result-popup {
    margin-top: 20px;
    background: rgba(30, 15, 45, 0.9);
    border: 1px solid var(--gold);
    padding: 15px 25px;
    border-radius: 16px;
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.wheel-result-popup h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 4px;
}

.wheel-result-popup p {
    font-size: 12px;
    color: var(--rose-gold);
}

/* 3D STACK VIEW */
.stack-view-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    width: 100%;
}

.stack-card-deck {
    position: relative;
    width: clamp(230px, 70vw, 300px);
    height: clamp(280px, 80vw, 360px);
    perspective: 1000px;
}

.stack-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    padding: 12px 12px 30px 12px;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stack-item img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    object-position: center top;
    border-radius: 8px;
}

.stack-item p {
    font-family: var(--font-hand);
    color: #222;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-top: 10px;
}

.stack-nav-btns {
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stack-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.stack-counter-text {
    font-size: 14px;
    color: var(--gold);
    font-weight: 700;
}

/* CAKE WITH PHOTO TOPPER */
.cake-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    width: 100%;
}

.cake {
    position: relative;
    width: clamp(180px, 50vw, 240px);
    height: clamp(160px, 45vw, 200px);
    margin-top: 60px;
}

.cake-photo-topper {
    position: absolute;
    bottom: 185px;
    left: 50%;
    transform: translateX(-50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #ffd700, #ff4081);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    z-index: 5;
}

.cake-photo-topper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
}

.topper-crown {
    position: absolute;
    top: -12px;
    right: -2px;
    color: var(--gold);
    font-size: 14px;
    transform: rotate(20deg);
}

.plate {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 115%;
    height: 16px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.layer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px;
}

.layer-bottom {
    bottom: 8px;
    width: 90%;
    height: 50px;
    background: linear-gradient(135deg, #ad1457, #880e4f);
}

.layer-middle {
    bottom: 58px;
    width: 72%;
    height: 45px;
    background: linear-gradient(135deg, #d81b60, #ad1457);
}

.layer-top {
    bottom: 103px;
    width: 52%;
    height: 42px;
    background: linear-gradient(135deg, #ff4081, #f50057);
}

.icing {
    position: absolute;
    bottom: 142px;
    left: 50%;
    transform: translateX(-50%);
    width: 52%;
    height: 10px;
    background: #ffffff;
    border-radius: 8px 8px 0 0;
}

.candles-row {
    position: absolute;
    bottom: 147px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.candle {
    width: 10px;
    height: 30px;
    background: linear-gradient(to bottom, #ffd700, #ff9800);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.flame {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 18px;
    background: radial-gradient(ellipse at bottom, #ffeb3b, #ff5722);
    border-radius: 50% 50% 20% 20%;
    box-shadow: 0 0 12px #ffeb3b, 0 0 25px #ff5722;
    animation: flicker 1s infinite alternate;
}

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

.candle.extinguished .flame {
    display: none;
}

.smoke {
    display: none;
    position: absolute;
    top: -20px;
    left: 50%;
    width: 6px;
    height: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: smokeRise 2s forwards;
}

.candle.extinguished .smoke {
    display: block;
}

@keyframes smokeRise {
    0% { transform: translateX(-50%) translateY(0) scale(0.5); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-35px) scale(2); opacity: 0; }
}

.wish-controls {
    margin-top: 30px;
    text-align: center;
    width: 100%;
}

.cake-buttons-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.magic-action-btn, .mic-action-btn {
    background: linear-gradient(135deg, #ff9800, #ff4081);
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mic-action-btn {
    background: linear-gradient(135deg, #7c4dff, #e040fb);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

.mic-status {
    font-size: 12px;
    color: var(--gold);
    margin-top: 10px;
    font-weight: 600;
}

.hidden-wish-msg {
    display: none;
    margin-top: 20px;
    font-size: clamp(18px, 5vw, 24px);
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* BESTIE QUIZ SECTION */
.quiz-card-wrapper {
    max-width: 550px;
    width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 22px 18px;
    border-radius: 20px;
}

.quiz-photo-frame {
    width: 100%;
    height: 290px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid var(--glass-border);
}

@media (max-width: 500px) {
    .quiz-photo-frame {
        height: 180px;
    }
}

.quiz-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.quiz-progress-fill {
    height: 100%;
    width: 33%;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    transition: width 0.4s ease;
}

.quiz-question-box h3 {
    font-size: clamp(15px, 4vw, 19px);
    margin-bottom: 15px;
    color: #fff;
}

.quiz-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-opt-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s;
}

.quiz-opt-btn.correct {
    background: var(--primary);
    border-color: var(--primary);
}

.quiz-result-hidden {
    display: none;
    text-align: center;
    padding: 15px 0;
}

.quiz-score-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 15px;
}

/* 10 REASONS FLIP GRID */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    width: 100%;
}

.reason-card {
    perspective: 1000px;
    height: 160px;
    cursor: pointer;
}

.reason-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

.reason-card.flipped .reason-inner {
    transform: rotateY(180deg);
}

.reason-front, .reason-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 18px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.reason-front {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.reason-front i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.reason-back {
    background: linear-gradient(135deg, #2a083b, #4a154b);
    color: var(--rose-gold);
    transform: rotateY(180deg);
    border-color: var(--primary);
}

.reason-back h4 {
    color: var(--gold);
    margin-bottom: 6px;
    font-size: 15px;
}

.reason-back p {
    font-size: 13px;
    line-height: 1.35;
}

/* SCRATCH CARDS */
.scratch-cards-wrapper {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px 0;
    width: 100%;
}

.scratch-card-box {
    position: relative;
    width: clamp(250px, 80vw, 280px);
    height: 190px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--primary);
    touch-action: none;
}

.scratch-secret {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.scratch-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.65);
}

.scratch-overlay-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(15, 8, 20, 0.4);
    backdrop-filter: blur(2px);
}

.scratch-overlay-text i {
    font-size: 30px;
    color: var(--gold);
    margin-bottom: 6px;
}

.scratch-overlay-text h3 {
    font-size: 15px;
    color: #fff;
    margin-bottom: 4px;
}

.scratch-overlay-text p {
    font-size: 12px;
    color: var(--rose-gold);
}

.scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: pointer;
    touch-action: none;
}

/* LETTER SECTION */
.letter-paper-wrapper {
    max-width: 750px;
    width: 100%;
    margin: 0 auto;
    background: #fffdf9;
    color: #2b231f;
    padding: clamp(22px, 5vw, 45px);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
}

.letter-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    gap: 12px;
}

.stamp-badge {
    border: 2px dashed #b8405e;
    color: #b8405e;
    padding: 5px 12px;
    font-weight: 700;
    font-size: 11px;
    border-radius: 4px;
    transform: rotate(4deg);
    white-space: nowrap;
}

.letter-photo-corner {
    width: 75px;
    height: 90px;
    background: #fff;
    padding: 4px 4px 12px 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transform: rotate(-4deg);
    border-radius: 4px;
    flex-shrink: 0;
}

.letter-photo-corner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 2px;
}

.letter-heading {
    font-family: var(--font-serif);
    font-size: clamp(24px, 5vw, 32px);
    color: #b8405e;
    margin-bottom: 18px;
    text-align: left;
}

.typewriter-text {
    font-family: var(--font-hand);
    font-size: clamp(19px, 4.5vw, 24px);
    line-height: 1.55;
    color: #3d312a;
    width: 100%;
    margin-bottom: 25px;
    text-align: left;
}

.letter-footer-btns {
    margin-top: 15px;
    text-align: center;
    width: 100%;
    clear: both;
}

/* CUSTOM MODAL */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2500;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.custom-modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    padding: 30px 20px;
    border-radius: 20px;
    background: rgba(30, 15, 45, 0.95);
    border: 1px solid var(--glass-border);
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: white;
    cursor: pointer;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: var(--gold);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    outline: none;
}

.full-width {
    width: 100%;
    max-width: 100%;
    margin-top: 15px;
}

/* LIGHTBOX MODAL */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content {
    max-width: 95%;
    max-height: 90vh;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 10px;
    border: 3px solid #fff;
    box-shadow: 0 0 35px rgba(255, 64, 129, 0.5);
}

.lightbox-caption {
    margin-top: 12px;
    font-family: var(--font-hand);
    font-size: clamp(20px, 5vw, 28px);
    color: var(--gold);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 36px;
    color: white;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.lightbox-nav.prev { left: 15px; }
.lightbox-nav.next { right: 15px; }

.bday-footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 12px;
    padding: 0 15px;
    width: 100%;
}

/* Lock Toast Banner */
.lock-toast-info {
    margin: 15px auto 5px;
    background: rgba(255, 64, 129, 0.2);
    border: 1px dashed var(--primary);
    color: var(--gold);
    padding: 10px 18px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    max-width: 360px;
    animation: popIn 0.4s ease;
}

/* ========================================== */
/* MODAL & LIGHTBOX OVERLAY SYSTEM            */
/* ========================================== */
.custom-modal,
.lightbox-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(10, 5, 20, 0.85) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

.custom-modal.active,
.lightbox-modal.active {
    display: flex !important;
}

.modal-content {
    background: rgba(30, 15, 45, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    max-width: 450px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}
.modal-close:hover {
    color: #fff;
}

