/* Display serif: self-hosted Latin only (English). font-display: optional so a
   late webfont never restyles headings after first paint. CJK uses system serif. */
@font-face {
  font-family: "MRY Serif";
  src: url("/brand/morris/fonts/noto-serif-sc-latin-700.woff2?v=18") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "MRY Serif";
  src: url("/brand/morris/fonts/noto-serif-sc-latin-900.woff2?v=18") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Surface & Canvas: Warm Venetian Parchment & Aged Alabaster */
  --linen: #f7f3e8;
  --linen-2: #ece3d0;
  --linen-3: #e0d4be;

  /* Wood Materials: Italian Walnut, Chestnut & Smoked Pearwood */
  --wood: #d5a66a;
  --wood-light: #e6c288;
  --wood-deep: #a87238;
  --wood-dark: #633816;
  --wood-noir: #3d200b;

  /* Ink Typography: Deep Charcoal Sepia */
  --ink: #221811;
  --ink-soft: #574636;
  --ink-muted: #887460;

  /* Brand Accents */
  --brown: #824419;
  --brown-deep: #5e2c0b;
  --brown-glow: rgba(130, 68, 25, 0.22);

  --gold: #bd8724;
  --gold-deep: #966712;
  --gold-light: #fad67a;
  --gold-glow: rgba(189, 135, 36, 0.24);

  --vermilion: #be3927;
  --vermilion-deep: #982617;
  --vermilion-glow: rgba(190, 57, 39, 0.22);

  --jade: #2b6a4c;
  --jade-deep: #1b4b34;
  --jade-light: #44926d;
  --jade-glow: rgba(43, 106, 76, 0.2);

  /* Lines & Dividers */
  --line: rgba(100, 58, 22, 0.16);
  --line-soft: rgba(100, 58, 22, 0.08);
  --line-strong: rgba(100, 58, 22, 0.28);

  /* Card Surfaces */
  --surface: #fdfaf4;
  --surface-2: #f4ecdc;
  --surface-3: #e8dcc6;
  --surface-glass: rgba(253, 250, 244, 0.88);

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 6px rgba(45, 22, 7, 0.05), 0 1px 2px rgba(45, 22, 7, 0.04);
  --shadow: 0 12px 32px rgba(45, 22, 7, 0.10), 0 2px 8px rgba(45, 22, 7, 0.04);
  --shadow-lg: 0 20px 48px rgba(45, 22, 7, 0.16), 0 4px 12px rgba(45, 22, 7, 0.06);

  --scroll-thumb: rgba(130, 68, 25, 0.32);
  --scroll-track: transparent;

  --serif: "MRY Serif", "Songti SC", "Songti TC", "STSong", "Source Han Serif SC",
    "Noto Serif CJK SC", "SimSun", "宋体", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --sidebar-w: 200px;
  --ad-w: 160px;
  color-scheme: light;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

/* CJK pages never attach the Latin webfont, so Songti metrics are stable on first paint. */
html[lang="zh-CN"],
html[lang="zh-TW"] {
  --serif: "Songti SC", "Songti TC", "STSong", "Source Han Serif SC",
    "Noto Serif CJK SC", "SimSun", "宋体", serif;
}

:root[data-theme="dark"] {
  --linen: #140e09;
  --linen-2: #1c140d;
  --linen-3: #241b12;

  --wood: #6a4422;
  --wood-light: #8a5a2f;
  --wood-deep: #4d2f14;
  --wood-dark: #2a1808;
  --wood-noir: #120902;

  --ink: #f7eee2;
  --ink-soft: #c2b19a;
  --ink-muted: #8c7c68;

  --brown: #d88944;
  --brown-deep: #f2a868;
  --brown-glow: rgba(216, 137, 68, 0.25);

  --gold: #e2a83b;
  --gold-deep: #f5c464;
  --gold-light: #fae29c;
  --gold-glow: rgba(226, 168, 59, 0.26);

  --vermilion: #e65240;
  --vermilion-deep: #fa7b6c;
  --vermilion-glow: rgba(230, 82, 64, 0.25);

  --jade: #429f74;
  --jade-deep: #6ec29a;
  --jade-light: #8fe0ba;
  --jade-glow: rgba(66, 159, 116, 0.22);

  --line: rgba(226, 185, 140, 0.14);
  --line-soft: rgba(226, 185, 140, 0.07);
  --line-strong: rgba(226, 185, 140, 0.25);

  --surface: #201710;
  --surface-2: #281d14;
  --surface-3: #34271c;
  --surface-glass: rgba(32, 23, 16, 0.88);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.72), 0 4px 16px rgba(0, 0, 0, 0.4);

  --scroll-thumb: rgba(216, 137, 68, 0.42);
  --scroll-track: rgba(14, 9, 5, 0.45);
  color-scheme: dark;
}

html {
  height: 100%;
  background-color: #5c2c0c;
}
html, body {
  height: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
img, svg, canvas {
  display: block;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  background-color: #5c2c0c;
  transition: color 0.25s, background-color 0.25s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #2a1608;
}

button {
  appearance: none;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  line-height: inherit;
}

button, select, input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--brown);
  text-decoration: none;
  transition: color 0.16s ease;
}
a:hover {
  color: var(--gold);
}

/* ===== App shell: sidebar + content ===== */
.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background: var(--linen);
}

/* ===== Sidebar navigation ===== */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: calc(18px + env(safe-area-inset-top)) 14px 14px;
  color: #fdf6ec;
  background-color: #5c2c0c;
  background-image: linear-gradient(172deg, #5c2c0c 0%, #462007 48%, #2f1403 100%);
  border-right: 1px solid rgba(255, 220, 170, 0.12);
  box-shadow: 4px 0 24px rgba(35, 15, 4, 0.28);
}

:root[data-theme="dark"] .sidebar {
  background-color: #2a1608;
  background-image: linear-gradient(172deg, #2a1608 0%, #1e0e04 48%, #120802 100%);
  border-right: 1px solid rgba(226, 168, 59, 0.12);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
}
.sidebar .brand {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 235, 200, 0.14);
}

