:root {
  --bg: #f1e4c9;
  --bg-top: #f6ecd8;
  --bar: #dfc391;
  --bar-line: #b78e50;
  --ink: #6f4a18;
  --muted: #9b7c4e;
  --arrow: #34210d;
  --arrow-soft: #8f7243;
  --hint: #e2b13f;
  --blocked: #df2929;
  --hover: #6f8f62;
  --region-blue: #2865f4;
  --region-red: #f03535;
  --region-orange: #ee880d;
  --region-green: #0fa873;
  --region-purple: #884cff;
  --water: #55a8ee;
  --empty: rgba(105, 80, 43, 0.14);
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans", "Arial Rounded MT Bold", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: #ead8b3;
  color: var(--ink);
}

body.game-page {
  overflow-y: auto;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.mobile-game {
  --game-width: min(100vw, 820px);
  --header-height: clamp(108px, 17svh, 148px);
  --heart-height: 42px;
  --bottom-height: clamp(142px, 20svh, 190px);
  position: relative;
  display: grid;
  grid-template-rows: var(--header-height) var(--heart-height) minmax(0, 1fr) var(--bottom-height);
  width: var(--game-width);
  height: 100svh;
  min-height: 560px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 30%, rgba(255,255,255,0.16), transparent 38%),
    linear-gradient(180deg, var(--bg-top), var(--bg) 72%);
}

.game-header {
  display: grid;
  grid-template-columns: 58px 1fr 88px;
  grid-template-rows: 44% 28% 28%;
  align-items: stretch;
  height: var(--header-height);
  padding: 0;
  border-bottom: 1px solid rgba(128, 91, 45, 0.25);
  color: #d08a00;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.header-title {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  place-items: center;
}

.header-title strong {
  font-size: 28px;
  line-height: 1;
}

.line-stat {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  border-top: 1px solid rgba(128, 91, 45, 0.18);
  color: #8c6122;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.moved-line {
  grid-row: 2;
}

.remaining-line {
  grid-row: 3;
  border-bottom: 1px solid rgba(128, 91, 45, 0.18);
}

.icon-button,
.tiny-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  color: #765c3d;
}

.icon-button {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
}

.info-button,
.tiny-icon {
  position: relative;
  border-radius: 50%;
}

.info-button {
  width: 48px;
  height: 48px;
}

.info-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 3px solid #77542b;
  border-radius: 50%;
  color: #77542b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -1px 0 rgba(255, 245, 216, 0.7);
}

.header-actions {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  padding-right: 8px;
}

.tiny-icon {
  font-size: 32px;
}

.region-toggle {
  position: relative;
}

.region-toggle.is-active::after {
  content: none;
}

.region-toggle.is-active {
  background: rgba(255, 248, 231, 0.5);
  box-shadow: inset 0 0 0 2px rgba(129, 94, 43, 0.28);
}

.mobile-game.is-cleared .header-title strong,
.mobile-game.is-cleared .status-line {
  animation: clear-pulse 260ms ease-in-out 5;
}

.mobile-game.is-cleared .game-header {
  animation: clear-wash 360ms ease-in-out 3;
}

.mobile-game.is-tutorial-prompt .status-line {
  color: #0f8f5e;
  text-shadow:
    0 0 10px rgba(15, 143, 94, 0.32),
    0 2px 0 rgba(255, 244, 215, 0.84);
  animation: tutorial-status-flash 880ms ease-in-out infinite;
}

.region-toggle.is-active::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 2px solid rgba(118, 84, 43, 0.38);
  pointer-events: none;
}

.header-tool-icon {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  pointer-events: none;
}

.settings-icon {
  width: 36px;
  height: 36px;
}

.heart-row {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 42px;
  padding: 0 0 0 16px;
}

.heart-row span {
  position: relative;
  width: 26px;
  height: 26px;
  overflow: hidden;
  color: transparent;
}

