:root {
    --bg-color: #faf9f6;
    --card-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-sub: #86868b;
    --accent-1: #66a6ff; /* Soft Blue */
    --accent-2: #89f7fe; /* Cyan Light Blue */
    --shadow-color: rgba(143, 148, 153, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    /* Use native Apple system fonts for a true Apple-like feel */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    background-image: radial-gradient(circle at top right, #e0f2fe 0%, transparent 40%),
                      radial-gradient(circle at bottom left, #f0f8ff 0%, transparent 40%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    padding: 2rem 1rem;
}

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

.card {
    background: var(--card-bg);
    border-radius: 32px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 40px var(--shadow-color),
                0 1px 3px rgba(0,0,0,0.02);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    z-index: 2;
    position: relative;
    overflow: hidden; /* Prevent content from overflowing during transition */
}

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

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 2rem;
    animation: float 6s ease-in-out infinite;
}

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

.avatar-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    opacity: 0.25;
    filter: blur(8px);
    z-index: 1;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--card-bg);
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.text-content {
    text-align: center;
    margin-bottom: 2.5rem;
    width: 100%;
}

.greeting {
    font-size: 1.05rem;
    color: var(--text-sub);
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.birthday-title {
    /* Use system serif font for elegance */
    font-family: "SF Pro Display", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    font-style: italic;
    font-size: clamp(2.2rem, 10vw, 3rem);
    line-height: 1.15;
    color: var(--text-main);
    margin-bottom: 1rem;
    background: linear-gradient(120deg, #1d1d1f 0%, #86868b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--accent-1);
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.action-btn {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    border-radius: 20px;
    padding: 1.1rem 2rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(102, 166, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 100%;
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn:hover {
    box-shadow: 0 12px 24px rgba(102, 166, 255, 0.35);
    transform: translateY(-2px);
}

.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-text svg {
    transition: transform 0.3s ease;
}

.action-btn:hover .btn-text svg {
    transform: scale(1.1) rotate(5deg);
}

/* 步骤切换动画与 Step 2 样式 */
.step-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.step-container.fade-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.gift-gif {
    width: 180px;
    height: auto;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 20px rgba(102, 166, 255, 0.15);
}

.question-text {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-group {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.secondary-btn {
    flex: 1;
}

.outline-btn {
    background: transparent;
    border: 2px solid var(--accent-1);
    color: var(--accent-1);
    box-shadow: none;
    flex: 1;
}

.outline-btn:hover {
    background: rgba(102, 166, 255, 0.08);
    box-shadow: none;
}

/* 定时器样式 */
.timer-title {
    font-size: 1.15rem;
    color: var(--text-sub);
    margin-bottom: 1.2rem;
    letter-spacing: 1px;
}

.timer-box {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
}

.time-item {
    background: rgba(102, 166, 255, 0.08);
    padding: 0.8rem 0.5rem;
    border-radius: 16px;
    min-width: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.5), 0 4px 10px rgba(102, 166, 255, 0.05);
}

.time-item span:first-child {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-1);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.time-label {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-top: 0.4rem;
    font-weight: 500;
}

/* 信件与最终页面样式 */
.letter-content {
    text-align: center;
    line-height: 2.2;
    color: var(--text-main);
    font-size: 1.05rem;
    width: 100%;
}

.fade-text {
    opacity: 0;
    transform: translateY(15px);
    animation: textFadeIn 1.5s ease-out forwards;
}

@keyframes textFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Specific Mobile Fixes */
@media (max-width: 380px), (max-height: 700px) {
    body {
        padding: 1rem;
    }
    
    .card {
        padding: 2rem 1.2rem;
        border-radius: 24px;
    }
    
    .avatar-wrapper {
        width: 85px;
        height: 85px;
        margin-bottom: 1.5rem;
    }
    
    .text-content {
        margin-bottom: 2rem;
    }
    
    .birthday-title {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .action-btn {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
        border-radius: 16px;
    }
    
    .time-item {
        min-width: 55px;
        padding: 0.6rem 0.4rem;
    }
    
    .time-item span:first-child {
        font-size: 1.4rem;
    }
}