/* App-icon tile: refined shield with subtle specular bevel */
.sidebar .brand .brand__mark {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 12px;
  background: none;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar .brand:hover .brand__mark {
  transform: translateY(-1px) scale(1.02);
}

.sidebar .brand,
.sidebar .brand:hover {
  color: #fffaf0;
  text-decoration: none;
}
.sidebar .brand__name {
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fffaf0;
  font-size: 20px;
  line-height: 24px;
  height: 24px;
  letter-spacing: 0.05em;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.sidebar .brand__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sidebar__top-spacer {
  display: none;
}
.brand .brand__mark {
  display: block;
  border-radius: 10px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
}
.brand__name {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  white-space: nowrap;
}
.brand__latin {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.sidebar .brand__latin {
  color: rgba(255, 236, 205, 0.72);
}
.brand__text p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.sidebar .brand__text p {
  color: rgba(255, 245, 230, 0.68);
}

.nav {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 5px;
  flex: 1 1 auto;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 42px;
  height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 242, 225, 0.78);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
}
.nav__item:hover {
  background: rgba(255, 240, 220, 0.12);
  color: #ffffff;
  border-color: rgba(255, 240, 220, 0.16);
  transform: translateX(2px);
}
.nav__item.active {
  background: linear-gradient(135deg, rgba(255, 235, 195, 0.24), rgba(255, 235, 195, 0.10));
  color: #fffdf9;
  font-weight: 600;
  border-color: rgba(255, 220, 160, 0.25);
  box-shadow: 0 4px 14px rgba(30, 12, 2, 0.25);
}
.nav__item svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  opacity: 0.92;
}

/* Latin nav labels */
html[lang="en"] .nav__item {
  font-family: var(--sans);
  font-weight: 600;
  color: rgba(255, 242, 225, 0.85);
}
html[lang="en"] .nav__item.active {
  font-weight: 600;
}

.sidebar__foot {
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 235, 200, 0.14);
  font-size: 12px;
  color: rgba(255, 240, 220, 0.65);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar__tools {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 240, 220, 0.22);
  border-radius: 12px;
  background: rgba(255, 240, 220, 0.10);
  color: rgba(255, 246, 232, 0.95);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.icon-btn:hover {
  background: rgba(255, 240, 220, 0.20);
  border-color: rgba(255, 240, 220, 0.40);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}
.icon-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.icon-btn svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}
.mry-icon-sun {
  display: none;
}
:root[data-theme="dark"] .mry-icon-sun {
  display: block;
}
:root[data-theme="dark"] .mry-icon-moon {
  display: none;
}
.icon-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.icon-btn:disabled:hover {
  background: rgba(255, 240, 220, 0.08);
  border-color: rgba(255, 240, 220, 0.18);
  transform: none;
}

.sidebar__panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.menu-toggle,
.nav-scrim {
  display: none;
}

/* ===== Content area ===== */
.content {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.4) 0%, transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.15) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(0deg, rgba(140, 95, 45, 0.04) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #faf6eb 0%, var(--linen) 50%, #ede3ce 100%);
}
:root[data-theme="dark"] .content {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(226, 168, 59, 0.04) 0%, transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #18110a 0%, var(--linen) 50%, #120b06 100%);
}
.content-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}

