/* Display serif: self-hosted Latin only. CJK headings fall back to the reader's
   system serif so Chinese pages never download a webfont.
   Body stays on the system sans stack. */
@font-face {
  font-family: "GMY Serif";
  src: url("/brand/gomoku/fonts/noto-serif-sc-latin-700.woff2?v=34") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  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: "GMY Serif";
  src: url("/brand/gomoku/fonts/noto-serif-sc-latin-900.woff2?v=34") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  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;
}

/* ==========================================================================
   Gomoku Visual Design System (五子棋 视觉系统)
   Theme: Kaya Wood, Kuroki Slate Black, Hyuga Clam Pearl, Imperial Gold & Pine Jade
   ========================================================================== */

:root {
  /* Surface & Background */
  --linen: #f5eedf;
  --linen-2: #ebe0cb;
  --surface: #fdfbf7;
  --surface-2: #f4ecdc;
  --surface-3: #eae0cc;
  --surface-elevated: #ffffff;

  /* Material Wood & Warmth */
  --wood: #dfaf70;
  --wood-deep: #c49458;
  --wood-border: #ba884c;

  /* Ink & Mineral Typography */
  --ink: #221912;
  --ink-soft: #634f3e;
  --ink-muted: #8e7865;

  /* Accent & Status Colors */
  --brown: #8f4d1e;
  --brown-deep: #5e2f0e;
  --jade: #2d6a4f;
  --jade-deep: #1e523c;
  --gold: #c8861e;
  --gold-deep: #9e640e;
  --vermilion: #c8382b;
  --crimson: #a82318;

  /* Lines & Borders */
  --line: rgba(100, 65, 30, 0.16);
  --line-soft: rgba(100, 65, 30, 0.08);
  --line-strong: rgba(100, 65, 30, 0.28);

  /* Geometry & Elevation */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Layered Physical Shadows */
  --shadow-sm: 0 2px 6px rgba(60, 30, 10, 0.04), 0 1px 2px rgba(60, 30, 10, 0.03);
  --shadow: 0 10px 28px -4px rgba(70, 35, 12, 0.10), 0 2px 8px rgba(70, 35, 12, 0.04);
  --shadow-lg: 0 18px 44px -8px rgba(60, 25, 8, 0.16), 0 4px 14px rgba(60, 25, 8, 0.05);
  --shadow-wood: 0 14px 36px -6px rgba(45, 18, 5, 0.24), 0 2px 10px rgba(0, 0, 0, 0.06);

  /* Scrollbars */
  --scroll-thumb: rgba(143, 77, 30, 0.32);
  --scroll-track: transparent;

  /* Typography Stacks */
  --serif: "GMY Serif", "Songti SC", "Songti TC", "STSong", "Source Han Serif SC",
    "Noto Serif CJK SC", "SimSun", "宋体", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  /* Dimensions */
  --sidebar-w: 200px;
  --ad-w: 160px;

  color-scheme: light;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

:root[data-theme="dark"] {
  /* Dark Mode: Smoked Cypress & Zen Lacquer */
  --linen: #16120e;
  --linen-2: #1e1812;
  --surface: #231a12;
  --surface-2: #2c2117;
  --surface-3: #37291d;
  --surface-elevated: #2f2319;

  --wood: #caa065;
  --wood-deep: #a87438;
  --wood-border: #8c5d28;

  --ink: #f6efe4;
  --ink-soft: #c2b19b;
  --ink-muted: #94826d;

  --brown: #df9452;
  --brown-deep: #f5b878;
  --jade: #4ade80;
  --jade-deep: #6ee7b7;
  --gold: #e5a947;
  --gold-deep: #f5c46b;
  --vermilion: #f87171;
  --crimson: #ef4444;

  --line: rgba(235, 205, 160, 0.14);
  --line-soft: rgba(235, 205, 160, 0.07);
  --line-strong: rgba(235, 205, 160, 0.25);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.6);
  --shadow-wood: 0 16px 44px rgba(0, 0, 0, 0.65);

  --scroll-thumb: rgba(223, 148, 82, 0.42);
  --scroll-track: rgba(16, 11, 7, 0.45);

  color-scheme: dark;
}

html {
  height: 100%;
  background-color: #5c3519;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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: 15px/1.6 var(--sans);
  background-color: #5c3519;
  transition: color 0.25s, background-color 0.25s;
}

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

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.15s ease;
}

a:hover {
  color: var(--gold);
}

/* ==========================================================================
   App Shell & Layout Architecture
   ========================================================================== */

.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: #fdf6e8;
  background-color: #5c3519;
  background-image: linear-gradient(172deg, #6b340e 0%, #542807 55%, #3e1b02 100%);
  border-right: 1px solid rgba(255, 235, 205, 0.14);
  box-shadow: 4px 0 24px rgba(45, 20, 5, 0.25);
  position: relative;
  z-index: 20;
}

:root[data-theme="dark"] .sidebar {
  background-color: #24180e;
  background-image: linear-gradient(172deg, #2b1a0d 0%, #1f1207 55%, #140a03 100%);
  border-right: 1px solid rgba(235, 205, 160, 0.08);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.45);
}

.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: 12px;
  border-bottom: 1px solid rgba(255, 240, 215, 0.12);
}

.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.38));
}

.sidebar .brand,
.sidebar .brand:hover {
  color: #fff9f0;
  text-decoration: none;
}

