/* ============================================================
   拾光游戏厅 · reversi.css
   黑白棋 / 翻转棋：墨绿呢面棋盘 / 黑曜石与象牙棋子 / 铜牌侧栏
   所有选择器以 .rv- 前缀，避免污染其他游戏。
   ============================================================ */

/* ---------------- 舞台与棋盘外框 ---------------- */
.rv-wrap {
  width: 100%;
}

.rv-stage {
  padding: clamp(12px, 1.9vw, 28px);
  background:
    radial-gradient(ellipse at 50% -6%, rgba(255, 219, 162, .13), transparent 58%),
    radial-gradient(ellipse at 88% 104%, rgba(47, 111, 98, .12), transparent 55%),
    repeating-linear-gradient(93deg, rgba(28, 16, 8, .26) 0 2px, rgba(255, 230, 183, .013) 2px 5px, transparent 5px 21px),
    linear-gradient(155deg, #452e1c, #271a10 82%);
}

.rv-stage-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rv-board-frame {
  position: relative;
  width: min(100%, 640px);
  padding: clamp(10px, 1.7vw, 20px);
  border-radius: 12px;
  border: 1px solid rgba(16, 8, 2, .92);
  background:
    linear-gradient(180deg, rgba(255, 218, 158, .22), transparent 13%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 6px),
    linear-gradient(152deg, #734d2c, #4a2e17 52%, #2b1a0c);
  box-shadow:
    0 28px 54px rgba(0, 0, 0, .56),
    0 5px 0 rgba(0, 0, 0, .34),
    inset 0 1px 0 rgba(255, 226, 176, .26),
    inset 0 -3px 10px rgba(0, 0, 0, .58);
}

/* 内圈铜线 */
.rv-board-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 220, 160, .1);
  pointer-events: none;
}

/* 四角铜钉 */
.rv-board-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  background:
    radial-gradient(circle at 3% 3.6%, rgba(240, 210, 148, .65) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 97% 3.6%, rgba(240, 210, 148, .65) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 3% 96.4%, rgba(240, 210, 148, .55) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 97% 96.4%, rgba(240, 210, 148, .55) 0 1.4px, transparent 2.2px);
}

/* ---------------- 墨绿呢面棋盘 ---------------- */
.rv-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  container-type: inline-size;
  touch-action: manipulation;
  background:
    radial-gradient(ellipse at 26% 14%, rgba(198, 236, 206, .17), transparent 55%),
    radial-gradient(ellipse at 82% 92%, rgba(0, 0, 0, .3), transparent 62%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .045) 0 2px, transparent 2px 5px),
    linear-gradient(150deg, #265a41 0%, #1d4b37 40%, #163b2b 72%, #0f2b20 100%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 186, 124, .34),
    inset 0 0 0 3px rgba(0, 0, 0, .22),
    inset 0 2px 3px rgba(255, 255, 255, .08),
    inset 0 0 64px rgba(0, 0, 0, .34);
}

/* 呢面受光与暗角 */
.rv-board::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 8%, rgba(255, 246, 208, .1), transparent 46%),
    radial-gradient(ellipse at 72% 100%, rgba(0, 0, 0, .26), transparent 58%);
}

.rv-board::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(10, 32, 22, .5),
    inset 0 0 2.6cqw rgba(0, 0, 0, .3);
}

/* 棋盘坐标 */
.rv-coords {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.rv-coord {
  position: absolute;
  transform: translate(-50%, -50%);
  color: rgba(230, 205, 150, .58);
  font-family: var(--font-mono);
  font-size: clamp(7px, 1.7cqw, 11px);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .55);
  user-select: none;
}

/* 中央四角的黄铜嵌点 */
.rv-stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.rv-star {
  position: absolute;
  width: 1.1%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d9a0, #b8914e 62%, #7c5c28);
  box-shadow: 0 0 .4cqw rgba(0, 0, 0, .45), 0 0 .8cqw rgba(230, 195, 120, .18);
}

/* ---------------- 8×8 格与棋子 ---------------- */
.rv-grid {
  position: absolute;
  inset: 6.4%;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
}

