/* ============================================================
   拾光游戏厅 · 军棋翻翻棋样式
   厚重木纹棋盘 / 双轨铁路 / 立式木质漆牌 / 统一暗子牌背
   所有选择器以 .jq- 前缀限定
   ============================================================ */

/* ---------------- 页面布局 ---------------- */
.jq-wrap { width: 100%; }
.jq-layout { align-items: start; }

.jq-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
  min-height: 0;
}

/* ---------------- 阶段条 ---------------- */
.jq-phasebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  min-height: 30px;
}

.jq-phase-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.jq-phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid rgba(198, 160, 90, .32);
  border-radius: 2px;
  background: rgba(20, 13, 8, .35);
  color: rgba(230, 201, 130, .82);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  white-space: nowrap;
}
.jq-phase-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(230, 201, 130, .5);
  box-shadow: 0 0 0 2px rgba(230, 201, 130, .12);
}
.jq-phase-chip--r { color: #e5a292; border-color: rgba(178, 58, 43, .48); background: rgba(120, 32, 24, .22); }
.jq-phase-chip--r i { background: #cf5741; box-shadow: 0 0 9px rgba(207, 87, 65, .8); }
.jq-phase-chip--b { color: #d3c2a4; border-color: rgba(198, 160, 90, .3); background: rgba(16, 11, 7, .42); }
.jq-phase-chip--b i { background: #e6d8bb; box-shadow: 0 0 8px rgba(230, 216, 187, .5); }
.jq-phase-chip--first { color: var(--brass-hi); border-color: rgba(230, 201, 130, .55); background: rgba(120, 88, 38, .22); }
.jq-phase-chip--first i { background: var(--brass-hi); box-shadow: 0 0 10px rgba(230, 201, 130, .85); animation: jq-pending-pulse 2s ease-in-out infinite; }
.jq-phase-chip--over { color: rgba(230, 201, 130, .9); }
.jq-phase-chip--over i { background: var(--brass); box-shadow: 0 0 9px rgba(198, 160, 90, .7); }

.jq-phase-note {
  color: rgba(239, 225, 196, .43);
  font-size: 10px;
  letter-spacing: .02em;
  line-height: 1.5;
}

/* ---------------- 木棋盘 ---------------- */
.jq-board {
  position: relative;
  width: clamp(272px, 27vw, 392px);
  padding: 28px 26px 24px;
  border: 1px solid rgba(198, 160, 90, .32);
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 28% 0%, rgba(255, 224, 170, .16), transparent 52%),
    repeating-linear-gradient(93deg, rgba(28, 15, 7, .24) 0 2px, rgba(255, 218, 164, .022) 2px 5px, transparent 5px 17px),
    repeating-linear-gradient(3deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 7px),
    linear-gradient(148deg, #4b2f1c 0%, #33200f 48%, #241407 100%);
  box-shadow:
    0 27px 48px rgba(0, 0, 0, .58),
    0 2px 0 #150c06,
    0 3px 0 rgba(198, 160, 90, .16),
    inset 0 2px 0 rgba(255, 226, 176, .13),
    inset 0 0 42px rgba(0, 0, 0, .38);
}
.jq-board::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(198, 160, 90, .16);
  border-radius: 5px;
  pointer-events: none;
}
.jq-board::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .3),
    inset 0 0 24px rgba(0, 0, 0, .22);
}

/* 棋面：浅色木纹 */
.jq-field {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 12;
  border-radius: 2px;
  background:
    radial-gradient(ellipse at 30% 8%, rgba(255, 244, 214, .5), transparent 54%),
    repeating-linear-gradient(91deg, rgba(88, 55, 26, .065) 0 1.5px, rgba(255, 240, 205, .05) 1.5px 4px, transparent 4px 13px),
    radial-gradient(ellipse at 72% 78%, rgba(118, 78, 40, .18), transparent 62%),
    linear-gradient(168deg, #cdac7d 0%, #bb9463 46%, #a87e4f 100%);
  box-shadow:
    0 0 0 4px #3a2415,
    0 0 0 5px rgba(198, 160, 90, .22),
    inset 0 0 0 1px rgba(74, 45, 22, .4),
    inset 0 2px 5px rgba(255, 246, 222, .42),
    inset 0 -3px 8px rgba(66, 40, 20, .3);
}

.jq-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* SVG 棋盘线条 */
.jq-roads line {
  stroke: rgba(60, 38, 19, .44);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.jq-mountain rect { fill: rgba(43, 25, 12, .5); }
.jq-mountain path {
  fill: rgba(38, 22, 10, .52);
  stroke: rgba(24, 13, 6, .22);
  stroke-width: 1;
}
.jq-mountain text {
  fill: rgba(248, 232, 198, .55);
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 4px;
  text-anchor: middle;
}
.jq-camp-outer {
  fill: rgba(255, 246, 220, .17);
  stroke: rgba(58, 35, 17, .62);
  stroke-width: 2.6;
}
.jq-camp-inner {
  fill: none;
  stroke: rgba(58, 35, 17, .34);
  stroke-width: 1.4;
  stroke-dasharray: 7 6;
}
.jq-camp-dot { fill: rgba(58, 35, 17, .32); }
.jq-hq-outer {
  fill: rgba(178, 58, 43, .09);
  stroke: rgba(58, 35, 17, .66);
  stroke-width: 2.6;
}
.jq-hq-inner {
  fill: none;
  stroke: rgba(58, 35, 17, .3);
  stroke-width: 1.3;
}
.jq-rail-base {
  stroke: rgba(44, 26, 12, .5);
  stroke-width: 11;
  stroke-linecap: round;
}
.jq-rail-ties line { stroke: rgba(44, 26, 12, .3); stroke-width: 2.4; }
.jq-rail-line { stroke: rgba(244, 227, 190, .74); stroke-width: 2.2; }

/* 棋盘上下木框标签：只表示先手/后手，不固定颜色方位 */
.jq-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 25px;
}
.jq-frame--top { margin-bottom: 5px; }
.jq-frame--bottom { margin-top: 5px; }
.jq-frame-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid rgba(198, 160, 90, .22);
  border-radius: 2px;
  background: rgba(14, 9, 5, .38);
  color: rgba(239, 225, 196, .4);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .16em;
  transition: color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.jq-frame-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(239, 225, 196, .2);
  transition: box-shadow .25s ease, background .25s ease;
}
.jq-frame-label--r i { background: #d4543e; }
.jq-frame-label--b i { background: #f2e6cd; }
.jq-frame-label.is-active {
  color: var(--brass-hi);
  border-color: rgba(230, 201, 130, .5);
  box-shadow: 0 0 14px rgba(230, 201, 130, .16);
}
.jq-frame-label--r.is-active i { box-shadow: 0 0 9px rgba(212, 84, 62, .9); }
.jq-frame-label--b.is-active i { box-shadow: 0 0 9px rgba(242, 230, 205, .7); }

/* ---------------- 格子 ---------------- */
.jq-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(12, 1fr);
  z-index: 2;
}

.jq-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.jq-cell:focus { outline: none; }
.jq-cell:focus-visible {
  outline: 2px solid var(--brass-hi);
  outline-offset: -3px;
  z-index: 6;
}

.jq-cell.is-target::after {
  content: "";
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffefc4, #b23a2b 76%);
  box-shadow: 0 0 0 2px rgba(255, 242, 210, .5), 0 3px 9px rgba(0, 0, 0, .42);
  z-index: 3;
  pointer-events: none;
  animation: jq-target-pulse 1.7s ease-in-out infinite;
}
.jq-cell.is-target--battle::after {
  width: 78%;
  height: 78%;
  border-radius: 8px;
  background: none;
  border: 2.5px dashed rgba(255, 226, 166, .92);
  box-shadow: 0 0 14px rgba(255, 196, 120, .38), inset 0 0 12px rgba(255, 196, 120, .28);
  animation: jq-target-ring 1.7s ease-in-out infinite;
}

.jq-cell.is-selected::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(230, 201, 130, .9), 0 0 20px rgba(230, 201, 130, .42);
  z-index: 4;
  pointer-events: none;
}
.jq-cell.is-selected .jq-piece { transform: translateY(-5px); }

.jq-cell.is-last-from::after,
.jq-cell.is-last-to::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(230, 201, 130, .28);
  pointer-events: none;
  z-index: 1;
}

