/* 井字棋游戏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

header h1 {
    font-size: 2rem;
    color: #4a148c;
    margin-bottom: 10px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.status {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #4a148c;
    text-align: center;
    min-height: 40px;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 10px;
    background-color: #4a148c;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.cell {
    width: 100px;
    height: 100px;
    background-color: white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cell:hover {
    background-color: #f5f5f5;
}

.cell.x {
    color: #e91e63;
}

.cell.o {
    color: #2196f3;
}

.controls {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.mode-btn {
    background-color: #4a148c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.mode-btn.active {
    background-color: #7b1fa2;
    font-weight: bold;
}

.mode-btn:hover {
    background-color: #7b1fa2;
}

button {
    background-color: #4a148c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #7b1fa2;
}

.home-button {
    margin-top: 20px;
    background-color: #333;
}

.home-button:hover {
    background-color: #555;
}

.score-board {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 320px;
    margin: 20px 0;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score {
    text-align: center;
}

.score h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.score p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a148c;
}

.instructions {
    margin: 20px 0;
    text-align: center;
    max-width: 500px;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .board {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
    }
    
    .cell {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .board {
        grid-template-columns: repeat(3, 70px);
        grid-template-rows: repeat(3, 70px);
    }
    
    .cell {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .status {
        font-size: 1.2rem;
    }
}
