* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Arial', sans-serif; overflow: hidden; background: #000; }
#canvas3d { display: block; width: 100vw; height: 100vh; }

#loading {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #ff9ed8, #d896ff, #ff9ed8);
    background-size: 300% 300%;
    animation: bgShift 4s ease infinite;
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
}

@keyframes bgShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.birthday-loading {
    text-align: center;
    animation: fadeUp 0.8s ease-out both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.birthday-title {
    font-size: 2.8em;
    color: white;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 4px 16px rgba(0,0,0,0.2);
    margin: 10px 0 10px;
    animation: pulse 1.6s ease-in-out infinite;
}

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

.birthday-sub {
    color: rgba(255,255,255,0.88);
    font-size: 1.05em;
    margin: 0 0 22px;
}

.b-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
}

.b-dots span {
    display: block;
    width: 13px; height: 13px;
    background: white;
    border-radius: 50%;
    animation: bounce 1.2s ease-in-out infinite;
}

.b-dots span:nth-child(2) { animation-delay: 0.2s; }
.b-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%,100% { transform: translateY(0); opacity: 0.5; }
    50%      { transform: translateY(-14px); opacity: 1; }
}

.birthday-hearts {
    font-size: 1.4em;
    letter-spacing: 8px;
    color: white;
    animation: float 2.2s ease-in-out infinite;
}

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

/* 旧的 spinner 隐藏 */
.spinner { display: none; }

.spinner {
    border: 4px solid rgba(255,255,255,0.4);
    border-top: 4px solid white;
    border-radius: 50%; width: 55px; height: 55px;
    animation: spin 1s linear infinite; margin-bottom: 20px;
}

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

.hint {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.65); color: white; padding: 12px 28px;
    border-radius: 30px; font-size: 14px; z-index: 100;
    backdrop-filter: blur(12px); white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.interaction-ui {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
    background: rgba(76, 175, 80, 0.92); color: white; padding: 14px 30px;
    border-radius: 30px; font-size: 16px; z-index: 100;
    animation: pulse 1.5s infinite; box-shadow: 0 4px 15px rgba(76,175,80,0.4);
}

.key {
    display: inline-block; background: white; color: #4CAF50;
    padding: 2px 10px; border-radius: 5px; font-weight: bold; margin: 0 5px;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
}

.modal-content {
    position: relative; margin: 5% auto; padding: 0;
    width: 90%; max-width: 480px; animation: slideIn 0.35s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-60px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.card {
    background: white; border-radius: 24px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.close {
    position: absolute; top: 14px; right: 14px; color: #bbb;
    font-size: 26px; font-weight: bold; cursor: pointer; z-index: 10;
    background: rgba(255,255,255,0.95); width: 36px; height: 36px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: all 0.25s; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.close:hover { background: #f44336; color: white; transform: rotate(90deg); }

.gift-box { padding: 40px 30px; text-align: center; }

#gift-image, #ferris-image {
    width: 100%; max-width: 300px; height: 260px; object-fit: cover;
    border-radius: 16px; margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

#gift-name, #ferris-title {
    font-size: 22px; color: #2c2c2c;
    margin-bottom: 12px; font-weight: 700;
}

#gift-description, #ferris-description {
    font-size: 15px; color: #666; line-height: 1.7; margin-bottom: 20px;
}

.message-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; padding: 18px 20px; border-radius: 16px;
    font-size: 17px; font-style: italic;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#music-control {
    position: fixed; bottom: 20px; right: 20px; z-index: 100;
    background: rgba(0,0,0,0.7); color: white; padding: 10px 22px;
    border-radius: 30px; cursor: pointer; backdrop-filter: blur(10px);
    transition: all 0.3s; font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#music-control:hover { background: rgba(0,0,0,0.9); transform: scale(1.05); }

@media (max-width: 768px) {
    .modal-content { width: 95%; margin: 10% auto; }
    .gift-box { padding: 28px 18px; }
    #gift-image, #ferris-image { height: 200px; }
    .hint { font-size: 12px; padding: 10px 18px; }
}
@keyframes slideDown {
    from { transform: translate(-50%, -30px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, -30px); opacity: 0; }
}