/* ---------------- 立式木质棋子 ---------------- */
.jq-piece {
  position: relative;
  width: 86%;
  aspect-ratio: 1 / 1;
  z-index: 2;
  transform: translateY(0);
  transition: transform .16s ease, filter .16s ease;
}

.jq-piece-face {
  position: absolute;
  inset: 0 0 8% 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  overflow: hidden;
  font-family: var(--font-display);
}
.jq-piece-face::before {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 3px;
  border: 1px solid rgba(255, 235, 200, .16);
  pointer-events: none;
}

.jq-piece--r .jq-piece-face {
  color: #f4e4c1;
  background:
    radial-gradient(ellipse at 32% 18%, rgba(255, 222, 176, .36), transparent 48%),
    repeating-linear-gradient(94deg, rgba(54, 12, 8, .18) 0 1.5px, rgba(255, 205, 170, .05) 1.5px 4.5px, transparent 4.5px 12px),
    linear-gradient(152deg, #c34b37 0%, #a23527 44%, #7a1f17 100%);
  border: 1px solid rgba(255, 216, 172, .26);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 194, .44),
    inset 0 -2px 3px rgba(52, 10, 6, .5),
    inset 0 0 0 1px rgba(92, 20, 12, .32),
    0 2px 0 #4a120c,
    0 4px 0 #360c07,
    0 7px 10px rgba(0, 0, 0, .4);
  text-shadow: 0 -1px 0 rgba(60, 12, 8, .85), 0 1px 0 rgba(255, 228, 188, .22);
}