/* Board layout: 3 columns — board | info | ad */
.play {
  display: grid;
  --panel-w: 336px;
  --mid: calc(var(--panel-w) + 14px);
  grid-template-columns: minmax(0, 1fr) var(--mid) var(--ad-w);
  column-gap: 0;
  row-gap: 14px;
  align-items: start;
  height: 100dvh;
  min-height: 100dvh;
  padding: 12px;
}
.play.play--ready {
  transition: grid-template-columns 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.play--noad {
  grid-template-columns: minmax(0, 1fr) var(--mid);
}
.play--collapsed {
  --mid: 0px;
  grid-template-columns: minmax(0, 1fr) 0px var(--ad-w);
}
.play--noad.play--collapsed {
  grid-template-columns: minmax(0, 1fr) 0px;
  padding-right: 42px;
}

/* ===== Board column (fills the viewport height) ===== */
.board {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow: visible;
  container-type: size;
  --sq: min(100cqw, calc(100cqh - 96px));
}
.play--scoring:not(.play--spectating) .board {
  --sq: min(100cqw, calc(100cqh - 200px));
}
.play--scoring:not(.play--spectating) .toolbar--board {
  display: none;
}
.play--spectating .toolbar--board {
  display: none;
}
.play--spectating .board {
  --sq: min(100cqw, calc(100cqh - 56px));
}
[data-mry-spectate-leave] {
  display: none;
}
.play--spectating [data-mry-spectate-leave="panel"] {
  display: block;
  width: 100%;
}
.play-head [data-mry-spectate-leave="head"] {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Stage holds the square board frame */
.board__stage {
  position: relative;
  flex: 0 0 auto;
  width: var(--sq);
  height: var(--sq);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}
.panel-toggle {
  position: absolute;
  top: 50%;
  right: -30px;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-left: none;
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  color: var(--brown-deep);
  box-shadow: 3px 0 10px rgba(45, 20, 5, 0.08);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.panel-toggle:hover {
  background: var(--surface-2);
  color: var(--gold);
}
.panel-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.play--collapsed .panel-toggle svg {
  transform: rotate(180deg);
}

/* Compact, real (visible) H1 above the board */
.play-head {
  flex: 0 0 auto;
  width: var(--sq);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.play-head__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.play-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brown-deep);
  line-height: 1.2;
}

/* Live status pulled onto the H1 row */
.head-live {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.head-live__turn,
.head-live__cap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
.head-live__turn {
  color: var(--ink);
}
.head-live__turn [data-mry-turn-text] {
  min-width: 12ch;
}
.head-live__cap {
  color: var(--ink-soft);
}
.head-live__cap b {
  color: var(--ink);
  font-weight: 700;
}
.head-live__sep {
  color: var(--line);
  margin: 0 1px;
}

.infobar {
  width: 100%;
  max-width: min(100%, calc(100dvh - 140px));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Board size segmented control */
.size-switch {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
}
.size-switch__btn {
  padding: 5px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.size-switch__btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.size-switch__btn.active {
  background: linear-gradient(135deg, var(--jade), var(--jade-deep));
  color: #f3fbf5;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--jade-glow);
}
.mode-pill {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--jade), var(--jade-deep));
  color: #f3fbf5;
  font-size: 13px;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px var(--jade-glow);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.turn {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #f7efe0;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.info-cap {
  flex: 1 1 auto;
  text-align: right;
  color: var(--ink-soft);
  font-size: 14px;
}
.btn-sound {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease, transform 0.12s ease;
}
.btn-sound svg {
  width: 18px;
  height: 18px;
}
.btn-sound:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
  transform: translateY(-1px);
}
.btn-sound:active {
  transform: translateY(1px);
}
.btn-sound[aria-pressed="false"] {
  opacity: 0.5;
}

/* Masterwork Chamfered Wood Board Casing */
.board__frame {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  padding: clamp(8px, 1.3vw, 12px);
  border-radius: 14px;
  background: linear-gradient(145deg, #dfb479 0%, #cc9859 45%, #a86f34 100%);
  border: 1px solid rgba(110, 58, 20, 0.45);
  box-shadow:
    0 20px 48px rgba(45, 20, 5, 0.22),
    0 4px 14px rgba(45, 20, 5, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(70, 32, 8, 0.4),
    inset 0 0 20px rgba(60, 26, 6, 0.35);
  -webkit-tap-highlight-color: transparent;
}
:root[data-theme="dark"] .board__frame {
  background: linear-gradient(145deg, #442813 0%, #2c1809 45%, #180c04 100%);
  border: 1px solid rgba(213, 159, 82, 0.25);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.75),
    0 6px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(213, 159, 82, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    inset 0 0 20px rgba(0, 0, 0, 0.75);
}

.board__frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(30, 15, 5, 0.25);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.mry-board-host {
  width: 100%;
  height: 100%;
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.board__status {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  margin: 0;
  max-width: calc(100% - 28px);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transform: translateX(-50%);
  background: rgba(45, 22, 8, 0.88);
  backdrop-filter: blur(8px);
  color: #fffaf0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  border: 1px solid rgba(255, 220, 160, 0.25);
  box-shadow: 0 8px 24px rgba(30, 12, 3, 0.35);
}
.board__status[hidden] {
  display: none;
}

/* ===== Info column ===== */
.panel {
  min-width: 0;
  width: auto;
  height: 100%;
  margin-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
.play.play--ready .panel {
  transition:
    margin-left 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}
.play--collapsed .panel {
  margin-left: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ===== Live status card (top of info column) ===== */
.status-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow);
}
.status-card__top {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}
.status-card__badges {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}
.status-card__badges .mode-pill,
.status-card__badges .status-chip {
  flex: 0 0 auto;
  width: max-content;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-card__badges .status-chip {
  gap: 6px;
}
.status-card__top .btn-sound {
  margin-left: auto;
  flex: 0 0 auto;
}
.status-card__turn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brown-deep);
}
.stone-dot {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 1.5px 4px rgba(25, 12, 4, 0.35);
}
.stone-dot.black {
  background: radial-gradient(circle at 35% 32%, #4a4239 0%, #26201a 40%, #110e0b 75%, #000000 100%);
  border: 1px solid rgba(18, 14, 10, 0.95);
  box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.45);
}
.stone-dot.white {
  background: radial-gradient(circle at 35% 32%, #ffffff 0%, #fcf7ef 35%, #ede0c8 72%, #b59b72 100%);
  border: 1px solid rgba(140, 95, 45, 0.55);
  box-shadow: 0 1.5px 4px rgba(30, 15, 5, 0.25);
}
.status-card__hint {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3.5px solid var(--gold);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  min-height: calc(20px + 3em);
  box-shadow: var(--shadow-sm);
}
.status-card__size {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-card__label {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 13px;
}
.status-card__size .size-switch {
  flex: 1 1 auto;
  justify-content: stretch;
  gap: 4px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}
.status-card__size .size-switch__btn {
  flex: 1 1 0;
  text-align: center;
}

.caps-row {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.caps-row__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.caps-row__item dt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}
.caps-row__item .stone-dot {
  width: 14px;
  height: 14px;
}
.caps-row__item dd {
  margin: 0 0 0 auto;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.board__bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.board__bar label {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.board__bar select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}

.toolbar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.toolbar .btn {
  border-radius: 12px;
}
.toolbar .btn--primary {
  grid-column: 1 / -1;
}

/* Toolbar mounted below the board */
.toolbar--board {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  width: var(--sq);
  gap: 8px;
}
.toolbar--board .btn {
  flex: 1 1 0;
  min-width: 92px;
  padding-inline: 12px;
  white-space: nowrap;
}
.toolbar--board .btn[aria-busy="true"],
.toolbar--board .btn.is-replaying {
  cursor: wait;
  opacity: 0.85;
  animation: mry-hint-pulse 1.1s ease-in-out infinite;
}
@keyframes mry-hint-pulse {
  50% { opacity: 0.55; }
}

.score-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: var(--sq);
  flex: 0 0 auto;
  margin-top: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.score-bar[hidden] {
  display: none !important;
}
.score-bar__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.score-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.score-bar__actions .btn {
  flex: 1 1 0;
  min-width: 120px;
}

.toolbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.toolbar .btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.85;
}
.toolbar .btn--primary svg {
  opacity: 1;
}

/* Luxury Tactile Button System */
.btn {
  min-height: 38px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(45, 22, 7, 0.05);
}
.btn--primary {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, #b05c22 0%, var(--brown-deep) 100%);
  color: #fdf6ec;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(94, 44, 11, 0.35);
}
.btn--primary:hover {
  background: linear-gradient(135deg, #be6829 0%, #70330d 100%);
  box-shadow: 0 8px 24px rgba(94, 44, 11, 0.45);
}
.btn--lg {
  min-height: 44px;
  padding: 10px 26px;
  font-size: 15px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 15px;
}
.card h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brown-deep);
}
.card--inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.card--inline > h3 {
  margin: 0;
  flex: 0 0 auto;
  font-size: 15px;
}
.card--inline .select {
  flex: 1 1 auto;
  min-width: 0;
}
.card--inline .select__trigger {
  padding: 6px 10px;
  min-height: 36px;
}
.card--inline .select__labels {
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}

.stat-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.stat-item dt {
  color: var(--ink-soft);
  font-size: 13px;
}
.stat-item dd {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.card-side {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 12px 12px;
}
.side-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line-soft);
}
.side-tabs__btn {
  min-height: 30px;
  padding: 4px 2px 8px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.side-tabs__btn:hover {
  color: var(--brown-deep);
}
.side-tabs__btn.active {
  color: var(--brown-deep);
  border-bottom-color: var(--gold);
}
.side-stack {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.side-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.side-pane[hidden] {
  display: none;
}
.side-pane.is-off {
  visibility: hidden;
  pointer-events: none;
}
.side-pane[data-mry-side-pane="history"]:not([hidden]) {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.move-list-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 4px 0 0;
  pointer-events: none;
}
.move-list-bar .move-list-copy {
  pointer-events: auto;
}
.move-list-copy {
  min-height: 28px;
  padding: 2px 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.card-side .move-list {
  flex: none;
  align-self: start;
  width: 100%;
  min-height: 0;
  max-height: none;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  overflow-anchor: none;
  box-sizing: border-box;
}

.card-history {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card-history__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.card-history__toggle h3 {
  margin: 0;
}
.card-history__meta {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.card-history__chevron {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
}
.card-history__toggle[aria-expanded="true"] .card-history__chevron {
  transform: rotate(180deg);
}
.card-history__toggle + .move-list {
  margin-top: 12px;
}
.move-list {
  margin: 0;
  padding: 0 2px 4px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
.move-list button {
  width: 100%;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-soft);
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.move-list button .mry-move__play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.move-list button .stone-dot {
  width: 12px;
  height: 12px;
  display: block;
  flex: 0 0 auto;
}
.move-list .active button .stone-dot.black {
  box-shadow: 0 0 0 1px rgba(255, 248, 238, 0.4);
}
.move-list .active button .stone-dot.white {
  border-color: rgba(255, 248, 238, 0.7);
}
.move-list button:hover {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--line);
}
.move-list .active button {
  background: linear-gradient(135deg, var(--brown), var(--brown-deep));
  color: #fff8ee;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--brown-glow);
}
:root[data-theme="dark"] .move-list .active button {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: transparent;
  color: #1a1208;
  box-shadow: 0 2px 8px var(--gold-glow);
}
:root[data-theme="dark"] .move-list .active button .stone-dot.black {
  box-shadow: 0 0 0 1px rgba(26, 18, 8, 0.45);
}
:root[data-theme="dark"] .move-list .active button .stone-dot.white {
  border-color: rgba(26, 18, 8, 0.55);
}

/* ===== Ad column (160x600) ===== */
.ad-rail {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: center;
  margin-left: 14px;
}
.ad-slot {
  width: var(--ad-w);
  height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
  backdrop-filter: blur(4px);
  color: var(--ink-soft);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.ad-slot:hover {
  background: var(--surface);
  border-color: var(--gold);
  color: var(--brown-deep);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.ad-slot__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.ad-slot__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brown-deep);
}
.ad-slot__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}
.ad-slot__cta {
  flex-shrink: 0;
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #b05c22, var(--brown-deep));
  color: #fdf3e3;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(94, 44, 11, 0.3);
}

/* ===== Article (rules / tips) ===== */
.article {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 28px;
}
.article section + section {
  margin-top: 30px;
}
.article h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--brown-deep);
}
.article p {
  color: var(--ink-soft);
}
.guide-list {
  padding-left: 22px;
  color: var(--ink-soft);
}
.guide-list li {
  margin: 9px 0;
}
.guide-list strong {
  color: var(--brown-deep);
}
.article-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--brown-deep);
  font-size: 0.92em;
  border: 1px solid var(--line-soft);
}
.article-toc {
  margin: 24px 0 30px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.article-toc strong {
  color: var(--brown-deep);
}
.article-toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px;
  margin: 11px 0 0;
  padding-left: 24px;
}
.article-toc li {
  padding-left: 4px;
}
.article-toc a {
  color: var(--jade-deep);
  text-decoration: none;
}
.article-toc a:hover {
  color: var(--brown);
  text-decoration: underline;
}

.score-table-wrap {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.score-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  text-align: left;
  color: var(--ink-soft);
}
.score-table caption {
  padding: 14px 16px 8px;
  color: var(--brown-deep);
  font-weight: 700;
  text-align: left;
}
.score-table th,
.score-table td {
  padding: 11px 16px;
  border-top: 1px solid var(--line);
}
.score-table thead th {
  color: var(--brown-deep);
  background: var(--surface-2);
}
.score-table tbody th {
  color: var(--brown-deep);
  font-weight: 600;
}

.practice-checklist {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.practice-checklist h3 {
  margin: 0 0 12px;
  color: var(--brown-deep);
  font-family: var(--serif);
  font-size: 21px;
}
.practice-checklist ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--ink-soft);
}
.practice-checklist li + li {
  margin-top: 10px;
}
.practice-checklist a {
  color: var(--jade-deep);
  font-weight: 700;
}
.practice-checklist__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--jade-deep) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--jade) 12%, var(--surface));
  color: var(--jade-deep);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: background 0.16s ease, color 0.16s ease;
}
.practice-checklist__cta:hover {
  background: color-mix(in srgb, var(--jade) 18%, var(--surface));
  color: var(--brown-deep);
}

.tips-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  color: var(--brown-deep);
}
.tips-flow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.tips-flow__step strong {
  font-size: 15px;
  line-height: 1.3;
}
.tips-flow__step span {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}
.tips-flow__step--last {
  background: color-mix(in srgb, var(--jade) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--jade-deep) 28%, var(--line));
}
.tips-flow__step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  color: var(--brown);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.strategy-examples {
  margin: 28px 0 8px;
}
.strategy-examples h3 {
  margin: 0 0 14px;
  color: var(--brown-deep);
  font-family: var(--serif);
  font-size: 21px;
}
.strategy-examples__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.strategy-example {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.strategy-example__turn {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--jade-deep) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--jade) 10%, var(--surface));
  color: var(--jade-deep);
  font-size: 12px;
  font-weight: 700;
}
.strategy-example svg {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
}
.strategy-example h4 {
  margin: 0 0 6px;
  color: var(--brown-deep);
  font-size: 16px;
}
.strategy-example p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}
.strategy-example__board {
  fill: none;
  stroke: var(--brown);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}
