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

/* 基础字体和颜色设置 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom, #0e741e, #0a5215);
    color: #fff;
    min-height: 100vh;
    padding: 1rem;
    display: flex;
    justify-content: center;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* 页眉样式 */
header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

header h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 游戏信息区域 */
.game-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.status-message {
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.25rem);
    margin-bottom: 1rem;
    font-weight: bold;
    min-height: 2rem;
}

.score-display {
    display: flex;
    justify-content: space-around;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

/* 游戏区域样式 */
.game-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.game-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
}

.score {
    text-align: center;
    font-size: clamp(1rem, 3vw, 1.25rem);
    margin-bottom: 1rem;
    font-weight: bold;
}

/* 牌区域样式 */
.cards-area {
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* 牌样式 */
.card {
    width: 60px;
    height: 90px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: black;
    font-weight: bold;
    font-size: 1.25rem;
    position: relative;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-face-down {
    background: linear-gradient(45deg, #2c3e50 25%, transparent 25%),
                linear-gradient(-45deg, #2c3e50 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #2c3e50 75%),
                linear-gradient(-45deg, transparent 75%, #2c3e50 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    color: transparent;
}

.card-red {
    color: #e74c3c;
}

.card-value-top, .card-value-bottom {
    font-size: 0.75rem;
}

.card-value-bottom {
    transform: rotate(180deg);
}

.card-suit-center {
    text-align: center;
    font-size: 1.5rem;
}

/* 控制按钮区域 */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

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

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #2ecc71;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #27ae60;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .card {
        width: 50px;
        height: 75px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .game-section {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }
    
    .card {
        width: 45px;
        height: 67px;
        font-size: 1rem;
    }
    
    .card-suit-center {
        font-size: 1.25rem;
    }
}