:root {
    --primary-red: #d32f2f;
    --dark-red: #8e0000;
    --gold: #ffd700;
    --light-gold: #fff8e1;
    --bg-dark: #1a0505;
}

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

body {
    background-color: var(--dark-red);
    background-image: radial-gradient(circle at 50% 30%, #ef4444 0%, #7f1d1d 70%, #450a0a 100%);
    color: var(--light-gold);
    font-family: 'Microsoft YaHei', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

#fireworksCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto; /* 允许点击 */
}

.app-container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: center;
}

/* 字体 */
h1, h2, h3, .lantern-text, .nav-btn {
    font-family: 'Ma Shan Zheng', cursive, 'KaiTi', serif;
}

/* 灯笼样式 */
header {
    position: relative;
    margin-bottom: 40px;
    padding-top: 20px;
}

.lantern {
    position: absolute;
    top: -20px;
    width: 80px;
    animation: swing 3s infinite ease-in-out alternate;
}

.lantern.left { left: 10px; }
.lantern.right { right: 10px; animation-delay: 1s; }

.lantern-body {
    width: 80px;
    height: 70px;
    background-color: var(--primary-red);
    border-radius: 30px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), inset 0 0 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-top: 4px solid var(--gold);
    border-bottom: 4px solid var(--gold);
}

.lantern-text {
    font-size: 36px;
    color: var(--gold);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.lantern-tassel {
    width: 4px;
    height: 50px;
    background-color: var(--gold);
    margin: 0 auto;
    position: relative;
}

.writing-vertical {
    writing-mode: vertical-rl;
    text-orientation: upright;
}
.lantern-tassel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 24px;
    height: 40px;
    background: repeating-linear-gradient(to right, var(--primary-red), var(--primary-red) 2px, transparent 2px, transparent 4px);
    border-radius: 0 0 5px 5px;
}

@keyframes swing {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

/* 标题 */
.title-box h1 {
    font-size: 6rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
    background: linear-gradient(to bottom, #ffd700, #ffa500);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Fallback for browsers that don't support background-clip: text */
    color: var(--gold); 
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
    .title-box h1 {
        color: transparent;
    }
}

.title-box h2 {
    font-size: 2.5rem;
    color: #fff;
    letter-spacing: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* 倒计时 */
.countdown-section {
    background: rgba(142, 0, 0, 0.3);
    border: 2px solid var(--dark-red);
    border-radius: 15px;
    padding: 30px;
    margin: 40px 0;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 30px rgba(211, 47, 47, 0.2);
}

.countdown-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ffccbc;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-block span {
    font-size: 3rem;
    font-weight: bold;
    color: var(--gold);
    background: rgba(0,0,0,0.3);
    padding: 10px 15px;
    border-radius: 8px;
    min-width: 80px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.time-block label {
    margin-top: 5px;
    font-size: 1rem;
    color: #ffab91;
}

/* 导航按钮 */
.game-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    border: 2px solid var(--gold);
    border-radius: 50%;
    color: var(--light-gold);
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.nav-btn:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 0, 0, 0.4);
    background: linear-gradient(135deg, #e53935, #b71c1c);
}

.nav-btn .icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.nav-btn .text {
    font-size: 1.2rem;
    font-weight: bold;
}

footer {
    margin-top: auto;
    padding-top: 40px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* 响应式 */
@media (max-width: 600px) {
    .title-box h1 { font-size: 4rem; }
    .title-box h2 { font-size: 1.5rem; }
    .time-block span { font-size: 2rem; min-width: 60px; }
    .nav-btn { width: 100px; height: 100px; }
    .nav-btn .icon { font-size: 2rem; }
    .nav-btn .text { font-size: 0.9rem; }
    .lantern { transform: scale(0.7); top: -10px; }
    .lantern.left { left: -10px; }
    .lantern.right { right: -10px; }
}

/* --- 求签页面样式 --- */
.page-header {
    padding: 20px;
    text-align: left;
}

.back-btn {
    color: var(--gold);
    text-decoration: none;
    font-size: 1.2rem;
    border: 1px solid var(--gold);
    padding: 5px 15px;
    border-radius: 20px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--gold);
    color: var(--dark-red);
}

.fortune-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shaker-box {
    width: 200px;
    height: 300px;
    background: linear-gradient(to right, #8d6e63, #5d4037);
    border-radius: 10px 10px 40px 40px;
    position: relative;
    border: 4px solid #3e2723;
    display: flex;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.shaker-box::before {
    content: '签';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: #3e2723;
    font-family: 'Ma Shan Zheng', cursive;
    opacity: 0.5;
    border: 4px solid #3e2723;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shaker-box.shaking {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0% { transform: rotate(0deg) translate(0, 0); }
    25% { transform: rotate(5deg) translate(2px, -2px); }
    50% { transform: rotate(0deg) translate(0, 0); }
    75% { transform: rotate(-5deg) translate(-2px, -2px); }
    100% { transform: rotate(0deg) translate(0, 0); }
}

.result-card {
    /* 保留动画定义，其他样式由 Tailwind 控制 */
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.result-title {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 15px;
    font-family: 'Ma Shan Zheng', cursive;
}

.result-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.draw-btn {
    margin-top: 40px;
    padding: 15px 40px;
    font-size: 1.5rem;
    background: var(--primary-red);
    color: var(--gold);
    border: 2px solid var(--gold);
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Ma Shan Zheng', cursive;
    transition: transform 0.2s;
}

.draw-btn:active {
    transform: scale(0.95);
}

/* --- 许愿孔明灯页面样式 --- */
.wishes-body {
    background: radial-gradient(circle at bottom, #1a237e 0%, #000000 100%);
    overflow: hidden;
}

.input-area {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.wish-input {
    flex: 1;
    padding: 15px;
    border-radius: 30px;
    border: 2px solid var(--gold);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    outline: none;
}

.send-btn {
    width: 60px;
    height: 50px;
    border-radius: 50%;
    background: var(--gold);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.send-btn:active {
    transform: scale(0.9);
}

.sky-lantern {
    position: absolute;
    width: 60px;
    height: 80px;
    background: radial-gradient(circle, #ffecb3 20%, #ffca28 100%);
    border-radius: 10px 10px 30px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
    animation: flyUp 15s linear forwards, swingLantern 4s ease-in-out infinite alternate;
    cursor: pointer;
    user-select: none;
    z-index: 10;
}

.sky-lantern::after {
    content: '';
    position: absolute;
    bottom: -10px;
    width: 20px;
    height: 10px;
    border: 1px solid #ffca28;
    border-top: none;
}

.sky-lantern .wish-text {
    font-size: 0.8rem;
    color: #3e2723;
    writing-mode: vertical-rl;
    text-orientation: upright;
    max-height: 70px;
    overflow: hidden;
    font-weight: bold;
}

@keyframes flyUp {
    from { bottom: -100px; opacity: 1; }
    to { bottom: 120%; opacity: 0; }
}

@keyframes swingLantern {
    from { transform: translateX(-10px) rotate(-5deg); }
    to { transform: translateX(10px) rotate(5deg); }
}
