/* Reversi / Othello — plateau family (design/Jeu - Reversi). A green-felt board set
   in a wooden frame on the warm leather surface, the same in light and dark. Ivory
   (you) vs ebony discs that flip when captured; a playable square shows how many it
   flips. A side panel keeps the turn and the disc count. Scoped under .rev-root. */

.rev-root { display: flex; flex-direction: column; align-items: stretch; inline-size: 100%; color: var(--color-text); }

.rev-surface {
  inline-size: 100%; box-sizing: border-box;
  background: #43302b; border-block: 1px solid #2c1f1b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: var(--space-6) 0; color: #f4ece5;
}
.rev-inner { max-inline-size: 1000px; margin-inline: auto; padding-inline: var(--space-4); box-sizing: border-box; display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: center; }

.rev-planche {
  flex: 0 1 auto; padding: 14px; border-radius: 4px; box-sizing: border-box;
  background: linear-gradient(152deg, #7b5638 0%, #603f2e 40%, #4c3427 78%, #5d3f2d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -2px 6px rgba(0, 0, 0, 0.4), 0 22px 44px rgba(0, 0, 0, 0.40);
}
/* Green felt board with fine grid rules. */
.rev-board {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  inline-size: min(80vw, 400px); aspect-ratio: 1; box-sizing: border-box; border-radius: 2px;
  background: linear-gradient(158deg, #24543f 0%, #1e4739 58%, #173629 100%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(0, 0, 0, 0.35);
}
.rev-cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  border-inline-end: 1px solid rgba(0, 0, 0, 0.34); border-block-end: 1px solid rgba(0, 0, 0, 0.34);
  box-shadow: inset -1px -1px 0 rgba(255, 255, 255, 0.06); cursor: pointer; perspective: 340px;
}
.rev-cell.last { box-shadow: inset 0 0 0 2px var(--color-accent-400); }
.rev-cell.hint { box-shadow: inset 0 0 0 3px var(--color-accent-400); }

/* A playable square: a gold ring carrying the number of discs it would flip. */
.rev-cell.legal::after {
  content: attr(data-gains); inline-size: 62%; aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums;
  border: 1.5px dashed #c6a066; color: #f0d9a8; background: rgba(198, 160, 102, 0.10);
  animation: rev-dotin 0.25s ease;
}
@keyframes rev-dotin { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
.rev-root.no-motion .rev-cell.legal::after { animation: none; }
.rev-cell:hover.legal::after { background: rgba(198, 160, 102, 0.22); }
.rev-cell.ai-preview::after { content: ""; inline-size: 70%; aspect-ratio: 1; border-radius: 50%; background: rgba(251, 250, 246, 0.4); box-shadow: 0 0 0 2px rgba(251, 250, 246, 0.7); animation: rev-pulse 0.9s ease-in-out infinite; }
@keyframes rev-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.95; } }
.rev-root.no-motion .rev-cell.ai-preview::after { animation: none; }

/* Two-faced disc: rotating it 180° IS the capture flip. */
.rev-disc { inline-size: 80%; aspect-ratio: 1; border-radius: 50%; position: relative; transform-style: preserve-3d; transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.4, 1); }
.rev-root.no-motion .rev-disc { transition: none; }
.rev-disc.to-white { transform: rotateY(180deg); }
.rev-disc.place { animation: rev-in 0.22s ease; }
@keyframes rev-in { from { opacity: 0; } to { opacity: 1; } }
.rev-face { position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.42); }
.rev-face.black { background: radial-gradient(circle at 34% 27%, #55504c 0%, #211d1b 48%, #0c0a09 100%); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.42), inset 0 3px 4px rgba(255, 255, 255, 0.24); }
.rev-face.white { background: radial-gradient(circle at 34% 27%, #ffffff 0%, #efe9dd 46%, #c3b9a6 100%); transform: rotateY(180deg); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 -3px 5px rgba(0, 0, 0, 0.42), inset 0 3px 4px rgba(255, 255, 255, 0.92); }

/* Side panel: turn + scores. */
.rev-side { flex: 0 1 218px; min-inline-size: 200px; display: flex; flex-direction: column; gap: var(--space-4); color: #f4ece5; }
.rev-turn { border-inline-start: 2px solid var(--color-accent-400); padding-inline-start: var(--space-3); font-size: 15px; min-block-size: 1.4em; }
.rev-turn.over { font-family: var(--font-heading); font-weight: 600; color: var(--color-accent-300); }
.rev-scores { display: flex; flex-direction: column; gap: var(--space-2); border-block-start: 1px solid rgba(244, 236, 229, 0.2); padding-block-start: var(--space-3); }
.rev-sc { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.rev-sc b { margin-inline-start: auto; font-family: var(--font-heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.rev-chip { inline-size: 16px; block-size: 16px; border-radius: 50%; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.4); }
.rev-chip.you { background: radial-gradient(circle at 34% 27%, #ffffff, #efe9dd 60%, #c3b9a6); }
.rev-chip.ai { background: radial-gradient(circle at 34% 27%, #55504c, #211d1b 60%, #0c0a09); }

.rev-hint { text-align: center; font-size: 12px; color: var(--color-neutral-600); max-inline-size: 560px; margin-inline: auto; padding-block-start: var(--space-3); }
.lz-variants.rev-inline-chips { margin: 0; }