.sidebar .brand__name {
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fff9f0;
  font-size: 20px;
  line-height: 24px;
  height: 24px;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.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.3));
}

.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.68);
}

.brand__text p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.sidebar .brand__text p {
  color: rgba(255, 248, 232, 0.65);
}

.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, 240, 220, 0.74);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.nav__item:hover {
  background: rgba(255, 240, 220, 0.10);
  color: #fff8ee;
  border-color: rgba(255, 240, 220, 0.08);
}

.nav__item:active {
  transform: scale(0.985);
}

.nav__item.active {
  background: linear-gradient(135deg, rgba(245, 180, 80, 0.26), rgba(245, 180, 80, 0.10));
  color: #fffbf2;
  border-color: rgba(245, 180, 80, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.15);
  font-weight: 600;
}

.nav__item svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  opacity: 0.9;
}

.nav__item.active svg {
  opacity: 1;
  color: #ffdda6;
}

.nav__group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 240, 220, 0.14);
}

.nav__group-label {
  margin: 0 14px 1px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255, 240, 220, 0.42);
}

.nav__group .nav__item {
  background: rgba(255, 240, 220, 0.07);
  border-color: rgba(255, 240, 220, 0.1);
}

.nav__group .nav__item:hover {
  background: rgba(255, 240, 220, 0.12);
  color: #fff8ee;
  border-color: rgba(255, 240, 220, 0.16);
}

.nav__group .nav__item.active {
  background: linear-gradient(135deg, rgba(245, 180, 80, 0.26), rgba(245, 180, 80, 0.1));
  border-color: rgba(245, 180, 80, 0.35);
}

html[lang="en"] .nav__item {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", var(--sans);
  font-weight: 600;
  color: rgba(255, 240, 220, 0.84);
}

.sidebar__foot {
  padding: 14px 6px 0;
  border-top: 1px solid rgba(255, 240, 220, 0.14);
  font-size: 12px;
  color: rgba(255, 240, 220, 0.6);
  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.18);
  border-radius: 12px;
  background: rgba(255, 240, 220, 0.08);
  color: rgba(255, 244, 228, 0.92);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, opacity 0.16s;
}

.icon-btn:hover {
  background: rgba(255, 240, 220, 0.18);
  border-color: rgba(255, 240, 220, 0.35);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.icon-btn:active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.icon-btn svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.gmy-icon-sun {
  display: none;
}

:root[data-theme="dark"] .gmy-icon-sun {
  display: block;
}

:root[data-theme="dark"] .gmy-icon-moon {
  display: none;
}

.icon-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.sidebar__panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.menu-toggle,
.nav-scrim {
  display: none;
}

/* ==========================================================================
   Content Area & Canvas Backdrop
   ========================================================================== */

.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, 245, 230, 0.5) 0%, transparent 60%),
    linear-gradient(165deg, #f9f5ec 0%, var(--linen) 55%, #e9dec8 100%);
}

:root[data-theme="dark"] .content {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(55, 38, 24, 0.45) 0%, transparent 60%),
    linear-gradient(165deg, #1d1610 0%, var(--linen) 55%, #140e09 100%);
}

.content-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}

/* ==========================================================================
   Play Layout: 3 Columns (Board | Info | Ad Rail)
   ========================================================================== */

.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 & Stage
   ========================================================================== */

.board {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  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-goy-spectate-leave] {
  display: none;
}

.play--spectating [data-goy-spectate-leave="panel"] {
  display: block;
  width: 100%;
}

.play-head [data-goy-spectate-leave="head"] {
  flex: 0 0 auto;
  white-space: nowrap;
}

.board__stage {
  position: relative;
  flex: 0 0 auto;
  width: var(--sq);
  height: var(--sq);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.board__frame {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: #ebb878;
  box-shadow: none;
}

:root[data-theme="dark"] .board__frame {
  background: #ebb878;
  box-shadow: none;
}

.gmy-board-host,
canvas[data-gmy-canvas],
.board__frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Panel Collapse/Expand Tab */
.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(60, 30, 10, 0.08);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.panel-toggle:hover {
  background: var(--surface-2);
  color: var(--gold-deep);
  box-shadow: 4px 0 14px rgba(60, 30, 10, 0.12);
}

.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);
}

/* Play Header row */
.play-head {
  flex: 0 0 auto;
  width: var(--sq);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.play-head__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.play-title {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brown-deep);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live Status Badges (Turn & Stones)
   Width is reserved for the longest locale string so a win / turn swap
   does not shove the neighbouring capsule left or right. */
.head-live {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.head-live__turn,
.head-live__cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.head-live__turn {
  color: var(--ink);
}

.head-live__turn [data-gmy-turn-text] {
  display: inline-block;
  min-width: 15ch;
  white-space: nowrap;
}

.head-live__cap {
  color: var(--ink-soft);
}

.head-live__cap b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 3ch;
  text-align: center;
}

.head-live__sep {
  color: var(--line-strong);
  margin: 0 1px;
}

/* Realistic 3D Stone Indicators */
.stone-dot {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  position: relative;
}

.stone-dot.black {
  background: radial-gradient(circle at 35% 25%, #5a6068 0%, #202227 42%, #08080a 100%);
  box-shadow:
    inset -1px -1px 3px rgba(255, 255, 255, 0.20),
    inset 1px 1px 2px rgba(255, 255, 255, 0.15),
    1px 3px 6px rgba(15, 8, 3, 0.45);
}

.stone-dot.white {
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #fbf7ee 38%, #e0d4c2 100%);
  border: 1px solid rgba(160, 130, 95, 0.35);
  box-shadow:
    inset -1px -1px 3px rgba(0, 0, 0, 0.12),
    inset 1px 1px 2px rgba(255, 255, 255, 0.8),
    1px 3px 6px rgba(40, 20, 8, 0.25);
}

.mode-pill {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--jade), var(--jade-deep));
  color: #f4fbf6;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(30, 82, 60, 0.25);
}