.strategy-example__stone {
  stroke-width: 2;
}
.strategy-example__stone--white {
  fill: #f7f2e8;
  stroke: #9f8e77;
}
.strategy-example__stone--black {
  fill: #24201d;
  stroke: #0e0c0b;
}
.strategy-example__target {
  fill: color-mix(in srgb, var(--gold) 18%, transparent);
  stroke: var(--gold);
  stroke-dasharray: 4 3;
  stroke-width: 3;
}
.strategy-example__arrow-symbol {
  fill: var(--jade-deep);
  font-size: 24px;
  font-weight: 800;
}
.strategy-examples__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
}
.strategy-examples__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.strategy-example__key {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.strategy-example__key--white {
  background: #f7f2e8;
  border: 1px solid #9f8e77;
}
.strategy-example__key--black {
  background: #24201d;
  border: 1px solid #0e0c0b;
}
.strategy-example__key--target {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  border: 2px dashed var(--gold);
}
.strategy-example__key--arrow {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--jade-deep);
}

.rules-overview {
  margin: 28px 0;
}
.rules-overview > h2 {
  margin-bottom: 14px;
}
.rules-overview__phases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.rules-overview__phases article {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.rules-overview__phases strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brown-deep);
  font-family: var(--serif);
  font-size: 17px;
}
.rules-overview__phases span {
  display: block;
  min-height: 38px;
  margin-bottom: 8px;
  color: var(--jade-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.rules-overview__phases p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}
.rules-overview__turn {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--jade-deep) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--jade) 8%, var(--surface));
}
.rules-overview__turn h3 {
  margin: 0 0 14px;
  color: var(--brown-deep);
  font-family: var(--serif);
  font-size: 19px;
}
.rules-overview__turn ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rules-turn;
}
.rules-overview__turn li {
  position: relative;
  min-height: 64px;
  padding: 12px 10px 10px 42px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
  counter-increment: rules-turn;
}
.rules-overview__turn li::before {
  content: counter(rules-turn);
  position: absolute;
  top: 12px;
  left: 10px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--brown-deep);
  color: var(--surface);
  font-size: 12px;
  font-weight: 800;
}
.rules-overview__turn li:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -17px;
  transform: translateY(-50%);
  color: var(--brown);
  font-weight: 800;
}
.rules-overview__turn small {
  display: block;
  margin-top: 5px;
  color: var(--jade-deep);
  font-size: 11px;
  line-height: 1.45;
}

.tips-eyes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tips-eyes__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.tips-eyes__label {
  margin: 0;
  color: var(--brown-deep);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.tips-eyes__panel svg {
  display: block;
  width: min(100%, 180px);
  height: auto;
}

.article-figure {
  max-width: 720px;
  margin: 22px auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.article-figure svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--brown-deep);
}
.article-figure figcaption {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}
.article-figure--wide {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}
.article-figure--wide svg {
  width: auto;
  min-width: 100%;
  max-width: none;
}

.article-note {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--jade);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.article-note strong {
  color: var(--brown-deep);
}
.article-note p {
  margin: 7px 0 0;
}

