/* 羊毛工坊 — 解压小游戏 */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  color-scheme: light dark;

  --bg: #efe3d1;
  --bg-deep: #e4d4bd;
  --ink: #26332c;
  --ink-2: #6a7669;
  --line: rgba(38, 51, 44, .14);
  --glass: rgba(255, 251, 243, .78);
  --panel: rgba(255, 252, 246, .9);
  --panel-line: rgba(38, 51, 44, .1);
  --shadow: 0 24px 50px -26px rgba(58, 48, 32, .45);

  --tile-bg: linear-gradient(178deg, #fffaf1 0%, #f8eeda 58%, #f0e2cb 100%);
  --tile-line: rgba(255, 255, 255, .9);
  --tile-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .95),
    inset 0 -3px 0 rgba(206, 186, 155, .5),
    0 4px 0 rgba(199, 178, 145, .38),
    0 10px 16px -8px rgba(73, 61, 40, .45);

  --slot: rgba(38, 51, 44, .055);
  --slot-line: rgba(38, 51, 44, .12);
  --accent: #c1694a;
  --accent-soft: rgba(193, 105, 74, .14);
  --sage: #7f9a7b;
  --hint: #d9a441;

  --sky-a: #f8efe0;
  --sky-b: #e7d8bf;
  --hill: #cbb99c;
  --star: rgba(193, 105, 74, .35);
  --mote: rgba(255, 249, 236, .9);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --tile: 44px;
  --slot-gap: 5px;
  --ease: cubic-bezier(.22, .75, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a16;
    --bg-deep: #0a1411;
    --ink: #efe7d8;
    --ink-2: #a3b2a7;
    --line: rgba(235, 244, 234, .14);
    --glass: rgba(17, 31, 26, .72);
    --panel: rgba(20, 35, 29, .92);
    --panel-line: rgba(235, 244, 234, .12);
    --shadow: 0 26px 60px -26px rgba(0, 0, 0, .75);

    --tile-bg: linear-gradient(178deg, #fdf7e9 0%, #f3e7d2 58%, #e9d9bd 100%);
    --tile-line: rgba(255, 255, 255, .55);
    --tile-shadow:
      inset 0 2px 0 rgba(255, 255, 255, .8),
      inset 0 -3px 0 rgba(190, 168, 134, .55),
      0 4px 0 rgba(97, 84, 60, .55),
      0 12px 20px -8px rgba(0, 0, 0, .6);

    --slot: rgba(240, 246, 236, .055);
    --slot-line: rgba(240, 246, 236, .16);
    --accent: #e08a68;
    --accent-soft: rgba(224, 138, 104, .18);
    --sage: #9ab595;
    --hint: #e8c169;

    --sky-a: #14251f;
    --sky-b: #0a1310;
    --hill: #1b2f27;
    --star: rgba(238, 228, 200, .75);
    --mote: rgba(232, 193, 105, .75);
  }
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 78% 8%, var(--sky-a) 0%, transparent 60%),
    linear-gradient(180deg, var(--sky-a) 0%, var(--bg) 46%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, p, dl, dd, dt, ul { margin: 0; }
ul { padding: 0; list-style: none; }

/* ---------- 夜空装饰 ---------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky-glow {
  position: absolute;
  top: -22vmin;
  right: -18vmin;
  width: 68vmin;
  height: 68vmin;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 193, 105, .34) 0%, rgba(232, 193, 105, .1) 42%, transparent 70%);
  filter: blur(2px);
}

.moon {
  position: absolute;
  top: 6vmin;
  right: 8vmin;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #fff8e6 0%, #f4e4c2 48%, #e6cfa4 100%);
  box-shadow:
    0 0 0 1px rgba(255, 250, 236, .45),
    0 0 40px 12px rgba(232, 193, 105, .18);
  opacity: .75;
}

.moon-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 66%, rgba(196, 165, 112, .22) 0 9%, transparent 10%),
    radial-gradient(circle at 40% 70%, rgba(196, 165, 112, .18) 0 6%, transparent 7%),
    radial-gradient(circle at 58% 34%, rgba(196, 165, 112, .14) 0 5%, transparent 6%);
}

@media (max-width: 460px) {
  .moon { width: 56px; height: 56px; top: 4vmin; right: 6vmin; }
}

.stars i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(3px * var(--s, 1));
  height: calc(3px * var(--s, 1));
  border-radius: 50%;
  background: var(--star);
  animation: twinkle 6s var(--d, 0s) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

.hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22vh;
  color: var(--hill);
  opacity: .55;
}

.hills svg { display: block; width: 100%; height: 100%; }

.motes i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mote);
  filter: blur(.5px);
  animation: drift 18s var(--d, 0s) linear infinite;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: .85; }
  80% { opacity: .5; }
  100% { transform: translate3d(26px, -80px, 0); opacity: 0; }
}

/* ---------- 布局 ---------- */

.stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    12px
    calc(10px + env(safe-area-inset-bottom, 0px));
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 0;
}

.brand-kicker {
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--ink-2);
  text-transform: uppercase;
}