.jq-piece--b .jq-piece-face {
  color: #ecdcba;
  background:
    radial-gradient(ellipse at 32% 18%, rgba(255, 236, 202, .2), transparent 46%),
    repeating-linear-gradient(94deg, rgba(0, 0, 0, .22) 0 1.5px, rgba(255, 225, 180, .035) 1.5px 4.5px, transparent 4.5px 12px),
    linear-gradient(152deg, #4d382b 0%, #34251b 44%, #1a110b 100%);
  border: 1px solid rgba(230, 201, 130, .24);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 202, .22),
    inset 0 -2px 3px rgba(0, 0, 0, .55),
    inset 0 0 0 1px rgba(0, 0, 0, .4),
    0 2px 0 #100a06,
    0 4px 0 #0b0704,
    0 7px 10px rgba(0, 0, 0, .44);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 236, 202, .16);
}

.jq-piece-grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    repeating-linear-gradient(92deg, transparent 0 3px, rgba(0, 0, 0, .055) 3px 4px),
    radial-gradient(ellipse at 82% 92%, rgba(0, 0, 0, .2), transparent 58%);
  mix-blend-mode: multiply;
}

.jq-piece-ch {
  position: relative;
  font-size: clamp(12px, 1.2vw, 16.5px);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  white-space: nowrap;
}

.jq-piece-seal {
  position: absolute;
  left: 9%;
  bottom: 8%;
  font-family: var(--font-display);
  font-size: 8px;
  line-height: 1;
  color: rgba(255, 240, 210, .55);
}
.jq-piece--b .jq-piece-seal { color: rgba(230, 201, 130, .55); }

/* ---------------- 统一暗子牌背 ---------------- */
.jq-piece--back { width: 86%; }