:root[data-theme="dark"] .mode-pill {
  background: linear-gradient(135deg, #1f6b48, #145338);
  color: #f4fbf6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.btn-sound {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.16s, color 0.16s, border-color 0.16s, opacity 0.16s;
}

.btn-sound svg {
  width: 17px;
  height: 17px;
}

.btn-sound:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-sound[aria-pressed="false"] {
  opacity: 0.55;
}

/* Floating board status toast */
.board__status {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 3;
  margin: 0;
  max-width: calc(100% - 28px);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  transform: translateX(-50%);
  background: rgba(45, 22, 8, 0.90);
  backdrop-filter: blur(8px);
  color: #fff9f0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(25, 10, 2, 0.35);
  border: 1px solid rgba(255, 230, 180, 0.2);
}

.board__status[hidden] {
  display: none;
}

/* ==========================================================================
   Action Toolbar (操作工具栏)
   ========================================================================== */

.toolbar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.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: 90px;
  padding-inline: 12px;
  white-space: nowrap;
}

.toolbar--board .btn[aria-busy="true"],
.toolbar--board .btn.is-replaying {
  cursor: wait;
  opacity: 0.9;
  animation: gmy-pulse-glow 1.2s ease-in-out infinite;
}

@keyframes gmy-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(200, 134, 30, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(200, 134, 30, 0.2);
  }
}

.btn {
  min-height: 38px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.85;
}

.btn:hover {
  background: var(--surface-elevated);
  border-color: var(--line-strong);
  color: var(--brown-deep);
  box-shadow: var(--shadow);
}

.btn:active {
  box-shadow: 0 1px 2px rgba(60, 30, 10, 0.08);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #a8581e 0%, var(--brown-deep) 100%);
  color: #fff9f0;
  box-shadow: 0 4px 14px rgba(94, 47, 14, 0.28);
}

.btn--primary svg {
  opacity: 1;
}

.btn--primary:hover {
  background: linear-gradient(135deg, #b86626 0%, #703710 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(94, 47, 14, 0.38);
}

.btn--primary:active {
  box-shadow: 0 2px 6px rgba(94, 47, 14, 0.25);
}

.btn--lg {
  min-height: 44px;
  padding: 10px 26px;
  font-size: 15px;
}

.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;
}

/* ==========================================================================
   Info Column (信息面板与控制卡片)
   ========================================================================== */

.panel {
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 0;
  align-self: stretch;
  margin-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  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;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brown-deep);
}

/* Status Card */
.status-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
}

.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: 4px 11px;
  font-size: 12.5px;
  line-height: 1.25;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.status-card__top .btn-sound {
  margin-left: auto;
  flex: 0 0 auto;
}

.status-card__hint {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
  min-height: calc(20px + 3em);
}

.panel-leave {
  width: 100%;
  margin-top: 4px;
}

/* Custom Select Dropdowns */
.select {
  position: relative;
  width: 100%;
}

.select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface) 100%);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.select__trigger:hover {
  border-color: var(--brown);
  background: var(--surface-elevated);
}

.select.open .select__trigger {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(143, 77, 30, 0.16);
}

.select__dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.18);
}

.select__dot.lv2 {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 134, 30, 0.18);
}

.select__dot.lv3 {
  background: var(--brown);
  box-shadow: 0 0 0 3px rgba(143, 77, 30, 0.18);
}

.select__dot.lv4 {
  background: #111113;
  box-shadow: 0 0 0 3px rgba(20, 20, 25, 0.22);
}

.select__dot.lv-black {
  background: #111113;
  box-shadow: 0 0 0 3px rgba(20, 20, 25, 0.20);
}

.select__dot.lv-white {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(120, 80, 40, 0.18);
  border: 1px solid var(--line);
}

.select__labels {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.select__title {
  font-size: 13.5px;
  font-weight: 600;
}

.select__sub {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.select__chev {
  flex: 0 0 auto;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
}

.select.open .select__chev {
  transform: rotate(180deg);
}

.select__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 3px;
  backdrop-filter: blur(12px);
}

.select__menu[hidden] {
  display: none;
}

.select__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}

.select__opt:hover {
  background: var(--surface-2);
}

.select__opt.active {
  background: linear-gradient(135deg, rgba(200, 134, 30, 0.16), rgba(200, 134, 30, 0.06));
  font-weight: 600;
}

/* Side Card Tabs & Stats */
.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: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, border-bottom-color 0.16s ease;
}

.side-tabs__btn:hover {
  color: var(--brown-deep);
}

.side-tabs__btn.active {
  color: var(--brown-deep);
  border-bottom-color: var(--brown-deep);
}

.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 !important;
}

.side-pane.is-off {
  display: none !important;
}

.side-pane[data-gmy-side-pane="history"]:not([hidden]) {
  position: relative;
  inset: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  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: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}

