/* Reversi */

.rv-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    user-select: none;
}

.rv-modes {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.rv-mode {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.rv-mode:hover { border-color: var(--color-primary-dark); }
.rv-mode.active {
    background: var(--color-primary);
    border-color: var(--color-primary-dark);
}

.rv-mode:focus-visible,
.rv-btn:focus-visible,
.rv-cell:focus-visible {
    outline: 3px solid var(--color-text);
    outline-offset: 2px;
}

.rv-status {
    font-size: 1.1rem;
    font-weight: 700;
    min-height: 1.5em;
    margin: 0;
    text-align: center;
}

.rv-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    width: min(420px, 92vw);
    aspect-ratio: 1;
    padding: 4px;
    background: #1f7a4d;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rv-cell {
    border: none;
    padding: 0;
    background: #2e9d68;
    border-radius: 2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

/* Discs are drawn as an inset circle so the square itself stays the hit area. */
.rv-cell.black::after,
.rv-cell.white::after {
    content: '';
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.rv-cell.black::after { background: #1c1c22; }
.rv-cell.white::after { background: #f7f7f2; }

/* Playable squares for the side to move. Reversi is close to unplayable for a
   newcomer without this. */
.rv-cell.legal::before {
    content: '';
    position: absolute;
    inset: 36%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
}

.rv-cell.last {
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.state-result .rv-cell { pointer-events: none; }

.rv-score {
    display: flex;
    gap: 1.5rem;
    font-weight: 600;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
}

.rv-btn {
    padding: 0.75rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: var(--color-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

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