:root {
    /* Vibrant, Lively Background */
    --bg-gradient: linear-gradient(135deg, #d31027 0%, #ea384d 100%);
    /* Bright Cherry Red */

    /* Light, Clean Cards */
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: rgba(255, 215, 0, 0.3);
    /* Gold border */

    /* Typography Colors */
    --primary-red: #D31027;
    --pine-green: #1a5c20;
    --rich-gold: #FFD700;
    --text-main: #2c3e50;
    /* Dark Blue-Gray for readability */
    --text-muted: #7f8c8d;

    --font-headers: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    touch-action: manipulation;
    /* Disables double-tap zoom */
}

/* ... existing code ... */

/* Enhanced Like Animation */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.3);
    }

    30% {
        transform: scale(0.9);
    }

    45% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.like-btn.liked i {
    color: var(--primary-red);
    animation: heartBeat 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.like-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

/* --- Snow Animation (Parallax) --- */
/* --- Snow Animation (Parallax) --- */
/* Fixed Gradient Syntax and increased opacity */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    /* Added many more snowflakes for density */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.9) 2px, transparent 3px),
        radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.9) 1px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 1) 2px, transparent 3px),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.8) 1.5px, transparent 2.5px),
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.9) 2px, transparent 3px),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.9) 3px, transparent 4px),
        radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.8) 2px, transparent 3px),
        radial-gradient(circle at 80% 90%, rgba(255, 255, 255, 0.9) 1px, transparent 2px);
    background-size: 400px 400px;
    /* Smaller size = repeats more often = more density */
    animation: snow 10s linear infinite;
    mix-blend-mode: normal;
    /* Removed overlay to make white pop */
}

#snow-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dense small snow in background */
    background-image:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.6) 1px, transparent 2px),
        radial-gradient(circle at 35% 45%, rgba(255, 255, 255, 0.6) 1px, transparent 2px),
        radial-gradient(circle at 55% 25%, rgba(255, 255, 255, 0.6) 1px, transparent 2px),
        radial-gradient(circle at 75% 55%, rgba(255, 255, 255, 0.6) 1px, transparent 2px),
        radial-gradient(circle at 95% 85%, rgba(255, 255, 255, 0.6) 1px, transparent 2px);
    background-size: 300px 300px;
    animation: snow 18s linear infinite reverse;
    opacity: 0.8;
}

@keyframes snow {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 100px 800px;
    }
}

/* --- App Container --- */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    /* Increased transparency to see snow */
    min-height: 100vh;
    position: relative;
    z-index: 20;
    /* Above snow */
    backdrop-filter: blur(2px);
    /* Less blur to clear red */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.4);
    padding-bottom: 90px;
}

/* --- Header --- */
.main-header {
    text-align: center;
    padding: 30px 20px;
    position: relative;
    z-index: 2;
}

.header-decor {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.main-header h1 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* System font for unity */
    font-weight: 800;
    /* Bold to match presence */
    font-size: 2.0rem;
    /* Reduced from 2.5rem */
    color: #fff;
    /* Removed text-shadow */
    margin-bottom: 8px;
    line-height: 1.2;
    position: relative;
    display: inline-block;
}

/* Decorative Icons in Title */
.main-header h1 .fa-hat-santa {
    color: #ff4757;
    transform: rotate(-15deg);
    margin-right: 5px;
    font-size: 0.8em;
}

/* Removed .main-header h1 span specific styling to unify text */

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.subtitle {
    font-family: var(--font-headers);
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    letter-spacing: 2px;
    background: rgba(0, 60, 0, 0.6);
    /* Slightly more transparent */
    display: inline-block;
    padding: 6px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    margin-top: 5px;
}

.wish-tree-btn {
    display: inline-block;
    background: linear-gradient(90deg, #FFD700, #FDB931);
    color: #b30000;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #fff;
}

.wish-tree-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.4);
}

.wish-tree-btn:active {
    transform: translateY(0);
}

/* --- Timeline Layout --- */
#program-list {
    position: relative;
    padding: 20px 20px 20px 40px;
}

/* The Line - Make it Gold */
#program-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--rich-gold), transparent);
    opacity: 0.8;
}

/* Program Card - Bright & Clean */
.program-card {
    position: relative;
    background: var(--card-bg);
    /* Almost white */
    border: 1px solid white;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    /* Crisp shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out backwards;
    /* Removed overflow: hidden so particles can fly out */
    overflow: visible;
    /* Essential for particles */
    z-index: 1;
    /* Base index */
}

.program-card:nth-child(1) {
    animation-delay: 0.1s;
}

.program-card:nth-child(2) {
    animation-delay: 0.2s;
}

.program-card:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.program-card:hover,
.program-card:active {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    z-index: 10;
    /* Bring to front on interaction so particles show */
}

/* Timeline Dot */
.program-card::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 25px;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 3px solid var(--primary-red);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Active Program */
.program-card.active-program {
    border: 2px solid var(--rich-gold);
    background: #fff;
}

.program-card.active-program::before {
    background: var(--rich-gold);
    border-color: #fff;
    box-shadow: 0 0 0 4px var(--rich-gold);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* Card Content */
.card-main {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
}

.program-time {
    font-family: var(--font-body);
    font-weight: 800;
    color: var(--primary-red);
    font-size: 0.9rem;
    margin-bottom: 5px;
    display: block;
}

.program-info {
    flex: 1;
}

.program-info h3 {
    font-family: var(--font-headers);
    font-size: 1.25rem;
    /* Reduced from 1.5rem */
    margin-bottom: 6px;
    color: #222;
    font-weight: 700;
}

.program-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.program-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--pine-green);
    color: #fff;
}

