/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* ===== 游戏容器 ===== */
.game-container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== 游戏标题 ===== */
.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

/* ===== 游戏主区域 ===== */
.game-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* ===== 玩家区域 ===== */
.player-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.player-area h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.computer-area {
    background: rgba(220, 53, 69, 0.2);
    border: 2px solid rgba(220, 53, 69, 0.3);
}

.player-area-human {
    background: rgba(40, 167, 69, 0.2);
    border: 2px solid rgba(40, 167, 69, 0.3);
}

/* ===== 卡牌容器 ===== */
.cards-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
}

/* ===== 卡牌样式 ===== */
.card {
    width: 80px;
    height: 110px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card-inner {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    transition: all 0.6s;
}

/* 卡牌背面样式 */
.card-back .card-inner {
    background: linear-gradient(45deg, #4c63d2, #ff6b9d);
    color: white;
    font-size: 2rem;
}

/* 卡牌正面样式 */
.card-front .card-inner {
    background: white;
    color: #333;
    border: 2px solid #ddd;
}

/* 花色颜色 */
.card-inner.red {
    color: #dc3545;
}

.card-inner.black {
    color: #333;
}

/* 卡牌翻转动画 */
.card.flipping {
    animation: cardFlip 0.8s ease-in-out;
}

@keyframes cardFlip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* ===== 手牌信息 ===== */
.hand-info {
    text-align: center;
}

.hand-type {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: inline-block;
}

/* ===== 游戏状态区域 ===== */
.game-status {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 10px 0;
}

.vs-indicator {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-display {
    margin-bottom: 15px;
}

.result-text {
    font-size: 1.3rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.result-text.win {
    background: rgba(40, 167, 69, 0.8);
    color: white;
    animation: pulse 1s ease-in-out;
}

.result-text.lose {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    animation: pulse 1s ease-in-out;
}

.result-text.tie {
    background: rgba(255, 193, 7, 0.8);
    color: #333;
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.score-board {
    display: flex;
    justify-content: space-around;
    font-size: 1.1rem;
    font-weight: bold;
}

/* ===== 游戏控制按钮 ===== */
.game-controls {
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 120px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #218838, #1ea085);
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #495057);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(45deg, #5a6268, #3d4142);
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(45deg, #138496, #10707f);
}

/* ===== 模态框样式 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: #333;
    border-radius: 15px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    color: white;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #ff6b9d;
}

.modal-body {
    padding: 25px;
    line-height: 1.6;
}

.modal-body h4 {
    color: #1e3c72;
    margin-bottom: 10px;
    margin-top: 20px;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body ol, .modal-body ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-body li {
    margin-bottom: 8px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-subtitle {
        font-size: 1rem;
    }
    
    .card {
        width: 65px;
        height: 90px;
    }
    
    .card-inner {
        font-size: 1.4rem;
    }
    
    .cards-container {
        gap: 10px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .vs-indicator {
        font-size: 1.5rem;
    }
    
    .result-text {
        font-size: 1.1rem;
    }
    
    .score-board {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }
    
    .player-area {
        padding: 15px;
    }
    
    .card {
        width: 55px;
        height: 75px;
    }
    
    .card-inner {
        font-size: 1.2rem;
    }
    
    .cards-container {
        gap: 8px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* ===== 特殊效果 ===== */
.card-deal-animation {
    animation: dealCard 0.5s ease-out;
}

@keyframes dealCard {
    0% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
}

/* 胜利特效 */
.winning-cards {
    animation: winningGlow 2s ease-in-out infinite;
}

@keyframes winningGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 215, 0, 0.8);
    }
} 