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

body {
    font-family: 'Press Start 2P', 'Microsoft YaHei', sans-serif; /* 使用新字体 */
    background-color: #0a0a2a; /* 深蓝色背景 */
    color: #ffffff;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 星星背景 */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 60px 110px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 80px 150px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 100px 190px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 120px 230px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 140px 270px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 310px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 180px 350px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 200px 390px, #ffffff, rgba(0,0,0,0));
    background-size: 400px 400px;
    animation: twinkle 5s infinite linear;
}

@keyframes twinkle {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* 主容器布局 */
.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-top: 150px;
}


@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 2px #ffffff, 0 0 10px rgba(255, 105, 180, 0.7); }
    50% { box-shadow: 0 0 0 2px #ffffff, 0 0 20px rgba(255, 105, 180, 1); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}




.pixel-card {
    
    width: 100%;
    height: 100%;
    background-color: #1a1a4a; /* 深蓝紫色背景 */
    border: 8px solid #ffd700; /* 金色边框 */
    box-shadow: 
        0 0 0 4px #ff69b4,
        0 0 20px rgba(255, 215, 0, 0.5);
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    image-rendering: pixelated;
}

.pixel-card::before {
    font-family: 'Press Start 2P', 'Microsoft YaHei', sans-serif; /* 使用新字体 */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(255, 215, 0, 0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 215, 0, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 215, 0, 0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 215, 0, 0.1) 75%);
    background-size: 20px 20px;
    z-index: 0;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.pixel-icon {
    font-size: 24px;
    margin-right: 15px;
    animation: bounce 2s infinite;
}

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

.pixel-title {
    color: #ffd700; /* 金色文字 */
    font-size: 24px;
    text-shadow: 
        2px 2px 0 #ff69b4,
        -2px -2px 0 #ff69b4;
    letter-spacing: 2px;
}

.card-content {
    font-family: 'Press Start 2P', 'Microsoft YaHei', sans-serif; /* 使用新字体 */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.countdown-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-value {
    font-size: 36px;
    color: #ffffff;
    background-color: #ff69b4; /* 粉色背景 */
    padding: 10px 15px;
    border: 4px solid #ffffff;
    margin-bottom: 10px;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 0 #c74c8e;
}

.countdown-label {
    font-size: 14px;
    color: #ffd700; /* 金色文字 */
}

.birthday-message {
    text-align: center;
    margin-top: 20px;
    line-height: 1.8;
}

.birthday-message p {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 10px;
}

.highlight-text {
    color: #ff69b4; /* 粉色文字 */
    font-size: 16px;
    animation: colorChange 3s infinite;
}

@keyframes colorChange {
    0% { color: #ff69b4; }
    33% { color: #ffd700; }
    66% { color: #00ffff; }
    100% { color: #ff69b4; }
}

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

.pixel-balloon, .pixel-star, .pixel-gift {
    position: absolute;
    font-size: 24px;
}

.balloon-1 {
    top: 10%;
    left: 5%;
    animation: float 6s infinite ease-in-out;
}

.balloon-2 {
    top: 15%;
    right: 5%;
    animation: float 7s infinite ease-in-out;
}

.star-1 { top: 10%; left: 10%; animation: star-rotate 4s infinite linear 0.1s; }
.star-2 { top: 20%; right: 15%; animation: star-rotate 4.5s infinite linear 0.7s; }
.star-3 { top: 15%; left: 25%; animation: star-rotate 3.8s infinite linear 1.3s; }
.star-4 { top: 25%; right: 30%; animation: star-rotate 4.2s infinite linear 1.9s; }
.star-5 { top: 30%; left: 5%; animation: star-rotate 4.7s infinite linear 2.5s; }
.star-6 { top: 35%; right: 20%; animation: star-rotate 4.3s infinite linear 3.1s; }
.star-7 { top: 40%; left: 40%; animation: star-rotate 3.9s infinite linear 3.7s; }
.star-8 { top: 45%; right: 35%; animation: star-rotate 4.4s infinite linear 4.3s; }

.star-9 { bottom: 25%; left: 15%; animation: star-float 4.2s infinite ease-in-out 0.2s; }
.star-10 { bottom: 20%; right: 20%; animation: star-float 4.5s infinite ease-in-out 1.2s; }
.star-11 { bottom: 30%; right: 40%; animation: star-float 4.8s infinite ease-in-out 2.2s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* 下部分 (1/5高度) - 按钮区域 */
.buttons-area {
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: clamp(15px, 3vw, 25px);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 2vw, 20px);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.05),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 2;
    width: fit-content;
    min-width: min-content;
}

/* 新的边框发光效果 */
.buttons-area::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 16px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.05) 50%,
        transparent
    );
    z-index: -1;
}

/* 简化悬挂线效果 */
.floating-item {
    position: absolute;
    font-size: clamp(24px, 4vw, 40px);
}

.floating-item::before {
    content: '';
    position: absolute;
    top: calc(-1 * var(--item-top)); /* 使用物品到顶部的距离作为线长 */
    left: 50%;
    width: 1px;
    height: var(--item-top); /* 线长等于物品到顶部的距离 */
    background: rgba(255, 255, 255, 0.3);
}



/* 重新设计流星效果 */
.shooting-star {
    position: fixed;
    width: 150px;
    height: 2px;
    background: linear-gradient(to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 60%,
        rgba(255, 255, 255, 0.8) 80%,
        rgba(255, 255, 255, 1) 100%
    );
    transform-origin: right;
    transform: rotate(135deg); /* 修改角度为135度，实现右上到左下的斜向滑落 */
    animation: meteorFall 2s cubic-bezier(0.58, 0, 0.58, 1) infinite;
    z-index: 1;
}

.shooting-star::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 
        0 0 10px #ffffff,
        0 0 20px #ffffff,
        0 0 30px rgba(255, 255, 255, 0.5);
}

/* 创建多个流星 */
.shooting-star:nth-child(1) {
    width: 180px;
    top: 0;
    right: 20%;
}

.shooting-star:nth-child(2) {
    width: 100px;
    top: 5%;
    right: 40%;
    animation-delay: 0.4s;
}

.shooting-star:nth-child(3) {
    width: 150px;
    top: -5%;
    right: 60%;
    animation-delay: 0.8s;
}

.shooting-star:nth-child(4) {
    width: 120px;
    top: 10%;
    right: 30%;
    animation-delay: 1.2s;
}

.shooting-star:nth-child(5) {
    width: 200px;
    top: -8%;
    right: 50%;
    animation-delay: 1.6s;
}

/* 流星划过动画 */
@keyframes meteorFall {
    0% {
        transform: rotate(135deg) translateX(-100px);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    80% {
        opacity: 0;
    }
    100% {
        transform: rotate(135deg) translateX(calc(100vh + 200px));
        opacity: 0;
    }
}

/* 流星雨组效果 */
.meteor-shower {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    animation: showerCycle 8s linear infinite;
}

@keyframes showerCycle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.3; }
}