.stat-item dt {
  color: var(--ink-soft);
  font-size: 12px;
}

.stat-item dd {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Move List (棋谱走法) */
.move-list-bar {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 2px 0 0;
  background: var(--surface);
}

.move-list-copy {
  min-height: 28px;
  padding: 2px 14px;
  font-size: 12px;
  font-weight: 600;
}

.move-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 4px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  scroll-snap-type: y proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.card-side .move-list {
  flex: none;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
}

.move-list {
  margin: 0;
  padding: 0 2px 4px 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: stretch;
  gap: 6px;
  list-style: none;
  overflow: visible;
}

.move-list > li {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: auto;
  overflow: visible;
  scroll-snap-align: start;
}

.move-list > li:nth-child(even) {
  scroll-snap-align: none;
}

.move-list button {
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-soft);
  text-align: left;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.move-list button .gmy-move__play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.move-list button .gmy-move__san {
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-list button:hover {
  background: color-mix(in srgb, var(--gold) 15%, var(--surface-2));
  color: var(--ink);
}

.move-list button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.move-list .active button {
  background: var(--brown);
  color: #ffffff;
  border-color: var(--brown);
  font-weight: 700;
  box-shadow: none;
}

.move-list .active button .gmy-move__san {
  color: #ffffff;
}

.move-list .stone-dot {
  width: 12px;
  height: 12px;
}

:root[data-theme="dark"] .move-list button:hover {
  background: var(--surface);
}

:root[data-theme="dark"] .move-list .active button {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c130b;
}

:root[data-theme="dark"] .move-list .active button .gmy-move__san {
  color: #1c130b;
}

/* ==========================================================================
   Ad Rail (160x600)
   ========================================================================== */

.ad-rail {
  position: sticky;
  top: 0;
  align-self: start;
  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: rgba(255, 255, 255, 0.45);
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.ad-slot:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--brown);
  color: var(--brown-deep);
  box-shadow: var(--shadow);
}

.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: 7px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #a8581e, var(--brown-deep));
  color: #fff9f0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(94, 47, 14, 0.22);
}

:root[data-theme="dark"] .ad-slot {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .ad-slot:hover {
  background: var(--surface-3);
  border-color: var(--gold);
  color: var(--ink);
}

:root[data-theme="dark"] .ad-slot__title {
  color: var(--gold-deep);
}

:root[data-theme="dark"] .ad-slot__desc {
  color: var(--ink);
}

:root[data-theme="dark"] .ad-slot__cta {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #1c130b;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Online Game Room & Matchmaking (在线对局与房间)
   ========================================================================== */

.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;
  align-items: stretch;
  gap: 20px;
  min-width: 0;
}

.online .card {
  background: linear-gradient(158deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: 15px;
}

.room-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  height: 100%;
}

.room-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.room-card > .btn {
  margin-top: auto;
}

.room-input {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.02em;
  text-align: center;
  outline: none;
}

.room-input:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(143, 77, 30, 0.16);
}

.online__hint {
  margin: 0;
  min-height: 1.2em;
  font-size: 13px;
  color: var(--gold);
}

.online__hint--warn {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--ink);
}

[data-online-type-note].online__hint--warn {
  margin-top: 14px;
}

.online__note {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.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);
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  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: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
  white-space: nowrap;
}

.seg__btn:hover {
  color: var(--ink);
}

.seg__btn.active {
  background: linear-gradient(135deg, #9e5522, #78380e);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(100, 50, 15, 0.22);
}

.opt-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.opt-row > span {
  font-size: 13px;
  color: var(--ink-soft);
}

.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(143, 77, 30, 0.18);
  border-top-color: var(--brown);
  animation: gmy-spin 0.9s linear infinite;
}

@keyframes gmy-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(143, 77, 30, 0.12);
  color: var(--brown);
}

.conn__ring.warn {
  background: rgba(200, 134, 30, 0.14);
  color: var(--gold);
}

.conn__ring.err {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.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;
}

.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);
}

.invite-row .btn {
  flex: 0 0 auto;
}

.copied {
  font-size: 12px;
  color: var(--jade-deep);
}

.lobby {
  max-width: 760px;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.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: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(143, 77, 30, 0.10);
  color: var(--brown-deep);
  border: 1px solid rgba(143, 77, 30, 0.18);
}

.lobby__empty {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}

.lobby__empty-icon {
  color: var(--brown-deep);
  opacity: 0.75;
}

/* VS Players presentation */
.players {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 6px 0 16px;
}

.player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  min-width: 0;
  flex: 1 1 110px;
  text-align: center;
}

.player.you {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-color: rgba(143, 77, 30, 0.35);
  box-shadow: 0 0 0 2px rgba(143, 77, 30, 0.18);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 2px solid var(--line);
}

