/* ==========================================
   中秋游戏 · 博饼 + 投壶
   ========================================== */

.game-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0 0 40px;
    flex-wrap: wrap;
}

.game-tab {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.25);
    color: var(--color-cream);
    padding: 14px 28px;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.game-tab:hover {
    border-color: var(--color-gold);
    transform: translateY(-2px);
}

.game-tab.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(200, 16, 46, 0.2));
    border-color: var(--color-gold);
    color: var(--color-gold);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.game-tab-icon { font-size: 22px; }

.game-panel {
    display: none;
    animation: fadeUp 0.5s;
}

.game-panel.active { display: block; }

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

/* ========== 博饼 ========== */
.bobing-wrap {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.05),
        rgba(200, 16, 46, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    padding: 40px 24px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.dice-tray {
    position: relative;
    background:
        radial-gradient(ellipse at center bottom,
            rgba(218, 165, 32, 0.18) 0%,
            transparent 70%),
        linear-gradient(135deg, #3a2418 0%, #1a0e08 100%);
    border: 2px solid rgba(218, 165, 32, 0.6);
    border-radius: 200px / 80px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto 32px;
    padding: 36px 24px;
    box-shadow:
        inset 0 8px 24px rgba(0, 0, 0, 0.6),
        0 12px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    min-height: 140px;
}

.dice {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #ffffff 0%, #f0e4c0 100%);
    border-radius: 12px;
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.5),
        inset 0 -4px 8px rgba(180, 130, 50, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 8px;
    transition: transform 0.4s;
}

.dice.rolling {
    animation: diceShake 0.15s infinite;
}

@keyframes diceShake {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-4px, -3px) rotate(-12deg); }
    50% { transform: translate(4px, 3px) rotate(8deg); }
    75% { transform: translate(-3px, 4px) rotate(-6deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.dice .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #c8102e 0%, #8b0000 70%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    align-self: center;
    justify-self: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.dice .dot.visible { opacity: 1; }

/* 骰子点位置 */
.dice[data-val="1"] .dot:nth-child(5) { opacity: 1; }
.dice[data-val="2"] .dot:nth-child(1),
.dice[data-val="2"] .dot:nth-child(9) { opacity: 1; }
.dice[data-val="3"] .dot:nth-child(1),
.dice[data-val="3"] .dot:nth-child(5),
.dice[data-val="3"] .dot:nth-child(9) { opacity: 1; }
.dice[data-val="4"] .dot:nth-child(1),
.dice[data-val="4"] .dot:nth-child(3),
.dice[data-val="4"] .dot:nth-child(7),
.dice[data-val="4"] .dot:nth-child(9) { opacity: 1; }
.dice[data-val="5"] .dot:nth-child(1),
.dice[data-val="5"] .dot:nth-child(3),
.dice[data-val="5"] .dot:nth-child(5),
.dice[data-val="5"] .dot:nth-child(7),
.dice[data-val="5"] .dot:nth-child(9) { opacity: 1; }
.dice[data-val="6"] .dot:nth-child(1),
.dice[data-val="6"] .dot:nth-child(3),
.dice[data-val="6"] .dot:nth-child(4),
.dice[data-val="6"] .dot:nth-child(6),
.dice[data-val="6"] .dot:nth-child(7),
.dice[data-val="6"] .dot:nth-child(9) { opacity: 1; }

.dice-shake-hint {
    position: absolute;
    bottom: -28px;
    left: 0;
    right: 0;
    font-size: 12px;
    color: var(--color-gold-soft);
    letter-spacing: 2px;
    opacity: 0.6;
}

.bobing-result {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.bobing-result-title {
    font-size: 14px;
    color: var(--color-cream);
    opacity: 0.7;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.bobing-result-prize {
    font-family: var(--font-calligraphy);
    font-size: 38px;
    color: var(--color-gold);
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.bobing-result-detail {
    font-size: 14px;
    color: var(--color-cream);
    letter-spacing: 2px;
    opacity: 0.85;
}

.bobing-result.win .bobing-result-prize {
    animation: prizeGlow 1.2s ease-in-out infinite;
}

@keyframes prizeGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 100, 0, 0.6); }
}

.bobing-btn,
.touhu-btn,
.touhu-reset {
    background: linear-gradient(135deg, #ffd700 0%, #c8102e 100%);
    color: white;
    border: none;
    padding: 16px 44px;
    border-radius: 14px;
    font-family: var(--font-title);
    font-size: 18px;
    letter-spacing: 4px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.5);
    transition: all 0.3s;
    margin: 8px 4px;
}

.bobing-btn:hover:not(:disabled),
.touhu-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(200, 16, 46, 0.6);
}

.bobing-btn:disabled,
.touhu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.bobing-counter {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 32px;
    font-size: 14px;
    color: var(--color-cream);
    opacity: 0.85;
    letter-spacing: 1px;
}

.bobing-counter strong { color: var(--color-gold); margin: 0 4px; }

/* ========== 投壶 ========== */
.touhu-wrap {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.05),
        rgba(200, 16, 46, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 720px;
    margin: 0 auto;
}

.touhu-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--color-cream);
    letter-spacing: 2px;
}