details {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
summary {
  cursor: pointer;
  color: var(--brown-deep);
  font-weight: 700;
}
details p {
  margin: 8px 0 0;
}
.license-notice pre {
  overflow-x: auto;
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
}

/* ===== Custom select (difficulty / options) ===== */
.select {
  position: relative;
  width: 100%;
}
.select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.select__trigger:hover {
  border-color: var(--gold);
}
.select.open .select__trigger {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.select__dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-glow);
}
.select__dot.lv2 {
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.select__dot.lv3 {
  background: var(--vermilion);
  box-shadow: 0 0 0 3px var(--vermilion-glow);
}
.select__dot.lv4 {
  background: #1c1917;
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.22);
}
.select__dot.lv-white {
  background: #fdf8ee;
  border: 1px solid rgba(140, 95, 45, 0.35);
  box-shadow: 0 0 0 3px rgba(140, 95, 45, 0.12);
}
.select__dot.lv-black {
  background: #1c1917;
  box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.22);
}
:root[data-theme="dark"] .select__dot.lv-white {
  background: #f4ece0;
  border-color: rgba(226, 168, 59, 0.45);
}
.select__labels {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.select__title {
  font-size: 14px;
  font-weight: 600;
}
.select__sub {
  font-size: 12px;
  color: var(--ink-soft);
}
.select__chev {
  flex: 0 0 auto;
  color: var(--ink-soft);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.select.open .select__chev {
  transform: rotate(180deg);
}

.select__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.select__menu[hidden] {
  display: none;
}
.select__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease;
}
.select__opt:hover {
  background: var(--surface-2);
}
.select__opt.active {
  background: rgba(189, 135, 36, 0.12);
}
.select__opt .select__title {
  color: var(--ink);
}

/* ===== Online room view ===== */
.online {
  max-width: 860px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 32px 24px;
}
.online__head {
  text-align: center;
  margin-bottom: 26px;
}
.online__head h1 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  color: var(--brown-deep);
}
.online__lead {
  margin: 0;
  max-width: none;
  width: 100%;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}
.online__head h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
  color: var(--ink-soft);
}
.online__head p {
  margin: 0;
  color: var(--ink-soft);
}
.online__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-width: 0;
}
.room-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.room-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.room-card .size-switch {
  justify-content: stretch;
  width: 100%;
}
.room-card .size-switch__btn {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.room-input {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.room-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.online__hint {
  margin: 0;
  min-height: 1.2em;
  font-size: 13px;
  color: var(--gold-deep);
}
.online__hint--warn {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
}
[data-online-type-note].online__hint--warn {
  margin-top: 14px;
}
.online__lobby {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.online__lobby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.online__lobby-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--brown-deep);
}
.room-code {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--brown-deep);
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px dashed var(--line);
  box-shadow: var(--shadow-sm);
}
.online__note {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(43, 106, 76, 0.10);
  border: 1px solid rgba(43, 106, 76, 0.24);
  color: var(--jade-deep);
  font-size: 14px;
}
.state-tabs {
  max-width: 720px;
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-glass);
}
.state-tabs__label {
  flex: 0 0 100%;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 2px;
}
.state-tabs button {
  padding: 5px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}
.state-tabs button.active {
  background: var(--brown);
  color: #fff5e6;
  border-color: var(--brown);
}

.conn {
  max-width: 560px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}
.conn__spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 4px solid rgba(130, 68, 25, 0.18);
  border-top-color: var(--brown);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.conn__ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(43, 106, 76, 0.14);
  color: var(--jade-deep);
}
.conn__ring.warn {
  background: rgba(189, 135, 36, 0.16);
  color: var(--gold-deep);
}
.conn__ring.err {
  background: rgba(190, 57, 39, 0.16);
  color: var(--vermilion);
}
.conn h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--brown-deep);
}
.conn p {
  margin: 0 0 20px;
  color: var(--ink-soft);
}
.conn__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  max-width: 100%;
}
.seg--full {
  display: flex;
  width: 100%;
  min-width: 0;
}
.seg--full .seg__btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}
.seg__btn {
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}
.seg__btn:hover {
  color: var(--ink);
}
.seg__btn.active {
  background: linear-gradient(135deg, #b05c22, var(--brown-deep));
  color: #fdf3e3;
  box-shadow: 0 4px 12px rgba(94, 44, 11, 0.35);
}
.seg__btn.active.jade {
  background: linear-gradient(135deg, var(--jade), var(--jade-deep));
  box-shadow: 0 4px 12px var(--jade-glow);
}
.opt-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.opt-row > span {
  font-size: 13px;
  color: var(--ink-soft);
}
.invite {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 20px;
  text-align: left;
}
.invite__label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.invite-row {
  display: flex;
  gap: 8px;
}
.invite-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.invite-row input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.invite-row .btn {
  flex: 0 0 auto;
}
.copied {
  font-size: 12px;
  color: var(--jade-deep);
  font-weight: 600;
}

/* Site Footer */
.site-footer {
  margin-top: 8px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 32px 32px;
  display: grid;
  grid-template-columns: 1.6fr 1.2fr 1fr;
  gap: 32px;
}
.footer-col h2,
.footer-col h4,
.footer-heading {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--brown-deep);
  letter-spacing: 0.02em;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}
.footer-col a:hover {
  color: var(--brown);
}
.footer-col--brand .brand {
  margin-bottom: 14px;
}
.footer-col--brand .brand__name {
  font-size: 17px;
}
.footer-about {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
  max-width: 34ch;
}

/* Language selector */
.lang {
  position: relative;
  display: inline-block;
}
.lang__trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.lang__trigger:hover {
  border-color: var(--brown);
}
.lang__trigger.open {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px var(--brown-glow);
}
.lang__globe {
  color: var(--brown);
}
.lang__caret {
  color: var(--ink-soft);
  transition: transform 0.18s ease;
}
.lang__trigger.open .lang__caret {
  transform: rotate(180deg);
}
.lang__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  transform-origin: bottom left;
  animation: langPop 0.16s ease;
}
@keyframes langPop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.lang__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}
.lang__opt:hover {
  background: var(--surface-2);
}
.lang__opt.active {
  background: rgba(189, 135, 36, 0.12);
  color: var(--brown-deep);
  font-weight: 600;
}
.lang__check {
  margin-left: auto;
  color: var(--brown);
}
.lang__opt:not(.active) .lang__check {
  visibility: hidden;
}
.site-footer__bar {
  border-top: 1px solid var(--line-soft);
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
@media (max-width: 900px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 36px 24px 28px;
  }
  .footer-col--brand {
    grid-column: 1 / -1;
  }
  .site-footer__bar {
    padding: 16px 24px;
  }
}
@media (max-width: 560px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}

/* Room lobby */
.lobby {
  max-width: 720px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}
