:root {
    --primary-red: #D32F2F;
    --dark-red: #8E0000;
    --primary-gold: #FFD700;
    --light-gold: #FFF59D;
    --text-color: #fff;
    --bg-overlay: rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Noto Serif SC', 'Microsoft YaHei', serif;
    background: radial-gradient(circle at center, var(--primary-red), var(--dark-red));
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

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

#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Danmaku Styles */
#danmaku-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    overflow: hidden;
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    color: #fff;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    will-change: transform;
    /* Initial position off-screen right handled by JS or CSS */
}

@keyframes scrollLeft {
    from {
        transform: translateX(100vw);
    }
    to {
        transform: translateX(-100%);
    }
}

.container {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

/* Header */
.animate-header {
    margin-bottom: 3rem;
    animation: fadeInDown 1.5s ease-out;
}

.main-title {
    font-size: 4rem;
    color: var(--primary-gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5), 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--light-gold);
    letter-spacing: 5px;
    text-transform: uppercase;
}

/* Countdown */
.countdown-section {
    background: rgba(142, 0, 0, 0.6);
    border: 2px solid var(--primary-gold);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
}

.countdown-section h2 {
    color: var(--light-gold);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.time-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.time-box span:first-child {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-gold);
    font-family: monospace; /* Monospace for consistent width */
}

.time-box .label {
    font-size: 0.9rem;
    color: #fff;
    margin-top: 0.5rem;
}

/* Controls */
.controls-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn {
    background: var(--primary-gold);
    color: var(--dark-red);
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    background: #FFC107;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid #fff;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Message Wall */
.message-wall-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    text-align: left;
}

.message-wall-section h2 {
    text-align: center;
    color: var(--primary-gold);
    margin-bottom: 1.5rem;
}

.message-input {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.message-input input, .message-input textarea {
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-family: inherit;
}

.message-input textarea {
    resize: vertical;
    min-height: 80px;
}

.message-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    
    /* Custom Scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) rgba(0, 0, 0, 0.1);
}

/* Custom Scrollbar for Chrome/Safari/Edge */
.message-list::-webkit-scrollbar {
    width: 6px; /* Thin */
}

.message-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.6);
}

.message-item {
    background: rgba(255, 215, 0, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-gold);
    animation: slideIn 0.5s ease;
}

.msg-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--light-gold);
    margin-bottom: 0.5rem;
}

.msg-content {
    font-size: 1rem;
    line-height: 1.4;
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.8rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: var(--primary-gold);
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    color: #333;
    max-width: 90%;
    width: 400px;
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.card-preview {
    margin: 1rem 0;
    border: 1px solid #ddd;
    background: #eee;
    display: flex;
    justify-content: center;
}

#cardCanvas {
    max-width: 100%;
    height: auto;
}

/* Modal Inputs */
.modal-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    background: #fff;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-bottom: 1rem;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

textarea.modal-input {
    min-height: 100px;
    resize: vertical;
}

.message-input-container {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

.full-width {
    width: 100%;
    justify-content: center;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 600px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .time-box span:first-child {
        font-size: 2rem;
    }
}
