/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    --bg-primary: #E6E6FA;      /* Lavender Background */
    --bg-secondary: #DCD0FF;    /* Soft Lavender Accent */
    --accent-pink: #FFB6D9;     /* Soft Pink Accent */
    --accent-blue: #B0E0E6;     /* Light Sky Blue Accent */
    --accent-purple: #C3B1E1;   /* Pastel Purple */
    --accent-dark: #8C7A9D;     /* Lavender shadow */
    --text-color: #3A2A4A;      /* Deep Lavender-Indigo for contrast */
    --text-muted: #634E75;      /* Muted purple-grey */
    --white-glass: rgba(250, 250, 250, 0.7); /* Soft white glass */
    --white-glass-solid: rgba(250, 250, 250, 0.9);
    --card-shadow: 0 16px 40px rgba(181, 162, 218, 0.22);
    --btn-shadow: 0 8px 20px rgba(181, 162, 218, 0.3);
    --font-ui: 'Quicksand', sans-serif;
    --font-cursive: 'Caveat', cursive;
    --font-serif: 'Playfair Display', serif;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #FFE5EC 50%, var(--accent-lavender) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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

#canvas-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* ==========================================================================
   FLOATING HEADER
   ========================================================================== */
.floating-header {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    height: 60px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    box-shadow: 0 8px 32px rgba(220, 130, 170, 0.15);
    z-index: 1000;
}

.header-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.heart-pulse {
    display: inline-block;
    animation: pulse 1.2s infinite;
}

.header-controls {
    display: flex;
    align-items: center;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
#app-container {
    position: relative;
    max-width: 1000px;
    width: 100%;
    margin: 100px auto 40px auto;
    padding: 0 20px;
    z-index: 10;
}

