/* 游戏样式 */

/* 游戏大厅 */
.games-container {
    padding: 20px;
}

.games-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.game-card:active {
    transform: scale(0.95);
}

.game-icon {
    font-size: 64px;
    margin-bottom: 15px;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.game-card h3 {
    color: var(--text-dark);
    font-size: 22px;
    margin-bottom: 10px;
}

.game-card p {
    color: var(--text-light);
    font-size: 14px;
}

.game-difficulty {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.difficulty-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
}

.difficulty-dot.active {
    background: var(--accent);
}

/* 气球游戏 */
.balloon-game {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.balloons-container {
    position: relative;
    height: 400px;
    background: linear-gradient(to bottom, #87CEEB, #E0F6FF);
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.balloon {
    position: absolute;
    width: 60px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.balloon:before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: #666;
}

.balloon:hover {
    transform: scale(1.1);
}

.balloon.popped {
    animation: pop 0.3s ease-out forwards;
}

@keyframes pop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

/* 拼图游戏 */
.puzzle-game {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.puzzle-letters {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.puzzle-letter {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.puzzle-letter:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
}

.puzzle-letter.used {
    opacity: 0.3;
    cursor: not-allowed;
}

.puzzle-blanks {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.puzzle-blank {
    width: 50px;
    height: 50px;
    border-bottom: 3px solid var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

/* 进度条 */
.progress-container {
    margin: 20px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: bold;
}

.progress-bar {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.5s ease;
    animation: progressFill 1s ease-out;
}

/* 奖励动画 */
.reward-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    z-index: 1000;
    animation: rewardPop 1s ease-out forwards;
    pointer-events: none;
}

@keyframes rewardPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* 分数显示 */
.score-display {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin: 20px 0;
    animation: bounceIn 0.5s ease-out;
}

/* 游戏按钮 */
.game-btn {
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.game-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.game-btn:active {
    transform: scale(0.95);
}

/* 卡片翻转动画 */
.flashcard {
    width: 300px;
    height: 200px;
    margin: 20px auto;
    perspective: 1000px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.flashcard-front {
    background: linear-gradient(135deg, var(--primary-color), #6366F1);
    color: white;
}

.flashcard-back {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    transform: rotateY(180deg);
}

.flashcard-word {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
}

.flashcard-image {
    font-size: 64px;
    margin-bottom: 10px;
}

/* 响应式 */
@media (max-width: 768px) {
    .game-cards {
        grid-template-columns: 1fr;
    }

    .balloons-container {
        height: 300px;
    }
}

/* 拼图单词游戏 */
.puzzle-game {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.puzzle-target {
    font-size: 28px;
    color: var(--text-dark);
    margin: 20px 0;
    font-weight: bold;
}

.puzzle-letters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.puzzle-letter {
    width: 60px;
    height: 60px;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    background: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
}

.puzzle-letter:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.puzzle-answer {
    min-height: 60px;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.puzzle-answer-letter {
    width: 50px;
    height: 50px;
    border: 2px dashed var(--success-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.puzzle-hint {
    color: var(--text-light);
    font-size: 16px;
}

/* 听力选择游戏 */
.listen-game {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.listen-play-btn {
    padding: 20px 40px;
    font-size: 24px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px 0;
}

.listen-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.4);
}

.listen-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.listen-option {
    padding: 20px;
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    background: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
}

.listen-option:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.listen-option.correct {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.listen-option.wrong {
    background: #FF6B6B;
    color: white;
    border-color: #FF6B6B;
}

.listen-feedback {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0;
    min-height: 30px;
}

/* 单词消消乐游戏 */
.match-game {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px auto;
    max-width: 600px;
}

.match-card {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
}

.match-card-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.match-card-front,
.match-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.match-card-front {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.match-card-back {
    background: white;
    color: var(--text-dark);
    border: 3px solid var(--primary-color);
    transform: rotateY(180deg);
    font-size: 24px;
    word-break: break-word;
    padding: 5px;
}

.match-feedback {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0;
    min-height: 30px;
}

/* 句子组合游戏 */
.sentence-game {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.sentence-target {
    font-size: 24px;
    color: var(--text-dark);
    margin: 20px 0;
    font-weight: bold;
    background: #f0f8ff;
    padding: 15px;
    border-radius: 12px;
}

.sentence-words {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.sentence-word {
    padding: 12px 20px;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    background: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
}

.sentence-word:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.sentence-word.used {
    opacity: 0.3;
    cursor: not-allowed;
}

.sentence-answer {
    min-height: 50px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
}

.sentence-answer-word {
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: bold;
}

.sentence-hint {
    color: var(--text-light);
    font-size: 14px;
}

/* 跟读练习游戏 */
.read-game {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-card);
    text-align: center;
}

.read-sentence {
    font-size: 28px;
    color: var(--text-dark);
    margin: 30px 0;
    font-weight: bold;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 20px;
}

.read-record-btn {
    padding: 20px 40px;
    font-size: 20px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--success-color), #43e97b);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    margin: 20px 0;
}

.read-record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 210, 160, 0.4);
}

.read-feedback {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0;
    min-height: 30px;
}

/* 难度选择器 */
.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.diff-btn {
    padding: 12px 25px;
    border: 3px solid var(--primary-color);
    border-radius: 25px;
    background: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
}

.diff-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.diff-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}