.touhu-status strong { color: var(--color-gold); margin: 0 4px; }

.touhu-field {
    position: relative;
    width: 100%;
    height: 320px;
    background:
        radial-gradient(ellipse at center,
            rgba(218, 165, 32, 0.15) 0%,
            transparent 70%),
        linear-gradient(180deg, #2c1810 0%, #1a0e08 100%);
    border: 1px solid rgba(218, 165, 32, 0.4);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

.touhu-stand {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(180deg, #5a3a20 0%, #3a2418 100%);
    border-top: 2px solid rgba(218, 165, 32, 0.5);
}

.touhu-vase {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vase-neck {
    width: 32px;
    height: 40px;
    background: linear-gradient(135deg, #b8860b 0%, #8b6914 50%, #5a3a08 100%);
    border-radius: 6px 6px 4px 4px;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
}

.vase-body {
    width: 80px;
    height: 110px;
    background: linear-gradient(135deg, #b8860b 0%, #8b6914 50%, #5a3a08 100%);
    border-radius: 12px 12px 24px 24px;
    box-shadow:
        inset 0 -8px 12px rgba(0, 0, 0, 0.4),
        inset 4px 0 8px rgba(255, 200, 100, 0.2);
    position: relative;
    margin-top: -2px;
    overflow: hidden;
}

.vase-score-target {
    position: absolute;
    color: rgba(255, 215, 0, 0.5);
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
}

.vase-score-target[data-score="10"] {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
}

.vase-score-target[data-score="5"] {
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px;
}

.vase-base {
    width: 96px;
    height: 14px;
    background: linear-gradient(135deg, #5a3a08 0%, #3a2418 100%);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.touhu-arrows {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.arrow {
    position: absolute;
    width: 6px;
    height: 90px;
    background: linear-gradient(180deg, #ffd700 0%, #c8102e 60%, #8b0000 100%);
    border-radius: 3px;
    transform-origin: bottom center;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
    animation: arrowFly 0.7s ease-out forwards;
}

.arrow::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #8b6914;
}

@keyframes arrowFly {
    0% {
        transform: translate(var(--start-x), var(--start-y)) rotate(var(--start-rot));
        opacity: 0;
    }
    20% { opacity: 1; }
    100% {
        transform: translate(var(--end-x), var(--end-y)) rotate(var(--end-rot));
        opacity: 1;
    }
}

.touhu-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.touhu-aim {
    width: 100%;
    max-width: 360px;
    color: var(--color-cream);
    font-size: 14px;
    letter-spacing: 2px;
}

.touhu-aim label {
    display: block;
    margin-bottom: 8px;
}

.touhu-aim label span {
    color: var(--color-gold);
    font-weight: bold;
}

.touhu-aim input[type="range"] {
    width: 100%;
    accent-color: var(--color-gold);
}

.touhu-result {
    margin-top: 16px;
    min-height: 24px;
    font-size: 15px;
    color: var(--color-cream);
    letter-spacing: 2px;
    text-align: center;
}

.touhu-result .win {
    color: var(--color-gold);
    font-weight: bold;
    font-size: 18px;
    animation: prizeGlow 1.2s ease-in-out infinite;
}

/* 玩法说明 */
.game-rules {
    margin: 32px auto 0;
    max-width: 720px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 14px;
    padding: 16px 24px;
    color: var(--color-cream);
}

.game-rules summary {
    cursor: pointer;
    font-size: 15px;
    color: var(--color-gold);
    letter-spacing: 2px;
    padding: 6px 0;
}

.game-rules summary:hover { opacity: 0.8; }

.game-rules ul {
    margin: 12px 0 0;
    padding-left: 20px;
    line-height: 1.9;
    font-size: 14px;
    opacity: 0.9;
}

.game-rules strong { color: var(--color-gold); }

/* ========== 月饼翻翻 ========== */
.memory-wrap {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.05),
        rgba(200, 16, 46, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 720px;
    margin: 0 auto;
}

.memory-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--color-cream);
    letter-spacing: 1px;
    flex-wrap: wrap;
    gap: 12px;
}

.memory-status strong { color: var(--color-gold); margin: 0 4px; font-family: var(--font-title); font-size: 18px; }

.memory-board {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 240px;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #3a2418 0%, #1a0e08 100%);
    border: 2px solid rgba(218, 165, 32, 0.4);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform-style: preserve-3d;
}

.memory-card:hover { transform: scale(1.04); }

.memory-card-back,
.memory-card-front {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    backface-visibility: hidden;
    transition: transform 0.5s;
    font-size: 36px;
}

.memory-card-back {
    background: linear-gradient(135deg, #5a3a20 0%, #3a2418 100%);
    color: rgba(218, 165, 32, 0.4);
    font-size: 28px;
}

.memory-card-front {
    background: linear-gradient(135deg, #fff8dc 0%, #ffd700 100%);
    color: #c8102e;
    transform: rotateY(180deg);
    box-shadow: inset 0 0 0 3px #c8102e;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.flipped .memory-card-back { transform: rotateY(180deg); }
.memory-card.flipped .memory-card-front { transform: rotateY(0); }

.memory-card.matched {
    border-color: var(--color-gold);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
    animation: matchPulse 0.6s;
}

.memory-card.matched .memory-card-front {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
}

@keyframes matchPulse {
    0%, 100% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.15); }
}

.memory-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.memory-difficulty {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--color-cream);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 1px;
    outline: none;
    cursor: pointer;
}

.memory-difficulty option { background: #1a0e08; }

.memory-btn {
    background: linear-gradient(135deg, #ffd700 0%, #c8102e 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.memory-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(200, 16, 46, 0.4); }

/* ========== 诗词接龙 ========== */
.chain-wrap {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.05),
        rgba(200, 16, 46, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    padding: 32px 24px;
    max-width: 720px;
    margin: 0 auto;
}

.chain-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--color-cream);
    letter-spacing: 1px;
    flex-wrap: wrap;
    gap: 12px;
}

.chain-status strong { color: var(--color-gold); margin: 0 4px; font-family: var(--font-title); font-size: 18px; }

.chain-display {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 14px;
    padding: 32px 20px;
    margin-bottom: 20px;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chain-label {
    font-size: 12px;
    color: var(--color-gold-soft);
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.chain-prompt {
    font-family: var(--font-poem);
    font-size: 26px;
    color: var(--color-cream);
    line-height: 1.6;
    letter-spacing: 4px;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.chain-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.chain-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--color-cream);
    padding: 14px 18px;
    border-radius: 10px;
    font-family: var(--font-poem);
    font-size: 18px;
    letter-spacing: 4px;
    outline: none;
    text-align: center;
    transition: border-color 0.3s;
}

.chain-input:focus {
    border-color: var(--color-gold);
    background: rgba(255, 215, 0, 0.05);
}

.chain-input:disabled { opacity: 0.5; }

.chain-btn,
.chain-btn-secondary {
    background: linear-gradient(135deg, #ffd700 0%, #c8102e 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    letter-spacing: 2px;
    transition: all 0.3s;
    white-space: nowrap;
}

.chain-btn-secondary {
    background: rgba(255, 215, 0, 0.1);
    color: var(--color-gold);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 10px 20px;
    font-size: 14px;
}

.chain-btn:hover:not(:disabled) { transform: translateY(-2px); }
.chain-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.chain-btn-secondary:hover { background: rgba(255, 215, 0, 0.2); }

.chain-feedback {
    min-height: 28px;
    text-align: center;
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--color-cream);
    margin-bottom: 16px;
}

.chain-feedback.correct { color: #4ade80; font-weight: bold; }
.chain-feedback.wrong { color: #f87171; }
.chain-feedback.skip { color: var(--color-gold-soft); }

.chain-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 568px) {
    .bobing-wrap, .touhu-wrap, .memory-wrap, .chain-wrap { padding: 24px 14px; }
    .dice { width: 52px; height: 52px; padding: 6px; }
    .dice .dot { width: 6px; height: 6px; }
    .dice-tray { padding: 24px 16px; gap: 10px; border-radius: 140px / 60px; }
    .bobing-result-prize { font-size: 30px; }
    .touhu-field { height: 260px; }
    .game-tab { padding: 12px 18px; font-size: 14px; gap: 6px; }
    .game-tab-icon { font-size: 18px; }
    .game-tabs { gap: 8px; }
    .memory-card-back, .memory-card-front { font-size: 28px; }
    .chain-prompt { font-size: 20px; letter-spacing: 2px; }
    .chain-input, .chain-btn { font-size: 15px; padding: 12px 14px; }
}