.avatar.black {
  background: radial-gradient(circle at 35% 25%, #5a6068 0%, #202227 42%, #08080a 100%);
  color: #fff;
  box-shadow:
    inset -1px -1px 3px rgba(255, 255, 255, 0.2),
    inset 1px 1px 2px rgba(255, 255, 255, 0.15),
    0 4px 10px rgba(15, 8, 3, 0.4);
}

.avatar.white {
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #fbf7ee 38%, #e0d4c2 100%);
  color: #221912;
  border-color: rgba(160, 130, 95, 0.4);
  box-shadow:
    inset -1px -1px 3px rgba(0, 0, 0, 0.12),
    inset 1px 1px 2px rgba(255, 255, 255, 0.8),
    0 4px 10px rgba(40, 20, 8, 0.22);
}

.player__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.player__meta {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.vs {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--brown-deep);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 38px;
  user-select: none;
}

.vs-swap {
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(143, 77, 30, 0.12);
  color: var(--brown-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.vs-swap:hover {
  background: rgba(143, 77, 30, 0.22);
  color: var(--gold-deep);
  transform: rotate(180deg);
}

.vs-swap svg {
  width: 18px;
  height: 18px;
}

.vs-swap[hidden] {
  display: none;
}

/* Room Items */
.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);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.room-item:hover {
  border-color: rgba(143, 77, 30, 0.32);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.room-item--mine {
  border-color: rgba(200, 134, 30, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(200, 134, 30, 0.06) 100%);
  box-shadow: 0 2px 10px rgba(200, 134, 30, 0.08);
}

.room-item__ava {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-family: var(--serif);
  font-weight: 700;
  user-select: none;
}

.room-item__ava--black {
  color: #f4efe6;
  background: radial-gradient(circle at 32% 28%, #5a5a5a, #1a1a1a 62%);
  border: 2px solid #111;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px rgba(60, 30, 10, 0.18);
}

.room-item__ava--white {
  color: #3a2a18;
  background: radial-gradient(circle at 32% 28%, #fffaf2, #d9d0c4 70%);
  border: 2px solid #c9b89a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 6px rgba(60, 30, 10, 0.12);
}

.room-item__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.room-item__name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
}

.room-item__title {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}

.room-item__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brown-deep);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}

.room-item__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.room-item__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.room-item__actions .btn {
  white-space: nowrap;
}

.room-item__join {
  min-height: 34px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
}

.room-item__close {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--ink-soft);
  border-radius: 999px;
}

.room-item__close:hover {
  color: #b93829;
  background: rgba(185, 56, 41, 0.08);
}

.room-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.room-tag--mine {
  background: rgba(200, 134, 30, 0.12);
  color: var(--gold-deep);
  border-color: rgba(200, 134, 30, 0.32);
  font-weight: 600;
}

.room-tag--private {
  background: rgba(120, 90, 160, 0.08);
  color: #6b4e9b;
  border-color: rgba(120, 90, 160, 0.22);
}

:root[data-theme="dark"] .room-tag--private {
  color: #c4b5fd;
  background: rgba(196, 181, 253, 0.12);
  border-color: rgba(196, 181, 253, 0.25);
}

.room-tag--public {
  background: rgba(45, 106, 79, 0.09);
  color: var(--jade-deep);
  border-color: rgba(45, 106, 79, 0.22);
}

.room-tag--waiting {
  color: var(--gold-deep);
  background: rgba(200, 134, 30, 0.1);
  border-color: rgba(200, 134, 30, 0.28);
}

.room-tag--live {
  color: var(--jade-deep);
  background: rgba(45, 106, 79, 0.12);
  border-color: rgba(45, 106, 79, 0.28);
  font-weight: 500;
}

.room-tag--watch {
  color: var(--ink-soft);
  background: var(--surface-2);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  width: max-content;
  white-space: nowrap;
}

.status-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-chip.online {
  background: rgba(45, 106, 79, 0.12);
  color: var(--jade-deep);
}

.status-chip.online .dot {
  background: var(--jade);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.22);
}

.status-chip.waiting {
  background: rgba(200, 134, 30, 0.14);
  color: var(--gold-deep);
}

.status-chip.waiting .dot {
  background: var(--gold);
  animation: gmy-dot-pulse 1.2s ease-in-out infinite;
}

.status-chip.offline {
  background: rgba(100, 75, 50, 0.12);
  color: var(--ink-soft);
}

.status-chip.offline .dot {
  background: var(--ink-soft);
}

@keyframes gmy-dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==========================================================================
   Modals & Overlay Dialogs (弹窗与浮层)
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 12, 4, 0.62);
  backdrop-filter: blur(10px);
  z-index: 50;
  animation: gmy-fade-in 0.22s ease-out;
}

:root[data-theme="dark"] .overlay {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(12px);
}

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

.overlay[hidden] {
  display: none;
}

.overlay__card {
  width: min(100%, 360px);
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  text-align: center;
  animation: gmy-scale-up 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] .overlay__card {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

@keyframes gmy-scale-up {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.overlay__icon {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.overlay__icon .stone-dot {
  width: 28px;
  height: 28px;
}

.overlay__title {
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--brown-deep);
}

.overlay__detail {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.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%;
}

/* ==========================================================================
   Below-fold Content & Editorial Guides (次屏与深度指引)
   ========================================================================== */

.below {
  padding: 64px 28px 84px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 280px);
}

:root[data-theme="dark"] .below {
  background: linear-gradient(180deg, rgba(43, 33, 24, 0.45), transparent 280px);
}

.below__inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.below__lead {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.gmy-kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(143, 77, 30, 0.08);
  border: 1px solid rgba(143, 77, 30, 0.18);
  color: var(--brown-deep);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

:root[data-theme="dark"] .gmy-kicker-pill {
  background: rgba(223, 148, 82, 0.12);
  border-color: rgba(223, 148, 82, 0.25);
  color: #f5dfc8;
}

.below__title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.8vw, 36px);
  font-weight: 700;
  line-height: 1.28;
  color: var(--brown-deep);
}

