/* 通天塔 · 一键爬塔 —— 页面样式 climb.css
   跟随老站（styles.css）的深色底与柔和描边，但更大、更圆、更亮。
   无外部资源：只有系统字体 + 代码画出来的渐变与圆角。 */

:root {
  /* 底 / 面 / 抬升面：比老站亮一档，避免"死黑" */
  --bg: #0b0d1a;
  --bg-2: #131830;
  --face: #161b30;
  --raise: #1f2543;
  --fg: #eef1fb;
  --fg-2: #b3bbd4;
  --fg-3: #7d86a3;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);

  /* 高饱和强调色（比老站的金色更活泼） */
  --gold: #ffd166;
  --orange: #ff9a4d;
  --hot: #ff6f3c;
  --pink: #ff5d8f;
  --mint: #5ee0c0;
  --blue: #58a6ff;
  --violet: #a06bff;
  --bad: #ff7b7b;

  --r: 18px;
  --r-lg: 22px;
  --r-sm: 13px;
  --btn-h: 52px;          /* 手指点得到：≥ 48px */
  --game-w: 480px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;               /* 游戏页不整页滚动；面板自己是 fixed，不受影响 */
}

body.climb { background:
  radial-gradient(1200px 700px at 50% -10%, #1b2145 0%, rgba(11, 13, 26, 0) 62%),
  var(--bg);
}

[hidden] { display: none !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(255, 209, 102, .3); }

@keyframes sheet-up {
  from { transform: translateY(18px); opacity: .55; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes pop-in {
  from { transform: scale(.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ───────────────── 画布区（手机整屏 / 桌面居中 480 宽） ───────────────── */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ───────────────── HUD：左上大号层数 ───────────────── */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  padding: calc(env(safe-area-inset-top) + 10px) 0 0 calc(env(safe-area-inset-left) + 18px);
  pointer-events: none;
}

/* 左上角压一层柔和暗光，保证任何天色下数字都看得清（用 closest-side 做无边界的渐变） */
.hud::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: min(80vw, 430px);
  height: 300px;
  background: radial-gradient(closest-side at 0 0,
              rgba(8, 10, 22, .52) 0%, rgba(8, 10, 22, .30) 45%, rgba(8, 10, 22, 0) 100%);
  pointer-events: none;
}

.hud > * { position: relative; }

.hud__floor {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0;
  line-height: .92;
}

.hud__floor b {
  font-size: 62px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .22), 0 10px 26px rgba(0, 0, 0, .45);
}

.hud__unit {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}

.hud__best {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, .74);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}

.hud__best b { font-weight: 800; color: #fff; }

.hud__combo {
  display: inline-block;
  margin: 10px 0 0;
  padding: 6px 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--orange));
  color: #40260a;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow: 0 6px 18px rgba(255, 140, 60, .38);
  animation: pop-in .18s var(--ease);
}

/* ───────────────── 通用按钮 ───────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-h);
  padding: 0 22px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .05);
  color: var(--fg);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform .12s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), opacity .16s var(--ease);
}

.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn--primary {
  border-color: rgba(255, 255, 255, .28);
  background: linear-gradient(180deg, #ffc466 0%, #ff7a3a 100%);
  color: #3a1d05;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(255, 122, 58, .38);
}
.btn--primary:active:not(:disabled) { background: linear-gradient(180deg, #ffb650, #f2682f); }

.btn--big { min-height: 58px; font-size: 19px; border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn--plain { background: none; border-color: transparent; color: var(--fg-3); font-size: 15px; }
.btn--plain:active:not(:disabled) { color: var(--fg-2); }

/* 次要按钮：透明底 + 细边框，比主按钮（btn--big 58px）矮一档，但仍然 ≥48px 好点 */
.btn--ghost {
  min-height: 48px;
  border-color: var(--line-2);
  background: none;
  color: var(--fg-2);
  font-size: 16px;
  font-weight: 600;
}
.btn--ghost:active:not(:disabled) { background: rgba(255, 255, 255, .07); color: var(--fg); }

.linkbtn {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  background: none;
  color: var(--fg-3);
  font-size: 14px;
  transition: color .16s var(--ease);
}
.linkbtn:active { color: var(--fg-2); }

/* ── 开始页那几排按钮：同一排必须一样高、彼此留出间隙 ── */
.row2 { align-items: stretch; }
.row2 .btn { margin-top: 0; height: auto; min-height: var(--btn-h); }
.row2 + .btn, .row2 + .row2 { margin-top: 12px; }
#btn-security { margin-top: 12px; }

/* ── 金币 / 每日任务 / 提现 ── */
.hud__coins {
  margin: 6px 0 0; display: flex; align-items: center; gap: 8px; width: fit-content;
  padding: 6px 6px 6px 10px; border-radius: 999px; font-size: 12px; color: #ffe6a8;
  background: rgba(40, 30, 8, .55); pointer-events: auto;
}
.hud__coins b { font-weight: 800; letter-spacing: .01em; }
.hud__withdraw {
  border: 1px solid rgba(255, 209, 102, .45); border-radius: 999px;
  background: rgba(255, 190, 80, .18); color: #ffe6a8;
  font-size: 11.5px; font-weight: 700; padding: 5px 10px; cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.hud__withdraw:active { transform: scale(.95); background: rgba(255, 190, 80, .32); }

/* ── 本局拾取到的金币 / 云朵免死（跟 .hud__coins 一个样，只换颜色）── */
.hud__run {
  margin: 6px 0 0; display: flex; align-items: center; gap: 6px; width: fit-content;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: #ffd76b; background: rgba(46, 34, 8, .55);
}
.hud__bad {
  margin: 6px 0 0; display: flex; align-items: center; gap: 6px; width: fit-content;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: #ffb3c8; background: rgba(60, 12, 30, .62);
}
.hud__saves {
  margin: 6px 0 0; display: flex; align-items: center; gap: 6px; width: fit-content;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  color: #cfe9ff; background: rgba(16, 34, 54, .55);
}

.tasks { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.task {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
}
.task.is-done { border-color: rgba(255, 209, 102, .35); background: rgba(255, 190, 80, .09); }
.task.is-claimed { opacity: .62; }
.task__n { font-size: 14.5px; font-weight: 700; color: #fff; }
.task__d { grid-column: 1 / 2; font-size: 12px; color: rgba(255, 255, 255, .55); }
.task__r { grid-column: 2 / 3; font-size: 12.5px; color: #ffe6a8; white-space: nowrap; }
.task__bar { grid-column: 1 / 2; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.task__bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffc466, #ff7a3a); }
.task__btn {
  grid-column: 2 / 3; grid-row: 2 / 4; align-self: center;
  padding: 8px 14px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 13px; font-weight: 800; color: #201503;
  background: linear-gradient(180deg, #ffc466, #ff7a3a); white-space: nowrap;
}
.task__btn:disabled { background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .5); cursor: default; }
.task__btn:active:not(:disabled) { transform: scale(.96); }

/* ── 登录门新增：一排链接 / 找回密码 / 密保面板 ── */
.gate__links { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; }
.gate__links .linkbtn { display: inline-block; width: auto; min-height: 44px; margin-top: 0; padding: 0 4px; }
.gate__sep { color: var(--fg-4, rgba(255, 255, 255, .3)); font-size: 13px; }
.gate__tip { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--fg-3); }
.gate__q {
  margin: 14px 0 4px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 196, 102, .10); border: 1px solid rgba(255, 196, 102, .28);
  color: var(--gold); font-size: 14px; font-weight: 700; word-break: break-all;
}
/* 忘记密码比登录长，小屏要能滚（别把「重置密码」按钮顶出屏幕） */
.gate__box { max-height: calc(100vh - 32px); overflow-y: auto; }
#panel-security .sec { display: block; }
#panel-security .sec + .sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
#panel-security .field { display: block; margin: 10px 0 7px; }
#panel-security .input { display: block; width: 100%; box-sizing: border-box; }
#panel-security .sheet__note { margin: 0 0 4px; }

/* ───────────────── 开始页 / 结束页 ───────────────── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 18px);
  background: linear-gradient(180deg, rgba(9, 11, 22, .70) 0%, rgba(9, 11, 22, .90) 100%);
}

.panel {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: pop-in .2s var(--ease);
}

.title {
  margin: 0 0 6px;
  font-size: 54px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--gold);
  text-shadow: 0 10px 30px rgba(255, 154, 77, .30);
}

.hint {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--fg-2);
}

.best {
  margin: 0 0 22px;
  padding: 7px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  font-size: 14px;
  color: var(--fg-2);
}
.best b { font-weight: 800; color: var(--gold); }

.panel--start .btn--big { width: 100%; }
/* 「从头开始」：跟在主按钮下面，和它一样宽、但矮一档、字小一档 */
.panel--start .btn--ghost { width: 100%; margin-top: 10px; }

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
}

.old {
  margin-top: 26px;
  font-size: 13px;
  color: var(--fg-3);
  text-decoration: none;
  opacity: .72;
  transition: color .16s var(--ease), opacity .16s var(--ease);
}
.old:active { color: var(--fg-2); opacity: 1; }

/* 结束页 */
.panel--over { gap: 2px; }
/* 结算页：把游戏画面压暗 + 轻糊一点，数字才压得住（开始页不动） */
.screen--over {
  background: linear-gradient(180deg, rgba(9, 11, 22, .86) 0%, rgba(9, 11, 22, .96) 100%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.record {
  margin: 0 0 8px;
  padding: 6px 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe08a, var(--gold));
  color: #4a2e05;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(255, 209, 102, .34);
  animation: pop-in .2s var(--ease);
}

.score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  line-height: 1;
}

.score b {
  font-size: 74px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.score span { font-size: 18px; font-weight: 700; color: var(--fg-3); }

.over__line { margin: 12px 0 4px; font-size: 16px; color: var(--fg-2); }
.over__line b { color: #fff; font-weight: 800; }

.over__rank { margin: 2px 0; font-size: 18px; font-weight: 800; color: var(--mint); }
.over__beat { margin: 2px 0; font-size: 14px; color: var(--fg-2); }
.over__chase { margin: 2px 0 10px; font-size: 14px; color: var(--orange); }
.over__best { margin: 6px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .62); }
.over__best b { color: #ffe6a8; font-weight: 800; }

.panel--over .btn { width: 100%; }
.panel--over .btn + .btn { margin-top: 10px; }
#btn-over-board { margin-top: 4px; }

/* ───────────────── 底部弹出面板（排行榜 / 皮肤） ───────────────── */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, .64);
}

.sheet__card {
  position: relative;
  width: 100%;
  max-width: var(--game-w);
  max-height: 78dvh;
  margin: 0 auto;
  padding: 14px 18px calc(env(safe-area-inset-bottom) + 18px);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--face);
  box-shadow: 0 -22px 60px rgba(0, 0, 0, .55);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: sheet-up .22s var(--ease);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.sheet__title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
}

.sheet__x {
  flex: none;
  width: 48px;
  height: 48px;
  margin: -8px -8px -8px 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fg-3);
  font-size: 26px;
  line-height: 1;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.sheet__x:active { background: rgba(255, 255, 255, .08); color: var(--fg); }

.sheet__note {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--fg-3);
  text-align: center;
}
.sheet__note b { color: var(--gold); font-weight: 800; }

/* tab */
.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: var(--r);
  background: var(--raise);
}