/* 添加密集流星效果 */
.shooting-star.dense {
    width: 60px;
    animation-duration: 1.5s;
}

.shooting-star.dense:nth-child(6) {
    top: -5%;
    right: 35%;
    animation-delay: 0.2s;
}

.shooting-star.dense:nth-child(7) {
    top: 2%;
    right: 45%;
    animation-delay: 0.6s;
}

.shooting-star.dense:nth-child(8) {
    top: -2%;
    right: 55%;
    animation-delay: 1s;
}

/* 装饰物大小和动画 */
.floating-item:nth-child(1) { 
    font-size: 45px; 
    animation: floatAndScale 4s ease-in-out infinite;
}
.floating-item:nth-child(2) { 
    font-size: 35px;
    animation: floatAndScale 4s ease-in-out infinite 0.5s;
}
.floating-item:nth-child(3) { 
    font-size: 50px;
    animation: floatAndScale 4s ease-in-out infinite 1s;
}
.floating-item:nth-child(4) { 
    font-size: 30px;
    animation: floatAndScale 4s ease-in-out infinite 1.5s;
}
.floating-item:nth-child(5) { 
    font-size: 40px;
    animation: floatAndScale 4s ease-in-out infinite 2s;
}
.floating-item:nth-child(6) { 
    font-size: 38px;
    animation: floatAndScale 4s ease-in-out infinite 2.5s;
}

@keyframes floatAndScale {
    0% { 
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-15px) scale(1.1);
        opacity: 1;
    }
    100% { 
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .buttons-area {
        flex-direction: column;
        width: clamp(200px, 90vw, 320px);
        padding: clamp(12px, 3vw, 20px);
        gap: clamp(8px, 2vw, 15px);
        top: 55%;
    }

  
}