.below__intro {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.75;
  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: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brown-deep);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.below__resource-link:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--gold-deep);
}

.below__resource-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

/* Feature Cards (Image + Text) */
.feature-card {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1.28fr);
  gap: 40px;
  align-items: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.feature-card--reverse {
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1.12fr);
}

.feature-card--reverse .feature-card__media {
  order: 2;
}

.feature-card__media {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-card__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  box-shadow: 0 6px 20px rgba(70, 40, 15, 0.08);
}

.feature-card__caption {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding: 0 4px;
}

.feature-card__caption-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brown);
  flex-shrink: 0;
  margin-top: 7px;
}

.feature-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card__body h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--brown-deep);
}

.feature-card__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card__text p {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* Structured 3-Card Deck */
.gmy-deck {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.gmy-deck__header {
  max-width: 720px;
}

.gmy-deck__title {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--brown-deep);
}

.gmy-deck__intro {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

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

.gmy-deck__card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gmy-deck__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

.gmy-deck__card-head {
  margin-bottom: 12px;
}

.gmy-deck__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.gmy-deck__card[data-tone="calm"] .gmy-deck__badge {
  background: rgba(45, 106, 79, 0.12);
  color: var(--jade-deep);
  border: 1px solid rgba(45, 106, 79, 0.22);
}

.gmy-deck__card[data-tone="alert"] .gmy-deck__badge {
  background: rgba(200, 134, 30, 0.12);
  color: var(--gold-deep);
  border: 1px solid rgba(200, 134, 30, 0.25);
}

.gmy-deck__card[data-tone="decisive"] .gmy-deck__badge {
  background: rgba(200, 56, 43, 0.10);
  color: var(--crimson);
  border: 1px solid rgba(200, 56, 43, 0.22);
}

:root[data-theme="dark"] .gmy-deck__card[data-tone="calm"] .gmy-deck__badge {
  background: rgba(74, 222, 128, 0.18);
  color: #a7f3d0;
  border-color: rgba(74, 222, 128, 0.3);
}

:root[data-theme="dark"] .gmy-deck__card[data-tone="alert"] .gmy-deck__badge {
  background: rgba(229, 169, 71, 0.18);
  color: #fde68a;
  border-color: rgba(229, 169, 71, 0.3);
}

:root[data-theme="dark"] .gmy-deck__card[data-tone="decisive"] .gmy-deck__badge {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

.gmy-deck__card h4 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brown-deep);
}

.gmy-deck__card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* Drill Practice Callout Box */
.gmy-drill {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gmy-drill__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 30px 34px;
}

.gmy-drill__content {
  flex: 1 1 auto;
  max-width: 680px;
}

.gmy-drill__kicker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gmy-drill__icon {
  display: inline-flex;
  color: var(--brown);
}

.gmy-drill__kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brown);
}

.gmy-drill__title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--brown-deep);
}

.gmy-drill__body {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.gmy-drill__action {
  flex: 0 0 auto;
}

.gmy-drill__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  background: var(--brown-deep);
  color: #fff9f0;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(94, 47, 14, 0.25);
  transition: background 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.gmy-drill__btn:hover {
  background: var(--brown);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(94, 47, 14, 0.35);
}

/* Related Guides Navigation Cards */
.gmy-guides-nav {
  margin-top: 8px;
}

.gmy-guides-nav__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gmy-guide-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gmy-guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(143, 77, 30, 0.35);
}

.gmy-guide-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.gmy-guide-card__kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
  text-transform: uppercase;
}

:root[data-theme="dark"] .gmy-guide-card__kicker {
  color: #df9452;
}

.gmy-guide-card__title {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--brown-deep);
}

.gmy-guide-card__arrow {
  color: var(--brown);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.gmy-guide-card:hover .gmy-guide-card__arrow {
  transform: translateX(3px);
}

.beginner-guide {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  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 18px;
  font-family: var(--serif);
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 1.35;
  color: var(--brown-deep);
}

.beginner-guide__body p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.8;
}

.beginner-guide__body p:last-child {
  margin-bottom: 0;
}

.beginner-guide__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
}

.beginner-guide__item {
  min-width: 0;
  padding-left: 16px;
  border-left: 2px solid rgba(143, 77, 30, 0.28);
}

.beginner-guide__item-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--brown-deep);
}

.beginner-guide__item-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.75;
}

.below__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.below__stat {
  min-width: 0;
  margin: 0;
  padding: 22px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.below__stat strong,
.below__stat span {
  display: block;
}

.below__stat strong {
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--brown-deep);
}

.below__stat span {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
}

.content-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 44px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.content-feature--reverse .content-feature__media {
  order: 2;
}

.content-feature__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.content-feature__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-feature__body h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--brown-deep);
}

.content-feature__body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.8;
}

.content-feature--text {
  grid-template-columns: 1fr;
}

.content-feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.content-feature__tags span {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--brown-deep);
}

/* ==========================================================================
   Article Pages (规则指南 / 定式 / 开局)
   ========================================================================== */

.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);
  font-size: 15px;
  line-height: 1.75;
}

.guide-list {
  padding-left: 22px;
  color: var(--ink-soft);
}

.guide-list li {
  margin: 9px 0;
}

.guide-list strong {
  color: var(--brown-deep);
}

.article-toc {
  margin: 24px 0 30px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.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;
}

