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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

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

h1 {
    color: #333;
    font-size: 2rem;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 0;
    background-color: #e4c8a0;
    border: 2px solid #8b4513;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
}

.cell {
    position: relative;
    border: 1px solid #8b4513;
    cursor: pointer;
}

.cell::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
}

.cell.black::before {
    background-color: black;
}

.cell.white::before {
    background-color: white;
    border: 1px solid #ccc;
}

.controls {
    text-align: center;
}

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

button:hover {
    background-color: #45a049;
}

/* 落子动画 */
.piece-animation {
    animation: placePiece 0.3s ease-out;
}

@keyframes placePiece {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 获胜棋子高亮 */
.winning-piece::before {
    box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.8);
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.8);
    }
    to {
        box-shadow: 0 0 15px 5px rgba(255, 215, 0, 1);
    }
}

/* 悬停效果 */
.cell:not(.black):not(.white):hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.cell:not(.black):not(.white):hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px dashed #666;
}

/* 游戏结束时的遮罩效果 */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-message {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .cell::before {
        width: 70%;
        height: 70%;
    }
    
    .cell:not(.black):not(.white):hover::before {
        width: 70%;
        height: 70%;
    }
}