.card {
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.glass-card {
    background: var(--white-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Page transitions */
.page-section {
    display: none;
    opacity: 0;
    transform: translateY(35px) scale(0.98);
    transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.page-section.active-page {
    display: block;
}

.page-section.fade-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.page-section.hidden-page {
    display: none !important;
}

/* Typography styles */
.cursive-title {
    font-family: var(--font-cursive);
    font-size: 4.2rem;
    line-height: 1.2;
    color: #8B5FBF; /* Elegant Lavender-Purple */
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 2.3rem;
    color: #7C53A4; /* Lavender Accent Heading */
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 2.5rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Buttons styling */
.btn {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px 32px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--btn-shadow);
}

.btn-primary {
    background: linear-gradient(135deg, #9F7AEA 0%, var(--accent-pink) 100%); /* Lavender to pink */
    color: white;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 24px rgba(181, 162, 218, 0.45);
}

.btn-secondary {
    background: linear-gradient(135deg, #DFD6FC 0%, var(--accent-purple) 100%);
    color: var(--text-color);
}

.btn-secondary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 24px rgba(220, 208, 255, 0.5);
}

.btn-share {
    background: linear-gradient(135deg, #A8C0FF 0%, #E6E6FA 100%);
    color: #4A354F;
}

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

.pulse-glow {
    animation: buttonPulse 2s infinite;
}

.btn-glow:hover {
    box-shadow: 0 0 20px rgba(181, 162, 218, 0.6);
}

.control-btn {
    background: var(--accent-lavender);
    color: var(--text-color);
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: var(--accent-purple);
    transform: scale(1.05);
}

.nav-btn-container {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* ==========================================================================
   PAGE 1: LANDING PAGE - GIFT BOX
   ========================================================================== */
.avatar-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-lavender) 0%, var(--bg-secondary) 100%);
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(181, 162, 218, 0.3);
    border: 3px solid white;
}

.emoji-avatar {
    font-size: 3rem;
}

.animated-avatar {
    animation: float 3s ease-in-out infinite;
}

/* 3D-ish Gift Box */
.gift-box-container {
    position: relative;
    width: 200px;
    height: 220px;
    margin: 2rem auto;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.gift-box {
    width: 130px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.gift-box:hover {
    transform: scale(1.05);
}

.gift-lid {
    width: 140px;
    height: 25px;
    background: var(--accent-pink); /* Soft Pink Lid */
    position: absolute;
    top: -20px;
    left: -5px;
    border-radius: 5px;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    transform-origin: bottom right;
}

.gift-body {
    width: 130px;
    height: 110px;
    background: var(--bg-secondary); /* Lavender Body */
    border-radius: 0 0 10px 10px;
    position: absolute;
    top: 5px;
    left: 0;
    z-index: 5;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.gift-ribbon-vertical {
    width: 24px;
    height: 125px;
    background: #FFF;
    position: absolute;
    top: -20px;
    left: 53px;
    z-index: 8;
    border-radius: 2px;
}

.gift-ribbon-horizontal {
    width: 130px;
    height: 20px;
    background: #FFF;
    position: absolute;
    top: 50px;
    left: 0;
    z-index: 8;
}

.gift-sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
}

.gift-sparkles span {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.gift-sparkles span:nth-child(1) { top: -20px; left: 10px; }
.gift-sparkles span:nth-child(2) { top: -10px; right: 10px; }
.gift-sparkles span:nth-child(3) { bottom: 20px; left: -20px; }
.gift-sparkles span:nth-child(4) { bottom: 10px; right: -20px; }

/* Box Opened State */
.gift-box-container.opened .gift-lid {
    transform: translateY(-80px) rotate(45deg);
    opacity: 0;
}

.gift-box-container.opened .gift-sparkles span {
    opacity: 1;
    transform: scale(1.5) translate(var(--tx, 0px), var(--ty, 0px));
}

.hint-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 15px;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

/* ==========================================================================
   PAGE 2: BIRTHDAY WELCOME - HEARTFELT LETTER
   ========================================================================== */
.letter-sheet {
    background: #FAF6F0;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #F0EAE1;
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

/* Binder lines effect */
.letter-sheet::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 45px;
    width: 2px;
    background: rgba(255, 94, 151, 0.25);
}

.letter-para {
    font-family: var(--font-cursive);
    font-size: 1.95rem;
    line-height: 2.15rem;
    color: #433647;
    margin-bottom: 1.8rem;
    text-indent: 55px;
}

.cursive-sig {
    font-family: var(--font-cursive);
    font-size: 2.3rem;
    color: #FF5E97;
    font-weight: 700;
}

.card-decorations span {
    position: absolute;
    font-size: 2.5rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.decor-bubble.left {
    top: 40px;
    left: 20px;
    animation: float 4s ease-in-out infinite;
}

.decor-bubble.right {
    bottom: 60px;
    right: 20px;
    animation: float 5s ease-in-out infinite 1s;
}

/* ==========================================================================
   PAGE 3: PHOTO GALLERY - POLAROID SCRAPBOOK
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.gallery-item {
    background: white;
    padding: 15px 15px 25px 15px;
    box-shadow: 0 8px 20px rgba(180, 110, 150, 0.12);
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
}

/* Alternate polaroid rotations for organic scrapbook look */
.gallery-grid .gallery-item:nth-child(odd) {
    transform: rotate(-3deg);
}

.gallery-grid .gallery-item:nth-child(even) {
    transform: rotate(3deg);
}

.gallery-grid .gallery-item:hover {
    transform: rotate(0deg) scale(1.06);
    box-shadow: 0 16px 30px rgba(180, 110, 150, 0.2);
    z-index: 20;
}

.gallery-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
    background: #FFF5F7;
    border: 1px solid #F3ECEF;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 182, 217, 0.3);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-icon {
    font-size: 2.5rem;
    animation: bounce 1s infinite alternate;
}

.gallery-caption {
    margin-top: 15px;
    text-align: center;
}

.gallery-caption h3 {
    font-family: var(--font-cursive);
    font-size: 1.8rem;
    color: #FF5E97;
    margin-bottom: 5px;
}

.gallery-caption p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   PAGE 4: SPECIAL MOMENTS - TIMELINE & STATS
   ========================================================================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(220, 130, 170, 0.08);
    transition: transform 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #E05295;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Vertical Timeline */
.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: var(--accent-purple);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    margin-bottom: 20px;
}

.left-item {
    left: 0;
    text-align: right;
}

.right-item {
    left: 50%;
    text-align: left;
}

.timeline-marker {
    width: 40px;
    height: 40px;
    position: absolute;
    background: white;
    border: 3px solid var(--accent-purple);
    border-radius: 50%;
    top: 15px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.left-item .timeline-marker {
    right: -20px;
}

.right-item .timeline-marker {
    left: -20px;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
    border: 1px solid #FAF4F8;
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: scale(1.02);
}

.timeline-content h3 {
    color: #7C53A4;
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.timeline-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ==========================================================================
   PAGE 5: THE SQUAD / PEOPLE IN LIFE
   ========================================================================== */
.crew-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.2rem;
    margin-top: 1rem;
}

.crew-profile-card {
    background: white;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid rgba(181, 162, 218, 0.2);
    box-shadow: 0 10px 25px rgba(181, 162, 218, 0.08);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.crew-profile-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 35px rgba(181, 162, 218, 0.16);
}

.highlight-card {
    background: linear-gradient(180deg, #FAF8FF 0%, #F5F0FF 100%);
    border: 2px solid rgba(181, 162, 218, 0.35);
}

.profile-avatar-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 1.2rem auto;
    overflow: hidden;
    border: 4px solid var(--accent-lavender);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    background: #FFF5F7;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crew-profile-card h3 {
    font-size: 1.35rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.profile-role {
    font-size: 0.85rem;
    font-weight: 700;
    color: #7C53A4;
    margin-bottom: 12px;
}

.profile-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    height: 70px;
    overflow: hidden;
}

/* Stat bars style */
.profile-stats {
    margin-bottom: 1.5rem;
}

.stat-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
}

.stat-bar .label {
    width: 85px;
    color: var(--text-muted);
}

.bar-bg {
    flex-grow: 1;
    height: 8px;
    background: #F0EAEF;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple) 0%, var(--accent-pink) 100%);
    border-radius: 4px;
}

.crew-quote {
    font-family: var(--font-cursive);
    font-size: 1.6rem;
    color: #7D6B80;
    background: #FAF5FA;
    border-radius: 12px;
    padding: 10px;
    margin-top: 10px;
}

/* ==========================================================================
   PAGE 6: LETTER + GAMES (FINAL SURPRISE)
   ========================================================================== */
/* Interactive Folding Envelope */
.letter-envelope-container {
    perspective: 1000px;
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
}

.envelope-wrapper {
    position: relative;
    width: 300px;
    height: 200px;
    background: #FFF;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.envelope-wrapper:hover {
    transform: translateY(-5px);
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid var(--accent-pink); /* Pink Flap */
    transform-origin: top;
    transition: transform 0.4s ease 0.2s, z-index 0.2s ease 0.2s;
    z-index: 4;
}

.envelope-pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid var(--bg-secondary); /* Lavender pocket sides */
    border-right: 150px solid var(--bg-secondary);
    border-bottom: 100px solid var(--accent-pink); /* Pink base */
    border-radius: 0 0 12px 12px;
    z-index: 3;
}

.envelope-letter {
    position: absolute;
    bottom: 5px;
    left: 15px;
    width: 270px;
    height: 180px;
    background: #FAF8F5;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), height 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), left 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow-y: auto;
    border: 1px solid #EEE5DB;
}

.envelope-letter::-webkit-scrollbar {
    width: 4px;
}

.envelope-letter::-webkit-scrollbar-thumb {
    background: #DDD;
    border-radius: 2px;
}

.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #8B5FBF;
    border-bottom: 1px dashed rgba(139, 95, 191, 0.3);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.close-letter-btn {
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    padding: 2px 6px;
    display: inline-block;
    line-height: 1;
}

.close-letter-btn:hover {
    color: #FF4285;
    transform: scale(1.2);
}

.letter-body {
    font-family: var(--font-cursive);
    font-size: 1.45rem;
    line-height: 1.65rem;
    color: #4A3C31;
}

.letter-body p {
    margin-bottom: 10px;
}

.signature-line {
    text-align: right;
    font-weight: 700;
    color: #FF5E97;
}

.envelope-hint {
    position: absolute;
    bottom: -35px;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Envelope Open Anim States */
.envelope-wrapper.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-wrapper.open .envelope-letter {
    transform: translateY(-150px) scale(1.15);
    height: 310px;
    width: 320px;
    left: -10px; /* Centering expanded width of 320px inside 300px wrapper */
    z-index: 10;
    box-shadow: 0 15px 35px rgba(139, 95, 191, 0.22);
}

/* Games Tabs styling */
.tab-header {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(220, 208, 255, 0.3);
    padding-bottom: 10px;
}

.tab-btn {
    font-family: var(--font-ui);
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 12px;
}

.tab-btn:hover {
    color: #E05295;
    background: rgba(255, 255, 255, 0.4);
}

.tab-btn.active-tab {
    color: #FF4285;
    background: white;
    box-shadow: 0 4px 12px rgba(220, 130, 170, 0.1);
}

.games-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(220, 130, 170, 0.05);
    border: 1px solid #FAF4F8;
    margin-bottom: 2.5rem;
    min-height: 380px;
}

.game-title {
    font-size: 1.4rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

.game-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Game 1: Trivia Styles */
.trivia-progress {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.trivia-question-card {
    text-align: center;
    margin-bottom: 20px;
}

.trivia-question-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.trivia-choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.choice-btn {
    font-family: var(--font-ui);
    font-weight: 600;
    background: #FAF8FB;
    color: var(--text-color);
    border: 2px solid #EEE9F0;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
    font-size: 0.95rem;
}

.choice-btn:hover:not(:disabled) {
    background: var(--accent-lavender);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.choice-btn.correct {
    background: #D4EDDA;
    border-color: #C3E6CB;
    color: #155724;
}

.choice-btn.wrong {
    background: #F8D7DA;
    border-color: #F5C6CB;
    color: #721C24;
}

.game-feedback {
    text-align: center;
    font-weight: 700;
    padding: 12px;
    border-radius: 12px;
    margin-top: 15px;
    animation: bounce 0.6s ease;
}

.game-feedback.success {
    background: #D1ECF1;
    color: #0C5460;
}

/* Game 2: Memory Match Grid */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    background: #FFF;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

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

.memory-card-front, .memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FDF0F6;
}

.memory-card-back {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #FFF 100%);
    font-size: 1.5rem;
}

.memory-card-front {
    background: #FFF9FC;
    transform: rotateY(180deg);
    font-size: 2rem;
}

.memory-card.matched {
    animation: matchPulse 0.5s ease-in-out;
}

.memory-card.matched .memory-card-front {
    border-color: #B2F2BB;
    background: #EBFBEE;
}

.hidden-game-panel {
    display: none;
}

.mt-3 { margin-top: 1rem; }
.hidden { display: none !important; }

/* Share & Copy Toast Styles */
.share-container {
    margin: 3rem auto 1rem auto;
    position: relative;
}

.share-container p {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.toast-popup {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.toast-popup.visible {
    opacity: 1;
}

/* ==========================================================================
   FOOTER STYLING
   ========================================================================== */
.app-footer {
    padding: 2rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
    z-index: 10;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 110, 167, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 110, 167, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 110, 167, 0); }
}

@keyframes matchPulse {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.15); }
    100% { transform: rotateY(180deg) scale(1); }
}

/* ==========================================================================
   MEDIA QUERIES (MOBILE RESPONSIVENESS)
   ========================================================================== */
@media (max-width: 768px) {
    .floating-header {
        width: 95%;
        padding: 0 15px;
    }
    
    .cursive-title {
        font-size: 2.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1.5rem;
        border-radius: 20px;
    }
    
    .letter-sheet {
        padding: 2rem 1.2rem;
    }
    
    .letter-sheet::before {
        left: 20px;
    }
    
    .letter-para {
        font-size: 1.45rem;
        line-height: 1.7rem;
        text-indent: 30px;
    }
    
    .timeline::after {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 0;
        text-align: left;
    }
    
    .left-item, .right-item {
        left: 0;
    }
    
    .left-item .timeline-marker, .right-item .timeline-marker {
        left: 0px;
    }
    
    .memory-grid {
        gap: 8px;
    }
    
    .memory-card-back {
        font-size: 1.2rem;
    }
    
    .memory-card-front {
        font-size: 1.6rem;
    }
}
