/* =========================================================
   纵向攀爬 · VERTICAL CLIMB
   原创跳跃登高小游戏 · 深色克制风格，与迅易达官网保持一致
   ========================================================= */

:root {
  --ink: #0a0f0d;
  --ink-soft: #111a15;
  --panel: #101a14;
  --paper: #f4f5ef;
  --white: #fbfcf8;
  --acid: #d8f36b;
  --acid-strong: #c9ee4a;
  --teal: #77e7c5;
  --coral: #ff8377;
  --muted: #9aa8a0;
  --muted-dim: #64706a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #070b09;
  color: var(--paper);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(110% 50% at 50% 45%, rgba(38, 70, 52, 0.2) 0%, rgba(7, 11, 9, 0) 66%),
    #070b09;
}

@media (min-width: 500px) {
  .app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

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

.topbar {
  position: relative;
  z-index: 12;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 50px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0c130f 0%, #090e0b 100%);
}

.back-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.back-links a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  color: rgba(251, 252, 248, 0.62);
  font-size: 11.5px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.back-links a svg {
  width: 12px;
  height: 12px;
}

.back-links a:hover {
  color: var(--acid);
  background: rgba(216, 243, 107, 0.08);
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.title-mark {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.title-mark i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acid);
  opacity: 0.42;
}

.title-mark i:nth-child(2) {
  width: 7px;
  height: 7px;
  opacity: 1;
  box-shadow: 0 0 8px rgba(216, 243, 107, 0.65);
}

.title-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.title-copy strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.title-copy em {
  color: rgba(251, 252, 248, 0.35);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.sound-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: rgba(251, 252, 248, 0.66);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sound-toggle svg {
  width: 16px;
  height: 16px;
}

.sound-toggle .sound-body {
  fill: currentColor;
}

.sound-toggle .sound-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
}

.sound-toggle .sound-slash {
  fill: none;
  stroke: var(--coral);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sound-toggle.is-muted {
  color: rgba(251, 252, 248, 0.36);
}

.sound-toggle.is-muted .sound-wave {
  opacity: 0.22;
}

.sound-toggle.is-muted .sound-slash {
  opacity: 1;
}

.sound-toggle:hover {
  border-color: rgba(216, 243, 107, 0.3);
  color: var(--acid);
}

.tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(216, 243, 107, 0.22);
  border-radius: 4px;
  color: rgba(216, 243, 107, 0.7);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

/* ---------------- 数据栏 ---------------- */

.hud {
  position: relative;
  z-index: 11;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding: 7px 12px 9px;
  border-bottom: 1px solid var(--line);
  background: #0a110d;
}

.hud-stat {
  position: relative;
  min-width: 0;
  text-align: center;
}

.hud-stat + .hud-stat::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: -3px;
  width: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.hud-label {
  display: block;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.hud-stat strong {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.hud-stat strong em {
  margin-left: 1px;
  color: var(--muted-dim);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0;
}

.hud-best strong {
  color: rgba(251, 252, 248, 0.72);
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.hud-best.is-record strong {
  color: var(--acid);
  text-shadow: 0 0 18px rgba(216, 243, 107, 0.45);
}

.hud-stat strong.bump {
  animation: stat-bump 0.26s ease;
}

@keyframes stat-bump {
  0% { transform: scale(1); }
  42% { transform: scale(1.18); color: var(--acid); }
  100% { transform: scale(1); }
}

/* ---------------- 舞台 ---------------- */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #070b09;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------------- 操作提示 ---------------- */

.hint {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 6;
  max-width: calc(100% - 32px);
  padding: 5px 12px;
  overflow: hidden;
  border: 1px solid rgba(216, 243, 107, 0.16);
  border-radius: 999px;
  background: rgba(9, 15, 11, 0.66);
  color: rgba(251, 252, 248, 0.66);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.4s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hint.is-hidden {
  opacity: 0;
}

/* ---------------- 触控按钮 ---------------- */

.pads {
  position: absolute;
  right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: 0;
  z-index: 7;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 13px;
  pointer-events: none;
}

.pad-group {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

html.is-desktop .pads {
  display: none;
}

.pad-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(216, 243, 107, 0.3);
  border-radius: 50%;
  background: rgba(10, 17, 13, 0.42);
  color: rgba(216, 243, 107, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
  touch-action: none;
  transition: transform 0.13s ease, background 0.13s ease, border-color 0.13s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  user-select: none;
  -webkit-user-select: none;
}

/* 视觉尺寸之外再扩 4px 热区，便于拇指按住 */
.pad-btn::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
}

.pad-btn svg {
  width: 26px;
  height: 26px;
}

.pad-btn.is-down {
  border-color: rgba(216, 243, 107, 0.68);
  background: rgba(216, 243, 107, 0.22);
  transform: scale(0.96);
}

.pad-jump {
  width: 76px;
  height: 76px;
  grid-template-rows: auto auto;
  gap: 0;
  border-color: rgba(216, 243, 107, 0.46);
  background: rgba(22, 34, 21, 0.5);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(216, 243, 107, 0.05),
    0 0 22px rgba(216, 243, 107, 0.08);
}

.pad-jump svg {
  width: 24px;
  height: 24px;
  margin-top: 4px;
}

.pad-jump span {
  display: block;
  margin-top: -1px;
  color: rgba(216, 243, 107, 0.76);
  font-size: 9px;
  letter-spacing: 0.12em;
}

/* 320px 级窄屏仍保证 64px 以上触控尺寸 */
@media (max-width: 340px) {
  .pads {
    padding: 0 10px;
  }

  .pad-group {
    gap: 10px;
  }

  .pad-btn {
    width: 64px;
    height: 64px;
  }

  .pad-btn svg {
    width: 24px;
    height: 24px;
  }

  .pad-jump {
    width: 72px;
    height: 72px;
  }

  .pad-jump svg {
    width: 22px;
    height: 22px;
  }
}

/* 横屏 / 极矮屏的紧凑布局放在文件末尾，确保覆盖基础样式 */


/* ---------------- 浮层与结算 ---------------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
  background: rgba(4, 8, 6, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overscroll-behavior: contain;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  width: min(100%, 330px);
  margin: auto;
  padding: 22px 20px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(58, 98, 72, 0.3) 0%, rgba(13, 22, 17, 0) 62%),
    linear-gradient(160deg, #122018 0%, #0b130f 100%);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.overlay.show .sheet {
  transform: translateY(0) scale(1);
}

.sheet-kicker {
  color: rgba(216, 243, 107, 0.72);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.record-badge {
  display: inline-block;
  margin-top: 9px;
  padding: 3px 10px;
  border: 1px solid rgba(216, 243, 107, 0.42);
  border-radius: 999px;
  background: rgba(216, 243, 107, 0.1);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  animation: badge-glow 1.8s ease-in-out infinite;
}

.record-badge[hidden] {
  display: none;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(216, 243, 107, 0); }
  50% { box-shadow: 0 0 18px rgba(216, 243, 107, 0.22); }
}

.sheet h2 {
  margin-top: 7px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sheet > p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.68;
}

.how {
  margin-top: 13px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.how-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
}

.how-row + .how-row {
  margin-top: 7px;
}

.how-touch {
  display: flex;
}

.how-desktop {
  display: none;
}

html.is-desktop .how-touch {
  display: none;
}

html.is-desktop .how-desktop {
  display: flex;
}

.keys {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.keys b {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(251, 252, 248, 0.72);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
}

.keys b.wide {
  padding: 0 7px;
  font-family: var(--font);
  font-size: 8.5px;
  letter-spacing: 0.06em;
}

.keys i {
  color: var(--muted-dim);
  font-style: normal;
}

.how-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  color: var(--muted-dim);
  font-size: 9px;
  line-height: 1.6;
}

.ov-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.ov-stats[hidden] {
  display: none;
}

.ov-stat {
  min-width: 0;
  padding: 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
}

.ov-stat > span {
  display: block;
  color: var(--muted-dim);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.ov-stat strong {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.ov-stat strong em {
  margin-left: 1px;
  color: var(--muted-dim);
  font-size: 8px;
  font-style: normal;
}

.sheet-btn {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 15px;
  border-radius: 999px;
  background: var(--acid);
  color: #10170c;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: background 0.18s ease, transform 0.18s ease;
}

.sheet-btn:hover {
  background: var(--acid-strong);
}

.sheet-btn:active {
  transform: scale(0.98);
}

.ov-tip {
  margin-top: 9px;
  color: var(--muted-dim);
  font-size: 8.5px;
  letter-spacing: 0.04em;
}

/* ---------------- 页脚 ---------------- */

.foot {
  position: relative;
  z-index: 11;
  flex: 0 0 auto;
  padding: 7px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #090e0b;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 15px;
}

.foot-nav a {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.foot-nav a:hover {
  color: var(--acid);
}

.foot p {
  margin-top: 5px;
  color: var(--muted-dim);
  font-size: 8px;
  letter-spacing: 0.03em;
  text-align: center;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #070b09;
  color: var(--paper);
  font-size: 13px;
  text-align: center;
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 359px) {
  .topbar {
    padding: 0 10px;
  }

  .title-copy em {
    display: none;
  }

  .tag {
    display: none;
  }

  .back-links a {
    padding: 0 5px;
    font-size: 11px;
  }

  .hud {
    padding-left: 8px;
    padding-right: 8px;
  }

  .hud-stat strong {
    font-size: 17px;
  }

  .hud-label {
    font-size: 6.5px;
    letter-spacing: 0.08em;
  }

  .foot-nav {
    gap: 4px 12px;
  }
}

@media (max-height: 680px) {
  .topbar {
    height: 44px;
  }

  .hud {
    padding-top: 5px;
    padding-bottom: 6px;
  }

  .hud-stat strong {
    font-size: 17px;
  }

  .sheet {
    padding: 18px 18px 15px;
  }

  .sheet h2 {
    font-size: 20px;
  }

  .how {
    margin-top: 10px;
    padding: 8px 10px;
  }

  .sheet-btn {
    height: 40px;
    margin-top: 12px;
  }

  .foot p {
    display: none;
  }

  .foot {
    padding-top: 5px;
  }
}

@media (max-height: 580px) {
  .how-note {
    display: none;
  }

  .hint {
    top: 6px;
  }
}

/* 横屏 / 极矮屏：压缩上下栏与浮层，给玩法留高度，按钮仍不小于 64px */
@media (max-height: 520px) {
  .topbar {
    height: 40px;
  }

  .title-copy em {
    display: none;
  }

  .hud {
    padding-top: 3px;
    padding-bottom: 4px;
  }

  .hud-stat strong {
    font-size: 16px;
  }

  .hint {
    top: 6px;
  }

  .overlay {
    padding: 8px;
  }

  .sheet {
    padding: 13px 16px 11px;
    border-radius: 14px;
  }

  .sheet-kicker {
    font-size: 7px;
  }

  .sheet h2 {
    margin-top: 4px;
    font-size: 18px;
  }

  .sheet > p {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.5;
  }

  .how {
    margin-top: 7px;
    padding: 6px 8px;
  }

  .how-row {
    gap: 4px;
    font-size: 8.5px;
  }

  .how-row + .how-row {
    margin-top: 4px;
  }

  .how-note {
    display: none;
  }

  .keys b {
    min-width: 16px;
    height: 16px;
    font-size: 8px;
  }

  .keys b.wide {
    font-size: 8px;
  }

  .sheet-btn {
    height: 36px;
    margin-top: 9px;
    font-size: 11.5px;
  }

  .ov-tip {
    margin-top: 5px;
    font-size: 8px;
  }

  .ov-stats {
    margin-top: 8px;
  }

  .ov-stat {
    padding: 5px 3px;
  }

  .ov-stat strong {
    font-size: 14px;
  }

  .pads {
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    padding: 0 12px;
  }

  .pad-btn {
    width: 64px;
    height: 64px;
  }

  .pad-btn svg {
    width: 24px;
    height: 24px;
  }

  .pad-jump {
    width: 70px;
    height: 70px;
  }

  .pad-jump svg {
    width: 22px;
    height: 22px;
  }

  .foot {
    padding-top: 3px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  }

  .foot-nav a {
    font-size: 8.5px;
  }

  .foot p {
    display: none;
  }
}

/* ---------------- 减少动态效果 ---------------- */

@media (prefers-reduced-motion: reduce) {
  .overlay,
  .sheet,
  .hint,
  .pad-btn {
    transition-duration: 0.01ms;
  }

  .record-badge,
  .hud-stat strong.bump {
    animation: none;
  }
}
