/* Reversi (reversi.html) */

.board-wrap {
    max-width: 540px;
    margin: 10px auto;
    padding: 0 6px;
}

.rv-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    aspect-ratio: 1;
    width: 100%;
    background: #1b5e20;
    border: 10px solid #4e342e;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 2px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.rv-cell {
    position: relative;
    background: #2e7d32;
    border-radius: 2px;
}

.rv-cell.legal { cursor: pointer; }

.rv-cell.legal::after {
    content: "";
    position: absolute;
    inset: 36%;
    border-radius: 50%;
    background: rgba(249, 168, 37, 0.55);
    border: 2px solid #f9a825;
    box-sizing: border-box;
}

.rv-disc {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
    transition: background 0.35s ease, transform 0.35s ease;
}

.rv-disc.black { background: radial-gradient(circle at 35% 30%, #555, #111 65%); }
.rv-disc.white { background: radial-gradient(circle at 35% 30%, #fff, #ccc 65%); }
.rv-disc.flipped { animation: rv-flip 0.45s ease; }

@keyframes rv-flip {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(0.1); }
    100% { transform: scaleX(1); }
}

.rv-cell.last::before {
    content: "";
    position: absolute;
    inset: 42%;
    border-radius: 50%;
    background: #f9a825;
    z-index: 2;
}

/* Shared page furniture (chips, status, actions, modals) */
.score-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 8px auto;
    flex-wrap: wrap;
}

.player-chip {
    background: white;
    border: 3px solid transparent;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 15px;
    font-weight: bold;
    color: #555;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.player-chip.active { border-color: #f9a825; background: #fffde7; color: #333; }
.chip-p0 { border-left: 8px solid #111; }
.chip-p1 { border-left: 8px solid #bbb; }

.status-line {
    text-align: center;
    font-weight: bold;
    color: #444;
    min-height: 22px;
    margin: 4px 0;
}

.action-bar { text-align: center; margin: 10px 0; min-height: 50px; }

.action-btn {
    padding: 12px 26px;
    border: none;
    border-radius: 10px;
    background: #5d4037;
    color: white;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 6px;
}

.action-btn:disabled { opacity: 0.5; cursor: default; }

.bg-flash {
    display: inline-block;
    background: #fff8e1;
    border: 2px solid #f9a825;
    color: #6d4c00;
    font-weight: bold;
    border-radius: 8px;
    padding: 4px 12px;
    margin: 2px 4px;
    animation: rvflash-in 0.3s ease;
}

@keyframes rvflash-in { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.difficulty-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.difficulty-options button {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    background: #5d4037;
    color: white;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
}

.difficulty-options button:hover { background: #7b5e57; }

@media (max-width: 700px) {
    .player-chip { font-size: 13px; padding: 5px 12px; }
    .action-btn { font-size: 15px; padding: 10px 20px; }
}
