/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 灯笼装饰 */
.lantern {
    position: absolute;
    width: 60px;
    height: 80px;
    background: linear-gradient(to bottom, #ff4444, #cc0000);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    top: 20px;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
    animation: swing 3s ease-in-out infinite;
}

.lantern::before {
    content: '福';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: gold;
    font-size: 24px;
    font-weight: bold;
}

.lantern::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    background: gold;
    border-radius: 0 0 50% 50%;
}

.lantern-left {
    left: 10%;
    animation-delay: 0s;
}

.lantern-right {
    right: 10%;
    animation-delay: 1.5s;
}

@keyframes swing {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* 烟花粒子效果 */
.firework-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: firework 1s ease-out forwards;
    z-index: 9999;
}

@keyframes firework {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc((var(--x, 0) - 50) * 2px),
            calc((var(--y, 0) - 50) * 2px)
        ) scale(0);
        opacity: 0;
    }
}

/* 主容器 */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    animation: fadeIn 0.5s ease-in;
}

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

/* 头部 */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #ff6b6b;
}

.title {
    font-size: 2.5em;
    color: #d32f2f;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.horse-emoji {
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

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

.subtitle {
    font-size: 1.1em;
    color: #666;
    font-style: italic;
}

/* 模式选择界面 */
.mode-select {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.select-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.3em;
    color: #2d3436;
    margin-bottom: 15px;
    text-align: center;
}

/* 模式按钮 */
.mode-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.mode-btn {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border-color: #0984e3;
    color: white;
}

.mode-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.mode-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.mode-desc {
    font-size: 0.9em;
    opacity: 0.8;
}

/* 难度按钮 */
.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.difficulty-btn {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.difficulty-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
    border-color: #00b894;
    color: white;
}

.difficulty-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.difficulty-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.difficulty-desc {
    font-size: 0.85em;
    opacity: 0.8;
}

/* 开始按钮 */
.btn-start {
    width: 100%;
    padding: 20px;
    font-size: 1.5em;
    background: linear-gradient(135deg, #ff6b6b 0%, #d32f2f 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 游戏信息栏 */
.game-info {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.info-group {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 15px;
}

.info-group:last-child {
    margin-bottom: 0;
}

.info-item {
    font-size: 1.1em;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.label {
    color: #d63031;
}

.value {
    color: #2d3436;
    font-size: 1.3em;
}

.score {
    color: #e17055;
}

.combo {
    color: #d32f2f;
}

.combo-fire {
    font-size: 1.2em;
    animation: pulse 0.5s ease-in-out infinite;
}

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

.lives {
    font-size: 1.5em;
}

.time {
    color: #0984e3;
    font-size: 1.5em;
}

.time-unit {
    font-size: 0.9em;
    color: #636e72;
}

.total {
    color: #636e72;
}

/* 道具栏 */
.items-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.5);
}

.item-btn {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-color: #0984e3;
}

.item-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 游戏区域 */
.game-area {
    margin-bottom: 20px;
}

/* 谜题卡片 */
.riddle-card {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border: 3px solid #ff6b6b;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.riddle-header {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3em;
    color: #d32f2f;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.riddle-icon {
    animation: pulse 2s ease-in-out infinite;
}

.riddle-category {
    background: #ff6b6b;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
}

.riddle-content {
    font-size: 1.5em;
    color: #2d3436;
    text-align: center;
    line-height: 1.8;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
}

.riddle-hint {
    font-size: 1em;
    color: #e17055;
    text-align: center;
    min-height: 25px;
    font-style: italic;
    display: none;
}

/* 选项容器 */
.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.option-btn {
    padding: 20px;
    font-size: 1.2em;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.option-btn:active {
    transform: translateY(0);
}

.option-btn.correct {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
    animation: correctAnswer 0.5s ease;
}

.option-btn.wrong {
    background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
    animation: wrongAnswer 0.5s ease;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

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

@keyframes wrongAnswer {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 按钮样式 */
.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #d32f2f 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

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

.btn:active {
    transform: translateY(0);
}

/* 结果屏幕 */
.result-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.result-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

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

.result-title {
    font-size: 2em;
    color: #d32f2f;
    margin-bottom: 20px;
}

.result-horse {
    font-size: 5em;
    margin: 20px 0;
    animation: bounce 1s ease-in-out infinite;
}

.result-stats {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 1.1em;
    color: #2d3436;
    font-weight: bold;
}

.stat-value {
    font-size: 1.3em;
    color: #e17055;
    font-weight: bold;
}

.stat-value.highlight {
    font-size: 1.8em;
    color: #d32f2f;
}

.result-message {
    font-size: 1.2em;
    color: #e17055;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
}

/* 页脚 */
.game-footer {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    text-align: center;
    color: white;
    font-size: 1.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tips {
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .title {
        font-size: 1.8em;
    }

    .mode-buttons,
    .difficulty-buttons {
        grid-template-columns: 1fr;
    }

    .riddle-content {
        font-size: 1.2em;
        padding: 15px;
    }

    .options-container {
        grid-template-columns: 1fr;
    }

    .game-controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .lantern {
        width: 40px;
        height: 60px;
    }

    .lantern::before {
        font-size: 18px;
    }

    .info-group {
        flex-direction: column;
        gap: 10px;
    }

    .items-bar {
        flex-wrap: wrap;
    }
}