.brand-title {
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: clamp(21px, 5.6vw, 27px);
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.25;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
}

.level-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-2);
  white-space: nowrap;
}

.level-pill #levelName { color: var(--ink); font-weight: 600; letter-spacing: .1em; }

.pill-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  transition: transform .18s var(--ease), background .2s, opacity .2s;
}

.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="false"] { opacity: .45; }
.icon-btn[aria-pressed="false"] .icon-btn-glyph::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* ---------- 游戏区 ---------- */

.playfield {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.board-region {
  position: relative;
  flex: 1;
  min-height: 0;
}

.board-hint {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-2);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}

.board-hint.is-on { opacity: .85; }

.tray-wrap {
  flex: 0 0 auto;
  padding-top: 10px;
}

.tray {
  display: grid;
  grid-template-columns: repeat(var(--slots, 7), var(--tile));
  gap: var(--slot-gap);
  justify-content: center;
  padding: 7px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 14px 26px -22px rgba(48, 40, 26, .7);
  backdrop-filter: blur(6px);
}

.slot {
  width: var(--tile);
  height: var(--tile);
  border-radius: calc(var(--tile) * .26);
  background: var(--slot);
  box-shadow: inset 0 0 0 1px var(--slot-line);
  transition: background .45s ease, box-shadow .45s ease, opacity .45s ease;
}

/* 已经封上的格子：斜纹 + 一个小叉，看得见“还有几格” */
.slot.is-locked {
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 3px, rgba(0, 0, 0, .06) 3px 6px);
  opacity: .55;
  box-shadow: inset 0 0 0 1px var(--slot-line), inset 0 0 12px rgba(0, 0, 0, .18);
}

.slot.is-locked::after {
  content: '';
  display: block;
  width: 34%;
  height: 34%;
  margin: 33% auto 0;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: .35;
}

@media (prefers-reduced-motion: reduce) {
  .slot { transition: none; }
}

.tile-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---------- 牌 ---------- */

.tile {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--tile);
  height: var(--tile);
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(var(--r, 0deg)) scale(var(--s, 1));
  transform-origin: 50% 50%;
  transition:
    transform .42s var(--ease),
    opacity .32s ease;
  z-index: var(--z, 1);
  will-change: transform;
  cursor: pointer;
}

.tile-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: calc(var(--tile) * .26);
  border: 1px solid var(--tile-line);
  background: var(--tile-bg);
  box-shadow: var(--tile-shadow);
  transition: transform .18s var(--ease), filter .24s ease, box-shadow .24s ease;
}

.tile-face svg {
  width: 68%;
  height: 68%;
  display: block;
  overflow: visible;
}

.tile.is-blocked { cursor: default; }
.tile.is-blocked .tile-face {
  filter: brightness(.86) saturate(.55) contrast(.96);
}

.tile.is-free .tile-face { cursor: pointer; }

.tile.is-free:focus-visible { outline: none; }
.tile.is-free:focus-visible .tile-face {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (hover: hover) {
  .tile.is-free:hover .tile-face {
    transform: translateY(-3px);
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, .95),
      inset 0 -3px 0 rgba(206, 186, 155, .5),
      0 6px 0 rgba(199, 178, 145, .38),
      0 16px 22px -12px rgba(48, 40, 26, .6);
  }
}

.tile.is-free:active .tile-face { transform: translateY(1px) scale(.96); }

.tile.is-in-tray .tile-face {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .95),
    inset 0 -3px 0 rgba(206, 186, 155, .45),
    0 2px 0 rgba(199, 178, 145, .34),
    0 8px 12px -8px rgba(73, 61, 40, .5);
}

.tile.is-gone {
  opacity: 0;
  pointer-events: none;
}

.tile.is-matching .tile-face { animation: matchPulse .26s ease; }

@keyframes matchPulse {
  0% { transform: scale(1); }
  46% { transform: scale(1.1) rotate(-2deg); }
  100% { transform: scale(1); }
}

.tile.is-hint .tile-face {
  animation: hintRing 1.05s ease-in-out infinite;
}

@keyframes hintRing {
  0%, 100% { box-shadow: var(--tile-shadow), 0 0 0 2px rgba(217, 164, 65, .0), 0 0 16px rgba(217, 164, 65, .25); }
  50% { box-shadow: var(--tile-shadow), 0 0 0 3px rgba(217, 164, 65, .75), 0 0 26px rgba(217, 164, 65, .5); }
}

.tile.is-bump .tile-face { animation: bump .34s var(--ease); }

@keyframes bump {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-3px) rotate(-1.5deg); }
  55% { transform: translateX(3px) rotate(1.5deg); }
  80% { transform: translateX(-1px); }
}

.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--hint);
  pointer-events: none;
  z-index: 400;
  animation: sparkOut .7s var(--ease) forwards;
}

@keyframes sparkOut {
  0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) scale(.2); }
}

.toast {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translate(-50%, -6px);
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s var(--ease);
  z-index: 500;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 工具栏 ---------- */

.toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 2px;
}