.jq-piece-back {
  position: absolute;
  inset: 0 0 8% 0;
  display: grid;
  place-items: center;
  border-radius: 5px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 32% 18%, rgba(255, 226, 180, .14), transparent 50%),
    repeating-linear-gradient(48deg, rgba(198, 160, 90, .085) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-48deg, rgba(198, 160, 90, .06) 0 2px, transparent 2px 9px),
    linear-gradient(152deg, #3c2c1e 0%, #251a12 52%, #150e09 100%);
  border: 1px solid rgba(198, 160, 90, .3);
  box-shadow:
    inset 0 1px 0 rgba(255, 226, 176, .18),
    inset 0 -2px 3px rgba(0, 0, 0, .55),
    inset 0 0 0 1px rgba(0, 0, 0, .42),
    0 2px 0 #120b07,
    0 4px 0 #0c0705,
    0 7px 10px rgba(0, 0, 0, .42);
}
.jq-piece-back::before {
  content: "";
  position: absolute;
  inset: 11%;
  border: 1px solid rgba(198, 160, 90, .3);
  border-radius: 2px;
  pointer-events: none;
}
.jq-piece-back::after {
  content: "";
  position: absolute;
  inset: 23%;
  border: 1px dashed rgba(198, 160, 90, .2);
  border-radius: 2px;
  pointer-events: none;
}
.jq-back-emblem {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.45vw, 20px);
  font-weight: 700;
  line-height: 1;
  color: rgba(230, 201, 130, .72);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7), 0 -1px 0 rgba(255, 220, 160, .12);
}

/* 首翻阶段：暗子可点击，微微呼吸 */
.jq-grid.is-firstflip .jq-piece--back .jq-piece-back {
  animation: jq-back-breathe 2.4s ease-in-out infinite;
}
.jq-grid.is-firstflip .jq-cell--hidden { cursor: pointer; }

/* ---------------- 棋盘底部提示 ---------------- */
.jq-hint {
  width: 100%;
  max-width: 500px;
  margin: 0;
  text-align: center;
  color: rgba(239, 225, 196, .42);
  font-size: 10.5px;
  line-height: 1.65;
}
.jq-hint.is-over { color: rgba(230, 201, 130, .68); }

/* ---------------- 侧栏 ---------------- */
.jq-card { position: relative; }
.jq-panel .panel-heading { margin-bottom: 9px; }