.tab {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--fg-3);
  font-size: 15px;
  font-weight: 700;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.tab.is-on {
  background: linear-gradient(180deg, #ffc466, #ff7a3a);
  color: #3a1d05;
}

/* 排行榜 */
.board { margin-top: 12px; }

.board__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 15px;
}

.row + .row { margin-top: 5px; }

.row__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rank--g { background: linear-gradient(180deg, #ffe9a3, #f0b73c); color: #4a3105; }
.rank--s { background: linear-gradient(180deg, #f2f5fb, #b9c2d4); color: #333a49; }
.rank--b { background: linear-gradient(180deg, #f0b585, #c97b41); color: #3d2205; }

.row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
}

.row__score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.row--me {
  border-color: rgba(255, 209, 102, .45);
  background: rgba(255, 209, 102, .12);
}
.row--me .row__name { font-weight: 800; }

.board__me {
  position: sticky;
  bottom: -2px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  background: var(--face);
}

.empty {
  margin: 26px 0;
  text-align: center;
  color: var(--fg-3);
  font-size: 14.5px;
  line-height: 1.9;
}

/* 皮肤 */
.skins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.skin {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--raise);
  text-align: left;
  transition: border-color .16s var(--ease), background .16s var(--ease),
              transform .12s var(--ease), opacity .16s var(--ease);
}

.skin:active:not(.is-locked) { transform: scale(.98); }

.skin.is-on {
  border-color: var(--gold);
  background: rgba(255, 209, 102, .12);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, .22);
}

.skin.is-locked { opacity: .45; }

.skin__dot {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: inset 0 -4px 10px rgba(0, 0, 0, .22);
}

.skin__dot--plain   { background: #e8d9bd; }
.skin__dot--scarf   { background: linear-gradient(160deg, #ffe8c9 52%, #ff5d5d 52%); }
.skin__dot--cap     { background: linear-gradient(160deg, #eaf3ff 44%, #4a90ff 44%); }
.skin__dot--bell    { background: linear-gradient(160deg, #fff0cf 48%, #ffc93c 48%); }
.skin__dot--cloak   { background: linear-gradient(160deg, #ded8f8 42%, #3a3070 42%); }
.skin__dot--rainbow { background: linear-gradient(90deg, #ff5d6c, #ffa24d, #ffd94d, #5ddc8c, #49b6ff, #a06bff); }

.skin__name { font-size: 15px; font-weight: 700; }
.skin__need { font-size: 12px; color: var(--fg-3); }

/* ───────────────── 登录门 ───────────────── */
.gate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 24px);
  background: var(--bg);
  overflow-y: auto;
}

.gate__box { width: 100%; max-width: 340px; }

.gate__head { margin-bottom: 26px; text-align: center; }

.gate__title {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--gold);
  text-shadow: 0 10px 30px rgba(255, 154, 77, .28);
}

.gate__sub {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--fg-3);
}

.form { display: flex; flex-direction: column; }

.field { margin-bottom: 7px; font-size: 12.5px; letter-spacing: .08em; color: var(--fg-3); }

.input {
  height: var(--btn-h);
  font-size: 16px;   /* 同上：iOS 聚焦放大的门槛就是 16px */
  margin-bottom: 16px;
  padding: 0 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .04);
  outline: none;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.input::placeholder { color: #5c6480; }
.input:focus { border-color: rgba(255, 209, 102, .55); background: rgba(255, 255, 255, .06); }

.form__msg { margin: 0 0 12px; font-size: 13.5px; color: #ffa8a1; }

.regcode {
  padding: 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--face);
  text-align: center;
}

.regcode__v {
  margin: 12px 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.regcode__note { margin: 0 0 14px; font-size: 12.5px; color: var(--fg-3); line-height: 1.7; }

/* ───────────────── 提示条 / 启动提示 ───────────────── */
.toasts {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(env(safe-area-inset-top) + 10px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}

.toast {
  max-width: min(460px, 100%);
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--raise);
  font-size: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  opacity: 1;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}

.toast.is-out { opacity: 0; transform: translateY(-8px); }
.toast--good { border-color: rgba(94, 224, 192, .5); color: #a5f0dc; }
.toast--err { border-color: rgba(255, 123, 123, .5); color: #ffb3ae; }
.toast--gain { border-color: rgba(255, 209, 102, .5); color: #ffe0a3; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: var(--bg);
  color: var(--fg-3);
  font-size: 15px;
  letter-spacing: .1em;
}

/* ───────────────── 桌面：居中一个 480 宽的游戏框 ───────────────── */
@media (min-width: 720px) {
  .stage {
    left: 50%;
    right: auto;
    width: var(--game-w);
    transform: translateX(-50%);
    border-radius: 26px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  }

  .screen {
    left: 50%;
    right: auto;
    width: var(--game-w);
    transform: translateX(-50%);
    border-radius: 26px;
  }

  .sheet__card { border-radius: var(--r-lg); margin-bottom: 24px; }

  .title { font-size: 62px; }
  .gate__title { font-size: 46px; }
}

/* ───────────────── 小屏（360×640 一类） ───────────────── */
@media (max-height: 700px) {
  .hud__floor b { font-size: 48px; }
  .hud__best { margin-top: 4px; }
  .hud__combo { margin-top: 9px; padding: 5px 12px; font-size: 13px; }
  .title { font-size: 42px; }
  .hint { margin-bottom: 12px; font-size: 14px; }
  .best { margin-bottom: 16px; }
  .score b { font-size: 56px; }
  .sheet__card { max-height: 84dvh; }
  .old { margin-top: 18px; }
}

@media (max-height: 560px) {
  .panel { max-width: 320px; }
  .title { font-size: 36px; }
  .hud__floor b { font-size: 42px; }
}

/* 很高的屏（Pro Max 一类）稍微放大一点，别显得空 */
@media (min-height: 900px) {
  .hud__floor b { font-size: 68px; }
  .title { font-size: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   联机竞速：开始页入口 / 房间面板（三态）/ 开局倒计时 / 比赛中对手条
   沿用深色玻璃 + 橙金强调：金色只给「赢 / 第一 / 重点」，
   其余信息用白 + 灰 + 一点薄荷/蓝/紫/橙区分人。
   ═══════════════════════════════════════════════════════════════════ */

/* ───────── 开始页：「和朋友一起爬」 ───────── */
.btn--race {
  gap: 9px;
  margin-top: 12px;
  border-color: rgba(255, 209, 102, .40);
  background: linear-gradient(180deg, rgba(255, 209, 102, .15), rgba(255, 154, 77, .09));
  color: #ffe6b3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 24px rgba(0, 0, 0, .26);
}

.btn--race:active:not(:disabled) {
  border-color: rgba(255, 209, 102, .62);
  background: linear-gradient(180deg, rgba(255, 209, 102, .24), rgba(255, 154, 77, .15));
}

.ic-team {
  flex: none;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .92;
}

/* ───────── 房间面板：三块状态共用 ───────── */
#panel-race .sheet__card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0), rgba(255, 209, 102, .55), rgba(255, 209, 102, 0));
}

.race__pane { animation: pane-in .24s var(--ease); }

@keyframes pane-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.race__lead {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
}

/* 小标题：文字 + 一条渐隐的细线 */
.race__h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 9px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--fg-3);
}

.race__h::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), rgba(255, 255, 255, 0));
}

/* 房号输入 + 进去 */
.race__join {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.race__input {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--btn-h);
  margin: 0;
  padding: 0 10px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .34em;
  text-indent: .17em;
  font-variant-numeric: tabular-nums;
}

.race__input::placeholder {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  text-indent: .04em;
}

.race__join .btn { flex: none; min-width: 88px; }

/* 房间列表 */
.rooms {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--raise);
  text-align: left;
  transition: transform .12s var(--ease), border-color .16s var(--ease),
              background .16s var(--ease);
}

.room:active {
  transform: scale(.985);
  border-color: rgba(255, 209, 102, .45);
  background: rgba(255, 209, 102, .08);
}

.room__code {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

.room__meta { font-size: 12.5px; color: var(--fg-3); }
.room__go { font-size: 14px; font-weight: 800; color: var(--gold); }

#race-rooms-empty { margin: 16px 0 2px; font-size: 13.5px; line-height: 1.8; }

/* ───────── 在房间里等：房号大字 + 队伍 ───────── */
.codebtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 78px;
  padding: 4px 0;
  border: 1px solid rgba(255, 209, 102, .34);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 150% at 50% 0%, rgba(255, 209, 102, .17) 0%, rgba(255, 209, 102, .03) 62%),
    var(--raise);
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: .24em;
  text-indent: .12em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 12px 30px rgba(0, 0, 0, .34);
  transition: transform .12s var(--ease), border-color .16s var(--ease);
}

.codebtn:active {
  transform: scale(.985);
  border-color: rgba(255, 209, 102, .62);
}

.members {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.member {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .03);
}

.member__dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background-color: var(--dot, #8f98b3);
  box-shadow: inset 0 -4px 9px rgba(0, 0, 0, .26), 0 0 0 1px rgba(255, 255, 255, .13);
}

.member__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15.5px;
  font-weight: 700;
}

.member__tag {
  padding: 3px 10px;
  border: 1px solid rgba(255, 209, 102, .38);
  border-radius: 999px;
  background: rgba(255, 209, 102, .14);
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 800;
}

/* 4 个人各自的颜色（climb.js 也可以给 .member__dot 内联 --dot 覆盖） */
.member:nth-child(1) .member__dot { background-color: #5ee0c0; }
.member:nth-child(2) .member__dot { background-color: #58a6ff; }
.member:nth-child(3) .member__dot { background-color: #a06bff; }
.member:nth-child(4) .member__dot { background-color: #ff9a4d; }

.member.is-me {
  border-color: rgba(255, 209, 102, .42);
  background: rgba(255, 209, 102, .10);
}

.member.is-empty { opacity: .5; }

.member.is-empty .member__dot {
  background: none;
  border: 1.5px dashed rgba(255, 255, 255, .22);
  box-shadow: none;
}

.member.is-empty .member__name { color: var(--fg-3); font-weight: 600; }

#race-wait-hint { margin: 12px 0 4px; color: #ffcf8f; }
#race-start { margin-top: 6px; }
#race-leave { margin-top: 4px; }

/* 人数不够时的「一起出发」：整块灰掉，一眼看出还点不了
   （页面里只有这一个主按钮会被 disabled，其它主按钮不受影响） */
.btn--primary:disabled {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, .06);
  color: var(--fg-3);
  box-shadow: none;
  opacity: 1;
}

/* ───────── 比完了：名次台 ───────── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line-2);
}

.podium__c {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  max-width: 108px;
  min-width: 0;
  animation: podium-rise .32s var(--ease) both;
}

.podium__c.is-1 { order: 2; animation-delay: .05s; }
.podium__c.is-2 { order: 1; animation-delay: .15s; }
.podium__c.is-3 { order: 3; animation-delay: .23s; }

@keyframes podium-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.podium__crown {
  width: 27px;
  height: 17px;
  margin-bottom: 2px;
  fill: var(--gold);
  filter: drop-shadow(0 4px 10px rgba(255, 209, 102, .45));
  animation: crown-drop .34s var(--ease) .12s both;
}

@keyframes crown-drop {
  from { opacity: 0; transform: translateY(-11px) scale(.78); }
  to { opacity: 1; transform: none; }
}

.podium__name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-2);
}

.podium__floor {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--fg-3);
}

.podium__base {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: 13px 13px 0 0;
  background: rgba(255, 255, 255, .05);
  color: var(--fg-3);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.podium__c.is-1 .podium__name { font-size: 17px; font-weight: 800; color: var(--gold); }
.podium__c.is-1 .podium__floor { font-size: 13px; font-weight: 700; color: #ffe0a3; }

.podium__c.is-1 .podium__base {
  height: 76px;
  border-color: rgba(255, 209, 102, .55);
  background: linear-gradient(180deg, #ffe6a8 0%, #f0b73c 100%);
  color: #46300a;
  box-shadow: 0 -8px 26px rgba(255, 209, 102, .22);
}

.podium__c.is-2 .podium__base {
  height: 52px;
  border-color: rgba(255, 255, 255, .30);
  background: linear-gradient(180deg, #eef1f8 0%, #b9c2d4 100%);
  color: #333a49;
}

.podium__c.is-3 .podium__base {
  height: 36px;
  border-color: rgba(240, 181, 133, .45);
  background: linear-gradient(180deg, #f0b585 0%, #c97b41 100%);
  color: #3d2205;
}

.race__note {
  margin: 16px 0 14px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 209, 102, .22);
  border-radius: var(--r-sm);
  background: rgba(255, 209, 102, .09);
  color: #ffe6b3;
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}

#race-result .btn + .btn { margin-top: 8px; }

/* ───────── 开局倒计时遮罩 ───────── */
.count {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  background: radial-gradient(62% 46% at 50% 46%,
              rgba(6, 8, 16, .66) 0%, rgba(6, 8, 16, .34) 56%, rgba(6, 8, 16, 0) 100%);
  pointer-events: none;               /* 倒计时别挡住游戏输入 */
}

.count__num {
  font-size: clamp(96px, 30vw, 150px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 8px 0 rgba(0, 0, 0, .16), 0 18px 44px rgba(0, 0, 0, .55),
               0 0 48px rgba(255, 209, 102, .34);
}

/* 换数字时重播（去掉再加 .is-pop）；hidden 变可见本来也会自动放一次 */
.count__num.is-pop { animation: count-pop .82s var(--ease) both; }

@keyframes count-pop {
  0%   { opacity: 0; transform: scale(.5); }
  24%  { opacity: 1; transform: scale(1.07); }
  62%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.42); }
}

.count__note {
  margin: 0;
  padding: 7px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(9, 11, 22, .58);
  color: var(--fg-2);
  font-size: 13.5px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}

/* ───────── 比赛中：对手条（#stage 里，HUD 下方靠左） ───────── */
.strip {
  position: absolute;
  left: calc(env(safe-area-inset-left) + 18px);
  top: calc(env(safe-area-inset-top) + 188px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 52vw;
  pointer-events: none;
}

.strip__rank {
  margin: 0 0 2px;
  padding: 3px 11px;
  border: 1px solid rgba(255, 209, 102, .32);
  border-radius: 999px;
  background: rgba(9, 11, 22, .55);
  color: #ffe0a3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}

.strip__list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strip__r {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 12px 3px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(9, 11, 22, .52);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .26);
  transition: opacity .2s var(--ease), filter .2s var(--ease);
}

.strip__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background-color: var(--dot, #8f98b3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22);
}

.strip__ch {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

.strip__f {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--fg-2);
}

/* 第几行给什么颜色（climb.js 也可以用内联 --dot 覆盖） */
.strip__r:nth-child(1) .strip__dot { background-color: #5ee0c0; }
.strip__r:nth-child(2) .strip__dot { background-color: #58a6ff; }
.strip__r:nth-child(3) .strip__dot { background-color: #a06bff; }
.strip__r:nth-child(4) .strip__dot { background-color: #ff9a4d; }

.strip__r.is-me {
  border-color: rgba(255, 209, 102, .52);
  background: rgba(255, 209, 102, .16);
}

.strip__r.is-me .strip__f { color: #ffe0a3; }

.strip__r.is-out { opacity: .5; filter: grayscale(.75); }
.strip__r.is-out .strip__ch,
.strip__r.is-out .strip__f { text-decoration: line-through; }

/* ───────── HUD 上加的一行：第几名 ───────── */
.hud__race {
  display: block;                 /* 自己占一行，别跟 #hud-combo 挤在一起 */
  width: fit-content;
  margin: 9px 0 0;
  padding: 4px 13px;
  border: 1px solid rgba(255, 209, 102, .42);
  border-radius: 999px;
  background: rgba(9, 11, 22, .52);
  color: #ffe0a3;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .26);
}

/* ───────── 联机竞速的尺寸适配 ───────── */
@media (min-width: 720px) {
  /* 桌面：倒计时也收在那个 480 宽的游戏框里 */
  .count {
    left: 50%;
    right: auto;
    width: var(--game-w);
    transform: translateX(-50%);
    border-radius: 26px;
  }
}

@media (max-height: 700px) {
  .strip { top: calc(env(safe-area-inset-top) + 158px); }
  .count__num { font-size: clamp(82px, 26vw, 118px); }
  .codebtn { min-height: 68px; font-size: 38px; }
  .member { min-height: 46px; }
  .race__h { margin: 16px 0 8px; }
  .podium__c.is-1 .podium__base { height: 62px; }
  .podium__c.is-2 .podium__base { height: 44px; }
  .podium__c.is-3 .podium__base { height: 32px; }
  .race__note { margin: 13px 0 11px; }
}

@media (min-height: 900px) {
  .strip { top: calc(env(safe-area-inset-top) + 198px); }
}

/* 倒计时的数字动画末尾会淡出，关掉动效时要让它一直看得见 */
@media (prefers-reduced-motion: reduce) {
  .count__num { animation: none !important; opacity: 1 !important; transform: none !important; }
  .podium__c, .podium__crown { animation: none !important; }
}

/* ── 分数跳动（落地那一下的反馈） ── */
.hud__floor b.is-pop { animation: hudpop .26s cubic-bezier(.2, .8, .3, 1); }
@keyframes hudpop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hud__floor b.is-pop { animation: none; }
}
.strip__r .strip__ch { max-width: 4.6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 联机大厅：全服横幅 + HUD 里的名字/名次/最高 ── */
.banner {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px);
  transform: translateX(-50%);
  z-index: 60; max-width: min(92vw, 520px);
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  background: rgba(14, 17, 30, .92); color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: bannerIn .28s cubic-bezier(.2, .8, .3, 1);
  pointer-events: none;
}
.banner--cheer { border-color: rgba(255, 209, 102, .55); color: #ffe6a8; box-shadow: 0 10px 30px rgba(255, 160, 60, .22); }
.banner--fall { border-color: rgba(255, 120, 140, .45); color: #ffd7de; }
.banner.is-out { animation: bannerOut .24s ease forwards; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes bannerOut { to { opacity: 0; transform: translate(-50%, -12px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .banner, .banner.is-out { animation: none; } }

.hud__name { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: rgba(255, 255, 255, .78); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__online { margin: 6px 0 0; display: block; width: fit-content; padding: 3px 9px; border-radius: 999px; font-size: 11px; color: #d9e2ff; background: rgba(10, 12, 22, .5); }
.hud__top { margin: 5px 0 0; display: block; width: fit-content; max-width: 62vw; padding: 3px 9px; border-radius: 999px; font-size: 11px; color: #ffe6a8; background: rgba(40, 30, 8, .55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint--sub { margin: -6px 0 10px; font-size: 12px; color: rgba(255, 255, 255, .62); }

/* ── 顶部滚动公告条（从右往左）── */
.ticker {
  position: fixed; left: 0; right: 0; z-index: 55;
  top: env(safe-area-inset-top, 0px);
  height: 30px; overflow: hidden;
  background: linear-gradient(180deg, rgba(12, 15, 26, .88), rgba(12, 15, 26, .34));
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  pointer-events: none;
}
.ticker__t {
  position: absolute; top: 50%; left: 100%;
  transform: translateY(-50%);
  white-space: nowrap; font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: #dfe6fb;
  animation: tickerRun 11s linear forwards;
}
.ticker__t.is-cheer { color: #ffe6a8; text-shadow: 0 0 12px rgba(255, 190, 80, .35); }
.ticker__t.is-fall { color: #ffc9d4; }
@keyframes tickerRun { from { transform: translate(0, -50%); } to { transform: translate(calc(-100% - 100vw), -50%); } }
@media (prefers-reduced-motion: reduce) { .ticker__t { animation-duration: 18s; } }

/* HUD 往下让开公告条 */
.hud { top: calc(env(safe-area-inset-top, 0px) + 40px) !important; }

/* ── 底部聊天按钮与输入条 ── */
.chatbtn {
  position: fixed; right: calc(env(safe-area-inset-right, 0px) + 14px); z-index: 56;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18);
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 205, 120, .95), rgba(240, 130, 60, .95));
  color: #201503; font-size: 24px; line-height: 1; cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  transition: transform .12s ease;
}
.chatbtn:active { transform: scale(.94); }

/* 爬塔中的换地图按钮：摞在聊天按钮上面，同样的圆钮手感 */
.mapbtn {
  position: fixed; right: calc(env(safe-area-inset-right, 0px) + 14px); z-index: 56;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18);
  background: radial-gradient(120% 120% at 30% 20%, rgba(150, 215, 255, .95), rgba(90, 130, 240, .95));
  color: #071424; font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  transition: transform .12s ease;
}
.mapbtn:active { transform: scale(.94); }

/* 局内的「每日任务」圆钮：摞在换地图按钮上面 */
.taskbtn {
  position: fixed; right: calc(env(safe-area-inset-right, 0px) + 14px); z-index: 56;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 138px);
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18);
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 224, 145, .95), rgba(226, 160, 60, .95));
  color: #201503; font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  transition: transform .12s ease;
}
.taskbtn:active { transform: scale(.94); }
.taskbtn[hidden] { display: none; }

/* 局内的「暂停挂机」圆钮：摞在每日任务按钮上面（有事走开时按一下，台阶就不会塌） */
.pausebtn {
  position: fixed; right: calc(env(safe-area-inset-right, 0px) + 14px); z-index: 56;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 200px);
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18);
  background: radial-gradient(120% 120% at 30% 20%, rgba(206, 214, 255, .95), rgba(120, 128, 200, .95));
  color: #101433; font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  transition: transform .12s ease;
}
.pausebtn:active { transform: scale(.94); }
.pausebtn[hidden] { display: none; }

/* 暂停面板：把舞台压暗、居中一块说明，别让人以为卡住了 */
.screen--pause { background: rgba(8, 10, 24, .78); }
.panel--pause { gap: 6px; text-align: center; max-width: 320px; }
.pause__icon { font-size: 40px; line-height: 1; margin: 0 0 4px; }
.pause__title { font-size: 19px; font-weight: 700; margin: 0; }
.pause__note { font-size: 13.5px; line-height: 1.7; color: rgba(255, 255, 255, .66); margin: 6px 0 16px; }
.panel--pause .btn { width: 100%; }

/* 弹在屏幕中间的对话框（提现用；底部抽屉那种容易让人误会已经操作完了） */
.sheet--center { justify-content: center; padding: 0 18px calc(env(safe-area-inset-bottom) + 18px); }
.sheet__card--dialog {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .55);
  animation: pop-in .18s var(--ease);
}

/* 提现表单：一列排好，字段居中、输入框占满、提示字代替预填 */
.wd-form { display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.wd-note { margin: 4px 0 14px; font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, .62); }
.wd-label { display: block; margin: 0 0 6px; font-size: 12.5px; letter-spacing: .06em; color: var(--fg-3); text-align: center; }
.wd-form .input { display: block; width: 100%; box-sizing: border-box; text-align: center; margin: 0 0 14px; }
.wd-form .input::placeholder { color: rgba(255, 255, 255, .34); }
.wd-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 12px; }
.wd-max { font-size: 12.5px; color: rgba(255, 255, 255, .55); }
.wd-all {
  border: 1px solid rgba(255, 209, 102, .45); border-radius: 999px;
  background: rgba(255, 190, 80, .14); color: #ffe6a8;
  font-size: 12.5px; padding: 6px 12px; cursor: pointer;
}
.wd-all:active { transform: scale(.96); }
.wd-form .form__msg { text-align: center; }
.mapbtn[hidden] { display: none; }

.chatbar {
  position: fixed; left: 10px; right: 10px; z-index: 58;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: 18px;
  background: rgba(16, 19, 32, .96);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.chatbar__i {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06); color: #fff;
  font-size: 16px;   /* iOS：聚焦时 <16px 的输入框会把整页放大，别改小 */
}
.chatbar__i::placeholder { color: rgba(255, 255, 255, .42); }
.chatbar__s {
  flex: 0 0 auto; height: 44px; padding: 0 16px; border-radius: 12px; border: 0;
  background: linear-gradient(180deg, #ffc466, #ff7a3a); color: #201503;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.chatbar__x {
  flex: 0 0 auto; width: 40px; height: 44px; border-radius: 12px; border: 0;
  background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px; cursor: pointer;
}

/* 提示条挪到底部（别和顶部公告打架） */
.toasts {
  top: auto !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 76px) !important;
  justify-content: flex-end !important;
}

/* ── 移动端通用优化 ── */
html, body { -webkit-tap-highlight-color: transparent; }

/* ── 手机端别乱缩放（2026-09-22 用户反馈"点快了双击会放大"）──
   iOS 从 10 起就无视 user-scalable=no，只能靠这三条兜住：
   ① 交互元素显式 touch-action: manipulation（双击不再触发缩放，捏合仍然可用）；
   ② 输入框字号 ≥16px（见上，iOS 聚焦放大的门槛）；
   ③ 同位置的快速二连击在 touchend 里吃掉第二次（在 climb.js 的 killDoubleTap）。 */
.btn, .btn--ghost, .chatbtn, .mapbtn, .taskbtn, .pausebtn, .chip, .hud__coins, .stance,
input, button, .sheet, .panel { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 手机端别弹"拷贝/查询/放大镜"这一套（2026-09-22 用户反馈双击像触发复制，但没东西可复制）
   iOS 的放大镜是长按/双击选词触发的，靠 user-select + touch-callout 一起堵；
   输入框要留着能选字，所以单独放行。 */
* { -webkit-touch-callout: none; -webkit-user-drag: none; }
html, body { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.climb { overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
.chatbar__i { -webkit-user-select: text; user-select: text; }
body.climb.is-ios #stage { transform: translateZ(0); }
/* 宽屏（手机横屏）下 .stage 用 translateX(-50%) 居中，上面那条会把居中覆盖掉 → 补回来 */
@media (min-width: 720px) {
  body.climb.is-ios #stage { transform: translateX(-50%) translateZ(0); }
}

/* 画布高度优先用 JS 量出来的 visualViewport（iOS 地址栏收放不跳） */
.stage { height: var(--vvh, 100dvh); }

/* 移动端：长按不要弹系统菜单/放大镜，双击不要缩放 */
body.climb, .stage, .chatbtn, .btn, .stance { -webkit-touch-callout: none; }
body.climb { touch-action: manipulation; }

/* ── 结算页：一眼看懂（大分数 + 名次徽章 / 零碎一行 / 追赶一行）── */
.panel--over .score { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; }
.panel--over .over__rank {
  font-style: normal; font-size: 14px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 12px; border-radius: 999px;
  color: #ffe6a8; background: rgba(255, 190, 80, .16);
  border: 1px solid rgba(255, 209, 102, .45);
}
.panel--over .over__rank:empty { display: none; }
.panel--over .over__line { font-size: 13px; color: rgba(255, 255, 255, .62); margin: 10px 0 0; }
.panel--over .over__beat { font-weight: 400; color: rgba(255, 255, 255, .5); }
.panel--over .over__chase { font-size: 14.5px; color: #ffd166; margin: 8px 0 20px; }
.panel--over .over__best { font-size: 13px; color: rgba(255, 255, 255, .58); margin: 6px 0 0; }
.panel--over .over__chase:empty { margin: 0 0 12px; }
.panel--over .record { margin: 0 0 6px; }

/* ── 换地图 / 投票 / 100 层提示 ── */
#btn-scene { margin-top: 0; }   /* 现在它和「每日任务」并排，间距交给 .row2 */
.scenes { display: grid; gap: 8px; margin-top: 12px; }
.scene {
  display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto;
  align-items: center; gap: 2px 10px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.045); color: #fff; cursor: pointer;
}
.scene.is-on { border-color: rgba(255,209,102,.6); background: rgba(255,190,80,.12); }
.scene__dot { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; }
.scene__dot--cloud { background: linear-gradient(160deg,#8fd0f5,#ffffff); }
.scene__dot--noon { background: linear-gradient(160deg,#2fa2ef,#c8ecff); }
.scene__dot--dusk { background: linear-gradient(160deg,#7a4fa8,#ff9d63); }
.scene__dot--night { background: linear-gradient(160deg,#101736,#3d4380); }
.scene__dot--aurora { background: linear-gradient(160deg,#171f4a 40%,#5cf2c0 75%,#c98cff); }
.scene__dot--snow { background: linear-gradient(160deg,#ffd9a8,#e8f2ff); }
.scene__n { font-size: 15px; font-weight: 700; }
.scene__d { font-size: 12px; color: rgba(255,255,255,.55); }

.vote {
  position: fixed; left: 10px; right: 10px; z-index: 62;
  top: calc(env(safe-area-inset-top, 0px) + 36px);
  padding: 12px 14px; border-radius: 16px;
  background: rgba(18, 22, 36, .96); border: 1px solid rgba(255,209,102,.45);
  box-shadow: 0 14px 34px rgba(0,0,0,.5);
}
.vote__t { margin: 0; font-size: 14px; font-weight: 600; color: #ffe6a8; }
.vote__c { margin: 4px 0 0; font-size: 12px; color: rgba(255,255,255,.6); }
.vote__acts { display: flex; gap: 8px; margin-top: 10px; }
.vote__m { margin: 8px 0 0; font-size: 12px; color: rgba(255,255,255,.55); }
.vote__m:empty { display: none; }