.lobby__bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}
.lobby__bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lobby__bar h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--brown-deep);
  min-width: 0;
}
.lobby__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.lobby__filter button {
  padding: 5px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.lobby__filter button.active {
  background: var(--brown);
  color: #fff5e6;
  border-color: var(--brown);
  box-shadow: 0 2px 6px var(--brown-glow);
}
.lobby-block {
  margin-top: 8px;
}
.lobby-block + .lobby-block {
  margin-top: 24px;
}
.lobby-block__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.lobby-block h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--brown-deep);
}
.lobby-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  background: rgba(43, 106, 76, 0.12);
  color: var(--jade-deep);
  border: 1px solid rgba(43, 106, 76, 0.20);
}
.room-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.room-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 16px;
  padding: 13px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.room-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--line);
}
.room-item__ava {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  color: #fdf3e3;
  background: linear-gradient(135deg, var(--jade), var(--jade-deep));
  box-shadow: 0 2px 8px var(--jade-glow);
}
.room-item__body {
  min-width: 0;
}
.room-item__name {
  font-weight: 600;
  color: var(--ink);
}
.room-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.room-item__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-self: end;
  min-width: 88px;
}
.room-item__actions .btn {
  width: 100%;
  white-space: nowrap;
}
.room-item__close {
  font-size: 13px;
}
.room-tag {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-soft);
}
.room-tag.waiting {
  color: var(--gold-deep);
  border-color: rgba(189, 135, 36, 0.35);
  background: rgba(189, 135, 36, 0.12);
}
.lobby__empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-glass);
}
.room-item--mine {
  border-color: rgba(43, 106, 76, 0.35);
  background: linear-gradient(158deg, var(--surface), rgba(43, 106, 76, 0.08));
}
.room-item--busy {
  box-shadow: none;
  background: var(--surface-2);
  opacity: 0.92;
}
.room-item--busy .status-chip {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .room-item {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }
  .room-item__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .room-item__actions .room-item__join { flex: 1 1 auto; }
  .room-item__actions .room-item__close { flex: 0 0 auto; }
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  width: max-content;
  white-space: nowrap;
  box-sizing: border-box;
}
.status-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.status-chip.online {
  background: rgba(43, 106, 76, 0.14);
  color: var(--jade-deep);
}
.status-chip.online .dot {
  background: var(--jade);
  box-shadow: 0 0 0 2px var(--jade-glow);
}
.status-chip.watch {
  background: rgba(99, 78, 61, 0.10);
  color: var(--ink-soft);
}
.status-chip.waiting {
  background: rgba(189, 135, 36, 0.14);
  color: var(--gold-deep);
}
.status-chip.waiting .dot {
  background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}
.status-chip.offline {
  background: rgba(90, 74, 56, 0.12);
  color: var(--ink-soft);
}
.status-chip.offline .dot {
  background: var(--ink-soft);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.players {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 8px 0 22px;
}
.player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  flex: 1 1 120px;
}
.player.you {
  box-shadow: 0 0 0 2px var(--brown-glow);
}
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.avatar.black {
  background: radial-gradient(circle at 35% 32%, #4a4239 0%, #26201a 40%, #110e0b 75%, #000000 100%);
  border-color: rgba(18, 14, 10, 0.95);
  color: #fff;
}
.avatar.white {
  background: radial-gradient(circle at 35% 32%, #ffffff 0%, #fcf7ef 35%, #ede0c8 72%, #b59b72 100%);
  border-color: rgba(140, 95, 45, 0.55);
  color: #2b2118;
}
.avatar.ghost {
  background: var(--surface-2);
  color: var(--ink-soft);
  border-style: dashed;
}
.player__name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.player__meta {
  font-size: 12px;
  color: var(--ink-soft);
}
.vs {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--brown-deep);
  font-weight: 700;
}
.vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  user-select: none;
  touch-action: manipulation;
}
.vs-col:has(.vs-swap:not([hidden])) {
  cursor: pointer;
}
.vs-swap {
  appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(43, 106, 76, 0.12);
  color: var(--jade-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s ease, background 0.16s ease;
}
.vs-swap:hover {
  background: rgba(43, 106, 76, 0.22);
  transform: rotate(180deg);
}
.vs-swap svg {
  width: 20px;
  height: 20px;
}
.vs-swap[hidden] {
  display: none;
}

/* Online in-game panel */
.turn-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--ink);
}
.turn-flag .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.turn-flag .dot.black {
  background: radial-gradient(circle at 35% 32%, #4a4239 0%, #26201a 40%, #110e0b 75%, #000000 100%);
  border: 1px solid rgba(18, 14, 10, 0.95);
}
.turn-flag .dot.white {
  background: radial-gradient(circle at 35% 32%, #ffffff 0%, #fcf7ef 35%, #ede0c8 72%, #b59b72 100%);
  border: 1px solid rgba(140, 95, 45, 0.55);
}

/* ===== Editorial section below the fold ===== */
.below {
  padding: 56px 32px 64px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 240px);
}
.below__inner {
  max-width: 1040px;
  margin: 0 auto;
}
.below__lead {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}
.below__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--brown-deep);
}
.below__intro {
  margin: 0;
  font-size: 16px;
  color: var(--ink-soft);
}
.below__resource-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.below__resource-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brown-deep);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
}
.below__resource-link:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.below__resource-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.beginner-guide {
  max-width: 860px;
  margin: 0 auto 56px;
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.beginner-guide__body h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(21px, 2.6vw, 27px);
  color: var(--brown-deep);
}
.beginner-guide__body p {
  margin: 0 0 10px;
  color: var(--ink-soft);
}
.beginner-guide__link {
  display: inline-block;
  margin-top: 5px;
  color: var(--jade-deep);
  font-weight: 700;
}
.beginner-guide__link:hover {
  color: var(--brown);
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
  margin-bottom: 56px;
}
.feature:last-of-type {
  margin-bottom: 0;
}
.feature.reverse .feature__media {
  order: 2;
}
.feature__media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feature__body h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 700;
  color: var(--brown-deep);
}
.feature__body p {
  margin: 0 0 14px;
  color: var(--ink-soft);
}
.feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feature__tags span {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--brown-deep);
  box-shadow: var(--shadow-sm);
}

