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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* 游戏标题 */
.game-title {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 游戏信息栏 */
.game-info {
    display: flex;
    justify-content: space-around;
    background: #f7fafc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.info-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
}

/* 游戏容器 */
.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 游戏面板 */
.game-board {
    width: 100%;
    max-width: 400px;
    height: 600px;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    border: 2px solid #e2e8f0;
}

/* 行和方块 */
.row {
    display: flex;
    width: 100%;
    height: 120px;
}

.block {
    flex: 1;
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.block.black {
    background: #2d3748;
    transition: background 0.1s ease;
}

.block.black:active {
    background: #1a202c;
    transform: scale(0.95);
}

.block.clicked {
    background: #48bb78 !important;
    animation: clickAnimation 0.3s ease;
}

@keyframes clickAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* 控制面板 */
.control-section {
    margin-bottom: 20px;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 120px;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
}

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

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

/* 模式选择 */
.mode-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.mode-select {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-select:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 游戏说明 */
.game-instructions {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
}

.game-instructions h3 {
    color: #2d3748;
    margin-bottom: 15px;
    text-align: center;
}

.game-instructions ul {
    list-style-type: disc;
    padding-left: 20px;
    color: #4a5568;
    line-height: 1.6;
}

.game-instructions li {
    margin-bottom: 8px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

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

.modal-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 15px;
}

.win-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .game-info {
        gap: 5px;
    }
    
    .info-item {
        min-width: 60px;
    }
    
    .info-label {
        font-size: 0.8rem;
    }
    
    .info-value {
        font-size: 1.2rem;
    }
    
    .game-board {
        max-width: 350px;
        height: 525px;
    }
    
    .row {
        height: 105px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-board {
        max-width: 300px;
        height: 450px;
    }
    
    .row {
        height: 90px;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .mode-selector {
        flex-direction: column;
        gap: 10px;
    }
}