/* Game specific styles for Gomoku */

:root {
    --primary-color: #FF9800;
    --primary-hover: #F57C00;
    --primary-shadow: #E65100;
    --board-color: #f0b55c;
    --line-color: #333;
    --text-main: #333;
    --bg-card: #FFFFFF;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
}

/* Guidelines: Spacing */
.game-container h1 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.game-description {
    margin-bottom: 3rem;
    color: #555;
    font-size: 1.1rem;
}

.game-info-board {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1.5rem;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-select {
    padding: 8px 16px;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-main);
    cursor: pointer;
    background-color: #fff;
}

.turn-indicator {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 50px;
    background: #fff3e0;
}

.game-area-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    /* Limit board size */
    margin: 0 auto 3rem;
}

.board {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--board-color);
    border: 4px solid #5d4037;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    display: grid;
    /* 15 lines means 14 cells, but to place ON intersections we need different logic.
       Wait, simple way: 15x15 grid of cells, click on cell places stone.
       Actually stones are placed on intersections.
       Common web implementation: 15x15 grid cells, stone visual inside.
    */
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    padding: 5px;
    position: relative;
}

/* Grid Lines - Handled by cell borders */

.cell {
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Drawing lines inside each cell to simulate board */
.cell::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--line-color);
    z-index: 1;
}

.cell::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 1px;
    background: var(--line-color);
    z-index: 1;
}

/* Stones */
.stone {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    z-index: 2;
    /* Above lines */
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.3);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cell.black .stone {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    transform: scale(1);
}

.cell.white .stone {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
    transform: scale(1);
}

/* Last move marker */
.cell.last-move .stone::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    background-color: rgba(255, 0, 0, 0.5);
    border-radius: 50%;
}

/* Guidelines: Buttons */
.primary-btn {
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.8rem 1.5rem;
    min-height: 48px;
    border-radius: 50px;
    box-shadow: 0 4px 0 var(--primary-shadow);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(2px);
    border-radius: 4px;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #333;
    font-weight: 800;
}

/* Content Cards */
.instructions {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: left;
    margin: 3rem auto 5rem;
    color: #444;
    line-height: 1.8;
}

.instructions h3 {
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 700;
}

.instructions h3:first-child {
    margin-top: 0.5rem;
}

.instructions ul {
    padding-left: 1.5rem;
}

.instructions li {
    margin-bottom: 0.5rem;
}

.instructions dl dt {
    font-weight: bold;
    margin-top: 1rem;
    color: #333;
}

.instructions dl dd {
    margin-left: 0;
    margin-bottom: 1rem;
    color: #555;
}

@media (max-width: 500px) {
    .board {
        width: 100%;
    }
}