.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);
}

.article-note strong {
  color: var(--brown-deep);
}

.article-note p {
  margin: 7px 0 0;
}

.gmy-copy-kicker,
.article .gmy-copy-kicker,
.below .gmy-copy-kicker {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  color: var(--gold-deep);
}

.breadcrumb {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--brown);
  font-weight: 700;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb span[aria-current="page"] {
  color: var(--ink-soft);
}

.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__head {
  max-width: none;
  margin-bottom: 28px;
  padding: 0 0 22px;
  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);
}

.article__head > p:last-child {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.75;
}

.article-figure {
  max-width: 420px;
  margin: 0 auto 28px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.article-figure figcaption {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.article h3 {
  margin: 18px 0 8px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.article-examples {
  display: grid;
  gap: 12px;
}

.article-example {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.article-example h3 {
  margin: 0 0 6px;
}

.article-example p {
  margin: 0;
}

.article details {
  margin: 12px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.article summary {
  cursor: pointer;
  color: var(--brown-deep);
  font-weight: 700;
}

.article details p {
  margin: 8px 0 0;
}

.below-faq {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.below-faq > h2,
.below-faq__header h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.35;
  color: var(--brown-deep);
}

.below-faq details {
  margin: 0;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.below-faq summary {
  cursor: pointer;
  color: var(--brown-deep);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16.5px;
  line-height: 1.45;
  list-style: none;
}

.below-faq summary::-webkit-details-marker {
  display: none;
}

.below-faq details p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.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-layout--solo {
  grid-template-columns: minmax(0, 1fr);
  max-width: 900px;
}

.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;
}

.article-tags a {
  color: var(--brown);
  text-decoration: none;
}

.article-tags a:hover {
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.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);
}

.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 .intro {
  font-size: 16px;
  line-height: 1.75;
}

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

@media (max-width: 640px) {
  .article-layout {
    padding: 18px 14px 32px;
  }
  .article {
    padding: 24px 18px 36px;
  }
  .breadcrumb {
    margin-bottom: 18px;
  }
  .article__head {
    margin-bottom: 22px;
    padding: 0 0 18px;
  }
  .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;
  }
  .guide-list {
    padding-left: 18px;
  }
  .article-figure {
    padding: 0;
    margin-bottom: 24px;
  }
  .article details {
    padding: 14px;
  }
  .article summary,
  .below-faq 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: 999px;
    background: var(--surface);
    text-decoration: none;
  }
  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 14px;
  }
  .article-footer {
    margin-top: 28px;
    padding-top: 18px;
  }
}

/* ==========================================================================
   Footer & Chrome (页脚与多语言切换)
   ========================================================================== */

.site-footer {
  margin-top: auto;
  background-color: #5c3519;
  background-image: linear-gradient(180deg, #5c3519 0%, #3e1b02 100%);
  border-top: 1px solid rgba(255, 235, 205, 0.14);
  color: rgba(255, 235, 210, 0.78);
  font-size: 14px;
}

:root[data-theme="dark"] .site-footer {
  background-color: #24180e;
  background-image: linear-gradient(180deg, #24180e 0%, #130b05 100%);
  border-top: 1px solid rgba(235, 205, 160, 0.08);
  color: rgba(230, 210, 185, 0.70);
}

.gmy-chrome-footer::after {
  content: "";
  display: block;
  height: env(safe-area-inset-bottom, 0px);
}

.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 {
  display: flex;
  flex-direction: column;
}

.footer-col h2,
.footer-col h4,
.footer-heading {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: #fff6e8;
  letter-spacing: 0.02em;
}

:root[data-theme="dark"] .footer-heading {
  color: #f7efe4;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: rgba(255, 235, 210, 0.78);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #ffffff;
}

:root[data-theme="dark"] .footer-col a {
  color: rgba(230, 210, 185, 0.75);
}

:root[data-theme="dark"] .footer-col a:hover {
  color: #ffffff;
}

.footer-col--brand .brand {
  margin-bottom: 14px;
  padding: 0;
}

.footer-col--brand .brand__name {
  font-size: 17px;
  color: #fff6e8;
}

.footer-col--brand .brand__text p {
  color: rgba(255, 235, 210, 0.82);
}

:root[data-theme="dark"] .footer-col--brand .brand__name {
  color: #f7efe4;
}

:root[data-theme="dark"] .footer-col--brand .brand__text p {
  color: rgba(230, 210, 185, 0.78);
}

.footer-about {
  margin: 0 0 18px;
  color: rgba(255, 235, 210, 0.68);
  font-size: 13px;
  line-height: 1.7;
  max-width: 34ch;
}

:root[data-theme="dark"] .footer-about {
  color: rgba(230, 210, 185, 0.65);
}

/* Footer Language Dropdown */
.lang {
  position: relative;
  display: inline-block;
}

.lang__trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 235, 205, 0.22);
  border-radius: var(--radius-full);
  background: rgba(255, 235, 205, 0.1);
  color: #fff6e8;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.lang__trigger:hover {
  border-color: rgba(255, 235, 205, 0.4);
  background: rgba(255, 235, 205, 0.16);
}

.lang__trigger.open {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 134, 30, 0.25);
}

.lang__globe {
  color: var(--gold);
}

.lang__caret {
  color: rgba(255, 235, 210, 0.7);
  transition: transform 0.18s;
}

