:root {
  --ink: #20231f;
  --ink-soft: #5f655b;
  --ink-faint: #8a8d80;
  --paper: #f1eadb;
  --paper-deep: #e4d8c1;
  --paper-light: #fbf6ea;
  --wood: #b67b43;
  --wood-dark: #7d4b27;
  --wood-light: #d39d62;
  --red: #a83b32;
  --red-bright: #c84b3e;
  --red-deep: #762820;
  --black: #252822;
  --black-soft: #4b5048;
  --jade: #45685b;
  --jade-dark: #2d493f;
  --gold: #c39a4b;
  --gold-soft: #e2c78e;
  --line: rgba(53, 39, 24, 0.38);
  --shadow: 0 26px 70px rgba(40, 30, 17, 0.18);
  --serif: "STKaiti", "KaiTi", "Kaiti SC", "FangSong", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #e9e0d0;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 14% 4%, rgba(255, 252, 241, 0.95), transparent 34rem),
    radial-gradient(circle at 90% 90%, rgba(177, 105, 62, 0.16), transparent 34rem),
    linear-gradient(135deg, #eee6d7 0%, #e6dbc9 48%, #ded0ba 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    repeating-linear-gradient(96deg, rgba(85, 65, 38, 0.025) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(3deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 8px);
  mix-blend-mode: multiply;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: 0.48;
}

.ambient-one {
  top: -22rem;
  right: -13rem;
  background: radial-gradient(circle, rgba(129, 56, 39, 0.2), transparent 68%);
}

.ambient-two {
  bottom: -25rem;
  left: -15rem;
  background: radial-gradient(circle, rgba(61, 105, 82, 0.17), transparent 68%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 22px;
}

.hero {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 30px;
  padding: 0 4px 28px;
  border-bottom: 1px solid rgba(77, 63, 43, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.seal {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(117, 35, 28, 0.7);
  border-radius: 8px;
  color: var(--red-deep);
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), transparent 48%),
    rgba(168, 59, 50, 0.08);
  box-shadow: inset 0 0 0 4px rgba(168, 59, 50, 0.04);
  transform: rotate(-2deg);
}

.eyebrow,
.micro-label {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.brand h1 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.hero-copy {
  max-width: 560px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  text-align: center;
  text-wrap: balance;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--jade-dark);
  font-weight: 700;
}

.live-dot i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5e8068;
  box-shadow: 0 0 0 4px rgba(94, 128, 104, 0.1);
}

.game-layout {
  --board-width: clamp(300px, calc((100vh - 235px) * 0.9), 620px);
  display: grid;
  grid-template-columns: minmax(0, var(--board-width)) 344px;
  gap: 34px;
  align-items: start;
  justify-content: center;
  padding: 30px 0 0;
}

.board-column {
  min-width: 0;
  max-width: 620px;
  width: 100%;
}

.turn-strip {
  display: flex;
  align-items: center;
  min-height: 63px;
  gap: 13px;
  margin: 0 auto 13px;
  padding: 0 4px;
}

.turn-orb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex: 0 0 auto;
  transition: background 220ms ease, box-shadow 220ms ease;
}

.turn-orb.red {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(168, 59, 50, 0.11);
}

.turn-orb.black {
  background: var(--black);
  box-shadow: 0 0 0 5px rgba(37, 40, 34, 0.1);
}

.turn-orb.thinking {
  animation: ai-pulse 1.1s ease-in-out infinite;
}

.turn-copy {
  min-width: 110px;
}

.turn-name {
  margin: 3px 0 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.check-flag {
  margin-left: 4px;
  padding: 5px 9px 4px;
  border: 1px solid rgba(168, 59, 50, 0.35);
  border-radius: 4px;
  color: var(--red);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  background: rgba(168, 59, 50, 0.06);
  animation: check-pulse 1.4s ease-in-out infinite;
}

.move-count {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.clock-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: -2px 0 12px;
  padding: 8px 9px;
  border: 1px solid rgba(76, 66, 48, 0.14);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.78), rgba(237, 232, 218, 0.52)),
    rgba(255, 251, 242, 0.56);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.68) inset,
    0 5px 15px rgba(58, 42, 20, 0.045);
}

.clock-block {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
  padding: 2px 7px;
}