@media (max-width: 768px) {
    /* 调整普通星星位置到上方 */
    .star-1 { top: 5%; left: 3%; }
    .star-2 { top: 18%; right: 2%; }
    .star-3 { top: 25%; left: 25%; }
    .star-4 { top: 10%; right: 30%; }
    .star-5 { top: 20%; left: 10%; }
    .star-6 { top: 30%; right: 20%; }
    .star-7 { top: 40%; left: 18%; }
    .star-8 { top: 50%; right: 20%; }
    
    /* 只保留三颗大星星在下方 */
    .star-9 { bottom: 25%; left: 20%; }
    .star-10 { bottom: 20%; right: 15%; }
    .star-11 { bottom: 30%; left: 45%; }
    
    /* 保持原有的大小设置 */
    .decoration-item.star {
        font-size: clamp(12px, 2.5vw, 20px);
    }
    
    .decoration-item.star.large {
        font-size: clamp(16px, 3.5vw, 30px);
    }
}




/* 按钮悬停效果 */
.pixel-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 5px 15px rgba(255, 105, 180, 0.4),
        0 0 30px rgba(255, 215, 0, 0.3);
        font-family: 'Press Start 2P', 'Microsoft YaHei', sans-serif; /* 使用新字体 */
}

.pixel-button:active {
    transform: translateY(2px);
}

/* 按钮图标样式 */
.button-icon {
    font-size: 20px;
    margin: 0;
}

.button-text {
    font-size: 12px;
    letter-spacing: 1px;
}

/* 响应式设计调整 */
/* @media (max-width: 1200px) {
    .countdown-value {
        font-size: 28px;
        min-width: 60px;
    }
    
    .pixel-title {
        font-size: 20px;
    }
}

@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
    }
    
    .character-area {
        width: 100%;
        height: 20vh;
    }
    
    .content-area {
        width: 100%;
        height: 80vh;
    }
    
    .character-placeholder {
        height: 100%;
    }
    
    .pixel-frame {
        height: 80%;
        width: 40%;
    }
    
    .buttons-area {
        padding-bottom: 20px;
    }
} */

@media (max-width: 768px) {
    .countdown-display {
        flex-wrap: wrap;
    }
    
    .countdown-item {
        margin-bottom: 10px;
    }
    
    .buttons-area {
        flex-direction: column;
        bottom: 5%;
        gap: 15px;
    }
    
    .pixel-button {
        width: 80%;
    }
}

/* Happy Birthday 标题样式 */
.birthday-title {
    position: fixed;
    top: clamp(200px, 47vh, 420px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 100vw;
    padding: 0 2vw;
    text-align: center;
    z-index: 10;
}

.title-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: clamp(0.6rem, 2.6vw, 2rem);
    width: min(96vw, 1200px);
    margin: 0 auto;
}

.word-group {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.04em;
    min-width: 0;
}

.letter {
    display: inline-block;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: clamp(22px, 4.6vw, 72px);
    line-height: 1;
    font-weight: 400;
    color: #FFD700;
    text-shadow: 
        0 0 20px #FF69B4,
        0 0 40px #FF69B4,
        0 0 60px #FF69B4;
    margin: 0;
    transform-origin: center;
}

/* 修复字母D的动画，添加缺失的序号 */
.letter:nth-child(6) { animation: float-letter 3s infinite ease-in-out 0.5s; } /* 添加D字母的动画 */

/* 调整按钮区域位置和大小 */
.buttons-area {
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: clamp(15px, 3vw, 25px);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 2vw, 20px);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.05),
        inset 0 0 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 2;
    width: fit-content;
    min-width: min-content;
}

