/* 游戏页 · 水墨贪吃蛇 */
body.game-page { min-height: 100%; overflow-x: hidden; }

.game-corner { right: clamp(22px, 4vw, 58px); top: clamp(26px, 7vh, 72px); }

.game-wrap {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2vh, 26px);
  padding: 88px 18px 42px;
}
.game-head { text-align: center; }
.game-head h1 {
  margin: 0;
  font-family: var(--font-shou);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 48px);
  line-height: 1.15;
  letter-spacing: .2em;
  text-indent: .2em;
}
.game-head p {
  margin: 18px 0 0;
  font-size: 11px;
  letter-spacing: .34em;
  color: var(--ink-soft);
}

.board-wrap {
  position: relative;
  width: min(84vw, 480px);
  aspect-ratio: 1 / 1;
  flex: none;
}
.board-wrap::before {
  content: "";
  position: absolute;
  inset: -11px;
  border: 1.5px solid rgba(27,26,23,.32);
  border-radius: 6px 10px 7px 9px;
  pointer-events: none;
  z-index: 2;
}
#board {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,.16);
  border-radius: 3px;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  /* 不用 backdrop-filter：它会每帧重新模糊整块画布，低配设备直接卡顿 */
  background: rgba(243,239,228,.97);
  transition: opacity .35s, visibility .35s;
}
.overlay.is-hidden { opacity: 0; visibility: hidden; }
.overlay-title {
  margin: 0;
  font-family: var(--font-shou);
  font-size: clamp(34px, 6vw, 54px);
  letter-spacing: .18em;
  text-indent: .18em;
}
.overlay-text {
  margin: 0;
  font-size: 12px;
  line-height: 2.1;
  letter-spacing: .16em;
  color: var(--ink-soft);
}
.overlay .ink-btn { margin-top: 8px; }

.game-meta {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--ink-soft);
}
.game-meta b {
  font-weight: 400;
  font-size: 20px;
  color: var(--ink);
  margin-left: 6px;
  font-family: var(--font-shou);
}
.meta-sep { width: 1px; height: 18px; background: var(--ink-faint); }
.ink-btn--small { font-size: 12px; padding: 8px 20px; letter-spacing: .2em; }
.game-tip {
  margin: 0;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--ink-soft);
  opacity: .75;
}

/* 触屏方向键 */
.dpad { display: none; flex-direction: column; align-items: center; gap: 8px; margin-top: 4px; }
.dpad-row { display: flex; gap: 8px; }
.dpad button {
  appearance: none;
  width: 52px; height: 46px;
  border: 1px solid rgba(27,26,23,.28);
  border-radius: 40% 46% 42% 48% / 44% 40% 48% 44%;
  background: rgba(243,239,228,.6);
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.dpad button:active { background: rgba(27,26,23,.14); transform: scale(.92); }

@media (hover: none) and (pointer: coarse) { .dpad { display: flex; } .game-tip { display: none; } }
@media (max-width: 560px) {
  .game-wrap { padding-top: 76px; gap: 16px; }
  .board-wrap { width: min(88vw, 420px); }
  .game-corner { font-size: 10px; }
  .game-meta { gap: 12px; font-size: 11px; }
  .game-meta b { font-size: 17px; }
}
@media (max-height: 700px) and (min-width: 561px) {
  .board-wrap { width: min(62vh, 400px); }
  .game-wrap { padding-top: 70px; gap: 10px; }
}