.below__stats {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.below__stat {
  margin: 0;
  text-align: center;
  padding: 22px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.below__stat strong {
  display: block;
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  color: var(--jade-deep);
}
.below__stat span {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 400;
}

@media (max-width: 900px) {
  .online { padding: 24px 16px; }
  .online__grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
  .feature.reverse .feature__media { order: 0; }
  .below { padding: 40px 18px 48px; }
  .beginner-guide { padding: 26px; }
  .below__stats { grid-template-columns: repeat(2, 1fr); }
  .jump-path { gap: 32px; }
  .jump-path::before { display: none; }
  .jump-path__item { padding: 0 8px; }
  .table-notes { grid-template-columns: 140px minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .jump-path { grid-template-columns: 1fr; gap: 18px; }
  .jump-path__item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    padding: 0;
    text-align: left;
  }
  .jump-path__step {
    width: 48px;
    height: 48px;
    margin: 0;
    font-size: 15px;
  }
  .jump-path__item h3 { margin-top: 3px; }
  .table-notes {
    display: block;
    margin-top: 38px;
    border: 0;
    background: transparent;
  }
  .table-notes > div {
    display: block;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
  .table-notes > div + div { margin-top: 10px; }
  .table-notes dt,
  .table-notes dd { padding: 0; border: 0; }
  .table-notes dd { margin-top: 5px; font-size: 14px; line-height: 1.65; }
}

/* ===== Overlay & Dialogs ===== */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 14, 5, 0.65);
  backdrop-filter: blur(8px);
  z-index: 50;
}
:root[data-theme="dark"] .overlay {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}
.overlay[hidden] {
  display: none;
}
.overlay__card {
  width: min(100%, 360px);
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  text-align: center;
  animation: overlayPop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes overlayPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
:root[data-theme="dark"] .overlay__card {
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(226, 168, 59, 0.2);
}
.overlay__icon {
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.overlay__icon .stone-dot {
  width: 28px;
  height: 28px;
}
.overlay__icon .stone-dot.white {
  border-color: rgba(43, 33, 24, 0.42);
}
:root[data-theme="dark"] .overlay__icon .stone-dot.white {
  border-color: rgba(240, 231, 214, 0.55);
}
.overlay__title {
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 800;
  color: var(--brown-deep);
}
.overlay__detail {
  margin: 0 0 18px;
  color: var(--ink-soft);
}
.overlay__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.overlay__actions[hidden] {
  display: none;
}
.overlay__actions--stack {
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
}
.overlay__actions--stack .btn {
  width: 100%;
}
.overlay--online-confirm {
  z-index: 60;
}
.btn--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
  box-shadow: none;
}
.btn--quiet:hover {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 1360px) {
  .play {
    --panel-w: 300px;
    grid-template-columns: minmax(0, 1fr) var(--mid);
  }
  .ad-rail {
    display: none;
  }
  .play--collapsed {
    grid-template-columns: minmax(0, 1fr) 0px;
    padding-right: 42px;
  }
}

@media (max-width: 900px) {
  .app {
    flex-direction: column;
    height: 100dvh;
  }
  .sidebar {
    display: block;
    position: relative;
    z-index: 40;
    flex: 0 0 auto;
    width: 100%;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-right: none;
    background-image: none;
    border-bottom: 1px solid rgba(255, 220, 170, 0.14);
  }
  :root[data-theme="dark"] .sidebar {
    background-image: none;
    border-right: none;
    border-bottom: 1px solid rgba(226, 168, 59, 0.12);
  }
  .sidebar__top {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    column-gap: 8px;
  }
  .sidebar__top-spacer {
    display: block;
    width: 42px;
    height: 42px;
  }
  .sidebar .brand,
  .sidebar .brand--chrome {
    grid-column: 2;
    justify-self: center;
    flex: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border-bottom: none;
  }
  .sidebar .brand .brand__mark {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 9px;
    flex: 0 0 auto;
  }
  .sidebar .brand__name {
    font-size: 17px;
    letter-spacing: 0.06em;
    line-height: 1.1;
    white-space: nowrap;
  }
  .menu-toggle {
    display: inline-flex;
    grid-column: 3;
    justify-self: end;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 5px;
  }
  .menu-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sidebar.is-open .menu-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .sidebar.is-open .menu-toggle__bar:nth-child(2) { opacity: 0; }
  .sidebar.is-open .menu-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .sidebar__panel {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1;
    width: auto;
    flex: none;
    padding: 8px 14px 14px;
    background: linear-gradient(172deg, #5c2c0c 0%, #462007 48%, #2f1403 100%);
    border-top: 1px solid rgba(255, 244, 224, 0.12);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.32);
    max-height: min(72dvh, calc(100dvh - 72px));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px) scale(0.985);
    transform-origin: top center;
    pointer-events: none;
    transition:
      opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.28s;
  }
  :root[data-theme="dark"] .sidebar__panel {
    background: linear-gradient(172deg, #2a1608 0%, #1e0e04 48%, #120802 100%);
  }
  .sidebar.is-open .sidebar__panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .nav { flex: 0 0 auto; }
  .sidebar__foot { display: flex; }

  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(28, 14, 4, 0.46);
    touch-action: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.28s;
  }
  .nav-scrim.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .content { flex: 1 1 auto; }
  .play {
    grid-template-columns: 1fr;
    height: auto;
    padding: 14px;
    gap: 12px;
  }
  .board {
    width: 100%;
    max-width: 100%;
    height: auto;
    container-type: normal;
    --sq: min(100%, calc(100vw - 28px), calc(100dvh - 220px));
  }
  .play--scoring:not(.play--spectating) .board {
    --sq: min(100%, calc(100vw - 28px), calc(100dvh - 268px));
  }
  .play--spectating [data-mry-spectate-leave="head"] {
    display: inline-flex;
  }
  .play-head {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: var(--sq);
    text-align: center;
  }
  .play-title {
    width: 100%;
    text-align: center;
  }
  .play-head__meta {
    justify-content: center;
    width: 100%;
  }
  .head-live {
    justify-content: center;
  }
  .board__stage {
    width: var(--sq);
    height: var(--sq);
  }
  .board__frame {
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 8px;
    border-radius: 10px;
  }
  .infobar { max-width: var(--sq); }
  .panel-toggle { display: none; }
  .play.play--ready,
  .play.play--ready .panel {
    transition: none;
  }
  .play--collapsed {
    grid-template-columns: 1fr;
    padding-right: 14px;
  }
  .panel {
    height: auto;
    overflow: visible;
    margin-left: 0;
  }
  .card-history {
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  .move-list { max-height: none; }
  .play--collapsed .panel {
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
  }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .brand__name { font-size: 17px; }
}

.turn {
  background: linear-gradient(135deg, var(--brown), var(--brown-deep));
  color: #fff9ef;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(73, 37, 10, 0.24);
}

:root[data-theme="dark"] .board__bar select,
:root[data-theme="dark"] .room-input,
:root[data-theme="dark"] .invite-row input {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}
:root[data-theme="dark"] .select__trigger {
  background: linear-gradient(150deg, #32251a, #261b12);
  color: var(--ink);
  border-color: rgba(235, 206, 165, 0.28);
}
:root[data-theme="dark"] input::placeholder {
  color: #c9b99f;
  opacity: 1;
}
:root[data-theme="dark"] .ad-slot,
:root[data-theme="dark"] .state-tabs {
  background: rgba(42, 30, 20, 0.72);
}
:root[data-theme="dark"] .move-list button:hover {
  background: #382c20;
}

:root[data-theme="dark"] .content::-webkit-scrollbar,
:root[data-theme="dark"] .panel::-webkit-scrollbar,
:root[data-theme="dark"] .move-list::-webkit-scrollbar,
:root[data-theme="dark"] .article-figure--wide::-webkit-scrollbar,
:root[data-theme="dark"] .sidebar__panel::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
:root[data-theme="dark"] .content::-webkit-scrollbar-track,
:root[data-theme="dark"] .panel::-webkit-scrollbar-track,
:root[data-theme="dark"] .move-list::-webkit-scrollbar-track,
:root[data-theme="dark"] .article-figure--wide::-webkit-scrollbar-track,
:root[data-theme="dark"] .sidebar__panel::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}
:root[data-theme="dark"] .content::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .panel::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .move-list::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .article-figure--wide::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .sidebar__panel::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
:root[data-theme="dark"] .content::-webkit-scrollbar-thumb:hover,
:root[data-theme="dark"] .panel::-webkit-scrollbar-thumb:hover,
:root[data-theme="dark"] .move-list::-webkit-scrollbar-thumb:hover,
:root[data-theme="dark"] .article-figure--wide::-webkit-scrollbar-thumb:hover,
:root[data-theme="dark"] .sidebar__panel::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 137, 68, 0.72);
  background-clip: padding-box;
}
:root[data-theme="dark"] .content::-webkit-scrollbar-corner,
:root[data-theme="dark"] .panel::-webkit-scrollbar-corner,
:root[data-theme="dark"] .move-list::-webkit-scrollbar-corner,
:root[data-theme="dark"] .article-figure--wide::-webkit-scrollbar-corner,
:root[data-theme="dark"] .sidebar__panel::-webkit-scrollbar-corner {
  background: transparent;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: 13px;
}
.breadcrumb a {
  color: var(--jade-deep);
  font-weight: 700;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.breadcrumb span[aria-current="page"] {
  color: var(--ink-soft);
}
.article__head {
  max-width: none;
  margin-bottom: 34px;
  padding: 0 0 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.article__head h1,
.article > h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.3vw, 34px);
  font-weight: 700;
  line-height: 1.18;
  color: var(--brown-deep);
}
.notfound-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}
.article__head > p:last-child {
  margin: 10px 0 0;
  color: var(--ink-soft);
}
:root[data-theme="dark"] .article__head {
  background: transparent;
  box-shadow: none;
}

