/* ===================================
   games.css — 游戏中心页面
   =================================== */

#game-page {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

#game-page.visible {
    opacity: 1;
    pointer-events: auto;
}

#game-page.hidden-scene {
    opacity: 0;
    pointer-events: none;
}

/* ---- 顶部 ---- */
.game-header {
    text-align: center;
    padding: 20px 16px 10px;
    flex-shrink: 0;
}

.game-header-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    color: #FFD700;
    margin-bottom: 14px;
    text-shadow: 0 0 20px rgba(255,215,0,0.3);
}

/* ---- Tab 切换 ---- */
.game-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-tab:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.game-tab.active {
    background: rgba(255,215,0,0.2);
    color: #FFD700;
    border-color: #FFD700;
}

.game-tab.done {
    color: #B5EAD7;
}

.game-tab.done::after { content: ' ✓'; }

/* ---- 进度点 ---- */
.game-progress {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transition: all 0.4s ease;
}

.progress-dot.done {
    background: #B5EAD7;
    box-shadow: 0 0 8px rgba(181,234,215,0.6);
}

/* ---- 游戏区域 ---- */
.game-area {
    flex: 1;
    width: 90%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ---- 快捷键提示 ---- */
.game-skip-btn {
    position: absolute;
    top: 14px;
    right: 20px;
    z-index: 10;
    padding: 6px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 18px;
    background: rgba(255,255,255,0.1);
    font-family: 'Nunito', sans-serif;
    font-size: 0.82rem; font-weight: 600;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.25s ease;
}
.game-skip-btn:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}

.game-skip-hint kbd {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
    color: rgba(255,215,0,0.9);
    font-family: inherit;
    font-size: 0.7rem;
}

/* ---- 底部按钮 ---- */
.game-footer {
    padding: 16px;
    flex-shrink: 0;
}

.game-enter-btn {
    padding: 14px 40px;
    border-radius: 30px;
    background: linear-gradient(135deg, #FFD700, #FFB7C5);
    color: #1a1a2e;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 8px 30px rgba(255,215,0,0.4);
    transition: all 0.3s ease;
}

.game-enter-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(255,215,0,0.6);
}

/* ==================== 游戏A：吹气球 ==================== */
.balloon-game {
    text-align: center;
    width: 100%;
}

.balloon-canvas {
    display: block;
    margin: 0 auto;
}

.balloon-instruction {
    font-family: 'Quicksand', sans-serif;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin: 12px 0;
}

.balloon-retry {
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    margin-top: 8px;
}

/* ==================== 游戏B：采购烟花 ==================== */
.firework-game {
    text-align: center;
    width: 100%;
    color: #fff;
}

.fw-timer {
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    color: #FFD700;
    margin-bottom: 8px;
}

.fw-timer.urgent { color: #FF6B6B; animation: twinkle 0.5s ease-in-out infinite; }

.fw-shopping-list {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.fw-list-item {
    font-size: 2rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.fw-list-item.bought { opacity: 1; }
.fw-list-item.current {
    opacity: 1;
    transform: scale(1.4);
    filter: drop-shadow(0 0 6px #FFD700);
    animation: twinkle 0.6s ease-in-out infinite;
}

.fw-shop {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.fw-item {
    padding: 20px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    cursor: pointer;
    font-size: 2.5rem;
    transition: all 0.2s ease;
}

.fw-item:hover { background: rgba(255,255,255,0.18); transform: scale(1.05); }
.fw-item.bought { background: rgba(181,234,215,0.2); pointer-events: none; opacity: 0.5; }
.fw-item.gift-done { opacity: 0.4; pointer-events: none; position: relative; }
.fw-item.gift-done::after { content: '✅'; position: absolute; top: 4px; right: 8px; font-size: 0.8rem; }

.fw-result {
    font-family: 'Nunito', sans-serif;
    font-size: 1.2rem;
    margin: 12px 0;
}

/* ==================== 游戏D：包装礼物 ==================== */
.gift-game {
    text-align: center;
    width: 100%;
    color: #fff;
}

.gift-step-title {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: #FFD700;
    margin-bottom: 12px;
}

.gift-preview {
    width: 160px;
    height: 180px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    transition: background 0.3s;
}

.gift-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gift-color-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
}

.gift-color-btn:hover, .gift-color-btn.selected {
    border-color: #FFD700;
    transform: scale(1.15);
}

/* 丝带步骤 */
.gift-ribbon-meter {
    width: 80%;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    margin: 0 auto 16px;
    position: relative;
    overflow: hidden;
}

.gift-ribbon-indicator {
    width: 8px;
    height: 100%;
    background: #FFD700;
    border-radius: 4px;
    position: absolute;
    left: 0;
    transition: left 0.016s linear;
}

.gift-ribbon-zone {
    position: absolute;
    left: 55%;
    width: 20%;
    height: 100%;
    background: rgba(181,234,215,0.5);
    border-radius: 6px;
}

.gift-tap-btn {
    padding: 10px 30px;
    border-radius: 20px;
    background: #FFD700;
    color: #1a1a2e;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

/* 蝴蝶结步骤 */
.gift-bow-target {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px dashed rgba(255,255,255,0.4);
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gift-bow-target.placed { border-color: #B5EAD7; background: rgba(181,234,215,0.2); }

/* ==================== 游戏E：许愿星 ==================== */
.star-game {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
}

.star-game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.star-collected {
    position: absolute;
    font-size: 0.8rem;
    color: #FFD700;
    pointer-events: none;
    animation: star-text-rise 1.5s ease-out forwards;
}

@keyframes star-text-rise {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-60px); }
}