.heart-row span::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./heart-life.ad798668fc.svg") center / contain no-repeat;
  opacity: 0.28;
}

.heart-row .alive::before {
  opacity: 1;
}

.game-stage {
  position: relative;
  min-height: 0;
}

.goal-pill {
  display: none;
}

.board-wrap {
  position: absolute;
  left: 50%;
  top: 4px;
  width: min(calc(100% - 20px), 560px);
  height: calc(100% - 8px);
  aspect-ratio: auto;
  overflow: hidden;
  touch-action: none;
  transform: translateX(-50%);
}

.board-wrap.shape-ascii {
  --ascii-board-size: min(calc(var(--game-width) - 20px), calc(100% - 8px), 812px);
  top: 50%;
  width: var(--ascii-board-size);
  height: var(--ascii-board-size);
  transform: translate(-50%, -50%);
}

.board-pan {
  position: absolute;
  inset: 0;
  transform-origin: center;
  transition: transform 120ms ease;
}

.board-wrap.is-zoomed .board-pan {
  transition: none;
}

.board-loading {
  display: grid;
  place-items: center;
  touch-action: none;
  pointer-events: none;
}

.board-loading-frame {
  display: grid;
  min-width: min(68%, 260px);
  min-height: 110px;
  place-items: center;
  gap: 12px;
  border-radius: 999px;
  background: rgba(251, 242, 223, 0.42);
  color: #89570a;
  font-size: 18px;
  font-weight: 950;
  box-shadow: none;
}

.board-loader {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(137, 87, 10, 0.2);
  border-top-color: #d08a00;
  border-radius: 50%;
  animation: board-loader-spin 720ms linear infinite;
}

.shape-ascii svg.board {
  aspect-ratio: 1 / 1;
}

.hand-guide {
  display: none;
}

.hand-guide.is-visible {
  position: absolute;
  z-index: 2;
  display: block;
  transform: translate(-18%, -12%);
  font-size: clamp(24px, 5vw, 42px);
  filter: drop-shadow(0 2px 2px rgba(77, 47, 15, 0.22));
  pointer-events: none;
  animation: hand-tap 850ms ease-in-out infinite;
}

.board {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
}

.board:focus,
.board:focus-visible {
  outline: 0;
}

.board-grid {
  pointer-events: none;
}

.board-grid line,
.board-grid rect {
  fill: none;
  stroke: rgba(0, 0, 0, 0.14);
  stroke-width: 0.75px;
  vector-effect: non-scaling-stroke;
}

.board-grid rect {
  stroke: rgba(0, 0, 0, 0.26);
  stroke-width: 1px;
}

.board-wrap.is-zoomed .board-grid line {
  stroke: rgba(0, 0, 0, 0.3);
  stroke-width: 1px;
}

.board-wrap.is-zoomed .board-grid rect {
  stroke: rgba(0, 0, 0, 0.48);
  stroke-width: 1.2px;
}

.cell {
  pointer-events: auto;
}

.tap-area {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0.72;
  stroke-linecap: square;
  stroke-linejoin: miter;
  cursor: default;
  pointer-events: stroke;
}

.dot {
  fill: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
}

.board.show-grid .dot {
  opacity: 0.24;
}

.board-wrap.is-zoomed .board.show-grid .dot {
  opacity: 0.36;
}

.tile {
  touch-action: none;
  cursor: default;
}

