/* 贪吃蛇 · 专属样式（选择器统一 .g-snake 前缀；画面由 Canvas 绘制） */

/* ---------------- 视图容器 ---------------- */
.g-snake .snk-setup-view,
.g-snake .snk-play,
.g-snake .snk-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.g-snake .snk-play { flex: 1; }
.g-snake .snk-result { flex: 1; }

/* ---------------- 设置 ---------------- */
.g-snake .snk-setup-view .panel { padding: 12px 13px; }
.g-snake .snk-setup-view .panel-h { margin-bottom: 8px; }
.g-snake .snk-setup-view .hint { margin-top: 8px; }
.g-snake .snk-sound-row { display: flex; justify-content: center; margin-top: 10px; }
.g-snake .snk-rules { padding: 12px 13px; }
.g-snake .snk-rule-line {
  font-size: 12px;
  line-height: 1.78;
  color: var(--dim);
}
.g-snake .snk-rule-line b { color: var(--text); font-weight: 600; }

/* ---------------- HUD ---------------- */
.g-snake .snk-hud { display: flex; gap: 8px; flex: none; }
.g-snake .snk-hud-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 6px 7px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.g-snake .snk-hud-k { font-size: 10px; letter-spacing: 0.05em; color: var(--faint); }
.g-snake .snk-hud-item .num { font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--text); }

/* ---------------- 棋盘（Canvas 宿主） ---------------- */
.g-snake .snk-board-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-snake .snk-host {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(242, 209, 107, 0.07), transparent 62%),
    linear-gradient(160deg, #141b26 0%, #0c1118 100%);
  border: 1px solid var(--line);
  box-shadow:
    0 22px 54px -24px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.g-snake .snk-host canvas { display: block; border-radius: inherit; }

.g-snake .snk-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: rgba(6, 10, 15, 0.66);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  text-align: center;
  padding: 20px;
  cursor: pointer;
}
.g-snake .snk-pause-overlay.show { display: flex; }
.g-snake .snk-pause-inner { pointer-events: none; }
.g-snake .snk-pause-t { font-size: 16px; font-weight: 700; margin-bottom: 4px; }

/* ---------------- 工具 ---------------- */
.g-snake .snk-tools { display: flex; gap: 8px; flex: none; }
.g-snake .snk-tools .btn { flex: 1; min-height: 44px; }

/* ---------------- 结算 ---------------- */
.g-snake .snk-res-head { text-align: center; padding: 2px 0 0; }
.g-snake .snk-res-big {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, var(--accent), #fff2c2 55%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.g-snake .snk-res-big.lose {
  background: linear-gradient(120deg, #ff8b96, #ffc1c7);
  -webkit-background-clip: text;
  background-clip: text;
}
.g-snake .snk-res-big.win {
  background: linear-gradient(120deg, #7df0b0, #ffe9a8);
  -webkit-background-clip: text;
  background-clip: text;
}
.g-snake .snk-res-sub { margin-top: 3px; font-size: 11.5px; color: var(--faint); }
.g-snake .snk-res-best {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--dim);
  text-align: center;
}
.g-snake .snk-res-best .badge { font-size: 10.5px; }

/* ---------------- 小屏 ---------------- */
@media (max-width: 359px) {
  .g-snake .snk-hud-item .num { font-size: 16px; }
  .g-snake .snk-res-big { font-size: 27px; }
}