@media (max-width: 560px) {
  .article { padding: 24px 18px 36px; }
  .breadcrumb { margin-bottom: 18px; }
  .article__head { margin-bottom: 28px; padding: 0 0 20px; }
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb ol li + li::before {
  content: "/";
  margin-right: 9px;
  color: var(--ink-soft);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 36px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 28px 48px;
}
.article-layout .article {
  max-width: none;
  padding: 0;
}
.article-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.article-side section {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.article-side h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--brown-deep);
}
.article-side ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
}
.article-side li {
  margin: 6px 0;
}
.article-side p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 13px;
}
.article-footer {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 14px;
}
.author-bio {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.author-bio img {
  border-radius: 12px;
}
.author-bio strong {
  display: block;
  color: var(--brown-deep);
}
.author-bio span {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
}
.author-bio p {
  margin: 6px 0 0;
  font-size: 14px;
}

.article-layout--solo {
  grid-template-columns: minmax(0, 1fr);
  max-width: 900px;
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
    padding: 24px 18px 40px;
  }
  .article-figure { margin-inline: 0; padding: 10px; }
  .article-toc ol { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .article-layout { padding: 18px 14px 32px; }
  .article section + section { margin-top: 26px; }
  .article h2 { font-size: clamp(20px, 5.5vw, 26px); line-height: 1.28; }
  .article p,
  .guide-list,
  .article-note p { font-size: 15px; line-height: 1.7; }
  .article .intro { font-size: 16px; line-height: 1.75; }
  .guide-list { padding-left: 18px; }
  .article-toc {
    margin: 20px 0 24px;
    padding: 14px 14px 16px;
  }
  .article-toc ol {
    gap: 8px;
    padding-left: 18px;
  }
  .article-toc a {
    display: inline-block;
    padding: 2px 0;
    line-height: 1.45;
  }
  .article-figure { padding: 10px 8px; }
  .article-figure--wide svg { min-width: 520px; }
  .article-note {
    margin: 18px 0;
    padding: 14px;
    border-left-width: 3px;
  }
  .practice-checklist {
    margin: 18px 0;
    padding: 16px 14px;
  }
  .practice-checklist h3 { font-size: 19px; }
  .practice-checklist ol {
    padding-left: 18px;
    font-size: 15px;
    line-height: 1.65;
  }
  .practice-checklist__cta {
    min-height: 48px;
    font-size: 15px;
  }
  .tips-flow {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tips-flow__step {
    min-height: 0;
    padding: 14px 12px;
    text-align: left;
  }
  .tips-flow__step:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }
  .strategy-examples__grid {
    grid-template-columns: 1fr;
  }
  .strategy-example {
    padding: 12px;
  }
  .strategy-example svg {
    max-height: 112px;
  }
  .rules-overview__phases,
  .rules-overview__turn ol {
    grid-template-columns: 1fr;
  }
  .rules-overview__phases span {
    min-height: 0;
  }
  .rules-overview__turn {
    padding: 15px 13px;
  }
  .rules-overview__turn ol {
    gap: 12px;
  }
  .rules-overview__turn li {
    min-height: 0;
  }
  .rules-overview__turn li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }
  .tips-eyes {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .tips-eyes__panel svg {
    width: min(100%, 220px);
  }
  .score-table-wrap {
    overflow-x: visible;
    margin: 18px 0;
  }
  .score-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }
  .score-table caption {
    padding: 12px 14px 10px;
    font-size: 15px;
  }
  .score-table thead { display: none; }
  .score-table tbody tr {
    display: block;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
  }
  .score-table tbody th {
    display: block;
    padding: 10px 14px;
    border-top: 0;
    background: var(--surface-2);
    font-size: 14px;
  }
  .score-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-top: 1px solid var(--line-soft);
    font-size: 14px;
  }
  .score-table tbody td::before {
    color: var(--brown-deep);
    font-weight: 600;
    white-space: nowrap;
  }
  .score-table tbody td:nth-child(2)::before { content: "黑棋"; }
  .score-table tbody td:nth-child(3)::before { content: "白棋"; }
  details {
    padding: 14px;
  }
  summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    line-height: 1.45;
    padding-right: 8px;
  }
  .article-tags {
    gap: 10px;
    font-size: 13px;
  }
  .article-tags a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
  }
  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 14px;
  }
  .author-bio p { font-size: 13px; line-height: 1.65; }
  .article-footer { margin-top: 28px; padding-top: 18px; }
}

@media (max-width: 560px) {
  .article { padding: 24px 18px 36px; }
  .breadcrumb { margin-bottom: 18px; }
  .article__head {
    margin-bottom: 24px;
    padding: 0 0 18px;
  }
  .article__head h1,
  .article > h1 {
    font-size: clamp(26px, 7vw, 34px);
  }
}

/* PWA install guide (iOS Share → Add to Home Screen) */
.mry-pwa-guide {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.mry-pwa-guide[hidden] { display: none !important; }
.mry-pwa-guide__backdrop {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: rgba(20, 10, 4, 0.5);
  cursor: pointer;
}
.mry-pwa-guide__card {
  position: relative;
  z-index: 1;
  width: min(20.5rem, calc(100vw - 1.5rem));
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(50, 25, 8, 0.28);
}
.mry-pwa-guide__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 16px 12px;
  background: linear-gradient(165deg, #faecd4 0%, var(--surface) 60%);
  border-bottom: 1px solid var(--line-soft);
}
:root[data-theme="dark"] .mry-pwa-guide__head {
  background: linear-gradient(165deg, #362516 0%, var(--surface) 60%);
}
.mry-pwa-guide__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(60, 30, 10, 0.14);
}
.mry-pwa-guide__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.mry-pwa-guide__host {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.3;
}
.mry-pwa-guide__kicker {
  margin: 12px 16px 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brown);
}
.mry-pwa-guide__kicker[hidden],
.mry-pwa-guide__steps[hidden] { display: none !important; }
.mry-pwa-guide__steps {
  list-style: none;
  margin: 10px 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mry-pwa-guide__steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink);
}
.mry-pwa-guide__n {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--brown);
  margin-top: 1px;
}
.mry-pwa-guide__share {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 2px;
  vertical-align: -2px;
  color: var(--brown);
}
.mry-pwa-guide__actions {
  display: flex;
  gap: 8px;
  padding: 14px 16px 16px;
}
.mry-pwa-guide__primary,
.mry-pwa-guide__ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 5.75rem;
  min-height: 42px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mry-pwa-guide__primary {
  border: none;
  background: var(--brown);
  color: #fff;
  padding: 0 14px;
}
.mry-pwa-guide__primary:hover { filter: brightness(1.08); }
.mry-pwa-guide__ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 0 12px;
}
.mry-pwa-guide__ghost:hover {
  border-color: var(--brown);
  color: var(--brown-deep);
}