.rv-cell {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow:
    inset -1px -1px 0 rgba(214, 240, 214, .1),
    inset 1px 1px 0 rgba(0, 0, 0, .16);
}

.rv-grid.is-playing .rv-cell.is-legal {
  cursor: pointer;
}

.rv-cell:focus-visible {
  z-index: 5;
  outline: 2px solid rgba(232, 205, 144, .9);
  outline-offset: -2px;
}

.rv-grid.is-playing .rv-cell.is-legal:hover {
  background: rgba(255, 240, 196, .05);
}

.rv-grid.is-over .rv-cell {
  cursor: default;
}

/* 圆形棋子：正反两面，3D 翻面 */
.rv-disc {
  position: absolute;
  inset: 5%;
  visibility: hidden;
  transform: scaleX(1);
  transform-origin: 50% 50%;
  transition: transform .17s cubic-bezier(.3, 0, .5, 1);
}

.rv-cell.has-disc .rv-disc {
  visibility: visible;
}

.rv-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

/* 同一时刻只显示朝上的那一面；翻面时在棋子被压扁的瞬间交换 */
.rv-disc.is-black .rv-face--white,
.rv-disc.is-white .rv-face--black {
  display: none;
}

/* 黑曜石 */
.rv-face--black {
  background:
    radial-gradient(circle at 29% 20%, rgba(255, 255, 255, .6) 0%, rgba(216, 228, 234, .18) 8%, transparent 23%),
    radial-gradient(circle at 68% 76%, rgba(130, 156, 168, .12), transparent 32%),
    radial-gradient(circle at 36% 30%, #6d757b 0%, #40454a 16%, #24272b 38%, #101214 70%, #040506 100%);
  box-shadow:
    0 .42cqw .72cqw rgba(2, 10, 6, .56),
    0 .08cqw .12cqw rgba(0, 0, 0, .68),
    inset 0 -.34cqw .58cqw rgba(0, 0, 0, .74),
    inset .16cqw .2cqw .46cqw rgba(255, 255, 255, .14),
    inset 0 0 0 1px rgba(0, 0, 0, .6);
}

/* 温润象牙 + 贝母虹彩 */
.rv-face--white {
  background:
    radial-gradient(circle at 28% 20%, #ffffff 0%, rgba(255, 254, 248, .96) 13%, transparent 34%),
    radial-gradient(circle at 37% 31%, #fdf9ef 0%, #f6edda 27%, #e9dcc3 54%, #d6c3a3 78%, #bfab88 100%);
  box-shadow:
    0 .4cqw .72cqw rgba(12, 20, 14, .42),
    0 .08cqw .12cqw rgba(40, 22, 6, .3),
    inset 0 -.32cqw .58cqw rgba(126, 100, 62, .4),
    inset .16cqw .18cqw .42cqw rgba(255, 255, 255, .92),
    inset 0 0 0 1px rgba(118, 95, 58, .34);
}

.rv-face--white::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  opacity: .5;
  background: conic-gradient(from 205deg,
    rgba(186, 220, 208, .3),
    rgba(244, 224, 190, .12) 22%,
    rgba(192, 210, 230, .28) 45%,
    rgba(246, 226, 192, .1) 66%,
    rgba(186, 220, 208, .3) 100%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* 翻面：先压成一条边，换色后再展开（比 3D backface 更稳，Safari 也一致） */
.rv-cell.is-flipping .rv-disc {
  transform: scaleX(.045);
  transition-duration: .15s;
  transition-timing-function: cubic-bezier(.45, .05, .55, .95);
  transition-delay: var(--rv-delay, 0ms);
  will-change: transform;
}

/* 合法落点：黄铜小点 */
.rv-hint {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.rv-hint::before {
  content: "";
  width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  opacity: 0;
  transition: width .16s ease, opacity .16s ease;
}

.rv-cell.is-legal .rv-hint::before {
  width: 19%;
  opacity: .9;
  background: radial-gradient(circle at 36% 28%, #fff4d2, #ddb96f 52%, #a57c34 100%);
  box-shadow:
    0 0 .9cqw rgba(232, 194, 116, .48),
    inset 0 0 0 1px rgba(255, 246, 220, .55);
}

.rv-cell.is-legal:hover .rv-hint::before,
.rv-cell.is-legal:focus-visible .rv-hint::before {
  width: 0;
  opacity: 0;
}

/* 悬停预落子（按当前执子颜色） */
.rv-grid.is-playing .rv-cell.is-legal:hover::after,
.rv-grid.is-playing .rv-cell.is-legal:focus-visible::after {
  content: "";
  position: absolute;
  inset: 5%;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: .46;
}

.rv-board[data-turn="black"] .rv-cell.is-legal:hover::after,
.rv-board[data-turn="black"] .rv-cell.is-legal:focus-visible::after {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .5), transparent 26%),
    radial-gradient(circle at 37% 31%, #4c5156, #1c1f22 58%, #000 100%);
  box-shadow: 0 .32cqw .5cqw rgba(0, 0, 0, .3);
}

.rv-board[data-turn="white"] .rv-cell.is-legal:hover::after,
.rv-board[data-turn="white"] .rv-cell.is-legal:focus-visible::after {
  background:
    radial-gradient(circle at 30% 22%, #ffffff, transparent 30%),
    radial-gradient(circle at 38% 33%, #fbf6ea, #e9dec7 58%, #cbbc9c 100%);
  box-shadow: 0 .32cqw .5cqw rgba(20, 30, 22, .26);
}

/* 最后一手：右上角铜色角标 */
.rv-last-mark {
  position: absolute;
  right: 7%;
  top: 7%;
  z-index: 3;
  width: 17%;
  height: 17%;
  opacity: 0;
  border-top: 1.5px solid rgba(246, 219, 152, .92);
  border-right: 1.5px solid rgba(246, 219, 152, .92);
  border-top-right-radius: 2px;
  filter: drop-shadow(0 0 2px rgba(240, 200, 120, .55));
  pointer-events: none;
  transition: opacity .2s ease;
}

.rv-cell.is-last .rv-last-mark {
  opacity: 1;
}

/* 非法落点：红框抖动 */
.rv-cell.is-invalid::before {
  content: "";
  position: absolute;
  inset: 2%;
  z-index: 4;
  border-radius: 3px;
  border: 1.5px solid rgba(196, 74, 52, .9);
  box-shadow: 0 0 .9cqw rgba(178, 58, 43, .45);
  pointer-events: none;
}

/* 棋盘锁定时压暗与暖光提示 */
.rv-board[data-phase="finished"] .rv-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(4, 16, 10, .14);
}

.rv-board[data-phase="finished"] .rv-cell.has-disc::after {
  display: none;
}

/* 静默恢复时不播过渡 */
.rv-board[data-silent="1"] .rv-face,
.rv-board[data-silent="1"] .rv-disc,
.rv-board[data-silent="1"] .rv-hint::before,
.rv-board[data-silent="1"] .rv-last-mark {
  transition: none !important;
  animation: none !important;
}

.rv-board[data-silent="1"] .rv-disc {
  animation: none !important;
}

/* 棋盘铭牌 */
.rv-plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding: 5px 13px 5px 7px;
  border-radius: 2px;
  border: 1px solid rgba(198, 160, 90, .32);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 45%),
    linear-gradient(160deg, #2b2119, #181310);
  box-shadow: inset 0 1px 0 rgba(255, 230, 185, .1), 0 3px 8px rgba(0, 0, 0, .32);
}

.rv-plate-seal {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(198, 160, 90, .45);
  color: var(--brass-hi);
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1;
  background: rgba(198, 160, 90, .08);
}

.rv-plate-title {
  color: rgba(230, 201, 130, .82);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .2em;
}

.rv-plate-sub {
  color: rgba(198, 160, 90, .34);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .16em;
  padding-left: 9px;
  border-left: 1px solid rgba(198, 160, 90, .2);
}

.rv-plate-turn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
  padding-left: 9px;
  border-left: 1px solid rgba(198, 160, 90, .2);
  color: rgba(236, 212, 162, .78);
  font-size: 10px;
  letter-spacing: .06em;
  white-space: nowrap;
}

.rv-plate-turn.is-over { color: rgba(226, 186, 130, .9); }

/* ---------------- 侧栏通用 ---------------- */
.rv-side .paper-card {
  padding: 14px 15px;
}

.rv-card .panel-heading {
  margin-bottom: 10px;
}

/* 对局状态 */
.rv-status { min-height: 64px; }

.rv-turn-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 2px;
  border: 1px solid rgba(100, 67, 32, .2);
  background: rgba(255, 249, 232, .42);
}

.rv-turn-row.is-black { box-shadow: inset 3px 0 0 rgba(34, 32, 28, .5); }
.rv-turn-row.is-white { box-shadow: inset 3px 0 0 rgba(166, 143, 102, .62); }

.rv-swatch {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.rv-swatch.is-black {
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, .5), transparent 24%),
    radial-gradient(circle at 37% 32%, #666d72, #24262a 48%, #000 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .45), inset 0 -2px 4px rgba(0, 0, 0, .65);
}

.rv-swatch.is-white {
  background:
    radial-gradient(circle at 30% 22%, #ffffff, transparent 34%),
    radial-gradient(circle at 38% 33%, #fcf7ec, #ecdfc8 55%, #cbba97 100%);
  box-shadow: 0 2px 4px rgba(60, 35, 10, .3), inset 0 -2px 4px rgba(122, 100, 62, .32);
}

.rv-turn-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.rv-turn-text b {
  color: #38250f;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .08em;
}

.rv-turn-text small {
  color: rgba(80, 55, 27, .58);
  font-size: 10.5px;
  letter-spacing: .02em;
}

.rv-turn-tag {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(100, 67, 32, .22);
  border-radius: 2px;
  color: rgba(90, 62, 30, .52);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: .12em;
  line-height: 1.5;
}

/* 计分条 */
.rv-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 7px 9px;
  border-radius: 2px;
  border: 1px solid rgba(100, 67, 32, .2);
  background: rgba(255, 249, 232, .28);
}

.rv-score-side {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.rv-score-side b {
  min-width: 20px;
  color: #33220f;
  font-family: var(--font-mono);
  font-size: 19px;
  line-height: 1;
  text-align: center;
}

.rv-score-side small {
  color: rgba(80, 55, 27, .55);
  font-size: 9px;
  letter-spacing: .04em;
}

.rv-score-bar {
  position: relative;
  flex: 1 1 auto;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(180deg, #f8efdb, #ddc9a6);
  box-shadow: inset 0 1px 2px rgba(80, 52, 20, .28), inset 0 -1px 0 rgba(255, 255, 255, .4);
}

.rv-score-bar i {
  display: block;
  height: 100%;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(180deg, #45494d, #14171a 66%, #050708);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 1px 0 0 rgba(198, 160, 90, .5);
  transition: width .3s ease;
}

/* 状态小标签 */
.rv-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.rv-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid rgba(100, 67, 32, .22);
  background: rgba(255, 249, 232, .38);
  color: rgba(74, 48, 22, .74);
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: .02em;
}

.rv-chip b {
  color: #3a2712;
  font-family: var(--font-mono);
  font-weight: 700;
}

.rv-chip em {
  margin-left: 1px;
  padding-left: 4px;
  border-left: 1px solid rgba(100, 67, 32, .2);
  color: rgba(122, 76, 32, .72);
  font-style: normal;
}

.rv-chip--quiet {
  color: rgba(80, 55, 27, .5);
  background: transparent;
}

/* 手数小表 */
.rv-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  border: 1px solid rgba(100, 67, 32, .2);
  border-radius: 2px;
  overflow: hidden;
  background: rgba(100, 67, 32, .16);
}

.rv-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 2px;
  background: rgba(255, 249, 232, .42);
}

.rv-stat-k {
  color: rgba(80, 55, 27, .55);
  font-size: 9.5px;
  letter-spacing: .06em;
}

.rv-stat-v {
  color: #3a2712;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.35;
}

.rv-stat-v.is-small {
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: .02em;
}

/* 终局状态条 */
.rv-result-band {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 2px;
  border: 1px solid rgba(100, 67, 32, .24);
  background: rgba(255, 249, 232, .42);
}

.rv-result-seal {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f3e6cb;
  font-family: var(--font-display);
  font-size: 18px;
  background: linear-gradient(160deg, #3a3d40, #17191b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 5px rgba(0, 0, 0, .32);
}

.rv-result-band.is-white .rv-result-seal {
  color: #4a331d;
  background: linear-gradient(160deg, #f7eeda, #cdbb96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 2px 5px rgba(60, 38, 12, .28);
}

.rv-result-band.is-draw .rv-result-seal {
  background: linear-gradient(160deg, #6f8f83, #3d5a51);
}

.rv-result-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.rv-result-text b {
  color: #38250f;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .07em;
}

.rv-result-text small {
  color: rgba(80, 55, 27, .6);
  font-size: 10px;
}

.rv-result-detail {
  margin-top: 8px;
  color: rgba(58, 39, 20, .72);
  font-size: 10.5px;
  line-height: 1.75;
}

.rv-result-detail b {
  color: #38250f;
  font-family: var(--font-mono);
}

/* ---------------- 操作区 ---------------- */
.rv-action-body { display: flex; flex-direction: column; gap: 7px; }

.rv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rv-toolbar .btn {
  flex: 1 1 auto;
  min-height: 33px;
  padding: 6px 10px;
  font-size: 11px;
}

.rv-toolbar .btn svg { width: 13px; height: 13px; }

.rv-spec-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 3px;
  padding-top: 9px;
  border-top: 1px dashed rgba(100, 67, 32, .2);
}

.rv-spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(80, 55, 27, .6);
  font-size: 10px;
  letter-spacing: .03em;
}

.rv-spec-mark {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(120, 88, 45, .45);
  border-radius: 2px;
  color: rgba(90, 62, 30, .7);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
  line-height: 1;
}

/* 迷你棋子（侧栏、铭牌、弹窗共用） */
.rv-mini-disc {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-block;
}

.rv-mini-disc.is-black {
  background: radial-gradient(circle at 33% 26%, #6e757a, #202326 56%, #000 100%);
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, .45), inset 0 -1px 2px rgba(0, 0, 0, .55);
}

.rv-mini-disc.is-white {
  background: radial-gradient(circle at 33% 26%, #fffdf7, #e9dfc9 55%, #c6b795 100%);
  box-shadow: 0 1px 1.5px rgba(60, 35, 10, .35), inset 0 0 0 .5px rgba(120, 98, 62, .4);
}

/* ---------------- 走子记录 ---------------- */
.rv-log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: rgba(80, 55, 27, .52);
  font-size: 9.5px;
  letter-spacing: .05em;
}

.rv-log-scroll {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 172px;
  overflow-y: auto;
  padding-right: 3px;
  overscroll-behavior: contain;
}

.rv-log-scroll:focus-visible { outline-offset: 2px; border-radius: 2px; }

.rv-log-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2.5px 6px;
  border-radius: 2px;
  color: rgba(58, 39, 20, .78);
  font-size: 10.5px;
  line-height: 1.6;
}

.rv-log-row:nth-child(odd) {
  background: rgba(255, 249, 232, .3);
}

.rv-log-row em {
  min-width: 19px;
  color: rgba(80, 55, 27, .45);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  text-align: right;
}

.rv-log-disc {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.rv-log-disc.is-black {
  background: radial-gradient(circle at 33% 26%, #6e757a, #202326 58%, #000 100%);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .5);
}

.rv-log-disc.is-white {
  background: radial-gradient(circle at 33% 26%, #fffdf7, #e9dfc9 55%, #c6b795 100%);
  box-shadow: inset 0 0 0 .5px rgba(120, 98, 62, .45);
}

.rv-log-row b {
  color: #3a2712;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}

.rv-log-flip {
  margin-left: auto;
  color: rgba(100, 70, 35, .55);
  font-family: var(--font-mono);
  font-size: 9px;
}

.rv-log-row.is-pass {
  border: 1px dashed rgba(178, 58, 43, .2);
  background: rgba(178, 58, 43, .055);
  color: rgba(122, 50, 36, .78);
  font-size: 9.5px;
}

.rv-log-row.is-pass em { color: rgba(160, 60, 40, .55); }
.rv-log-pass { letter-spacing: .02em; }

.rv-log-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 2px 2px;
  color: rgba(80, 55, 27, .55);
  font-size: 10.5px;
  line-height: 1.7;
}

.rv-empty-pair { display: inline-flex; flex: 0 0 auto; }

.rv-empty-pair i {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
}

.rv-empty-pair i + i { margin-left: -7px; }

.rv-empty-pair i.is-black {
  background: radial-gradient(circle at 33% 26%, #6e757a, #202326 58%, #000 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.rv-empty-pair i.is-white {
  background: radial-gradient(circle at 33% 26%, #fffdf7, #e9dfc9 55%, #c6b795 100%);
  box-shadow: 0 1px 2px rgba(60, 35, 10, .3), inset 0 0 0 .5px rgba(120, 98, 62, .4);
}

/* 规则说明 */
.rv-rules-en {
  padding-left: 8px;
  color: rgba(98, 67, 31, .4);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .16em;
}

.rv-rules-card { padding-bottom: 12px !important; }

/* ---------------- 终局弹窗 ---------------- */
.rv-result-modal .modal-body { padding-top: 6px; }

.rv-result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 10px;
  text-align: center;
}

.rv-hero-discs {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
}

.rv-hero-discs i {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.rv-hero-discs i + i { margin-left: -10px; }

.rv-hero-discs i.is-black {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .6), transparent 24%),
    radial-gradient(circle at 37% 32%, #6b7276, #232528 48%, #000 100%);
  box-shadow: 0 3px 7px rgba(0, 0, 0, .45), inset 0 -3px 6px rgba(0, 0, 0, .6);
}

.rv-hero-discs i.is-white {
  background:
    radial-gradient(circle at 30% 22%, #ffffff, transparent 34%),
    radial-gradient(circle at 38% 33%, #fbf6ea, #e8ddc6 55%, #c8b795 100%);
  box-shadow: 0 3px 7px rgba(60, 35, 10, .3), inset 0 -3px 6px rgba(122, 100, 62, .3);
}

.rv-result-title {
  color: #5c2a1c;
  font-family: var(--font-display);
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: .24em;
  text-indent: .24em;
}

.rv-result-hero.is-white .rv-result-title { color: #4a3a22; }
.rv-result-hero.is-draw .rv-result-title { color: #3f5c53; }

.rv-result-sub {
  margin-top: 5px;
  color: rgba(80, 55, 27, .6);
  font-size: 10.5px;
  letter-spacing: .08em;
}

.rv-hero-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 0 0 12px;
  padding: 9px 12px;
  border-top: 1px dashed rgba(100, 67, 32, .26);
  border-bottom: 1px dashed rgba(100, 67, 32, .26);
}

.rv-hero-side {
  display: flex;
  align-items: center;
  gap: 7px;
}

.rv-hero-side b {
  color: #33220f;
  font-family: var(--font-mono);
  font-size: 25px;
  line-height: 1;
}

.rv-hero-side small {
  color: rgba(80, 55, 27, .55);
  font-size: 9.5px;
}

.rv-hero-side .rv-mini-disc { width: 16px; height: 16px; }

.rv-hero-vs {
  color: rgba(90, 62, 30, .4);
  font-family: var(--font-mono);
  font-size: 18px;
}

.rv-receipt {
  padding: 11px 13px;
  border: 1px solid rgba(100, 67, 32, .26);
  border-radius: 2px;
  background:
    repeating-linear-gradient(0deg, rgba(110, 79, 40, .025) 0 1px, transparent 1px 3px),
    rgba(255, 250, 236, .5);
}

.rv-receipt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px dashed rgba(100, 67, 32, .28);
  color: #6a4c26;
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: .08em;
}

.rv-receipt-head em {
  color: rgba(98, 67, 31, .42);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
  letter-spacing: .16em;
}

.rv-receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  color: rgba(58, 39, 20, .78);
  font-size: 11px;
}

.rv-receipt-row b {
  color: #38250f;
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.rv-receipt-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(100, 67, 32, .24);
  color: rgba(80, 55, 27, .62);
  font-size: 10px;
  line-height: 1.75;
}

/* ---------------- 动效 ---------------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rv-drop {
    0% { transform: scale(.62); }
    62% { transform: scale(1.045); }
    100% { transform: scale(1); }
  }
  .rv-cell.is-placed .rv-disc {
    animation: rv-drop .26s cubic-bezier(.2, .85, .3, 1.15);
  }

  @keyframes rv-hint-pulse {
    0%, 100% { transform: scale(1); opacity: .82; }
    50% { transform: scale(1.16); opacity: 1; }
  }
  .rv-cell.is-legal .rv-hint::before {
    animation: rv-hint-pulse 1.9s ease-in-out infinite;
  }

  @keyframes rv-invalid-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    45% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
  }
  .rv-cell.is-invalid { animation: rv-invalid-shake .34s ease-out; }

  @keyframes rv-last-glow {
    0%, 100% { opacity: .9; }
    50% { opacity: .45; }
  }
  .rv-cell.is-last .rv-last-mark { animation: rv-last-glow 2.4s ease-in-out infinite; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .rv-board-frame { width: min(100%, 590px); }
}

@media (max-width: 900px) {
  .rv-stage { padding: clamp(10px, 2.4vw, 20px); }
  .rv-board-frame { width: min(100%, 560px); }
  .rv-side .paper-card { padding: 12px 13px; }
  .rv-log-scroll { max-height: 148px; }
}

@media (max-width: 640px) {
  .rv-stage { padding: 9px 8px 13px; }
  .rv-board-frame { padding: 7px; border-radius: 8px; }
  .rv-board-frame::after { display: none; }
  .rv-board-frame::before { inset: 2px; border-radius: 6px; }
  .rv-plate { margin-top: 11px; padding: 4px 10px 4px 6px; }
  .rv-plate-title { font-size: 11px; letter-spacing: .15em; }
  .rv-plate-sub { display: none; }
  .rv-plate-turn { font-size: 9.5px; }
  .rv-coord { font-size: clamp(7px, 2.1cqw, 9.5px); }
  .rv-turn-text b { font-size: 14px; }
  .rv-stat-v { font-size: 14px; }
  .rv-result-title { font-size: 26px; }
  .rv-log-scroll { max-height: 136px; }
}

@media (max-width: 390px) {
  .rv-stage { padding: 7px 6px 11px; }
  .rv-board-frame { padding: 5px; }
  .rv-plate { padding: 3px 8px 3px 5px; gap: 6px; }
  .rv-plate-seal { width: 19px; height: 19px; font-size: 10px; }
  .rv-plate-title { font-size: 10px; }
  .rv-plate-turn { padding-left: 7px; font-size: 9px; }
  .rv-spec { font-size: 9.5px; }
  .rv-score-side b { font-size: 17px; }
  .rv-turn-row { gap: 9px; padding: 8px 9px; }
  .rv-swatch { width: 26px; height: 26px; }
  .rv-side .paper-card { padding: 11px 12px; }
}

/* ---------------- 沉浸 / 全屏模式 ---------------- */
body.focus-mode .rv-wrap,
body.focus-mode .rv-stage-inner { height: 100%; }

body.focus-mode .rv-stage-inner { justify-content: center; }

body.focus-mode .rv-board-frame {
  width: min(100%, calc(100dvh - 86px), 820px);
}

body.focus-mode .rv-plate { display: none; }

body.focus-mode .rv-board-frame::after { display: none; }