/* 更新按钮样式，减小尺寸 */
.pixel-button {
    min-width: 100px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-family: 'Press Start 2P', 'Microsoft YaHei', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.button-icon {
    font-size: 20px;
    margin: 0 auto;
    display: block;
}

.button-text {
    width: 100%;
    text-align: center;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .letter {
        font-size: clamp(18px, 9.2vw, 42px);
    }

    .title-container {
        flex-direction: column;
        gap: clamp(0.35rem, 1.8vh, 0.8rem);
        width: 94vw;
    }

    .birthday-title {
        top: clamp(160px, 42vh, 280px);
    }

    .buttons-area {
        top: 60%;
    }
}

@media (max-width: 480px) {
    .letter {
        font-size: clamp(16px, 8.5vw, 30px);
    }

    .title-container {
        width: 94vw;
    }
    
    .buttons-area {
        width: 90%;
    }

    .pixel-button {
        width: 100%;
        padding: 12px 20px;
    }
}

/* 装饰元素样式 */
.decorations {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.decoration-item {
    position: fixed;
    pointer-events: none;
    z-index: 1;
}

/* 星星基础样式 */
.decoration-item.star {
    font-size: clamp(15px, 3vw, 25px);
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff;
}

/* 大星星样式 */
.decoration-item.star.large {
    font-size: clamp(20px, 4vw, 35px);
    color: #FFD700;
    text-shadow: 
        0 0 5px #FFD700,
        0 0 10px #FFD700;
}

/* 小星星旋转动画 */
@keyframes star-rotate {
    0% { 
        transform: rotate(0deg);
        opacity: 0.7;
        text-shadow: 0 0 5px #fff;
    }
    50% { 
        transform: rotate(180deg);
        opacity: 1;
        text-shadow: 
            0 0 10px #fff,
            0 0 20px #fff,
            0 0 30px #fff;
    }
    100% { 
        transform: rotate(360deg);
        opacity: 0.7;
        text-shadow: 0 0 5px #fff;
    }
}

/* 大星星浮动动画 */
@keyframes star-float {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 0.8;
        text-shadow: 
            0 0 5px #FFD700,
            0 0 10px #FFD700;
    }
    50% { 
        transform: translateY(-20px) scale(1.1);
        opacity: 1;
        text-shadow: 
            0 0 10px #FFD700,
            0 0 20px #FFD700,
            0 0 30px #FFD700;
    }
}









/* 添加新的装饰元素 */
/* .floating-decorations {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-item {
    position: absolute;
    font-size: 2.5em;
    opacity: 0.8;
} */

/* 添加更多装饰元素的动画 */
/* @keyframes shine {
    0% { transform: translateX(-200%) rotate(45deg); }
    100% { transform: translateX(200%) rotate(45deg); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
} */

/* 添加装饰性粒子 */
.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFD700;
    border-radius: 50%;
    animation: particle-float 3s infinite ease-in-out;
}

@keyframes particle-float {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    50% { transform: translate(20px, -20px); opacity: 1; }
}

/* 字母动画 */
.letter:nth-child(1) { animation: float-letter 3s infinite ease-in-out 0.1s; }
.letter:nth-child(2) { animation: float-letter 3s infinite ease-in-out 0.2s; }
.letter:nth-child(3) { animation: float-letter 3s infinite ease-in-out 0.3s; }
.letter:nth-child(4) { animation: float-letter 3s infinite ease-in-out 0.4s; }
.letter:nth-child(5) { animation: float-letter 3s infinite ease-in-out 0.5s; }
.letter:nth-child(7) { animation: float-letter 3s infinite ease-in-out 0.6s; }
.letter:nth-child(8) { animation: float-letter 3s infinite ease-in-out 0.7s; }
.letter:nth-child(9) { animation: float-letter 3s infinite ease-in-out 0.8s; }
.letter:nth-child(10) { animation: float-letter 3s infinite ease-in-out 0.9s; }
.letter:nth-child(11) { animation: float-letter 3s infinite ease-in-out 1.0s; }
.letter:nth-child(12) { animation: float-letter 3s infinite ease-in-out 1.1s; }
.letter:nth-child(13) { animation: float-letter 3s infinite ease-in-out 1.2s; }
.letter:nth-child(14) { animation: float-letter 3s infinite ease-in-out 1.3s; }