.clock-block + .clock-block {
  border-left: 1px solid rgba(76, 66, 48, 0.13);
}

.clock-block span {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.clock-block strong {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.clock-block.is-move strong {
  color: var(--jade-dark);
}

.clock-strip.is-game-low .clock-block:first-child strong {
  color: var(--red);
}

.clock-strip.is-low .clock-block.is-move strong {
  color: var(--red);
  animation: clock-warning 900ms ease-in-out infinite;
}

.clock-strip.is-paused {
  opacity: 0.62;
}

.sound-toggle {
  flex: 0 0 auto;
  min-width: 62px;
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid rgba(76, 66, 48, 0.16);
  border-radius: 3px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(255, 253, 247, 0.66);
  cursor: pointer;
}

.sound-toggle.is-on {
  color: var(--jade-dark);
  border-color: rgba(69, 104, 91, 0.32);
  background: rgba(69, 104, 91, 0.07);
}

.sound-toggle:hover {
  border-color: rgba(69, 104, 91, 0.5);
}

.board-wrap {
  position: relative;
  margin: 0 auto;
}

.last-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 9px;
  padding: 9px 11px;
  border: 1px solid rgba(69, 104, 91, 0.2);
  border-radius: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.9), rgba(240, 234, 219, 0.78)),
    var(--paper-light);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 5px 16px rgba(58, 42, 20, 0.06);
}

.last-action.is-new {
  animation: last-action-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.last-action.has-capture {
  border-color: rgba(168, 59, 50, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 249, 238, 0.96), rgba(244, 226, 207, 0.82)),
    var(--paper-light);
}

