/* Gomoku Game Styles */

/* Game Section */
.game-section {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
}

.game-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

/* Game Setup */
.game-setup {
    max-width: 500px;
    margin: 0 auto;
}

.setup-card {
    background: var(--card-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.setup-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.setup-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.setup-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.setup-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: white;
}

.setup-card .btn-primary {
    width: 100%;
    margin-top: 1rem;
}

/* Game Container */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Game Info */
.game-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    background: var(--card-color);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.875rem;
    color: var(--light-text);
    margin-bottom: 0.25rem;
}

.info-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Board Container */
.board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Game Board */
.board {
    display: grid;
    grid-template-columns: repeat(15, 40px);
    grid-template-rows: repeat(15, 40px);
    gap: 1px;
    background-color: #8b6914;
    padding: 10px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.board::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    background-color: #000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.board-cell {
    width: 40px;
    height: 40px;
    background-color: #d3b36e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color 0.2s ease;
}

/* 为棋盘添加网格线 */
.board-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* 标记星位点 */
.board-cell:nth-child(113), /* 天元 */
.board-cell:nth-child(37),  /* 左上角星位 */
.board-cell:nth-child(89),  /* 右上角星位 */
.board-cell:nth-child(157), /* 左下角星位 */
.board-cell:nth-child(209)  /* 右下角星位 */ {
    position: relative;
}

.board-cell:nth-child(113)::after,
.board-cell:nth-child(37)::after,
.board-cell:nth-child(89)::after,
.board-cell:nth-child(157)::after,
.board-cell:nth-child(209)::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: #000;
    border-radius: 50%;
    z-index: 1;
}

.board-cell:hover {
    background-color: #c4a35e;
}

.board-cell.has-piece {
    cursor: default;
}

.board-cell.has-piece:hover {
    background-color: #d3b36e;
}

/* Game Pieces */
.piece {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: placePiece 0.3s ease-out;
}

@keyframes placePiece {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.piece.black {
    background-color: #000;
}

.piece.white {
    background-color: #fff;
    border: 1px solid #e0e0e0;
}

/* Piece Indicators */
.piece.ai-next {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: rgba(255, 0, 0, 0.6);
    border-radius: 50%;
    z-index: 2;
}

.piece.feint {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 2px dashed rgba(255, 0, 0, 0.6);
    border-radius: 50%;
    z-index: 2;
    animation: feintPulse 1s infinite;
}

@keyframes feintPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.1);
    }
}

/* Skill Buttons */
.skill-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.skill-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--card-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.skill-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 165, 0, 0.3);
}

.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* AI Indicator */
.ai-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    background-color: rgba(255, 165, 0, 0.1);
    color: var(--primary-color);
    border-radius: 0.5rem;
    font-weight: 600;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Game Result */
.game-result {
    max-width: 500px;
    margin: 0 auto;
}

.result-card {
    background: var(--card-color);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.result-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.result-card p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: var(--light-text);
}

.result-stats {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 0.5rem;
}

.result-stats p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .board {
        grid-template-columns: repeat(15, 30px);
        grid-template-rows: repeat(15, 30px);
    }
    
    .board-cell {
        width: 30px;
        height: 30px;
    }
    
    .piece {
        width: 24px;
        height: 24px;
    }
    
    .game-info {
        gap: 1rem;
    }
    
    .skill-buttons {
        gap: 0.75rem;
    }
    
    .skill-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .board {
        grid-template-columns: repeat(15, 25px);
        grid-template-rows: repeat(15, 25px);
    }
    
    .board-cell {
        width: 25px;
        height: 25px;
    }
    
    .piece {
        width: 20px;
        height: 20px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .setup-card {
        padding: 1.5rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
}