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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

/* 游戏头部 */
.game-header {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #56ab2f;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.level-info {
    font-size: 16px;
    font-weight: bold;
    color: #56ab2f;
}

.game-title {
    font-size: 24px;
    font-weight: bold;
    color: #56ab2f;
    text-shadow: 2px 2px 0 #fff;
}

.game-stats {
    font-size: 16px;
    font-weight: bold;
    color: #56ab2f;
}

/* 游戏区域 */
.game-board {
    flex: 1;
    position: relative;
    padding: 20px;
    overflow: hidden;
}

/* 卡牌样式 */
.card {
    position: absolute;
    width: 60px;
    height: 75px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid #56ab2f;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    user-select: none;
    z-index: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3);
}

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

.card.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    filter: grayscale(50%);
}

.card.selected {
    animation: pulse 0.3s ease;
}

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

/* 槽位区域 */
.slot-area {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-top: 3px solid #56ab2f;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.slots {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.slot {
    flex: 1;
    height: 80px;
    background: linear-gradient(145deg, #e8f5e9, #c8e6c9);
    border: 3px dashed #56ab2f;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.slot .card {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    font-size: 32px;
}

/* 覆盖层 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 4px solid #56ab2f;
}

.modal-title {
    font-size: 32px;
    color: #56ab2f;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 #fff;
}

.modal-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.modal-message {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
}

.start-btn {
    background: linear-gradient(145deg, #56ab2f, #a8e063);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(86, 171, 47, 0.6);
}

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

.rules {
    margin-top: 30px;
    text-align: left;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
}

.rules h3 {
    font-size: 16px;
    color: #56ab2f;
    margin-bottom: 10px;
}

.rules p {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
    line-height: 1.4;
}

/* 消除动画 */
@keyframes eliminate {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.eliminate {
    animation: eliminate 0.4s ease forwards;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .card {
        width: 50px;
        height: 65px;
        font-size: 30px;
    }

    .slot {
        height: 70px;
    }

    .modal {
        padding: 30px 20px;
        max-width: 280px;
    }

    .game-title {
        font-size: 20px;
    }
}

/* 音乐控制按钮 */
.music-btn {
    background: linear-gradient(145deg, #56ab2f, #a8e063);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(86, 171, 47, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
}

.music-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(86, 171, 47, 0.6);
}

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

.game-stats {
    display: flex;
    align-items: center;
}