* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'STKaiti', 'KaiTi', serif;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5c4 100%);
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 顶部信息栏 */
.top-bar {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.score-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 18px;
    flex-wrap: wrap;
}

.current-score, .high-score, .combo-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label {
    color: #8b4513;
    font-weight: bold;
}

#score, #combo {
    color: #d2691e;
    font-size: 28px;
    font-weight: bold;
}

.combo-bonus {
    color: #ff6347;
    font-size: 16px;
}

/* 墨魂选择区 */
.mohun-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mohun-section h3 {
    color: #8b4513;
    margin-bottom: 15px;
    text-align: center;
}

.mohun-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
}

.mohun-card {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
    text-align: center;
}

.mohun-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mohun-card.selected {
    border-color: #d2691e;
    background: linear-gradient(135deg, #ffe4c4 0%, #ffd39b 100%);
}

.mohun-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mohun-name {
    font-size: 16px;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 5px;
}

.mohun-power {
    font-size: 14px;
    color: #d2691e;
}

.mohun-poems {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.selected-mohun {
    display: flex;
    gap: 10px;
    justify-content: center;
    min-height: 40px;
    padding: 10px;
    border-top: 1px solid #ddd;
}

.selected-tag {
    background: #d2691e;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

/* 层叠牌堆区 */
.stack-area {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stack-area h3 {
    color: #8b4513;
    margin-bottom: 15px;
    text-align: center;
}

.stacks-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    min-height: 240px;
    flex-wrap: wrap;
}

.stack {
    position: relative;
    width: 110px;
    min-height: 280px;
    background: rgba(139, 69, 19, 0.1);
    border: 2px dashed #d2691e;
    border-radius: 10px;
    padding: 6px;
}

.stack-card {
    position: absolute;
    width: 98px;
    background: linear-gradient(135deg, #fffaf0 0%, #faebd7 100%);
    border: 2px solid #d2691e;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.stack-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(210, 105, 30, 0.4);
}

.stack-card.selected {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-color: #ff6347;
    transform: translateY(-5px);
    z-index: 100;
}

.stack-card.wild {
    background: linear-gradient(135deg, #98fb98 0%, #90ee90 100%);
    border-color: #32cd32;
}

.stack-card-poet {
    font-size: 10px;
    color: #8b4513;
    margin-bottom: 4px;
    text-align: center;
}

.stack-card-text {
    font-size: 13px;
    color: #2c1810;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stack-card-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #ff6347;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 9px;
}

/* 下方五张牌区域 */
.bottom-cards-area {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bottom-cards-area h3 {
    color: #8b4513;
    margin-bottom: 15px;
    text-align: center;
}

.bottom-cards-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto 15px;
    padding: 0 20px;
}

.bottom-card {
    position: relative;
    background: linear-gradient(135deg, #fffaf0 0%, #faebd7 100%);
    border: 2px solid #d2691e;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bottom-card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(210, 105, 30, 0.3);
}

.bottom-card.selected {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-color: #ff6347;
    transform: scale(1.08);
}

.bottom-card.wild {
    background: linear-gradient(135deg, #98fb98 0%, #90ee90 100%);
    border-color: #32cd32;
}

.bottom-card-poet {
    font-size: 12px;
    color: #8b4513;
    margin-bottom: 5px;
}

.bottom-card-text {
    font-size: 16px;
    color: #2c1810;
    line-height: 1.5;
}

.bottom-card-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff6347;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
}

.swap-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.btn-swap {
    background: linear-gradient(135deg, #4169e1 0%, #1e90ff 100%);
    color: white;
    padding: 10px 25px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-swap:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(65, 105, 225, 0.4);
}

.btn-swap:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cards-count {
    font-size: 16px;
    color: #8b4513;
    font-weight: bold;
}

.cards-count span {
    color: #d2691e;
    font-size: 20px;
}

.btn-danger {
    background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.4);
}


/* 动画 */
@keyframes matchAnimation {
    0% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.2) rotate(5deg);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* 游戏控制 */
.game-controls {
    text-align: center;
}

.btn {
    padding: 12px 30px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    margin: 0 10px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(210, 105, 30, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #808080 0%, #696969 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(128, 128, 128, 0.4);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #8b4513;
    margin-bottom: 20px;
    font-size: 32px;
}

.final-score {
    margin: 20px 0;
}

.final-score #finalScore {
    font-size: 48px;
    color: #d2691e;
    font-weight: bold;
}

.reward-tier {
    font-size: 24px;
    margin-top: 10px;
    font-weight: bold;
}

.reward-tier.tier-1 {
    color: #ffd700;
}

.reward-tier.tier-2 {
    color: #c0c0c0;
}

.reward-tier.tier-3 {
    color: #cd7f32;
}

.reward-tier.tier-4 {
    color: #8b4513;
}

.stats {
    margin: 20px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.stats p {
    margin: 10px 0;
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-board {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .card {
        min-height: 100px;
        padding: 10px;
    }

    .card-text {
        font-size: 14px;
    }

    .mohun-list {
        gap: 10px;
    }

    .mohun-card {
        min-width: 100px;
        padding: 10px;
    }
}