.performer {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

/* Like Button & Animation */
.like-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: #ccc;
    /* Default grey */
    cursor: pointer;
    margin-left: 15px;
    transition: color 0.3s;
    position: relative;
    z-index: 20;
    /* Ensure button is above card content */
}

.like-btn i {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.like-btn.liked {
    color: var(--primary-red);
}

/* Bouncy Heart */
.like-btn.liked i {
    animation: heartBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartBounce {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.6);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* Particle Burst Effect using Pseudo-elements */
/* Use a separate class '.animating' to allow re-triggering */
.like-btn.animating::before,
.like-btn.animating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    /* Super high z-index for particles */
}

.like-btn.animating::before {
    background: gold;
    box-shadow:
        15px 0 0 gold,
        -15px 0 0 gold,
        0 15px 0 gold,
        0 -15px 0 gold,
        10px -10px 0 gold,
        -10px 10px 0 gold;
    animation: particles 0.6s ease-out forwards;
}

@keyframes particles {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.0);
        /* Increased scale for visibility */
    }
}

.like-count {
    font-size: 0.85rem;
    margin-top: 5px;
    font-weight: bold;
    color: #999;
    /* Grey by default for visibility on white card */
    transition: color 0.3s;
}

.like-btn.liked .like-count {
    color: var(--primary-red);
    /* Red when liked */
}

/* Comments */
.comments-section {
    background: #f9f9f9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.comments-section.open {
    max-height: 400px;
    border-top: 1px solid #eee;
}

.comments-content-wrapper {
    padding: 20px;
}

.comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.comment-bubble {
    background: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.comment-form {
    display: flex;
    gap: 8px;
}

.comment-input {
    flex: 1;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    color: #333;
    outline: none;
    transition: 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.comment-input:focus {
    border-color: var(--primary-red);
}

.send-comment-btn {
    background: var(--primary-red);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(211, 16, 39, 0.4);
}

/* --- Photo Gallery --- */
.gallery-section {
    padding: 40px 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.1), transparent);
}

.gallery-header h2 {
    font-family: var(--font-headers);
    color: #fff;
    text-align: center;
    margin-bottom: 24px;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Upload Button */
.upload-btn-large {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 18px;
    background: #fff;
    /* White button */
    color: var(--primary-red);
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 30px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.upload-btn-large:active {
    transform: scale(0.97);
}

/* True Masonry Layout using CSS Columns */
.masonry-grid {
    column-count: 2;
    column-gap: 15px;
    /* Spacing between columns */
}

.photo-item {
    break-inside: avoid;
    /* Prevent splitting across columns */
    margin-bottom: 15px;
    /* Spacing between items vertically */

    background: #fff;
    /* White background for the border effect */
    padding: 6px;
    /* The white border thickness - uniform */

    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

    /* Ensure it behaves like a block to hug content */
    display: inline-block;
    width: 100%;

    transition: transform 0.3s;
    cursor: zoom-in;
}

.photo-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

.photo-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    /* Slight radius on the image itself */
}

/* --- Danmaku & FAB --- */
/* --- Danmaku UI --- */
#danmaku-layer {
    position: fixed;
    top: 5%;
    left: 0;
    width: 100%;
    height: 50%;
    pointer-events: none;
    z-index: 2000;
    /* High Z-index to be visible */
    overflow: hidden;
}

.danmaku-msg {
    position: absolute;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
    /* Pill background */
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: var(--font-body);
    /* Colors will be handled by JS or random classes */
}

/* Fixed Bottom Bar */
#danmaku-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(211, 16, 39, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 2500;
    display: flex;
    justify-content: center;
    backdrop-filter: blur(10px);
}

/* Hidden State for Layer */
#danmaku-layer.danmaku-hidden {
    opacity: 0;
    transition: opacity 0.3s;
}

#toggle-danmaku-btn {
    width: 44px;
    height: 44px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

#toggle-danmaku-btn.off {
    color: #aaa;
    background: #e0e0e0;
}

#toggle-danmaku-btn.off i {
    text-decoration: line-through;
    /* Optional visual cue */
}

/* Adjust wrapper gap */
.danmaku-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    gap: 12px;
}

#danmaku-input {
    flex: 1;
    border: 2px solid #eee;
    background: #f9f9f9;
    padding: 12px 20px;
    border-radius: 24px;
    outline: none;
    font-size: 1rem;
    color: #333;
    transition: all 0.3s;
}

#danmaku-input:focus {
    border-color: var(--rich-gold);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.1);
}

#send-danmaku-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #d31027, #ea384d);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(211, 16, 39, 0.3);
    transition: transform 0.2s;
    flex-shrink: 0;
}

#send-danmaku-btn:active {
    transform: scale(0.9);
}

/* Adjust main container to account for bottom bar */
.app-container {
    padding-bottom: 90px;
}

/* Lightbox */
.lightbox {
    background: rgba(0, 0, 0, 0.95);
    display: none;
    /* Default hidden */
    justify-content: center;
    align-items: center;
    z-index: 3000;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lightbox:not(.hidden) {
    display: flex;
    /* Show only when not hidden */
}

.lightbox-content-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 100%;
    max-height: 100vh;
    border: none;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    z-index: 3005;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 45px;
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 20px;
    z-index: 3005;
    user-select: none;
}

.lightbox-nav:hover {
    color: #fff;
}

.nav-prev {
    left: 0;
}

.nav-next {
    right: 0;
}