@keyframes float-letter {
    0%, 100% { 
        transform: translateY(0);
        text-shadow: 
            0 0 20px #FF69B4,
            0 0 40px #FF69B4,
            0 0 60px #FF69B4;
    }
    50% { 
        transform: translateY(-20px);
        text-shadow: 
            0 0 30px #FF69B4,
            0 0 60px #FF69B4,
            0 0 90px #FF69B4;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .buttons-area {
        flex-direction: column;
        bottom: 5%;
        gap: 15px;
    }

    .floating-item {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .buttons-area {
        width: 90%;
    }

    .pixel-button {
        width: 100%;
        padding: 12px 20px;
    }
}

/* 倒计时卡片样式 */
/* .countdown-card {
    background: rgba(26, 26, 74, 0.9);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.3),
        0 0 40px rgba(255, 105, 180, 0.2);
    backdrop-filter: blur(5px);
    max-width: 600px;
    width: 100%;
}

.countdown-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.countdown-item {
    text-align: center;
}

.countdown-value {
    font-size: 3em;
    color: #FFD700;
    background: rgba(255, 105, 180, 0.2);
    padding: 15px;
    border-radius: 10px;
    min-width: 80px;
} */

.pixel-button {
    font-family: 'Press Start 2P', 'Microsoft YaHei', sans-serif; /* 使用新字体 */
    flex: 1;
    min-width: clamp(120px, 17vw, 180px); /* 响应式最小宽度 */
    max-width: clamp(160px, 24vw, 240px); /* 响应式最大宽度 */
    min-height: clamp(96px, 14vh, 136px);
    padding: clamp(12px, 2vw, 18px) clamp(16px, 3vw, 26px);
    white-space: nowrap; /* 防止文字换行 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, 1.2vh, 12px);
    background-color: #ff69b4; /* 粉色背景 */
    border: none;
    color: #ffffff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-shadow: 
        0 6px 0 #c74c8e,
        0 0 10px rgba(255, 105, 180, 0.5);
}

.pixel-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 10px 10px;
    z-index: 0;
}

.button-icon {
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1;
    margin-bottom: clamp(4px, 0.8vh, 10px);
    position: relative;
    z-index: 1;
}

.button-text {
    font-size: clamp(11px, 1.1vw, 14px);
    position: relative;
    z-index: 1;
}

.pixel-button:hover {
    transform: translateY(3px);
    box-shadow: 
        0 3px 0 #c74c8e,
        0 0 15px rgba(255, 105, 180, 0.7);
}

.pixel-button:active {
    transform: translateY(6px);
    box-shadow: none;
}

/* 修改静音按钮位置和样式 */
.mute-button {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 14px);
    left: calc(env(safe-area-inset-left, 0px) + 14px);
    transform: none;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
    z-index: 100;
    padding: 0;
    animation: buttonPulse 3s infinite ease-in-out;
}

/* 修改提示框位置到按钮左侧 */
.mute-button::after {
    left: 120%;
    right: auto;
    content: "播放生日快乐🎵";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #ffffff;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    animation: tipFadeIn 3s 2s forwards;
}

/* 当按钮被点击后隐藏提示 */
.mute-button.clicked::after {
    display: none;
}

/* 修改提示框动画，改为从右向左淡入 */
@keyframes tipFadeIn {
    0% {
        opacity: 0;
        visibility: hidden;
        transform: translate(10px, -50%);
    }
    100% {
        opacity: 1;
        visibility: visible;
        transform: translate(0, -50%);
    }
}