/* 先手 / 后手与颜色归属 */
.jq-seats { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.jq-seat {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(100, 67, 32, .2);
  border-radius: 2px;
  background: rgba(255, 249, 232, .3);
  color: #4a331d;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.jq-seat.is-active {
  border-color: rgba(178, 58, 43, .38);
  background: rgba(255, 249, 232, .52);
  box-shadow: inset 0 0 0 1px rgba(230, 201, 130, .38);
}
.jq-seat-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
}
.jq-seat-label em {
  font-style: normal;
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: .12em;
  color: rgba(74, 51, 29, .45);
}
.jq-seat-color {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid;
  border-radius: 2px;
  font-size: 9.5px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.jq-seat-color--r { color: #8d3325; border-color: rgba(178, 58, 43, .38); background: rgba(178, 58, 43, .08); }
.jq-seat-color--b { color: #3a2b20; border-color: rgba(58, 43, 32, .38); background: rgba(58, 43, 32, .08); }
.jq-seat-color.is-pending { color: rgba(74, 51, 29, .55); border-color: rgba(74, 51, 29, .22); border-style: dashed; }
.jq-seat-turn {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
  color: #a33a28;
  white-space: nowrap;
}
.jq-seat:not(.is-active) .jq-seat-turn { display: none; }

/* 首翻定色提示 */
.jq-firstflip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px dashed rgba(178, 58, 43, .4);
  border-radius: 2px;
  background: rgba(255, 249, 232, .42);
}
.jq-ff-seal {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 216, 172, .32);
  background: radial-gradient(circle at 35% 28%, #c34b37, #7a1f17);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 232, 194, .4);
  color: #f4e4c1;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}
.jq-ff-body { min-width: 0; }
.jq-ff-body strong {
  display: block;
  color: #4a2e16;
  font-family: var(--font-display);
  font-size: 13.5px;
  letter-spacing: .08em;
}
.jq-ff-body small { color: rgba(74, 51, 29, .62); font-size: 10px; line-height: 1.55; }
.jq-note { margin: 8px 0 0; color: rgba(74, 51, 29, .58); font-size: 10px; line-height: 1.65; }

.jq-status-band { align-items: center; }
.jq-status-band small { text-align: right; line-height: 1.5; }
.jq-turn-line { display: flex; align-items: center; gap: 7px; }
.jq-turn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22), 0 0 0 2px rgba(255, 255, 255, .16);
}
.jq-turn-dot--r { background: radial-gradient(circle at 35% 30%, #e57e66, #96291b); }
.jq-turn-dot--b { background: radial-gradient(circle at 35% 30%, #6d5847, #201510); }

.jq-lastline {
  margin-top: 9px;
  padding: 7px 9px;
  border: 1px dashed rgba(100, 67, 32, .28);
  border-radius: 2px;
  background: rgba(255, 249, 232, .42);
  color: #4a331d;
  font-size: 10.5px;
  line-height: 1.6;
  word-break: break-word;
}
.jq-hiddenline {
  margin-top: 7px;
  padding-left: 2px;
  color: rgba(90, 60, 28, .6);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .04em;
}

.jq-toolbar { margin-top: 11px; }
.jq-resign { color: #8d4a35; border-color: rgba(141, 74, 53, .4); }

/* 暗子进度条 */
.jq-hiddenbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(95, 64, 30, .16);
}
.jq-hiddenbar-label { flex: 0 0 auto; color: rgba(74, 51, 29, .62); font-size: 10px; letter-spacing: .05em; }
.jq-hiddenbar-track {
  flex: 1;
  height: 7px;
  border-radius: 2px;
  background: rgba(95, 64, 30, .14);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .16);
}
.jq-hiddenbar-track i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #7a5a30, #c6a05a);
  transition: width .3s ease;
}
.jq-hiddenbar-num {
  flex: 0 0 44px;
  text-align: right;
  color: #4a331d;
  font-family: var(--font-mono);
  font-size: 11px;
}
.jq-hiddenbar-num em { font-style: normal; font-size: 9px; color: rgba(74, 51, 29, .45); }

/* 兵力条 */
.jq-strength { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.jq-strength-side {
  flex: 0 0 32px;
  color: rgba(74, 51, 29, .8);
  font-size: 10.5px;
  letter-spacing: .06em;
}
.jq-strength--b .jq-strength-side { color: #3a2b20; }
.jq-strength-bar {
  flex: 1;
  height: 7px;
  border-radius: 2px;
  background: rgba(95, 64, 30, .14);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .16);
}
.jq-strength-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease;
}
.jq-strength--r .jq-strength-bar i { background: linear-gradient(90deg, #b23a2b, #d4705a); }
.jq-strength--b .jq-strength-bar i { background: linear-gradient(90deg, #3a2b20, #7a6250); }
.jq-strength-num {
  flex: 0 0 42px;
  text-align: right;
  color: #4a331d;
  font-family: var(--font-mono);
  font-size: 11px;
}
.jq-strength-num em { font-style: normal; font-size: 9px; color: rgba(74, 51, 29, .45); }

/* 阵亡棋子 */
.jq-fallen-row { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; }
.jq-fallen-label {
  flex: 0 0 44px;
  padding-top: 2px;
  color: rgba(74, 51, 29, .55);
  font-size: 9.5px;
  letter-spacing: .05em;
}
.jq-fallen-list { display: flex; flex-wrap: wrap; gap: 4px; }
.jq-fallen-chip {
  padding: 1px 5px;
  border: 1px solid rgba(100, 67, 32, .22);
  border-radius: 2px;
  background: rgba(120, 80, 40, .07);
  color: rgba(58, 39, 20, .68);
  font-size: 9.5px;
}
.jq-fallen-chip--r { border-color: rgba(178, 58, 43, .3); background: rgba(178, 58, 43, .06); color: #8d3325; }
.jq-fallen-chip em { font-style: normal; margin-left: 2px; opacity: .7; }
.jq-fallen-none { color: rgba(60, 110, 86, .78); font-size: 9.5px; }

/* 操作日志 */
.jq-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 6px;
  padding-top: 9px;
  border-top: 1px solid rgba(95, 64, 30, .16);
  color: rgba(74, 51, 29, .6);
  font-size: 10px;
  letter-spacing: .08em;
}
.jq-log-count { font-family: var(--font-mono); font-size: 9px; color: rgba(74, 51, 29, .4); }
.jq-log {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 172px;
  overflow: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}
.jq-log-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 4px;
  border-radius: 2px;
  color: rgba(58, 39, 20, .74);
  font-size: 10px;
  line-height: 1.5;
}
.jq-log-row:nth-child(odd) { background: rgba(255, 249, 232, .3); }
.jq-log-n {
  flex: 0 0 21px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: .7;
}
.jq-log-seat {
  flex: 0 0 auto;
  padding: 0 3px;
  border-radius: 2px;
  border: 1px solid rgba(100, 67, 32, .22);
  font-family: var(--font-display);
  font-size: 9px;
  line-height: 1.5;
  color: rgba(74, 51, 29, .7);
}
.jq-log-row--A .jq-log-n { color: #a33a28; }
.jq-log-row--A .jq-log-seat { border-color: rgba(178, 58, 43, .3); color: #8d3325; }
.jq-log-row--B .jq-log-n { color: #3a2b20; }
.jq-log-row--B .jq-log-seat { border-color: rgba(58, 43, 32, .3); color: #3a2b20; }
.jq-log-text { flex: 1; word-break: break-word; }
.jq-log-empty { padding: 8px 2px; color: rgba(74, 51, 29, .4); font-size: 10px; }

/* 翻棋要诀 */
.jq-notes-card { overflow: hidden; }
.jq-notes-seal {
  position: absolute;
  right: -8px;
  bottom: -30px;
  font-family: var(--font-display);
  font-size: 118px;
  line-height: 1;
  color: rgba(120, 82, 40, .075);
  pointer-events: none;
  user-select: none;
}
.jq-notes-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(58, 39, 20, .7);
  font-size: 10.5px;
  line-height: 1.65;
}
.jq-notes-list li { position: relative; padding-left: 13px; }
.jq-notes-list li::before { content: "·"; position: absolute; left: 2px; top: -1px; color: #9a6b32; font-weight: 700; }

/* 规则 */
.jq-rank-flow { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 9px; }
.jq-rank-flow span {
  padding: 2px 4px;
  border: 1px solid rgba(100, 67, 32, .2);
  border-radius: 2px;
  background: rgba(255, 249, 232, .3);
  color: rgba(74, 51, 29, .72);
  font-size: 8.5px;
  letter-spacing: .02em;
}
.jq-rank-flow span:first-child { color: #8d3325; border-color: rgba(178, 58, 43, .28); }
.jq-rank-flow span:last-child { color: #2f6f62; border-color: rgba(47, 111, 98, .3); }

/* 终局 */
.jq-result { display: flex; align-items: center; gap: 11px; padding: 4px 0 10px; }
.jq-result-seal {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 216, 172, .32);
  background: radial-gradient(circle at 35% 28%, #c34b37, #7a1f17);
  box-shadow: 0 4px 11px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 232, 194, .4);
  color: #f4e4c1;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}
.jq-result--draw .jq-result-seal {
  background: radial-gradient(circle at 35% 28%, #6d5847, #201510);
  border-color: rgba(230, 201, 130, .28);
}
.jq-result-body { min-width: 0; }
.jq-result-body strong {
  display: block;
  color: #4a2e16;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .08em;
}
.jq-result-body small { color: rgba(74, 51, 29, .6); font-size: 10px; line-height: 1.5; }

/* 终局弹窗（浅色纸面） */
.jq-result-modal .modal-head h2 { color: #3f2a14; }
.jq-modal-lead { margin: 0 0 6px; font-size: 12.5px; }
.jq-modal-stats { display: flex; gap: 10px; margin: 12px 0 6px; }
.jq-modal-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px;
  border: 1px solid rgba(104, 73, 37, .25);
  border-radius: 2px;
  background: rgba(255, 251, 239, .42);
}
.jq-modal-stat span { color: rgba(75, 51, 23, .55); font-size: 9px; letter-spacing: .14em; }
.jq-modal-stat strong { font-family: var(--font-display); font-size: 25px; line-height: 1.2; }
.jq-modal-stat small { color: rgba(75, 51, 23, .45); font-size: 9px; }
.jq-modal-stat--r strong { color: #9c2b1c; }
.jq-modal-stat--b strong { color: #3a2b20; }
.jq-modal-note { margin: 4px 0 0; color: rgba(75, 51, 23, .55); font-size: 10px; }

/* ---------------- 动效 ---------------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes jq-target-pulse {
    0%, 100% { transform: scale(.85); opacity: .72; }
    50% { transform: scale(1.06); opacity: 1; }
  }
  @keyframes jq-target-ring {
    0%, 100% { transform: scale(.97); opacity: .68; }
    50% { transform: scale(1); opacity: 1; }
  }
  @keyframes jq-land {
    0% { transform: translateY(-9px) scale(1.07); }
    55% { transform: translateY(1px) scale(.99); }
    100% { transform: translateY(0) scale(1); }
  }
  @keyframes jq-flip {
    0% { transform: rotateY(84deg) scale(.94); opacity: .45; }
    60% { transform: rotateY(-6deg) scale(1.03); opacity: 1; }
    100% { transform: rotateY(0) scale(1); }
  }
  @keyframes jq-clash {
    0% { opacity: 0; transform: scale(.8); }
    18% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.12); }
  }
  @keyframes jq-back-breathe {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(230, 201, 130, 0)); }
    50% { filter: drop-shadow(0 0 5px rgba(230, 201, 130, .35)); }
  }
  @keyframes jq-pending-pulse {
    0%, 100% { opacity: .7; }
    50% { opacity: 1; }
  }
  .jq-cell.is-landed .jq-piece { animation: jq-land .52s cubic-bezier(.2, .85, .3, 1) both; }
  .jq-cell.is-flipped .jq-piece { animation: jq-flip .5s cubic-bezier(.2, .8, .3, 1) both; }
  .jq-cell.is-clash::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: radial-gradient(circle, rgba(255, 226, 158, .8), rgba(178, 58, 43, .42) 46%, transparent 72%);
    animation: jq-clash .62s ease-out both;
    pointer-events: none;
    z-index: 7;
  }
}

@media (hover: hover) and (pointer: fine) {
  .jq-cell--filled:hover .jq-piece { transform: translateY(-3px); filter: drop-shadow(0 7px 8px rgba(0, 0, 0, .4)); }
  .jq-cell--hidden:hover .jq-piece { transform: translateY(-3px); filter: drop-shadow(0 0 7px rgba(230, 201, 130, .4)) drop-shadow(0 7px 8px rgba(0, 0, 0, .4)); }
  .jq-cell.is-selected:hover .jq-piece { transform: translateY(-5px); }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .jq-board { width: clamp(268px, 32vw, 352px); padding: 24px 22px 20px; }
}

@media (max-width: 900px) {
  .jq-board { width: min(100%, 372px); }
  .jq-stage { padding: 16px 14px 12px; }
}

@media (max-width: 600px) {
  .jq-stage { padding: 12px 10px 10px; gap: 9px; }
  .jq-board { width: min(100%, 338px); padding: 17px 15px 15px; border-radius: 7px; }
  .jq-phasebar { justify-content: center; }
  .jq-phase-info { justify-content: center; }
  .jq-phase-note { display: none; }
  .jq-hint { font-size: 9.5px; max-width: 340px; }
  .jq-piece-ch { font-size: clamp(11px, 3.6vw, 14.5px); }
  .jq-back-emblem { font-size: clamp(12px, 3.4vw, 16px); }
  .jq-frame { height: 21px; }
  .jq-frame-label { font-size: 7px; padding: 1px 7px; letter-spacing: .12em; }
  .jq-log { max-height: 148px; }
  .jq-seat-label { font-size: 11px; }
}

@media (max-width: 390px) {
  .jq-board { width: 100%; padding: 14px 12px 12px; }
  .jq-piece-seal { font-size: 7px; }
}