.tools {
  display: flex;
  gap: 7px;
  min-width: 0;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .16s var(--ease), background .2s, opacity .2s;
  white-space: nowrap;
}

.tool:hover { transform: translateY(-1px); background: var(--accent-soft); }
.tool:active { transform: scale(.96); }
.tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tool[disabled] {
  opacity: .38;
  cursor: not-allowed;
  transform: none;
  background: var(--glass);
}

.tool-ico { font-size: 14px; line-height: 1; opacity: .8; }
.tool-label { font-weight: 500; }

.tool-count {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 96px;
}

.progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--slot);
  box-shadow: inset 0 0 0 1px var(--slot-line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), var(--hint));
  transition: width .5s var(--ease);
}

.progress-text {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- 弹层 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(10, 20, 16, .35), rgba(10, 20, 16, .62));
  backdrop-filter: blur(7px);
  opacity: 1;
  transition: opacity .32s ease;
}

.overlay[data-open="false"] {
  opacity: 0;
  pointer-events: none;
}

.overlay-panel {
  width: min(100%, 380px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 26px 24px 22px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  box-shadow: var(--shadow);
  text-align: left;
  transform: translateY(0) scale(1);
  transition: transform .36s var(--ease);
}

.overlay[data-open="false"] .overlay-panel { transform: translateY(10px) scale(.97); }

.ov-kicker {
  font-size: 10px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.ov-title {
  margin-top: 8px;
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: clamp(23px, 6.4vw, 29px);
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.35;
}

.ov-text {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  letter-spacing: .02em;
}

.ov-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.ov-stats div { display: flex; flex-direction: column; gap: 3px; }
.ov-stats dt { font-size: 10.5px; letter-spacing: .12em; color: var(--ink-2); }
.ov-stats dd { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.ov-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.btn {
  flex: 1 1 130px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14.5px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .2s, background .2s, opacity .2s;
}

.btn-primary {
  background: linear-gradient(180deg, #cf7a5a, #b45f42);
  color: #fff8f0;
  box-shadow: 0 12px 22px -14px rgba(150, 70, 44, .9);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 26px -14px rgba(150, 70, 44, .95); }
.btn-primary:active { transform: scale(.97); }

.btn-ghost {
  flex: 0 1 auto;
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover { background: var(--accent-soft); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.ov-rules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}

.ov-rules li {
  position: relative;
  padding-left: 14px;
}

.ov-rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage);
}

.nojs {
  position: fixed;
  inset: auto 0 40% 0;
  text-align: center;
  z-index: 999;
}

/* ---------- 通关时间榜 ---------- */

.ov-board-btn { flex: 1 1 100%; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 960;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 100%, rgba(10, 20, 16, .3), rgba(10, 20, 16, .6));
  backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity .3s ease;
}

.sheet[data-open="false"] {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sheet-panel {
  width: min(100%, 420px);
  max-height: min(80dvh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 20px calc(22px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-bottom: 0;
  box-shadow: var(--shadow);
  text-align: left;
  transform: translateY(0);
  transition: transform .34s var(--ease);
}

.sheet[data-open="false"] .sheet-panel { transform: translateY(22px); }

@media (min-width: 500px) {
  .sheet { align-items: center; padding: 20px; }
  .sheet-panel { border-radius: 26px; border-bottom: 1px solid var(--panel-line); }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-kicker {
  margin: 0 0 5px;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--ink-2);
}

.sheet-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.sheet-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.sheet-close:hover { background: var(--accent-soft); color: var(--accent); }

.board-tabs {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar { display: none; }

.board-tab {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.board-tab[aria-selected="true"] {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}

.board-note {
  margin: 12px 0 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.board-form {
  margin: 0 0 14px;
  padding: 12px 13px 10px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(193, 105, 74, .22);
}

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

.board-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.board-label {
  flex: 1 1 100%;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--ink-2);
}

.board-input {
  flex: 1 1 110px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.board-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.board-save {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 18px;
}

.board-save[disabled] { opacity: .6; cursor: progress; }

.board-status {
  margin: 7px 0 0;
  min-height: 1.1em;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

.board-status[data-tone="ok"] { color: var(--sage); }
.board-status[data-tone="warn"] { color: var(--accent); }

.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.board-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--slot);
  font-size: 13.5px;
}

.board-row.is-mine {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(193, 105, 74, .3);
}

.board-rank {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  text-align: center;
}

.board-row:nth-child(1) .board-rank { color: var(--hint); font-weight: 700; }
.board-row:nth-child(2) .board-rank,
.board-row:nth-child(3) .board-rank { color: var(--ink); font-weight: 600; }

.board-nick {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.board-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.01em;
}

.board-moves {
  min-width: 30px;
  font-size: 10.5px;
  color: var(--ink-2);
  text-align: right;
}

.board-empty {
  margin: 10px 2px 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}

body.is-sheet { overflow: hidden; }

/* ---------- 矮屏 ---------- */

@media (max-height: 620px) {
  .ov-rules { display: none; }
  .overlay-panel { padding: 20px 20px 18px; }
  .brand-kicker { display: none; }
  .tool { min-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
  }
}