.mute-icon {
    font-size: 32px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(249, 228, 0, 0.5);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .button-icon {
        font-size: clamp(28px, 8.5vw, 40px);
    }

    .mute-button {
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        left: calc(env(safe-area-inset-left, 0px) + 12px);
        transform: none;
        width: 56px;
        height: 56px;
    }
    
    .mute-button::after {
        left: 112%;
        right: auto;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .button-icon {
        font-size: clamp(26px, 10vw, 36px);
    }

    .mute-button {
        top: calc(env(safe-area-inset-top, 0px) + 10px);
        left: calc(env(safe-area-inset-left, 0px) + 10px);
        transform: none;
        width: 52px;
        height: 52px;
    }

    .mute-button::after {
        left: 110%;
        right: auto;
    }
}

/* iPad 适配（覆盖 768px 触发的手机规则） */
@media screen and (min-width: 768px) and (max-width: 1366px) {
    .birthday-title {
        top: clamp(210px, 44vh, 420px);
    }

    .title-container {
        flex-direction: row;
        width: min(92vw, 1080px);
        gap: clamp(0.8rem, 1.8vw, 1.6rem);
    }

    .letter {
        font-size: clamp(28px, 5.2vw, 64px);
    }

    .buttons-area {
        top: clamp(64%, 67vh, 72%);
        width: min(90vw, 860px);
        padding: clamp(16px, 2vw, 24px);
        gap: clamp(12px, 1.6vw, 20px);
    }

    .pixel-button {
        min-width: clamp(140px, 19vw, 210px);
        max-width: clamp(180px, 23vw, 260px);
        min-height: clamp(102px, 12vh, 138px);
    }

    .button-icon {
        font-size: clamp(30px, 3.8vw, 44px);
    }

    .button-text {
        font-size: clamp(12px, 1.2vw, 14px);
    }

    .mute-button {
        top: calc(env(safe-area-inset-top, 0px) + 16px);
        left: calc(env(safe-area-inset-left, 0px) + 16px);
        width: 62px;
        height: 62px;
    }

    .mute-icon {
        font-size: 30px;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .birthday-title {
        top: clamp(220px, 42vh, 420px);
    }

    .buttons-area {
        top: clamp(66%, 70vh, 74%);
        width: min(92vw, 760px);
    }
}

@media screen and (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .birthday-title {
        top: clamp(200px, 40vh, 360px);
    }

    .buttons-area {
        top: clamp(62%, 65vh, 69%);
    }
}

/* Mobile + motion performance overrides */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .birthday-title {
        top: clamp(120px, 30vh, 200px);
        padding: 0 3vw;
    }

    .title-container {
        width: 94vw;
        gap: 0.5rem;
    }

    .buttons-area {
        top: auto;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
        width: min(92vw, 360px);
        gap: 10px;
        padding: 12px;
        backdrop-filter: none;
    }

    .pixel-button {
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 82px;
        padding: 10px 12px;
    }

    .meteor-shower {
        display: none;
    }

    .decorations .star:not(.large) {
        display: none;
    }

    .particles {
        opacity: 0.6;
    }

    .mute-button::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .letter {
        font-size: clamp(15px, 8.2vw, 28px);
    }

    .buttons-area {
        width: 94vw;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    }

    .pixel-button {
        min-height: 76px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stars-container,
    .particles,
    .meteor-shower {
        animation: none !important;
        display: none !important;
    }

    .letter,
    .decoration-item,
    .mute-button,
    .pixel-button {
        animation: none !important;
        transition: none !important;
    }
}

body.reduced-motion .stars-container,
body.reduced-motion .particles,
body.reduced-motion .meteor-shower {
    display: none !important;
}

/* Critical mobile layout fix: prevent button stack clipping on small screens */
@media (max-width: 1024px) {
    body {
        min-height: 100dvh;
        overflow-x: hidden !important;
    }

    .birthday-title {
        top: clamp(88px, 16vh, 148px) !important;
        transform: translateX(-50%) !important;
    }

    .buttons-area {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: auto !important;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 10px) !important;
        width: min(92vw, 360px) !important;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 170px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 10px !important;
        gap: 8px !important;
        backdrop-filter: none !important;
    }

    .pixel-button {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: none !important;
        min-height: clamp(64px, 11vh, 92px) !important;
        padding: 8px 10px !important;
    }

    .button-icon {
        font-size: clamp(22px, 7vw, 30px) !important;
        margin-bottom: 2px !important;
    }

    .button-text {
        font-size: clamp(11px, 2.8vw, 13px) !important;
    }
}

@media (max-width: 480px) {
    .buttons-area {
        width: 94vw !important;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 150px) !important;
    }
}

/* Cross-device final layout overrides */
@media (min-width: 768px) and (max-width: 1024px) {
    body {
        overflow-y: auto;
    }

    .birthday-title {
        top: clamp(84px, 15vh, 140px) !important;
    }

    .buttons-area {
        flex-direction: row !important;
        width: min(94vw, 820px) !important;
        max-height: none !important;
        overflow: visible !important;
        gap: 12px !important;
        padding: 12px !important;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    }

    .pixel-button {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: clamp(86px, 10.2vh, 110px) !important;
    }

    .button-icon {
        font-size: clamp(26px, 4vw, 34px) !important;
    }
}

@media (max-width: 767px) {
    .birthday-title {
        top: clamp(84px, 16vh, 152px) !important;
    }

    .buttons-area {
        width: min(94vw, 380px) !important;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 170px) !important;
    }

    .pixel-button {
        min-height: clamp(70px, 10vh, 90px) !important;
    }
}

/* Title hard-center override */
.birthday-title {
    left: 0 !important;
    right: 0 !important;
    width: fit-content !important;
    max-width: calc(100vw - var(--safe-left, 0px) - var(--safe-right, 0px) - 16px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    transform: none !important;
    display: grid;
    place-items: center;
    text-align: center !important;
}

.title-container {
    width: max-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
}