.arrow-line {
  fill: none;
  stroke: var(--arrow);
  stroke-width: 0.14;
  stroke-linecap: square;
  stroke-linejoin: miter;
  marker-end: url(#arrow-head);
  paint-order: stroke;
  cursor: default;
}

.color-regions .region-0 .arrow-line {
  stroke: var(--region-blue);
}

.color-regions .region-1 .arrow-line {
  stroke: var(--region-red);
}

.color-regions .region-2 .arrow-line {
  stroke: var(--region-orange);
}

.color-regions .region-3 .arrow-line {
  stroke: var(--region-green);
}

.color-regions .region-4 .arrow-line {
  stroke: var(--region-purple);
}

.tile.hinted .arrow-line {
  stroke: var(--hint);
  marker-end: url(#hint-head);
  filter: drop-shadow(0 0 0.08px rgba(226, 177, 63, 0.8)) drop-shadow(0 0 0.2px rgba(226, 177, 63, 0.55));
  animation: hint-glow 1100ms ease-in-out infinite;
}

.tile.tutorial-target .arrow-line {
  stroke: var(--region-green);
  marker-end: url(#hint-head);
  filter:
    drop-shadow(0 0 0.1px rgba(15, 168, 115, 0.95))
    drop-shadow(0 0 0.35px rgba(15, 168, 115, 0.75));
  animation: tutorial-line-pulse 820ms ease-in-out infinite;
}

.tile.blocked .arrow-line {
  stroke: var(--blocked);
  marker-end: url(#blocked-head);
  animation: blocked-flash 140ms steps(2, jump-none) 6;
}

@media (hover: hover) {
  .tile:hover .arrow-line {
    stroke: var(--hover);
    marker-end: url(#hover-head);
    filter: drop-shadow(0 0 0.08px rgba(111, 143, 98, 0.9)) drop-shadow(0 0 0.22px rgba(111, 143, 98, 0.65));
    animation: hover-glow 760ms ease-in-out infinite;
  }
}

.tile.exiting {
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(52, 33, 13, 0.25));
}

.bottom-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(64px, 0.8fr) 1fr;
  height: var(--bottom-height);
  border-top: 2px solid var(--bar-line);
  background:
    linear-gradient(180deg, rgba(244, 223, 178, 0.9), rgba(213, 178, 111, 0.72)),
    var(--bar);
}

.tool-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3.4vw, 32px);
  padding: 0 10px;
  transform: translateY(-28px);
}

.round-tool {
  position: relative;
  display: grid;
  width: clamp(58px, 16vw, 86px);
  height: clamp(58px, 16vw, 86px);
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, #fffefa 0 18%, #fff3d8 58%, #e7bd68 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -5px 9px rgba(166, 99, 20, 0.12),
    0 4px 12px rgba(93, 59, 20, 0.24);
  color: #6f4a18;
  font-size: 42px;
  overflow: visible;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.round-tool[aria-pressed="true"] {
  background:
    radial-gradient(circle at 34% 24%, #fffefa 0 18%, #ffe9aa 58%, #db9a28 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.82),
    inset 0 -5px 9px rgba(136, 82, 15, 0.18),
    0 0 0 3px rgba(137, 87, 10, 0.18),
    0 5px 13px rgba(93, 59, 20, 0.26);
}

.round-tool:active {
  transform: translateY(2px) scale(0.98);
  box-shadow:
    inset 0 2px 8px rgba(111, 69, 18, 0.16),
    0 2px 6px rgba(93, 59, 20, 0.18);
}

.tool-icon {
  display: block;
  width: 72%;
  height: 72%;
  object-fit: contain;
  pointer-events: none;
}

.tool-icon-levels {
  width: 70%;
  height: 70%;
}

.tool-icon-hint {
  width: 78%;
  height: 78%;
}

.tool-symbol {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
}

.grid-symbol {
  border: 3px solid #755426;
  background:
    linear-gradient(90deg, transparent 30%, #755426 30% 38%, transparent 38% 62%, #755426 62% 70%, transparent 70%),
    linear-gradient(0deg, transparent 30%, #755426 30% 38%, transparent 38% 62%, #755426 62% 70%, transparent 70%);
}

.zoom-symbol::before,
.zoom-symbol::after,
.zoom-mark,
.zoom-mark::after {
  content: "";
  position: absolute;
  display: block;
}

.zoom-symbol::before {
  left: 1px;
  top: 1px;
  width: 22px;
  height: 22px;
  border: 4px solid #755426;
  border-radius: 50%;
}

.zoom-symbol::after {
  right: 1px;
  bottom: 4px;
  width: 14px;
  height: 4px;
  border-radius: 4px;
  background: #755426;
  transform: rotate(45deg);
}

.zoom-mark {
  left: 10px;
  top: 12px;
  width: 10px;
  height: 4px;
  border-radius: 4px;
  background: #755426;
  z-index: 1;
}

.zoom-symbol.is-plus .zoom-mark::after {
  right: auto;
  bottom: auto;
  left: 3px;
  top: -3px;
  width: 4px;
  height: 10px;
  border-radius: 4px;
  background: #755426;
}

.hint-badge {
  position: absolute;
  right: -3px;
  top: -5px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff4d7;
  border-radius: 999px;
  background: #df2929;
  color: white;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  z-index: 2;
}

.status-line {
  align-self: start;
  margin: 0;
  color: #89570a;
  font-size: clamp(24px, 7vw, 44px);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.legal-mini {
  position: absolute;
  left: 0;
  top: 100%;
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 14px;
  padding: 6px 10px 10px;
  background: var(--bar);
  color: rgba(92, 58, 18, 0.58);
  font-size: 10px;
}

.modal-backdrop,
.sheet-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: end center;
  background: rgba(60, 38, 12, 0.24);
}

.modal,
.level-sheet,
.settings-sheet,
.info-sheet {
  width: var(--game-width);
  border-radius: 14px 14px 0 0;
  background: #f6ecd8;
  box-shadow: 0 -8px 20px rgba(84, 54, 16, 0.18);
}

.modal {
  display: grid;
  gap: 14px;
  padding: 22px 18px 20px;
  text-align: center;
}

.modal-out {
  gap: 10px;
  padding: 24px 20px 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 249, 237, 0.96), rgba(255, 249, 237, 0) 44%),
    linear-gradient(180deg, #fffdf9 0%, #fbf2df 100%);
}

.modal h2,
.modal p {
  margin: 0;
}

.modal h2 {
  color: #171c24;
  font-size: clamp(26px, 7vw, 31px);
  font-weight: 950;
  line-height: 1.05;
}

.modal > p:not(.modal-copy):not(.share-notice) {
  color: #89570a;
  font-size: 20px;
  font-weight: 900;
}

.modal-copy {
  max-width: 360px;
  justify-self: center;
  color: #5f6877;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
}

.share-heading {
  margin-top: 6px;
  color: #151922;
  font-size: 16px;
  font-weight: 950;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.share-buttons button {
  min-height: 43px;
  border-radius: 7px;
  color: white;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.14);
}

.share-x,
.share-douyin {
  background: #111820;
}

.share-facebook {
  background: #2d62bf;
}

.share-reddit {
  background: #df4928;
}

.share-telegram {
  background: #2c8fc7;
}

.share-wechat {
  background: #08bf6f;
}

.share-rednote {
  background: #ff2f4f;
}

.share-kuaishou {
  background: #ff7146;
}

.share-notice {
  margin: 2px 0 -2px;
  color: #0a8b74;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.3;
}

.modal-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  color: #6d7480;
  font-size: 14px;
  font-weight: 950;
}

.modal-divider::before,
.modal-divider::after {
  content: "";
  height: 1px;
  background: rgba(116, 100, 78, 0.22);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.out-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.out-actions .continue-button:only-child,
.out-actions .restart-button:only-child {
  grid-column: 1 / -1;
}

.modal-actions button,
.sheet-head button {
  min-width: 92px;
  min-height: 38px;
  border-radius: 7px;
  background: #ead8b3;
  color: #6f4a18;
  font-weight: 800;
}

.modal-actions button {
  min-height: 46px;
  box-shadow: 0 5px 0 rgba(113, 83, 34, 0.18);
}

.modal-actions button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.modal-actions .primary {
  background: #0f8d79;
  color: white;
}

.out-actions .restart-button {
  background: #ffd24a;
  color: #05070a;
}

.level-sheet {
  max-height: 76svh;
  padding: 14px 12px 18px;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  color: #6f4a18;
}

.sheet-head button {
  min-width: 34px;
  width: 34px;
  border-radius: 999px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  overflow-y: auto;
  max-height: calc(76svh - 62px);
}

.level-grid button {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid rgba(144, 102, 46, 0.2);
  border-radius: 8px;
  background: #fbf2df;
  color: #77511e;
}

.level-grid button.is-locked,
.level-grid button:disabled {
  cursor: not-allowed;
  border-color: rgba(130, 118, 99, 0.16);
  background: #e5dccd;
  color: rgba(119, 81, 30, 0.36);
  box-shadow: none;
  opacity: 0.72;
}

.level-grid button.active {
  border-color: #c47c00;
  background: #f9ddb0;
}

.level-grid em {
  display: none;
}

.settings-sheet {
  padding: 16px 16px 18px;
}

.info-sheet {
  max-height: 84svh;
  overflow: auto;
  padding: 16px;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border: 1px solid rgba(133, 88, 35, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 250, 236, 0.92), rgba(239, 213, 158, 0.78));
  color: #6f4a18;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  font-size: 18px;
  font-weight: 900;
}

.settings-row strong {
  color: #b97804;
  font-size: 17px;
  font-weight: 900;
}

.language-menu {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.language-menu.is-open {
  display: grid;
}

.language-menu button {
  min-height: 48px;
  border: 1px solid rgba(133, 88, 35, 0.2);
  border-radius: 12px;
  background: #fbf2df;
  color: #70501f;
  font-size: 15px;
  font-weight: 900;
}

.language-menu button.active {
  border-color: rgba(183, 126, 22, 0.68);
  background: linear-gradient(180deg, #ffd976, #e9a927);
  color: #5a3711;
  box-shadow: 0 3px 8px rgba(112, 72, 21, 0.16);
}

.volume-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(133, 88, 35, 0.16);
  border-radius: 12px;
  background: rgba(255, 250, 236, 0.68);
  color: #6f4a18;
  font-weight: 900;
}

.volume-row input {
  width: 100%;
  accent-color: #b97804;
}

.seo-content {
  width: 100%;
  padding: 34px 14px 48px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.3), transparent 34%),
    linear-gradient(180deg, #ead8b3, #f5ead2 22%, #ead3a3);
}

.info-panel[hidden] {
  display: none;
}

.info-copy .seo-content,
.info-copy.seo-content {
  padding: 0;
  background: transparent;
}

.info-copy .seo-inner {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.info-copy .seo-grid {
  grid-template-columns: 1fr;
}

.info-copy .seo-content h1,
.info-copy h1 {
  font-size: 30px;
}

.seo-inner {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 26px;
  border: 1px solid rgba(127, 86, 33, 0.16);
  border-radius: 14px;
  background: rgba(255, 249, 236, 0.78);
  box-shadow: 0 12px 28px rgba(91, 59, 19, 0.12);
}

.seo-content h1,
.seo-content h2,
.seo-content h3 {
  color: #6f4a18;
}

.seo-content h1 {
  margin: 4px 0 12px;
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.05;
}

.seo-content h2 {
  margin: 28px 0 10px;
  font-size: clamp(22px, 4vw, 30px);
}

.seo-content h3 {
  margin: 18px 0 6px;
  font-size: 18px;
}

.seo-lead {
  max-width: 680px;
  margin: 0;
  color: #6b4e27;
  font-size: 18px;
  line-height: 1.75;
}

.seo-content p,
.seo-content li {
  color: #6b4e27;
  line-height: 1.78;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.seo-card {
  padding: 16px;
  border: 1px solid rgba(127, 86, 33, 0.14);
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.72);
}

.seo-card p {
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid rgba(127, 86, 33, 0.14);
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.7);
}

.faq-list summary {
  cursor: pointer;
  padding: 13px 15px;
  color: #6f4a18;
  font-weight: 900;
}

.faq-list details p {
  margin: 0;
  padding: 0 15px 14px;
}

.seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.seo-links a {
  color: #7f5209;
  font-weight: 900;
}

.site-header,
.site-footer {
  display: none;
}

.legal-page {
  overflow: auto;
  background: var(--bg);
}

.legal-page .site-header,
.legal-page .site-footer {
  display: flex;
  width: min(860px, calc(100% - 28px));
  margin: 0 auto;
}

.legal-page .site-header {
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.language-switcher {
  display: flex;
  gap: 8px;
}

.language-switcher a {
  color: var(--ink);
}

.legal-shell {
  width: min(860px, calc(100% - 28px));
  margin: 12px auto 24px;
  padding: 24px;
  border-radius: 10px;
  background: rgba(255, 249, 236, 0.78);
}

.legal-shell h1 {
  margin: 4px 0 12px;
}

.legal-shell p,
.legal-shell li {
  line-height: 1.75;
}

.eyebrow {
  margin: 0;
  color: #c47c00;
  font-weight: 900;
}

.legal-page .site-footer {
  justify-content: space-between;
  padding: 8px 0 22px;
}

.legal-page .site-footer nav {
  display: flex;
  gap: 12px;
}

@keyframes hint-glow {
  0%, 100% {
    opacity: 0.62;
  }
  50% {
    opacity: 1;
  }
}

@keyframes blocked-flash {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.18;
  }
}

@keyframes hover-glow {
  0%, 100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes hand-tap {
  0%, 100% {
    transform: translate(-18%, -12%) scale(1);
  }
  50% {
    transform: translate(-18%, -12%) scale(0.88);
  }
}

@keyframes tutorial-line-pulse {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

@keyframes tutorial-status-flash {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.045);
    opacity: 1;
  }
}

@keyframes clear-pulse {
  0%, 100% {
    color: #89570a;
  }
  50% {
    color: #0f8f5e;
  }
}

@keyframes clear-wash {
  0%, 100% {
    background: transparent;
  }
  50% {
    background: rgba(135, 218, 125, 0.18);
  }
}

@keyframes board-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 600px) {
  body {
    background: #d6bf91;
  }

  .mobile-game {
    --header-height: clamp(104px, 13svh, 132px);
    --bottom-height: clamp(128px, 16svh, 164px);
  }

  .line-stat {
    font-size: 15px;
  }

  .tool-row {
    transform: translateY(-20px);
  }
}

@media (max-width: 560px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }

  .seo-inner {
    padding: 20px;
  }

  .modal-out {
    padding-inline: 20px;
  }
}

@media (max-width: 390px) {
  .modal-copy {
    font-size: 16px;
  }

  .share-buttons {
    gap: 8px;
  }

  .share-buttons button {
    min-height: 40px;
    font-size: 14px;
  }

  .modal-actions button {
    min-height: 44px;
    font-size: 15px;
  }
}

@media (max-height: 650px) {
  .mobile-game {
    --header-height: 104px;
    --heart-height: 36px;
    --bottom-height: 126px;
  }

  .board-wrap {
    width: min(calc(100vw - 20px), 340px);
    top: 2px;
  }

  .game-header {
    grid-template-rows: 42px 31px 31px;
  }

  .tool-row {
    transform: translateY(-18px);
  }

  .round-tool {
    width: 56px;
    height: 56px;
  }

  .status-line {
    font-size: 24px;
  }

  .modal-out {
    gap: 8px;
    padding-top: 18px;
  }

  .modal h2 {
    font-size: 24px;
  }

  .modal-copy {
    font-size: 15px;
    line-height: 1.3;
  }

  .share-heading {
    margin-top: 2px;
    font-size: 14px;
  }

  .share-buttons button {
    min-height: 38px;
  }

  .modal-actions button {
    min-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