.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;
  display: flex;
  flex-direction: column;
  gap: 3px;
  backdrop-filter: blur(12px);
}

.lang__menu[hidden] {
  display: none;
}

.lang__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.lang__opt:hover {
  background: var(--surface-2);
}

.lang__opt.active {
  background: rgba(143, 77, 30, 0.12);
  color: var(--brown-deep);
  font-weight: 600;
}

:root[data-theme="dark"] .lang__opt.active {
  background: rgba(224, 149, 82, 0.18);
  color: #f7efe4;
}

.lang__check {
  margin-left: auto;
  color: var(--brown);
}

.lang__opt:not(.active) .lang__check {
  visibility: hidden;
}

/* Bottom Bar: Left Copyright & Right Tagline */
.site-footer__bar {
  border-top: 1px solid rgba(255, 235, 205, 0.1);
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 235, 210, 0.62);
}

:root[data-theme="dark"] .site-footer__bar {
  border-top: 1px solid rgba(255, 235, 205, 0.08);
  color: rgba(230, 210, 185, 0.55);
}

/* PWA install guide (iOS Share → Add to Home Screen) */
.gmy-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));
}

.gmy-pwa-guide[hidden] {
  display: none !important;
}

.gmy-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.55);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.gmy-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);
}

.gmy-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"] .gmy-pwa-guide__head {
  background: linear-gradient(165deg, #362516 0%, var(--surface) 60%);
}

.gmy-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);
}

.gmy-pwa-guide__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.gmy-pwa-guide__host {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.3;
}

.gmy-pwa-guide__kicker {
  margin: 12px 16px 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brown);
}

.gmy-pwa-guide__kicker[hidden],
.gmy-pwa-guide__steps[hidden] {
  display: none !important;
}

.gmy-pwa-guide__steps {
  list-style: none;
  margin: 10px 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gmy-pwa-guide__steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink);
}

.gmy-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;
}

.gmy-pwa-guide__share {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 2px;
  vertical-align: -2px;
  color: var(--brown);
}

.gmy-pwa-guide__actions {
  display: flex;
  gap: 8px;
  padding: 14px 16px 16px;
}

.gmy-pwa-guide__primary,
.gmy-pwa-guide__ghost {
  flex: 1;
  min-height: 40px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.16s, background 0.16s;
}

.gmy-pwa-guide__primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--brown), var(--brown-deep));
  box-shadow: 0 4px 14px rgba(94, 47, 14, 0.25);
}

.gmy-pwa-guide__primary:hover {
  filter: brightness(1.08);
}

.gmy-pwa-guide__ghost {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.gmy-pwa-guide__ghost:hover {
  background: var(--surface-3);
}

/* ==========================================================================
   Responsive Adaptations (响应式优化)
   ========================================================================== */

@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;
  }
  :root[data-theme="dark"] .sidebar {
    background-image: none;
    border-right: none;
  }
  .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;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    gap: 5px;
    border-radius: 12px;
    border: 1px solid rgba(255, 240, 220, 0.18);
    background: rgba(255, 240, 220, 0.08);
    color: #fff9f0;
    cursor: pointer;
  }
  .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(165deg, #6b340e 0%, #542807 55%, #3e1b02 100%);
    border-top: 1px solid rgba(255, 244, 224, 0.12);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
    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(165deg, #2b1a0d 0%, #1f1207 55%, #140a03 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 {
    height: auto;
    container-type: normal;
    --sq: min(100%, calc(100dvh - 220px));
  }
  .play-head {
    flex-direction: column;
    flex-wrap: nowrap;
    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: auto;
  }
  .board__frame {
    width: 100%;
    height: auto;
  }
  .panel-toggle {
    display: none;
  }
  .panel {
    height: auto;
    overflow: visible;
    margin-left: 0;
  }
  .card-side,
  .side-stack,
  .side-pane {
    flex: 0 1 auto;
  }
  .move-list-scroll {
    max-height: min(360px, 50dvh);
  }
  .side-stack {
    min-height: 152px;
  }
  .move-list-scroll {
    min-height: 112px;
  }
  .play--collapsed .panel {
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
  }
  .online {
    padding: 24px 16px;
  }
  .online__grid {
    grid-template-columns: 1fr;
  }
  .feature-card,
  .feature-card--reverse {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  .feature-card--reverse .feature-card__media {
    order: 0;
  }
  .gmy-deck__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .gmy-drill__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
  }
  .gmy-guides-nav__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .below {
    padding: 40px 18px 56px;
  }
  .content-feature,
  .content-feature--reverse {
    grid-template-columns: 1fr;
    max-width: none;
    gap: 18px;
    padding: 0;
    margin: 0;
  }
  .content-feature--reverse .content-feature__media {
    order: 0;
  }
  .content-feature__media {
    max-width: none;
    justify-self: stretch;
  }
  .beginner-guide {
    max-width: none;
    padding: 24px 18px;
    border-radius: var(--radius);
  }
  .beginner-guide__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .beginner-guide__item {
    padding-left: 14px;
    border-left: 2px solid rgba(143, 77, 30, 0.28);
  }
  .below__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
    gap: 10px;
  }
  .below__stat {
    padding: 16px 12px;
  }
  .below-faq {
    max-width: none;
  }
  .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) {
  body {
    font-size: 14.5px;
  }
  .brand__name {
    font-size: 17px;
  }
  .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;
  }
  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