.last-action-side {
  display: inline-grid;
  place-items: center;
  min-width: 37px;
  padding: 3px 7px;
  border-radius: 3px;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.last-action-side.red {
  color: #fff6e4;
  background: var(--red);
}

.last-action-side.black {
  color: #f5edda;
  background: var(--black-soft);
}

.last-action-text {
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
}

.last-action-capture {
  padding: 4px 8px;
  border-radius: 3px;
  color: #fff8eb;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: linear-gradient(135deg, #b94d3e, #8f3029);
  box-shadow: 0 2px 7px rgba(143, 48, 41, 0.22);
}

.last-action-capture.self {
  background: linear-gradient(135deg, #5b806e, #36594a);
  box-shadow: 0 2px 7px rgba(54, 89, 74, 0.2);
}

.board {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 10;
  overflow: hidden;
  border: 1px solid rgba(74, 47, 25, 0.6);
  border-radius: 8px;
  background:
    radial-gradient(circle at 47% 38%, rgba(255, 223, 160, 0.32), transparent 35%),
    repeating-linear-gradient(91deg, rgba(94, 50, 18, 0.04) 0 2px, transparent 2px 8px),
    linear-gradient(139deg, #d2a066 0%, #bb804d 43%, #a96d3c 100%);
  box-shadow:
    0 2px 0 rgba(255, 237, 196, 0.35) inset,
    0 0 0 7px rgba(98, 58, 29, 0.1),
    var(--shadow);
  isolation: isolate;
  container-type: inline-size;
  touch-action: manipulation;
}

.board::before,
.board::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.board::before {
  inset: 0;
  opacity: 0.22;
  background:
    linear-gradient(102deg, transparent 0 42%, rgba(255, 246, 214, 0.5) 42.2% 42.6%, transparent 42.8% 100%),
    repeating-linear-gradient(7deg, transparent 0 18px, rgba(105, 55, 24, 0.16) 19px, transparent 20px 37px);
  mix-blend-mode: soft-light;
}

.board::after {
  inset: 10px;
  border: 1px solid rgba(76, 44, 20, 0.28);
  border-radius: 3px;
}

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

.board-grid-line {
  fill: none;
  stroke: rgba(64, 40, 19, 0.46);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.board-border-line {
  fill: none;
  stroke: rgba(64, 40, 19, 0.72);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.board-palace-line {
  fill: none;
  stroke: rgba(64, 40, 19, 0.38);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.river-mark {
  fill: rgba(64, 40, 19, 0.42);
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 14px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.star-mark {
  fill: none;
  stroke: rgba(64, 40, 19, 0.39);
  stroke-width: 2;
  stroke-linecap: round;
}

.board-pieces {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.piece {
  position: absolute;
  display: grid;
  place-items: center;
  width: 8.55%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
  z-index: 3;
}

.piece::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px solid rgba(76, 44, 20, 0.36);
  pointer-events: none;
}

.piece:hover {
  transform: translate(-50%, -50%) translateY(-2px) scale(1.025);
  filter: brightness(1.04);
  z-index: 8;
}

.piece.selected {
  z-index: 10;
  transform: translate(-50%, -50%) translateY(-3px) scale(1.06);
  box-shadow:
    0 0 0 3px var(--gold-soft),
    0 0 0 6px rgba(195, 154, 75, 0.22),
    0 9px 18px rgba(48, 26, 10, 0.28);
}

.piece.last-moved {
  box-shadow:
    0 0 0 2px rgba(237, 205, 135, 0.88),
    0 7px 16px rgba(47, 28, 12, 0.23);
}

.piece.just-revealed {
  animation: reveal-in 560ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.piece.red-piece {
  color: var(--red);
  background:
    radial-gradient(circle at 38% 27%, rgba(255, 255, 255, 0.86), transparent 26%),
    linear-gradient(145deg, #f8edcf 0%, #e6d0a3 65%, #c8a66e 100%);
  box-shadow:
    0 2px 1px rgba(255, 255, 255, 0.55) inset,
    0 -2px 2px rgba(87, 52, 24, 0.22) inset,
    0 5px 8px rgba(66, 39, 16, 0.25);
}

.piece.black-piece {
  color: var(--black);
  background:
    radial-gradient(circle at 38% 27%, rgba(255, 255, 255, 0.8), transparent 26%),
    linear-gradient(145deg, #f8edcf 0%, #e4cfa4 65%, #c7a46c 100%);
  box-shadow:
    0 2px 1px rgba(255, 255, 255, 0.55) inset,
    0 -2px 2px rgba(87, 52, 24, 0.22) inset,
    0 5px 8px rgba(66, 39, 16, 0.25);
}

.piece.dark-piece {
  color: transparent;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 239, 0.78), transparent 34%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 242, 205, 0.1) 0 1px, transparent 1px 5px),
    linear-gradient(145deg, #f5d6b1 0%, #e1ab7e 52%, #bc7558 100%);
  box-shadow:
    0 2px 1px rgba(255, 252, 232, 0.72) inset,
    0 -3px 4px rgba(102, 53, 29, 0.18) inset,
    0 6px 9px rgba(64, 31, 16, 0.2);
}

.piece.dark-piece::after {
  content: "";
  position: absolute;
  inset: 27%;
  border: 1px solid rgba(246, 222, 166, 0.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 3px rgba(45, 30, 15, 0.08) inset,
    0 0 0 1px rgba(255, 241, 205, 0.08);
  pointer-events: none;
}

.piece.dark-piece.red-side {
  border: 2px solid rgba(172, 62, 45, 0.92);
}

.piece.dark-piece.black-side {
  border: 2px solid rgba(75, 57, 40, 0.8);
}

.piece.last-moved {
  z-index: 7;
  outline: 3px solid rgba(244, 207, 118, 0.98);
  outline-offset: 3px;
  animation: moved-piece-pulse 950ms ease-out;
}

.piece.last-moved.has-capture {
  outline-color: rgba(211, 71, 54, 0.98);
}

.move-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: clamp(12px, 2.4cqw, 18px);
  height: clamp(12px, 2.4cqw, 18px);
  border: 1px solid rgba(255, 250, 232, 0.9);
  border-radius: 50%;
  color: #fffaf0;
  font-family: var(--sans);
  font-size: clamp(7px, 1.4cqw, 10px);
  font-weight: 800;
  line-height: 1;
  background: var(--jade);
  box-shadow: 0 2px 5px rgba(40, 28, 15, 0.28);
  pointer-events: none;
}

.move-badge.capture {
  background: var(--red-bright);
}

.piece-char {
  position: relative;
  z-index: 2;
  margin-top: -2%;
  font-family: var(--serif);
  font-size: 5.55cqw;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

.piece.dark-piece .piece-char {
  display: none;
}

.side-marker {
  position: absolute;
  z-index: 3;
  top: 12%;
  left: 14%;
  width: 7%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.red-piece .side-marker {
  background: rgba(168, 59, 50, 0.82);
}

.black-piece .side-marker {
  background: rgba(37, 40, 34, 0.78);
}

.dark-piece.red-side .side-marker {
  background: rgba(212, 103, 84, 0.95);
}

.dark-piece.black-side .side-marker {
  background: rgba(228, 218, 183, 0.76);
}

.move-dot,
.capture-dot,
.self-dot {
  position: absolute;
  z-index: 4;
  width: 4.3%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.move-target {
  position: absolute;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 8.55%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.move-target:hover .move-dot,
.move-target:focus-visible .move-dot {
  transform: scale(1.22);
  background: #fff0c9;
}

.move-target .move-dot {
  position: relative;
  width: 50%;
  transform: none;
}

.move-dot {
  background: rgba(245, 226, 169, 0.86);
  box-shadow: 0 0 0 4px rgba(69, 104, 91, 0.15), 0 2px 4px rgba(35, 24, 10, 0.25);
  transition: transform 160ms ease, background 160ms ease;
}

.capture-dot {
  width: 7.8%;
  border: 2px solid rgba(255, 218, 155, 0.9);
  background: rgba(143, 42, 33, 0.16);
  box-shadow: 0 0 0 4px rgba(143, 42, 33, 0.12);
}

.self-dot {
  width: 7.8%;
  border: 2px dashed rgba(110, 154, 126, 0.95);
  background: rgba(54, 91, 72, 0.12);
  box-shadow: 0 0 0 4px rgba(54, 91, 72, 0.09);
}

.last-move-mark {
  position: absolute;
  z-index: 2;
  width: 6.8%;
  aspect-ratio: 1;
  border: 1px solid rgba(248, 215, 142, 0.54);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(248, 215, 142, 0.16);
}

.board-caption {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 14px 5px 0;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.6;
}

#statusHint {
  max-width: 560px;
}

.legend {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
}

.legend-dot.move {
  background: var(--gold);
}

.legend-dot.capture {
  border: 1px solid var(--red);
}

.legend-dot.self {
  border: 1px dashed var(--jade);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.mode-panel {
  padding-bottom: 15px;
}

.mode-current {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 4px 7px;
  border: 1px solid rgba(69, 104, 91, 0.3);
  border-radius: 3px;
  color: var(--jade-dark);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: rgba(69, 104, 91, 0.06);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mode-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 10px 10px 9px;
  border: 1px solid rgba(76, 66, 48, 0.14);
  border-radius: 4px;
  color: var(--ink-soft);
  text-align: left;
  background: rgba(255, 252, 244, 0.54);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.mode-button strong {
  color: inherit;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.05em;
}

.mode-button small {
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.35;
}

.mode-button:hover {
  border-color: rgba(67, 94, 77, 0.4);
  background: rgba(255, 254, 249, 0.9);
}

.mode-button.is-active {
  border-color: var(--jade-dark);
  color: #f4ead2;
  background: linear-gradient(135deg, #4d7364, #345447);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.1) inset;
}

.mode-button.is-active small {
  color: rgba(244, 234, 210, 0.66);
}

.mode-hint {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.online-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(69, 104, 91, 0.22);
  border-radius: 4px;
  background:
    linear-gradient(145deg, rgba(249, 246, 236, 0.94), rgba(230, 237, 228, 0.62)),
    rgba(255, 252, 244, 0.54);
}

.online-panel[hidden],
.online-lobby[hidden],
.online-room[hidden] {
  display: none;
}

.online-create {
  width: 100%;
}

.online-divider {
  position: relative;
  margin: 12px 0 10px;
  color: var(--ink-faint);
  font-size: 9px;
  text-align: center;
}

.online-divider::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(76, 66, 48, 0.12);
  content: "";
}

.online-divider span {
  position: relative;
  padding: 0 8px;
  background: #eff0e4;
}

.join-room-form label,
.online-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.join-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.join-room-row input {
  min-width: 0;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(76, 66, 48, 0.2);
  border-radius: 3px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(255, 253, 247, 0.82);
}

.join-room-row input:focus {
  border-color: rgba(69, 104, 91, 0.62);
  outline: 2px solid rgba(69, 104, 91, 0.12);
}

.online-hint {
  margin: 9px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.online-room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.room-code {
  color: var(--jade-dark);
  font-family: var(--sans);
  font-size: 21px;
  letter-spacing: 0.16em;
}

.online-connection {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(69, 104, 91, 0.2);
  border-radius: 99px;
  color: var(--jade-dark);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(69, 104, 91, 0.06);
}

.online-connection i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.online-connection.is-online i {
  background: #4f8a68;
  box-shadow: 0 0 0 3px rgba(79, 138, 104, 0.12);
}

.online-connection.is-offline {
  color: var(--red-deep);
  border-color: rgba(168, 59, 50, 0.24);
  background: rgba(168, 59, 50, 0.06);
}

.online-connection.is-offline i {
  background: var(--red);
}

.online-seat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.seat-chip {
  padding: 6px 7px;
  border: 1px solid rgba(76, 66, 48, 0.14);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 253, 247, 0.6);
}

.seat-chip.red {
  color: var(--red-deep);
}

.seat-chip.black {
  color: var(--black-soft);
}

.seat-chip.is-ready {
  border-color: rgba(69, 104, 91, 0.28);
  background: rgba(69, 104, 91, 0.07);
}

.seat-chip.is-you::after {
  margin-left: 4px;
  color: var(--jade-dark);
  content: "· 你";
}

.online-seat {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.online-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.online-actions .button {
  min-height: 33px;
  padding: 7px 8px;
  font-size: 10px;
}

.online-actions .danger-ghost {
  grid-column: 1 / -1;
}

.view-panel {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(127, 82, 42, 0.16);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.78), rgba(242, 228, 205, 0.48)),
    rgba(255, 252, 244, 0.46);
}

.view-panel[hidden] {
  display: none;
}

.view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.view-heading strong {
  color: #8e5134;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.view-button {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid rgba(76, 66, 48, 0.14);
  border-radius: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 253, 247, 0.68);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.view-button:hover {
  border-color: rgba(145, 79, 45, 0.38);
  background: rgba(255, 254, 249, 0.94);
}

.view-button.is-active {
  border-color: rgba(145, 79, 45, 0.72);
  color: #fff7e7;
  background: linear-gradient(135deg, #a96543, #7e4935);
}

.view-button:focus-visible {
  outline: 2px solid rgba(69, 104, 91, 0.62);
  outline-offset: 2px;
}

.view-hint {
  margin: 7px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.45;
}

.difficulty-panel {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(76, 66, 48, 0.12);
}

.difficulty-panel[hidden] {
  display: none;
}

.difficulty-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.difficulty-heading strong {
  color: var(--jade-dark);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.difficulty-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 7px 4px 6px;
  border: 1px solid rgba(76, 66, 48, 0.14);
  border-radius: 4px;
  color: var(--ink-soft);
  background: rgba(255, 252, 244, 0.5);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.difficulty-button strong {
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.difficulty-button small {
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.2;
}

.difficulty-button:hover {
  border-color: rgba(67, 94, 77, 0.36);
  background: rgba(255, 254, 249, 0.9);
}

.difficulty-button.is-active {
  border-color: rgba(145, 79, 45, 0.76);
  color: #fff7e7;
  background: linear-gradient(135deg, #a96543, #7e4935);
}

.difficulty-button.is-active small {
  color: rgba(255, 247, 231, 0.68);
}

.difficulty-hint {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.panel {
  padding: 19px 19px 18px;
  border: 1px solid rgba(80, 65, 44, 0.17);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.78), rgba(246, 238, 221, 0.55)),
    rgba(255, 250, 241, 0.58);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 12px 30px rgba(58, 42, 20, 0.055);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.panel-heading.compact {
  margin-bottom: 12px;
}

.panel h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.panel-stamp {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 4px 7px;
  border: 1px solid rgba(67, 94, 77, 0.34);
  border-radius: 3px;
  color: var(--jade-dark);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.14em;
  transform: rotate(2deg);
}

.toggle-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
}

.toggle-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 49px;
  padding: 9px 10px;
  border: 1px solid rgba(76, 66, 48, 0.12);
  border-radius: 4px;
  background: rgba(255, 252, 244, 0.55);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.toggle-card:hover {
  border-color: rgba(67, 94, 77, 0.35);
  background: rgba(255, 253, 247, 0.84);
}

.toggle-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-ui {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 19px;
  border: 1px solid rgba(61, 69, 57, 0.3);
  border-radius: 20px;
  background: rgba(83, 85, 71, 0.14);
  transition: background 180ms ease, border-color 180ms ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #f7f1e3;
  box-shadow: 0 1px 3px rgba(30, 25, 16, 0.25);
  transition: transform 180ms ease;
}

.toggle-card input:checked + .toggle-ui {
  border-color: var(--jade-dark);
  background: var(--jade);
}

.toggle-card input:checked + .toggle-ui::after {
  transform: translateX(15px);
}

.toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-copy strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.toggle-copy small {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.4;
}

.rule-note {
  margin: -5px 0 15px;
  padding: 8px 9px;
  border-left: 2px solid rgba(69, 104, 91, 0.38);
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.55;
  background: rgba(69, 104, 91, 0.035);
}

.rule-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 15px 0 0;
  border-top: 1px solid rgba(76, 66, 48, 0.12);
  list-style: none;
}

.rule-list li {
  display: grid;
  grid-template-columns: 49px 1fr;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.rule-list b {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.board-column > .rules-panel {
  margin-top: 23px;
}

.board-column > .rules-panel .rule-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 19px;
}

.captured-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 35px;
}

.captured-row + .captured-row {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed rgba(76, 66, 48, 0.12);
}

.captured-side {
  flex: 0 0 auto;
  width: 31px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.captured-side.red {
  color: var(--red);
}

.captured-side.black {
  color: var(--black);
}

.captured-stones {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 25px;
}

.captured-empty {
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 25px;
}

.mini-stone {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(145deg, #f8edcf, #d8bd8c);
  box-shadow: 0 2px 4px rgba(58, 40, 16, 0.18);
}

.mini-stone.captured-hidden {
  box-shadow:
    0 0 0 1px rgba(195, 154, 75, 0.72),
    0 2px 4px rgba(58, 40, 16, 0.18);
}

.mini-stone.red {
  color: var(--red);
}

.mini-stone.black {
  color: var(--black);
}

.mini-stone.just-captured,
.mini-stone.just-captured.captured-hidden {
  box-shadow:
    0 0 0 2px rgba(177, 57, 45, 0.92),
    0 0 0 5px rgba(177, 57, 45, 0.13),
    0 3px 6px rgba(58, 40, 16, 0.2);
  animation: captured-stone-pop 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mini-stone.just-captured::after {
  content: "新";
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  color: #fff8ea;
  font-family: var(--sans);
  font-size: 7px;
  font-weight: 800;
  background: var(--red-bright);
  box-shadow: 0 1px 3px rgba(72, 27, 20, 0.24);
}

.log-count {
  padding-top: 4px;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.move-log {
  display: grid;
  gap: 0;
  max-height: 190px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 91, 71, 0.32) transparent;
}

.move-log li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(76, 66, 48, 0.1);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.move-log li:first-child {
  border-top: 0;
}

.move-log li.latest-log {
  margin: 2px 0;
  padding-right: 7px;
  border-top-color: transparent;
  border-radius: 4px;
  background: rgba(195, 154, 75, 0.1);
}

.move-log li.latest-log.capture-log {
  box-shadow: 3px 0 0 rgba(168, 59, 50, 0.78) inset;
  background: rgba(168, 59, 50, 0.08);
}

.log-turn {
  display: grid;
  place-items: center;
  align-self: start;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
}

.log-turn.red {
  color: var(--red);
  background: rgba(168, 59, 50, 0.09);
}

.log-turn.black {
  color: var(--black);
  background: rgba(37, 40, 34, 0.08);
}

.log-text strong {
  color: var(--ink);
  font-weight: 700;
}

.log-text em {
  color: var(--jade-dark);
  font-style: normal;
}

.empty-log {
  display: block !important;
  color: var(--ink-faint) !important;
  font-size: 10px !important;
}

.controls-panel {
  display: grid;
  gap: 8px;
}

.board-controls-panel {
  margin-top: 11px;
  padding: 11px;
}

.board-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.board-action-grid .button {
  min-height: 42px;
  padding: 8px 7px;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.board-controls-panel .control-note {
  margin-top: 7px;
  padding: 0 2px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.button.primary {
  color: #f7ecd3;
  border-color: var(--jade-dark);
  background: linear-gradient(135deg, #4d7364, #345447);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.12) inset, 0 4px 9px rgba(43, 67, 55, 0.18);
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a8472, #3c6152);
}

.button.secondary {
  color: var(--ink);
  border-color: rgba(77, 71, 55, 0.25);
  background: rgba(255, 253, 247, 0.74);
}

.button.secondary:hover:not(:disabled) {
  border-color: rgba(67, 94, 77, 0.48);
  background: rgba(255, 254, 250, 0.95);
}

.button.ghost {
  color: var(--ink-soft);
  border-color: rgba(77, 71, 55, 0.14);
  background: transparent;
}

.button.ghost:hover:not(:disabled) {
  color: var(--ink);
  border-color: rgba(77, 71, 55, 0.3);
  background: rgba(255, 253, 247, 0.46);
}

.button.danger-ghost {
  color: var(--red);
  border-color: rgba(168, 59, 50, 0.22);
  background: rgba(168, 59, 50, 0.035);
}

.button.danger-ghost:hover:not(:disabled) {
  color: var(--red-deep);
  border-color: rgba(168, 59, 50, 0.48);
  background: rgba(168, 59, 50, 0.08);
}

.button.danger {
  color: #fff7e8;
  border-color: #7d2b24;
  background: linear-gradient(135deg, #bd4d40, #8e3029);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.1) inset, 0 4px 9px rgba(108, 36, 30, 0.2);
}

.button.danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #ca5a4c, #9b352d);
}

.control-note {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  z-index: 60;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 15px;
  border: 1px solid rgba(240, 218, 172, 0.24);
  border-radius: 4px;
  color: #f8efd9;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  background: rgba(37, 49, 41, 0.96);
  box-shadow: 0 12px 34px rgba(20, 27, 21, 0.28);
  transform: translateX(-50%);
}

.toast[hidden] {
  display: none;
}

.toast.is-error {
  border-color: rgba(239, 181, 166, 0.34);
  background: rgba(112, 46, 38, 0.97);
}

.game-overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 8px;
  background: rgba(34, 37, 30, 0.44);
  backdrop-filter: blur(3px);
  animation: overlay-in 300ms ease both;
}

.confirm-overlay {
  z-index: 24;
  background: rgba(34, 37, 30, 0.52);
}

.confirm-card {
  width: min(350px, 100%);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.confirm-actions .button {
  width: 100%;
}

.result-card {
  width: min(310px, 100%);
  padding: 27px 24px 23px;
  border: 1px solid rgba(255, 237, 197, 0.28);
  border-radius: 4px;
  color: var(--paper-light);
  text-align: center;
  background:
    linear-gradient(145deg, rgba(41, 49, 41, 0.97), rgba(27, 31, 26, 0.98)),
    #252a24;
  box-shadow: 0 22px 60px rgba(8, 12, 8, 0.38);
}

.result-card .micro-label {
  color: rgba(228, 205, 156, 0.62);
}

.result-card h2 {
  margin: 9px 0 7px;
  color: #f1d89d;
  font-family: var(--serif);
  font-size: 36px;
  letter-spacing: 0.12em;
}

.result-card.confirm-card h2 {
  font-size: 30px;
}

.result-card p:not(.micro-label) {
  margin: 0 0 19px;
  color: rgba(244, 235, 212, 0.68);
  font-size: 12px;
  line-height: 1.6;
}

.result-card .button {
  width: 100%;
}

.result-actions {
  display: grid;
  gap: 8px;
}

.result-actions .button.secondary {
  color: rgba(244, 235, 212, 0.86);
  border-color: rgba(244, 235, 212, 0.24);
  background: rgba(255, 255, 255, 0.045);
}

.result-actions .button.secondary:hover:not(:disabled) {
  border-color: rgba(241, 216, 157, 0.42);
  background: rgba(255, 255, 255, 0.085);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 27px;
  padding: 16px 4px 0;
  border-top: 1px solid rgba(77, 63, 43, 0.14);
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.board.is-over .piece {
  cursor: default;
}

.board.is-thinking .piece,
.board.is-thinking .move-target {
  cursor: wait;
}

[hidden] {
  display: none !important;
}

@keyframes reveal-in {
  0% {
    transform: translate(-50%, -50%) rotateY(88deg) scale(0.92);
    filter: brightness(1.3);
  }
  55% {
    transform: translate(-50%, -50%) rotateY(-8deg) scale(1.04);
  }
  100% {
    transform: translate(-50%, -50%) rotateY(0) scale(1);
  }
}

@keyframes last-action-in {
  from {
    opacity: 0.35;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes moved-piece-pulse {
  0% {
    outline-offset: 0;
    filter: brightness(1.2);
  }
  55% {
    outline-offset: 5px;
  }
  100% {
    outline-offset: 3px;
    filter: brightness(1);
  }
}

@keyframes captured-stone-pop {
  0% {
    opacity: 0.4;
    transform: scale(0.65);
  }
  65% {
    transform: scale(1.12);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes check-pulse {
  0%,
  100% {
    background: rgba(168, 59, 50, 0.06);
  }
  50% {
    background: rgba(168, 59, 50, 0.14);
  }
}

@keyframes ai-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px rgba(37, 40, 34, 0.1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(69, 104, 91, 0.18);
  }
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes clock-warning {
  50% {
    opacity: 0.58;
  }
}

@media (max-width: 1020px) {
  .hero {
    grid-template-columns: auto 1fr;
  }

  .hero-copy {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    text-align: left;
  }

  .hero-meta {
    align-items: flex-end;
  }

  .game-layout {
    grid-template-columns: minmax(0, var(--board-width)) 310px;
    gap: 24px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 28px, 680px);
    padding-top: 22px;
  }

  .hero {
    gap: 16px;
    padding-bottom: 21px;
  }

  .hero-meta {
    gap: 7px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 18px;
  }

  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .mode-panel,
  .log-panel,
  .controls-panel {
    grid-column: 1 / -1;
  }

  .captured-panel {
    grid-column: 1 / -1;
  }

  .board-column {
    width: min(100%, var(--board-width));
    margin: 0 auto;
  }
}

@media (max-width: 540px) {
  .app-shell {
    width: calc(100% - 18px);
    padding-top: 16px;
  }

  .hero {
    grid-template-columns: auto 1fr;
    gap: 11px;
    padding: 0 1px 17px;
  }

  .seal {
    width: 45px;
    height: 45px;
    font-size: 27px;
  }

  .brand {
    gap: 11px;
  }

  .brand h1 {
    font-size: 34px;
  }

  .eyebrow {
    font-size: 7px;
  }

  .hero-copy {
    font-size: 13px;
    line-height: 1.65;
  }

  .hero-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
  }

  .game-layout {
    padding-top: 12px;
    gap: 16px;
  }

  .turn-strip {
    min-height: 53px;
    margin-bottom: 5px;
    padding: 0 2px;
  }

  .turn-name {
    font-size: 21px;
  }

  .clock-strip {
    gap: 3px;
    padding: 7px 6px;
  }

  .clock-block {
    flex-direction: column;
    gap: 1px;
    padding: 1px 5px;
  }

  .clock-block strong {
    font-size: 17px;
  }

  .sound-toggle {
    min-width: 54px;
    padding: 4px 5px;
  }

  .board-caption {
    display: grid;
    gap: 8px;
    padding-top: 10px;
    font-size: 10px;
  }

  .legend {
    white-space: normal;
  }

  .side-panel {
    gap: 9px;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .mode-button {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 7px;
  }

  .panel {
    padding: 16px 14px 15px;
  }

  .board-controls-panel {
    padding: 10px;
  }

  .board-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-action-grid .button {
    min-height: 44px;
    font-size: 12px;
  }

  .panel h2 {
    font-size: 19px;
  }

  .toggle-copy small {
    font-size: 9px;
  }

  .rule-list li {
    grid-template-columns: 42px 1fr;
    font-size: 10px;
  }

  .board-column > .rules-panel .rule-list {
    grid-template-columns: 1fr;
  }

  .rule-list b {
    font-size: 12px;
  }

  .footer {
    display: grid;
    gap: 5px;
    margin-top: 19px;
    font-size: 9px;
  }

  .footer span:last-child {
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
