/* =========================================================
   上班族 · OFFICE RUSH — 界面样式
   ========================================================= */

:root {
  --ink: #171d2b;
  --ink-soft: #2a3245;
  --cream: #fff8e9;
  --paper: #fffaf0;
  --paper-deep: #f5ead5;
  --orange: #ff6b35;
  --orange-dark: #b64318;
  --gold: #ffc83d;
  --gold-deep: #e0a516;
  --mint: #69d39a;
  --red: #ff5d5d;
  --muted: #8c8a80;
  --line: rgba(23, 29, 43, 0.14);
  --shadow-hard: 8px 8px 0 rgba(11, 15, 24, 0.38);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Segoe UI", sans-serif;
  --font-hand: "STKaiti", "KaiTi", "Kaiti SC", "FangSong", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0d1220;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--cream);
  background: #0d1220;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

::selection {
  color: var(--ink);
  background: var(--gold);
}

.hidden {
  display: none !important;
}

/* ================= 页面背景 ================= */

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: clamp(10px, 2.6vh, 32px) 14px clamp(8px, 1.8vh, 20px);
  isolation: isolate;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% -20%, #26324c 0%, transparent 58%),
    linear-gradient(160deg, #111827 0%, #0b0f1a 64%, #0c101a 100%);
}

.page-bg__glow {
  position: absolute;
  width: 58vw;
  height: 58vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.17;
}

.page-bg__glow--one {
  top: -24vw;
  left: -8vw;
  background: #ff9b4a;
}

.page-bg__glow--two {
  right: -18vw;
  bottom: -30vw;
  background: #4469cf;
  opacity: 0.22;
}

.page-bg__grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

.shell {
  position: relative;
  width: min(1200px, 94vw, calc((100svh - 94px) * 16 / 9));
  max-width: 100%;
}

/* ================= 游戏舞台 ================= */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: clamp(12px, 1.7cqw, 24px);
  overflow: hidden;
  isolation: isolate;
  background: #171d2b;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 0 rgba(255, 255, 255, 0.08) inset,
    0 32px 90px rgba(0, 0, 0, 0.58),
    0 6px 22px rgba(0, 0, 0, 0.36);
  container-name: stage;
  container-type: inline-size;
}

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

.stage-grain,
.stage-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.stage-grain {
  opacity: 0.075;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.stage-vignette {
  background:
    radial-gradient(ellipse at 50% 46%, transparent 54%, rgba(6, 9, 16, 0.38) 100%),
    linear-gradient(180deg, rgba(7, 10, 17, 0.34) 0%, transparent 17%, transparent 82%, rgba(7, 10, 17, 0.24) 100%);
}

/* ================= HUD ================= */

.hud {
  position: absolute;
  inset: 0;
  z-index: 12;
  padding: clamp(8px, 1.8cqw, 22px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-7px);
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

.hud.is-live {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.hud-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(4px, 0.7cqw, 9px);
}

.pay-card,
.clock-card,
.distance-card {
  color: var(--cream);
  background: rgba(15, 20, 32, 0.78);
  border: 1px solid rgba(255, 248, 233, 0.16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.pay-card {
  display: flex;
  align-items: baseline;
  gap: clamp(6px, 0.9cqw, 12px);
  min-width: clamp(122px, 16cqw, 202px);
  padding: clamp(5px, 0.8cqw, 10px) clamp(9px, 1.25cqw, 16px);
  border-radius: clamp(8px, 1cqw, 13px);
  border-left: 3px solid var(--gold);
}

.hud-kicker {
  color: rgba(255, 248, 233, 0.58);
  font-size: clamp(7px, 0.9cqw, 11px);
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.pay-card strong {
  color: var(--gold);
  font-family: var(--font-num);
  font-size: clamp(15px, 2.2cqw, 28px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(255, 200, 61, 0.26);
}

.energy-card {
  width: clamp(128px, 17.5cqw, 218px);
  padding: clamp(5px, 0.75cqw, 9px) clamp(8px, 1.1cqw, 14px);
  border-radius: clamp(7px, 0.9cqw, 11px);
  background: rgba(15, 20, 32, 0.72);
  border: 1px solid rgba(255, 248, 233, 0.13);
  backdrop-filter: blur(10px);
}

.overtime-chip {
  display: none;
  align-items: center;
  gap: clamp(4px, 0.55cqw, 7px);
  padding: clamp(3px, 0.45cqw, 5px) clamp(7px, 0.9cqw, 11px);
  color: #ffd9c9;
  background: rgba(77, 24, 17, 0.82);
  border: 1px solid rgba(255, 113, 72, 0.44);
  border-radius: 99px;
  box-shadow: 0 4px 14px rgba(44, 8, 4, 0.16);
  font-size: clamp(7px, 0.82cqw, 10px);
  font-weight: 800;
  letter-spacing: 0.055em;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.overtime-chip.is-on {
  display: inline-flex;
  animation: overtimeGlow 2.4s ease-in-out infinite;
}

.overtime-flag {
  display: inline-grid;
  place-items: center;
  min-width: 1.9em;
  min-height: 1.45em;
  padding: 0.1em 0.28em;
  color: #2b120d;
  background: #ff8b58;
  border-radius: 0.3em;
  font-family: var(--font-num);
  font-size: 0.84em;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.overtime-chip b {
  color: var(--gold);
  font-family: var(--font-num);
  font-size: 1.12em;
  letter-spacing: 0;
}

@keyframes overtimeGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
  50% { box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12); }
}

.fatigue-chip {
  display: none;
  align-items: center;
  gap: clamp(4px, 0.55cqw, 7px);
  padding: clamp(3px, 0.45cqw, 5px) clamp(7px, 0.9cqw, 11px);
  border-radius: 99px;
  font-size: clamp(7px, 0.82cqw, 10px);
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.fatigue-chip.is-on {
  display: inline-flex;
}

.fatigue-chip.is-light {
  color: #ffe2a6;
  background: rgba(78, 57, 22, 0.84);
  border: 1px solid rgba(255, 197, 89, 0.38);
}

.fatigue-chip.is-severe {
  color: #ffd2c8;
  background: rgba(83, 23, 20, 0.88);
  border: 1px solid rgba(255, 105, 80, 0.5);
  animation: fatiguePulse 1s ease-in-out infinite;
}

.fatigue-dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.fatigue-chip small {
  color: currentColor;
  font-family: var(--font-num);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
}

@keyframes fatiguePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 86, 60, 0); }
  50% { box-shadow: 0 0 0 3px rgba(255, 86, 60, 0.14); }
}

.energy-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: clamp(3px, 0.45cqw, 6px);
  color: rgba(255, 248, 233, 0.72);
  font-size: clamp(7px, 0.85cqw, 10px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.energy-top :last-child {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.energy-bolt {
  font-style: normal;
  color: var(--gold);
}

.energy-track {
  height: clamp(4px, 0.55cqw, 7px);
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.energy-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffbf3a, #7be0a5);
  box-shadow: 0 0 12px rgba(123, 224, 165, 0.35);
  transform-origin: left center;
  transition: width 0.16s linear, background 0.3s ease;
}

.energy-card.is-low .energy-fill {
  background: linear-gradient(90deg, #ff4d4d, #ff9a43);
  animation: energyPulse 0.8s ease-in-out infinite;
}

.energy-card.is-low .energy-top :first-child {
  color: #ffb39c;
}

@keyframes energyPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.48; }
}

.hud-right {
  position: absolute;
  top: clamp(8px, 1.8cqw, 22px);
  right: clamp(8px, 1.8cqw, 22px);
  display: flex;
  align-items: stretch;
  gap: clamp(4px, 0.65cqw, 8px);
}

.clock-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: clamp(58px, 7.4cqw, 96px);
  padding: clamp(4px, 0.65cqw, 8px) clamp(7px, 0.95cqw, 12px);
  border-radius: clamp(7px, 0.9cqw, 11px);
  text-align: right;
}

.clock-card > span {
  font-family: var(--font-num);
  font-size: clamp(12px, 1.65cqw, 21px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.05;
}

.clock-card small {
  margin-top: 2px;
  color: rgba(255, 248, 233, 0.5);
  font-size: clamp(6px, 0.72cqw, 9px);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.distance-card {
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: clamp(4px, 0.65cqw, 8px) clamp(7px, 0.95cqw, 12px);
  border-radius: clamp(7px, 0.9cqw, 11px);
}

.distance-card span {
  font-family: var(--font-num);
  font-size: clamp(12px, 1.55cqw, 20px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.distance-card small {
  color: rgba(255, 248, 233, 0.48);
  font-size: clamp(6px, 0.7cqw, 9px);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: clamp(27px, 3.4cqw, 42px);
  height: auto;
  min-height: clamp(27px, 3.4cqw, 42px);
  padding: 0;
  color: var(--cream);
  background: rgba(15, 20, 32, 0.78);
  border: 1px solid rgba(255, 248, 233, 0.16);
  border-radius: clamp(7px, 0.9cqw, 11px);
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  transition: background 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover {
  background: rgba(42, 51, 73, 0.94);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn svg {
  width: 45%;
  height: 45%;
  fill: currentColor;
}

.icon-btn .icon-off {
  display: none;
}

body.is-muted .icon-btn .icon-on {
  display: none;
}

body.is-muted .icon-btn .icon-off {
  display: block;
}

.combo-float {
  position: absolute;
  top: clamp(12px, 2cqw, 24px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.7cqw, 9px);
  padding: clamp(4px, 0.55cqw, 7px) clamp(9px, 1.2cqw, 15px) clamp(4px, 0.55cqw, 7px) clamp(6px, 0.8cqw, 10px);
  color: var(--ink);
  background: linear-gradient(135deg, #ffe785, var(--gold));
  border: 2px solid rgba(23, 29, 43, 0.88);
  border-radius: 99px;
  box-shadow: 3px 3px 0 rgba(23, 29, 43, 0.5);
  transform: translateX(-50%) translateY(-10px) scale(0.82);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.combo-float.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.combo-float.is-hot {
  animation: comboPop 0.19s ease both;
}

@keyframes comboPop {
  0% { transform: translateX(-50%) scale(1.18) rotate(-2deg); }
  100% { transform: translateX(-50%) scale(1) rotate(0); }
}

.combo-x {
  font-family: var(--font-num);
  font-size: clamp(14px, 1.85cqw, 24px);
  font-weight: 900;
  line-height: 1;
}

.combo-copy {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: clamp(7px, 0.8cqw, 10px);
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.combo-copy b {
  font-family: var(--font-num);
  font-size: clamp(10px, 1.15cqw, 14px);
}

.buff-chip {
  position: absolute;
  top: clamp(47px, 6.1cqw, 78px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.55cqw, 7px);
  padding: clamp(3px, 0.42cqw, 5px) clamp(7px, 0.85cqw, 11px);
  color: #dfffe9;
  background: rgba(17, 54, 40, 0.85);
  border: 1px solid rgba(105, 211, 154, 0.4);
  border-radius: 99px;
  font-size: clamp(7px, 0.78cqw, 10px);
  font-weight: 700;
  letter-spacing: 0.03em;
  transform: translateX(-50%) translateY(-6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.buff-chip.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.buff-x {
  color: var(--gold);
  font-family: var(--font-num);
  font-weight: 900;
}

.buff-chip b {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* ================= 新手提示 / 触屏按钮 / 通知 ================= */

.tutorial-strip {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 1.8cqw, 22px);
  z-index: 11;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1cqw, 13px);
  padding: clamp(5px, 0.7cqw, 8px) clamp(10px, 1.4cqw, 18px);
  color: rgba(255, 248, 233, 0.8);
  background: rgba(13, 18, 30, 0.72);
  border: 1px solid rgba(255, 248, 233, 0.14);
  border-radius: 99px;
  font-size: clamp(7px, 0.88cqw, 11px);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  pointer-events: none;
}

.tutorial-strip.is-on {
  opacity: 1;
  visibility: visible;
}

.tutorial-strip i {
  width: 1px;
  height: 10px;
  background: rgba(255, 248, 233, 0.2);
}

.tutorial-strip kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 1px 5px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 248, 233, 0.2);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.92em;
  font-weight: 700;
}

.mobile-pad {
  position: absolute;
  right: clamp(10px, 3vw, 26px);
  bottom: clamp(10px, 2.5vh, 18px);
  z-index: 18;
  display: none;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s, transform 0.25s ease;
}

.mobile-pad.is-live {
  opacity: 1;
  visibility: visible;
}

.mobile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: clamp(46px, 6vw, 62px);
  height: clamp(46px, 6vw, 62px);
  padding: 0;
  color: var(--cream);
  background: rgba(19, 25, 38, 0.78);
  border: 1.5px solid rgba(255, 248, 233, 0.28);
  border-radius: 50%;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
  font-size: clamp(8px, 1.3vw, 11px);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(8px);
}

.mobile-btn--jump {
  background: rgba(255, 107, 53, 0.88);
  border-color: rgba(255, 235, 197, 0.55);
}

.mobile-btn:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: none;
}

.mobile-btn__arrow {
  font-family: var(--font-num);
  font-size: clamp(16px, 2.2vw, 24px);
  font-weight: 900;
  line-height: 1;
}

.mobile-btn small {
  font-size: 0.92em;
  font-weight: 700;
  opacity: 0.85;
}

.toasts {
  position: absolute;
  top: clamp(65px, 9.5cqw, 112px);
  left: 50%;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(92%, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 15px;
  color: var(--cream);
  background: rgba(17, 23, 37, 0.94);
  border: 1px solid rgba(255, 248, 233, 0.16);
  border-left: 3px solid var(--gold);
  border-radius: 7px;
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.3);
  font-size: clamp(8px, 0.92cqw, 12px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  animation: toastIn 0.24s ease both, toastOut 0.32s ease 2.15s both;
}

.toast.is-money {
  border-left-color: var(--mint);
}

.toast.is-warn {
  border-left-color: var(--red);
}

.toast.is-up {
  border-left-color: var(--orange);
}

.toast b {
  color: var(--gold);
  font-family: var(--font-num);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-6px); }
}

/* ================= 通用面板 / 按钮 ================= */

.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
}

.start-screen {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(10, 14, 24, 0.96) 0%, rgba(10, 14, 24, 0.9) 33%, rgba(10, 14, 24, 0.54) 60%, rgba(10, 14, 24, 0.06) 86%),
    linear-gradient(0deg, rgba(8, 12, 20, 0.68) 0%, transparent 35%, transparent 78%, rgba(8, 12, 20, 0.2) 100%);
  animation: screenIn 0.55s ease both;
}

@keyframes screenIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.start-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 4cqw;
  min-height: 0;
  padding: clamp(16px, 4.8cqw, 62px) clamp(20px, 5.6cqw, 72px);
}

.start-copy {
  position: relative;
  z-index: 2;
  width: min(58%, 610px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.7cqw, 9px);
  margin-bottom: clamp(9px, 1.5cqw, 19px);
  color: var(--gold);
  font-size: clamp(8px, 0.92cqw, 12px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: clamp(5px, 0.55cqw, 7px);
  height: clamp(5px, 0.55cqw, 7px);
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(105, 211, 154, 0.14);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 4px rgba(105, 211, 154, 0.14); }
  50% { opacity: 0.55; box-shadow: 0 0 0 7px rgba(105, 211, 154, 0.04); }
}

.logo {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 950;
  line-height: 0.9;
}

.logo-main {
  position: relative;
  display: inline-block;
  width: max-content;
  color: var(--cream);
  font-size: clamp(38px, 9cqw, 106px);
  letter-spacing: -0.075em;
  text-shadow:
    4px 4px 0 var(--orange),
    8px 8px 0 rgba(10, 13, 21, 0.35),
    0 26px 55px rgba(255, 107, 53, 0.2);
}

.logo-main::after {
  position: absolute;
  right: -0.29em;
  bottom: 0.07em;
  width: 0.16em;
  height: 0.16em;
  content: "";
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 0.04em rgba(255, 200, 61, 0.2);
}

.logo-en {
  margin-top: clamp(9px, 1.45cqw, 18px);
  color: var(--gold);
  font-family: var(--font-num);
  font-size: clamp(7px, 1.3cqw, 17px);
  font-weight: 700;
  letter-spacing: 0.42em;
}

.lead {
  margin: clamp(12px, 1.9cqw, 24px) 0 0;
  color: rgba(255, 248, 233, 0.7);
  font-size: clamp(10px, 1.2cqw, 16px);
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.03em;
}

.difficulty-switch {
  display: flex;
  width: min(100%, 460px);
  margin-top: clamp(11px, 1.65cqw, 20px);
  padding: 4px;
  gap: 4px;
  background: rgba(8, 12, 21, 0.46);
  border: 1px solid rgba(255, 248, 233, 0.13);
  border-radius: clamp(9px, 1cqw, 12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(9px);
}

.difficulty-option {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: clamp(6px, 0.78cqw, 10px) clamp(8px, 1.05cqw, 13px);
  color: rgba(255, 248, 233, 0.52);
  background: transparent;
  border: 1px solid transparent;
  border-radius: clamp(6px, 0.72cqw, 9px);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.difficulty-option:hover {
  color: var(--cream);
  background: rgba(255, 248, 233, 0.06);
}

.difficulty-option.is-active {
  color: var(--ink);
  background: linear-gradient(135deg, #ffe58b, var(--gold));
  border-color: rgba(255, 244, 197, 0.55);
  box-shadow: 0 2px 0 rgba(133, 82, 8, 0.23);
}

.difficulty-option[data-difficulty="overtime"].is-active {
  color: #fff6ee;
  background: linear-gradient(135deg, #ff8e55, #d9472d);
  border-color: rgba(255, 199, 158, 0.5);
  box-shadow: 0 2px 0 rgba(76, 17, 10, 0.55);
}

.difficulty-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(9px, 1.02cqw, 13px);
  font-weight: 850;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.difficulty-name b {
  color: var(--gold);
  font-family: var(--font-num);
  font-size: 1.04em;
  letter-spacing: 0;
}

.difficulty-option.is-active .difficulty-name b {
  color: #9a3f17;
}

.difficulty-option[data-difficulty="overtime"].is-active .difficulty-name b {
  color: #ffe178;
}

.difficulty-option small {
  overflow: hidden;
  max-width: 100%;
  font-size: clamp(7px, 0.76cqw, 9.5px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  opacity: 0.8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.difficulty-option.is-active small {
  color: rgba(28, 23, 14, 0.58);
  opacity: 1;
}

.difficulty-option[data-difficulty="overtime"].is-active small {
  color: rgba(255, 238, 224, 0.78);
}

.start-screen.is-overtime .eyebrow-dot {
  background: #ff7850;
  box-shadow: 0 0 0 4px rgba(255, 120, 80, 0.16);
}

.start-screen.is-overtime .btn-primary {
  background: linear-gradient(135deg, #ffe07b 0%, #ffb24a 42%, #ff7047 100%);
  box-shadow:
    0 0.35em 0 #9b341b,
    0 0.8em 1.8em rgba(255, 91, 53, 0.26);
}

.start-screen.is-overtime .btn-primary:hover {
  box-shadow:
    0 0.5em 0 #9b341b,
    0 1.1em 2.2em rgba(255, 91, 53, 0.34);
}

.overtime-config {
  display: none;
  width: min(100%, 460px);
  margin-top: clamp(6px, 0.8cqw, 9px);
  padding: clamp(8px, 1cqw, 12px);
  background: rgba(30, 15, 12, 0.46);
  border: 1px solid rgba(255, 126, 84, 0.22);
  border-radius: clamp(8px, 0.9cqw, 11px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(9px);
}

.overtime-config.is-on {
  display: block;
  animation: configIn 0.28s ease both;
}

@keyframes configIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.overtime-config__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 235, 220, 0.6);
  font-size: clamp(7px, 0.78cqw, 10px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.overtime-config__head b {
  color: #ffd167;
  font-family: var(--font-num);
  font-size: clamp(13px, 1.55cqw, 20px);
  letter-spacing: 0;
  line-height: 1;
}

.multiplier-options {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  margin-top: clamp(5px, 0.7cqw, 8px);
}

.multiplier-option {
  min-width: 0;
  padding: clamp(4px, 0.55cqw, 7px) 2px;
  color: rgba(255, 238, 225, 0.56);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 235, 218, 0.12);
  border-radius: 4px;
  font-family: var(--font-num);
  font-size: clamp(8px, 0.9cqw, 11px);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}

.multiplier-option:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 214, 186, 0.3);
}

.multiplier-option.is-active {
  color: #2d130d;
  background: #ff8b58;
  border-color: #ffc09c;
  box-shadow: 0 2px 0 rgba(73, 19, 9, 0.5);
}

.overtime-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(7px, 1.3cqw, 17px);
  margin-top: clamp(6px, 0.8cqw, 9px);
  color: rgba(255, 236, 222, 0.44);
  font-size: clamp(7px, 0.76cqw, 9.5px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.overtime-readout span {
  white-space: nowrap;
}

.overtime-readout b {
  margin-left: 2px;
  color: #ffd88c;
  font-family: var(--font-num);
  font-size: 1.06em;
  font-variant-numeric: tabular-nums;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(7px, 1cqw, 12px);
  margin-top: clamp(15px, 2.3cqw, 30px);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 0.9cqw, 12px);
  padding: clamp(8px, 1.15cqw, 15px) clamp(13px, 1.8cqw, 24px);
  color: var(--ink);
  border: 0;
  border-radius: clamp(8px, 0.9cqw, 12px);
  font-size: clamp(10px, 1.15cqw, 16px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.18s ease;
}

.btn kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5em;
  padding: 0.18em 0.42em;
  color: inherit;
  background: rgba(23, 29, 43, 0.12);
  border: 1px solid rgba(23, 29, 43, 0.18);
  border-radius: 0.3em;
  font-family: var(--font-num);
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.66;
}

.btn-primary {
  color: #201a10;
  background: linear-gradient(135deg, #ffe17b 0%, var(--gold) 44%, #ff9d45 100%);
  box-shadow:
    0 0.35em 0 var(--orange-dark),
    0 0.8em 1.8em rgba(255, 107, 53, 0.24);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0.5em 0 var(--orange-dark),
    0 1.1em 2.2em rgba(255, 107, 53, 0.3);
}

.btn-primary:active {
  transform: translateY(0.25em);
  box-shadow:
    0 0.1em 0 var(--orange-dark),
    0 0.35em 0.9em rgba(255, 107, 53, 0.18);
}

.btn-secondary {
  color: var(--cream);
  background: rgba(255, 248, 233, 0.08);
  border: 1px solid rgba(255, 248, 233, 0.22);
  box-shadow: 0 0.35em 0 rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 248, 233, 0.14);
  transform: translateY(-1px);
}

.btn-icon {
  color: var(--gold);
  font-family: var(--font-num);
  font-size: 1.08em;
  font-weight: 700;
  line-height: 1;
}

.btn-text {
  color: rgba(255, 248, 233, 0.62);
  background: transparent;
  box-shadow: none;
  border: 1px solid transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.05);
}

.start-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(6px, 1.1cqw, 15px);
  margin-top: clamp(11px, 1.6cqw, 21px);
  color: rgba(255, 248, 233, 0.5);
  font-size: clamp(8px, 0.9cqw, 11.5px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.start-stats i {
  width: 1px;
  height: 0.9em;
  background: rgba(255, 248, 233, 0.16);
}

.start-stats b {
  margin-left: 0.22em;
  color: var(--cream);
  font-family: var(--font-num);
  font-size: 1.08em;
  font-variant-numeric: tabular-nums;
}

.start-stats span:last-child b {
  color: var(--gold);
  font-family: var(--font-sans);
}

.howto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(7px, 1.2cqw, 16px);
  margin-top: clamp(10px, 1.5cqw, 20px);
  color: rgba(255, 248, 233, 0.48);
  font-size: clamp(8px, 0.88cqw, 11.5px);
}

.howto > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.howto kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  padding: 0.24em 0.46em;
  color: rgba(255, 248, 233, 0.8);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 248, 233, 0.2);
  border-radius: 0.32em;
  font-family: var(--font-num);
  font-size: 0.9em;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.howto em {
  font-style: normal;
}

.touch-key {
  display: none !important;
}

.sound-hint {
  margin-left: 0;
}

.text-audio {
  padding: 0;
  color: rgba(255, 248, 233, 0.38);
  background: none;
  border: 0;
  font: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-audio:hover {
  color: var(--gold);
}

.memo-card {
  position: absolute;
  top: 10%;
  right: 4.4%;
  z-index: 1;
  width: clamp(155px, 21cqw, 250px);
  padding: clamp(13px, 1.8cqw, 23px);
  color: #2b261d;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 52%),
    #fff1b8;
  border-radius: 2px;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.7) inset;
  font-family: var(--font-hand);
  transform: rotate(2.4deg);
}

.memo-card::after {
  position: absolute;
  right: 10%;
  bottom: -5px;
  left: 9%;
  height: 8px;
  content: "";
  background: rgba(0, 0, 0, 0.14);
  filter: blur(5px);
}

.memo-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 38%;
  height: 22px;
  background: rgba(255, 250, 225, 0.66);
  border-left: 1px dashed rgba(93, 79, 49, 0.16);
  border-right: 1px dashed rgba(93, 79, 49, 0.16);
  transform: translateX(-50%) rotate(-2deg);
  backdrop-filter: blur(1px);
}

.memo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.35em;
  border-bottom: 1.5px dashed rgba(63, 51, 29, 0.35);
  font-size: clamp(12px, 1.45cqw, 17px);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.memo-head span {
  color: rgba(63, 51, 29, 0.54);
  font-family: var(--font-num);
  font-size: 0.62em;
  letter-spacing: 0.01em;
}

.memo-list {
  margin: 0.72em 0;
  padding: 0;
  list-style: none;
  font-size: clamp(11px, 1.3cqw, 15px);
  line-height: 1.85;
}

.memo-list li {
  display: flex;
  align-items: center;
  gap: 0.55em;
}

.memo-list li span {
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  color: rgba(63, 51, 29, 0.72);
  border: 1px solid rgba(63, 51, 29, 0.35);
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 0.7em;
  font-weight: 700;
}

.memo-list li:last-child {
  color: #b84a2a;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.memo-note {
  margin: 0.85em 0 0;
  padding-top: 0.6em;
  color: rgba(63, 51, 29, 0.52);
  border-top: 1px dashed rgba(63, 51, 29, 0.22);
  font-size: clamp(8px, 0.9cqw, 11px);
  line-height: 1.65;
}

.memo-sign {
  margin-top: 0.45em;
  color: rgba(63, 51, 29, 0.7);
  font-size: clamp(10px, 1.1cqw, 13px);
  text-align: right;
}

.start-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(20px, 5.6cqw, 72px) clamp(12px, 2.2cqw, 28px);
  color: rgba(255, 248, 233, 0.28);
  font-size: clamp(6px, 0.68cqw, 9px);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.start-foot__hint {
  text-align: right;
}

.modal-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 3cqw, 34px);
  overflow-y: auto;
  background: rgba(7, 11, 18, 0.64);
  backdrop-filter: blur(7px) saturate(0.88);
  animation: screenIn 0.25s ease both;
}

.panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 100%;
  padding: clamp(18px, 3.3cqw, 38px);
  overflow-y: auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 200, 61, 0.2), transparent 23%),
    var(--cream);
  border: 2px solid rgba(15, 20, 32, 0.86);
  border-radius: clamp(12px, 1.5cqw, 20px);
  box-shadow:
    var(--shadow-hard),
    0 34px 90px rgba(0, 0, 0, 0.46);
  animation: panelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 29, 43, 0.28) transparent;
}

.panel::-webkit-scrollbar {
  width: 8px;
}

.panel::-webkit-scrollbar-thumb {
  background: rgba(23, 29, 43, 0.22);
  border-radius: 99px;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(18px) rotate(-0.4deg) scale(0.97); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

.panel-tag {
  display: inline-block;
  margin-bottom: 0.7em;
  padding: 0.28em 0.62em;
  color: var(--orange-dark);
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.28);
  border-radius: 99px;
  font-family: var(--font-num);
  font-size: clamp(7px, 0.82cqw, 10px);
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.2;
}

.panel h2 {
  margin: 0;
  font-size: clamp(24px, 3.4cqw, 40px);
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.panel-desc {
  margin: 0.55em 0 0;
  color: rgba(23, 29, 43, 0.55);
  font-size: clamp(9px, 1.02cqw, 13px);
  line-height: 1.7;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(7px, 0.9cqw, 11px);
  margin-top: clamp(14px, 2cqw, 24px);
}

.panel .btn {
  font-size: clamp(10px, 1.05cqw, 14px);
  padding: clamp(9px, 1.05cqw, 13px) clamp(12px, 1.5cqw, 20px);
  border-radius: clamp(7px, 0.8cqw, 10px);
}

.panel .btn-primary kbd,
.panel .btn-secondary kbd {
  color: inherit;
  background: rgba(23, 29, 43, 0.1);
  border-color: rgba(23, 29, 43, 0.16);
}

.panel .btn-secondary {
  color: var(--ink);
  background: #fffaf0;
  border: 1.5px solid rgba(23, 29, 43, 0.25);
  box-shadow: 0 0.3em 0 rgba(23, 29, 43, 0.12);
}

.panel .btn-secondary:hover {
  background: #fff;
  border-color: rgba(23, 29, 43, 0.45);
}

.panel .btn-text {
  color: rgba(23, 29, 43, 0.54);
}

.panel .btn-text:hover {
  color: var(--ink);
  background: rgba(23, 29, 43, 0.05);
}

.panel-tip {
  margin: 1em 0 0;
  color: rgba(23, 29, 43, 0.42);
  font-size: clamp(8px, 0.82cqw, 10px);
  line-height: 1.6;
  text-align: center;
}

/* ================= 暂停 ================= */

.pause-panel {
  width: min(480px, 100%);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: clamp(14px, 2.2cqw, 25px) 0 0;
  overflow: hidden;
  background: rgba(23, 29, 43, 0.1);
  border: 1px solid rgba(23, 29, 43, 0.1);
  border-radius: clamp(8px, 0.9cqw, 11px);
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(9px, 1.3cqw, 15px);
  background: var(--paper);
}

.stat-cell span {
  color: rgba(23, 29, 43, 0.44);
  font-size: clamp(7px, 0.78cqw, 10px);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-cell b {
  color: var(--ink);
  font-family: var(--font-num);
  font-size: clamp(14px, 1.7cqw, 21px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pause-panel .panel-actions .btn {
  flex: 1;
}

/* ================= 结算 ================= */

.result-panel {
  width: min(800px, 100%);
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(18px, 3cqw, 38px);
}

.result-title-wrap {
  flex: 1;
  min-width: 0;
}

.result-title-wrap h2 {
  font-size: clamp(27px, 4cqw, 48px);
  line-height: 1.02;
}

.result-title-wrap p {
  margin: 0.65em 0 0;
  color: rgba(23, 29, 43, 0.55);
  font-size: clamp(9px, 1cqw, 12px);
  line-height: 1.65;
}

.grade-stamp {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(66px, 10.5cqw, 112px);
  height: clamp(66px, 10.5cqw, 112px);
  color: var(--orange-dark);
  background:
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, 0.5) 7px 14px),
    #ffe08d;
  border: clamp(2px, 0.3cqw, 4px) solid var(--orange-dark);
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(255, 107, 53, 0.16),
    5px 5px 0 rgba(23, 29, 43, 0.12);
  font-family: var(--font-num);
  transform: rotate(-8deg);
}

.grade-stamp span {
  font-size: clamp(27px, 4.4cqw, 52px);
  font-weight: 950;
  line-height: 0.9;
}

.grade-stamp small {
  margin-top: 0.35em;
  color: rgba(148, 57, 22, 0.8);
  font-family: var(--font-sans);
  font-size: clamp(6px, 0.68cqw, 8px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.result-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(14px, 2.4cqw, 26px);
  margin: clamp(13px, 2cqw, 22px) 0;
  padding: clamp(12px, 1.9cqw, 20px) 0;
  border-top: 1.5px dashed rgba(23, 29, 43, 0.18);
  border-bottom: 1.5px dashed rgba(23, 29, 43, 0.18);
}

.result-money {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.result-money > span {
  color: rgba(23, 29, 43, 0.44);
  font-size: clamp(8px, 0.84cqw, 11px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.result-money b {
  color: var(--orange-dark);
  font-family: var(--font-num);
  font-size: clamp(32px, 5.2cqw, 60px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.result-money em {
  color: rgba(23, 29, 43, 0.38);
  font-size: clamp(7px, 0.76cqw, 10px);
  font-style: normal;
}

.result-money em.is-new {
  color: var(--orange-dark);
  font-weight: 700;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(7px, 1cqw, 12px);
}

.result-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: clamp(6px, 0.85cqw, 10px) clamp(7px, 0.95cqw, 12px);
  background: rgba(23, 29, 43, 0.035);
  border: 1px solid rgba(23, 29, 43, 0.08);
  border-radius: clamp(5px, 0.65cqw, 8px);
}

.result-stats span {
  color: rgba(23, 29, 43, 0.4);
  font-size: clamp(6px, 0.68cqw, 8px);
  font-weight: 600;
  white-space: nowrap;
}

.result-stats b {
  font-family: var(--font-num);
  font-size: clamp(11px, 1.32cqw, 17px);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.rank-line {
  margin-top: clamp(11px, 1.6cqw, 18px);
}

.rank-line__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 0.55em;
  font-size: clamp(8px, 0.85cqw, 11px);
}

.rank-line__top > span {
  color: rgba(23, 29, 43, 0.45);
  font-weight: 600;
}

.rank-line__top b {
  color: var(--orange-dark);
  font-size: 1.12em;
}

.rank-line__top small {
  margin-left: auto;
  color: rgba(23, 29, 43, 0.38);
  font-size: 0.85em;
  text-align: right;
}

.rank-bar {
  height: clamp(5px, 0.55cqw, 7px);
  overflow: hidden;
  background: rgba(23, 29, 43, 0.1);
  border-radius: 99px;
}

.rank-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-actions {
  margin-top: clamp(14px, 2cqw, 22px);
}

.result-actions .btn-primary {
  flex: 1.2;
}

/* ================= 商店 ================= */

.shop-panel {
  width: min(930px, 100%);
  padding: clamp(16px, 2.4cqw, 28px);
}

.shop-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 2cqw, 24px);
}

.shop-title {
  flex: 1;
  min-width: 0;
}

.shop-title h2 {
  font-size: clamp(22px, 2.8cqw, 34px);
}

.shop-title p {
  margin: 0.5em 0 0;
  color: rgba(23, 29, 43, 0.45);
  font-size: clamp(8px, 0.85cqw, 11px);
  line-height: 1.5;
}

.shop-wallet {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 0.55em 0.8em;
  background: rgba(23, 29, 43, 0.04);
  border: 1px solid rgba(23, 29, 43, 0.1);
  border-radius: clamp(7px, 0.85cqw, 10px);
}

.shop-wallet span {
  color: rgba(23, 29, 43, 0.42);
  font-size: clamp(6px, 0.68cqw, 8px);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.shop-wallet b {
  color: var(--orange-dark);
  font-family: var(--font-num);
  font-size: clamp(17px, 2cqw, 24px);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.close-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(24px, 2.5cqw, 31px);
  height: clamp(24px, 2.5cqw, 31px);
  padding: 0;
  color: rgba(23, 29, 43, 0.5);
  background: rgba(23, 29, 43, 0.05);
  border: 1px solid rgba(23, 29, 43, 0.1);
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: clamp(15px, 1.6cqw, 20px);
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}

.close-btn:hover {
  color: var(--ink);
  background: rgba(23, 29, 43, 0.1);
  transform: rotate(90deg);
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 0.9cqw, 11px);
  margin: clamp(12px, 1.8cqw, 20px) 0;
}

.upgrade-card {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8cqw, 9px);
  padding: clamp(9px, 1.15cqw, 14px);
  background: var(--paper);
  border: 1.5px solid rgba(23, 29, 43, 0.16);
  border-radius: clamp(7px, 0.9cqw, 11px);
  box-shadow: 0 3px 0 rgba(23, 29, 43, 0.06);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.upgrade-card:hover {
  border-color: rgba(23, 29, 43, 0.38);
  box-shadow: 0 5px 0 rgba(23, 29, 43, 0.08);
  transform: translateY(-1px);
}

.upgrade-card.is-max {
  background:
    linear-gradient(135deg, rgba(255, 200, 61, 0.12), transparent 60%),
    var(--paper);
  border-color: rgba(255, 150, 39, 0.37);
}

.upgrade-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.upgrade-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(28px, 3.2cqw, 39px);
  height: clamp(28px, 3.2cqw, 39px);
  background: #fff3d2;
  border: 1px solid rgba(23, 29, 43, 0.12);
  border-radius: clamp(6px, 0.8cqw, 9px);
  font-size: clamp(14px, 1.7cqw, 21px);
  line-height: 1;
}

.upgrade-name {
  flex: 1;
  min-width: 0;
}

.upgrade-name h3 {
  margin: 0;
  font-size: clamp(10px, 1.1cqw, 14px);
  font-weight: 850;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.upgrade-level {
  display: inline-block;
  margin-top: 3px;
  color: var(--orange-dark);
  font-family: var(--font-num);
  font-size: clamp(6px, 0.68cqw, 8px);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.upgrade-desc {
  margin: 0;
  color: rgba(23, 29, 43, 0.52);
  font-size: clamp(7.5px, 0.8cqw, 10.5px);
  line-height: 1.55;
}

.upgrade-pips {
  display: flex;
  gap: 3px;
}

.upgrade-pips i {
  flex: 1;
  height: clamp(3px, 0.34cqw, 4px);
  background: rgba(23, 29, 43, 0.1);
  border-radius: 99px;
}

.upgrade-pips i.is-on {
  background: var(--gold-deep);
}

.upgrade-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.upgrade-effect {
  flex: 1;
  min-width: 0;
  color: rgba(23, 29, 43, 0.44);
  font-size: clamp(6.5px, 0.72cqw, 9px);
  line-height: 1.35;
}

.buy-btn {
  flex: 0 0 auto;
  min-width: 4.8em;
  padding: 0.55em 0.72em;
  color: var(--ink);
  background: var(--gold);
  border: 1.5px solid rgba(23, 29, 43, 0.82);
  border-radius: 0.4em;
  box-shadow: 0 2px 0 rgba(23, 29, 43, 0.75);
  font-family: var(--font-num);
  font-size: clamp(7px, 0.78cqw, 10px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.13s, box-shadow 0.13s, background 0.13s;
}

.buy-btn:hover:not(:disabled) {
  background: #ffdc70;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(23, 29, 43, 0.75);
}

.buy-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(23, 29, 43, 0.75);
}

.buy-btn:disabled {
  color: rgba(23, 29, 43, 0.36);
  background: rgba(23, 29, 43, 0.07);
  border-color: rgba(23, 29, 43, 0.14);
  box-shadow: none;
  cursor: not-allowed;
}

.shop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(8px, 1.2cqw, 13px);
  color: rgba(23, 29, 43, 0.35);
  border-top: 1px dashed rgba(23, 29, 43, 0.14);
  font-size: clamp(6px, 0.7cqw, 9px);
}

.link-btn {
  padding: 0;
  color: rgba(23, 29, 43, 0.32);
  background: none;
  border: 0;
  font: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--orange-dark);
}

/* ================= 横屏提示 ================= */

.rotate-hint {
  position: fixed;
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 80;
  display: none;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 11px;
  color: var(--cream);
  background: rgba(17, 23, 37, 0.94);
  border: 1px solid rgba(255, 248, 233, 0.18);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  animation: screenIn 0.35s ease both;
}

.rotate-hint.is-on {
  display: flex;
}

.rotate-icon {
  font-family: var(--font-num);
  color: var(--gold);
  font-size: 1.5em;
  line-height: 1;
}

.rotate-icon span {
  display: inline-block;
  margin-left: 1px;
  font-size: 0.75em;
}

.rotate-hint b {
  display: block;
  font-size: 1em;
  white-space: nowrap;
}

.rotate-hint > span:not(.rotate-icon) {
  color: rgba(255, 248, 233, 0.55);
  line-height: 1.35;
}

.rotate-hint button {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--ink);
  background: var(--gold);
  border: 0;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 700;
  cursor: pointer;
}

/* ================= 页脚 ================= */

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: clamp(7px, 1.2vh, 14px) 4px 0;
  color: rgba(255, 248, 233, 0.26);
  font-size: clamp(8px, 0.75vw, 11px);
  letter-spacing: 0.04em;
}

.site-foot b {
  color: rgba(255, 200, 61, 0.6);
  font-weight: 800;
}

/* ================= 响应式 ================= */

@media (pointer: coarse) {
  .mobile-pad {
    display: flex;
  }

  .desktop-key {
    display: none !important;
  }

  .touch-key {
    display: flex !important;
  }
}

body.is-touch .mobile-pad {
  display: flex;
}

body.is-touch .desktop-key {
  display: none !important;
}

body.is-touch .touch-key {
  display: flex !important;
}

@container stage (max-width: 1050px) {
  .start-screen.is-overtime .lead {
    display: none;
  }

  .start-screen.is-overtime .start-inner {
    padding-top: clamp(12px, 3.4cqw, 42px);
    padding-bottom: clamp(12px, 3.4cqw, 42px);
  }
}

@container stage (max-width: 900px) {
  .memo-card {
    display: none;
  }

  .start-copy {
    width: min(72%, 610px);
  }

  .lead {
    max-width: 32em;
  }

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

  .shop-title p {
    display: none;
  }
}

@container stage (max-width: 720px) {
  .hud {
    padding: 7px;
  }

  .hud-right {
    top: 7px;
    right: 7px;
  }

  .pay-card {
    min-width: 112px;
    padding: 4px 8px;
    border-left-width: 2px;
  }

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

  .pay-card strong {
    font-size: 15px;
  }

  .energy-card {
    width: 118px;
    padding: 4px 7px;
  }

  .clock-card {
    min-width: 52px;
    padding: 3px 6px;
  }

  .clock-card > span {
    font-size: 12px;
  }

  .clock-card small {
    font-size: 6px;
  }

  .distance-card {
    display: none;
  }

  .icon-btn {
    width: 27px;
    min-height: 27px;
  }

  .combo-float {
    top: 8px;
    padding: 3px 8px 3px 5px;
  }

  .combo-x {
    font-size: 13px;
  }

  .combo-copy {
    font-size: 7px;
  }

  .combo-copy b {
    font-size: 9px;
  }

  .buff-chip {
    top: 38px;
    font-size: 7px;
  }

  .tutorial-strip {
    bottom: 8px;
    font-size: 7px;
    padding: 4px 8px;
  }

  .tutorial-strip i {
    display: none;
  }

  .start-inner {
    align-items: center;
    padding: 14px 20px;
  }

  .start-copy {
    width: 82%;
  }

  .eyebrow {
    margin-bottom: 7px;
    font-size: 7px;
  }

  .logo-main {
    font-size: clamp(36px, 9.2cqw, 66px);
    text-shadow:
      3px 3px 0 var(--orange),
      6px 6px 0 rgba(10, 13, 21, 0.3);
  }

  .logo-en {
    margin-top: 7px;
    font-size: 7px;
    letter-spacing: 0.3em;
  }

  .lead {
    display: none;
  }

  .difficulty-switch {
    margin-top: 8px;
  }

  .difficulty-option {
    padding: 5px 7px;
  }

  .difficulty-name {
    font-size: 9px;
  }

  .difficulty-option small {
    font-size: 6.5px;
  }

  .overtime-config {
    padding: 6px;
  }

  .overtime-readout {
    gap: 8px;
  }

  .cta-row {
    margin-top: 12px;
    gap: 6px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 10px;
    border-radius: 7px;
  }

  .btn kbd {
    display: none;
  }

  .start-stats {
    margin-top: 8px;
    gap: 5px;
    font-size: 7px;
  }

  .howto {
    margin-top: 7px;
    gap: 6px;
    font-size: 7px;
  }

  .howto .sound-hint {
    display: none;
  }

  .start-foot {
    display: none;
  }

  .panel {
    padding: 16px;
    border-radius: 12px;
    box-shadow: 5px 5px 0 rgba(11, 15, 24, 0.35);
  }

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

  .panel-tag {
    font-size: 7px;
  }

  .result-head {
    gap: 12px;
  }

  .result-title-wrap h2 {
    font-size: 25px;
  }

  .result-title-wrap p {
    display: none;
  }

  .grade-stamp {
    width: 58px;
    height: 58px;
    border-width: 2px;
  }

  .grade-stamp span {
    font-size: 25px;
  }

  .grade-stamp small {
    font-size: 5px;
  }

  .result-body {
    grid-template-columns: 1fr;
    gap: 9px;
    margin: 9px 0;
    padding: 9px 0;
  }

  .result-money {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }

  .result-money b {
    font-size: 30px;
  }

  .result-money > span {
    font-size: 7px;
  }

  .result-money em {
    display: none;
  }

  .result-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .result-stats > div {
    padding: 4px 5px;
  }

  .result-stats span {
    font-size: 5.5px;
  }

  .result-stats b {
    font-size: 10px;
  }

  .rank-line {
    margin-top: 8px;
  }

  .rank-line__top {
    font-size: 7px;
  }

  .result-actions {
    margin-top: 10px;
  }

  .panel .btn {
    padding: 8px 10px;
    font-size: 10px;
  }

  .panel .btn kbd {
    display: none;
  }

  .result-actions .btn-text {
    display: none;
  }

  .shop-panel {
    padding: 12px;
  }

  .shop-head {
    gap: 8px;
  }

  .shop-title h2 {
    font-size: 19px;
  }

  .shop-wallet {
    padding: 3px 6px;
  }

  .shop-wallet span {
    display: none;
  }

  .shop-wallet b {
    font-size: 15px;
  }

  .close-btn {
    width: 23px;
    height: 23px;
    font-size: 15px;
  }

  .upgrade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin: 8px 0;
  }

  .upgrade-card {
    padding: 7px;
    gap: 4px;
    border-radius: 7px;
  }

  .upgrade-icon {
    width: 25px;
    height: 25px;
    font-size: 13px;
  }

  .upgrade-name h3 {
    font-size: 9px;
  }

  .upgrade-desc {
    display: none;
  }

  .upgrade-effect {
    font-size: 6px;
  }

  .buy-btn {
    font-size: 7px;
    padding: 0.45em 0.55em;
  }

  .shop-foot {
    padding-top: 6px;
    font-size: 6px;
  }

  .stat-row {
    margin-top: 10px;
  }

  .stat-cell {
    padding: 7px;
  }

  .stat-cell span {
    font-size: 6px;
  }

  .stat-cell b {
    font-size: 13px;
  }

  .pause-panel .panel-desc {
    font-size: 9px;
  }

  .panel-tip {
    display: none;
  }

  .toasts {
    top: 52px;
  }

  .toast {
    font-size: 8px;
    padding: 5px 10px;
  }
}

@container stage (max-width: 500px) {
  .start-copy {
    width: 100%;
  }

  .logo-main {
    font-size: 38px;
  }

  .logo-main::after {
    display: none;
  }

  .logo-en {
    font-size: 6px;
    letter-spacing: 0.25em;
  }

  .eyebrow {
    font-size: 6px;
    margin-bottom: 6px;
  }

  .start-stats {
    font-size: 6px;
  }

  .start-stats i {
    display: none;
  }

  .cta-row .btn-secondary {
    padding: 7px 9px;
    font-size: 9px;
  }

  .upgrade-grid {
    grid-template-columns: 1fr;
  }

  .shop-panel {
    padding: 10px;
  }

  .shop-title h2 {
    font-size: 17px;
  }

  .upgrade-desc {
    display: block;
  }

  .upgrade-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .upgrade-head {
    flex: 1;
  }

  .upgrade-pips {
    width: 100%;
    order: 5;
  }

  .upgrade-foot {
    width: 100%;
    order: 6;
  }

  .tutorial-strip {
    display: none;
  }
}

@media (orientation: portrait) and (max-width: 900px) {
  .mobile-pad {
    right: 50%;
    bottom: auto;
    top: calc(100% + 16px);
    gap: 18px;
    transform: translateX(50%);
  }

  .mobile-btn {
    width: 54px;
    height: 54px;
    background: rgba(19, 25, 38, 0.9);
  }

  .mobile-btn--jump {
    background: rgba(255, 107, 53, 0.96);
  }
}

@media (max-height: 640px) {
  .shell {
    width: min(1200px, 96vw, calc((100svh - 62px) * 16 / 9));
  }

  .site-foot {
    padding-top: 5px;
    font-size: 8px;
  }
}

@media (max-height: 500px) {
  .page {
    padding: 4px 8px;
  }

  .shell {
    width: min(1200px, 98vw, calc((100svh - 24px) * 16 / 9));
  }

  .site-foot {
    display: none;
  }

  .start-inner {
    padding: 10px 22px;
  }
}

@media (max-width: 640px) {
  .site-foot {
    display: none;
  }

  .page {
    padding: 6px;
  }

  .shell {
    width: 98vw;
  }
}

/* =======================================================
   手机版：全屏舞台、触控操作与移动端弹层
   ======================================================= */

.mobile-start-note {
  display: none;
}

body.is-touch {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body.is-touch button,
body.is-touch a {
  touch-action: manipulation;
}

body.is-touch .page {
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  padding: 0;
  overflow: hidden;
}

body.is-touch .shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100svh;
}

body.is-touch .stage {
  width: min(100vw, calc(100vh * 16 / 9));
  width: min(100vw, calc(100svh * 16 / 9));
  max-width: none;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  flex: 0 0 auto;
}

body.is-touch #game {
  border-radius: 0;
}

body.is-touch .site-foot,
body.is-touch .back-to-hub,
body.is-touch .rotate-hint {
  display: none !important;
}

/* 手机端全屏开始 / 暂停 / 结算 / 商店 */
body.is-touch .start-screen,
body.is-touch .modal-screen {
  position: fixed;
  inset: auto;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  border-radius: 0;
  z-index: 500;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.is-touch .start-screen {
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 142, 76, 0.2), transparent 34%),
    radial-gradient(circle at 10% 88%, rgba(70, 105, 205, 0.2), transparent 42%),
    linear-gradient(155deg, #131a2a 0%, #0b0f18 58%, #0d1320 100%);
}

body.is-touch .start-inner {
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  min-height: 100%;
  padding:
    max(24px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
}

body.is-touch .start-copy {
  width: min(92vw, 560px);
  max-width: 560px;
}

body.is-touch .start-foot,
body.is-touch .memo-card {
  display: none;
}

body.is-touch .eyebrow {
  margin-bottom: 12px;
  font-size: 10px;
}

body.is-touch .logo-main {
  font-size: clamp(50px, 14vw, 68px);
  text-shadow:
    3px 3px 0 var(--orange),
    6px 6px 0 rgba(10, 13, 21, 0.3);
}

body.is-touch .logo-main::after {
  right: -0.26em;
}

body.is-touch .logo-en {
  margin-top: 9px;
  font-size: 8px;
  letter-spacing: 0.3em;
}

body.is-touch .lead {
  display: block;
  max-width: 30em;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.7;
}

body.is-touch .difficulty-switch {
  width: 100%;
  margin-top: 14px;
  padding: 5px;
}

body.is-touch .difficulty-option {
  min-height: 52px;
  padding: 9px 11px;
}

body.is-touch .difficulty-name {
  font-size: 12px;
}

body.is-touch .difficulty-option small {
  font-size: 8px;
  white-space: normal;
  line-height: 1.3;
}

body.is-touch .overtime-config {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
}

body.is-touch .overtime-config__head {
  font-size: 9px;
}

body.is-touch .overtime-config__head b {
  font-size: 18px;
}

body.is-touch .multiplier-options {
  gap: 5px;
  margin-top: 8px;
}

body.is-touch .multiplier-option {
  min-height: 38px;
  font-size: 11px;
  border-radius: 6px;
}

body.is-touch .overtime-readout {
  gap: 10px;
  margin-top: 8px;
  font-size: 9px;
}

body.is-touch .cta-row {
  width: 100%;
  margin-top: 16px;
  gap: 8px;
}

body.is-touch .cta-row .btn {
  flex: 1;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 13px;
  border-radius: 10px;
}

body.is-touch .cta-row .btn-primary {
  flex: 1.35;
}

body.is-touch .btn kbd {
  display: none;
}

body.is-touch .start-stats {
  gap: 7px;
  margin-top: 12px;
  font-size: 9px;
}

body.is-touch .start-stats i {
  display: inline-block;
}

body.is-touch .howto {
  gap: 9px;
  margin-top: 10px;
  font-size: 9px;
}

body.is-touch .howto .sound-hint {
  display: none;
}

body.is-touch .desktop-key {
  display: none !important;
}

body.is-touch .touch-key {
  display: flex !important;
}

body.is-touch .mobile-start-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 13px;
  padding-top: 11px;
  color: rgba(255, 248, 233, 0.42);
  border-top: 1px solid rgba(255, 248, 233, 0.1);
  font-size: 9px;
  letter-spacing: 0.02em;
}

body.is-touch .mobile-start-note a {
  color: rgba(255, 200, 61, 0.78);
  text-decoration: none;
  white-space: nowrap;
}

/* 手机端 HUD */
body.is-touch .hud {
  padding-top: 7px;
  padding-bottom: 7px;
  padding-left: max(7px, env(safe-area-inset-left));
  padding-right: max(7px, env(safe-area-inset-right));
}

body.is-touch .hud-right {
  top: 7px;
  right: max(7px, env(safe-area-inset-right));
  gap: 4px;
}

body.is-touch .icon-btn {
  width: 32px;
  min-height: 32px;
}

body.is-touch .combo-float {
  top: 8px;
}

body.is-touch .buff-chip {
  top: 38px;
}

body.is-touch .tutorial-strip {
  display: none !important;
}

body.is-touch .toasts {
  top: 58px;
  width: min(90%, 340px);
}

body.is-touch .toast {
  padding: 7px 12px;
  font-size: 9px;
}

/* 手机端触控按钮 */
body.is-touch .mobile-pad {
  position: fixed;
  z-index: 900;
  gap: 18px;
}

body.is-touch .mobile-btn {
  width: 60px;
  height: 60px;
  font-size: 10px;
  border-width: 2px;
  background: rgba(18, 24, 37, 0.9);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

body.is-touch .mobile-btn--jump {
  background: rgba(255, 107, 53, 0.96);
}

body.is-touch .mobile-btn__arrow {
  font-size: 23px;
}

body.is-touch .mobile-btn:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: none;
}

/* 手机端全屏面板 */
body.is-touch .modal-screen {
  align-items: center;
  padding:
    max(14px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  background: rgba(7, 11, 18, 0.78);
  backdrop-filter: blur(10px) saturate(0.86);
}

body.is-touch .panel {
  width: min(100%, 560px);
  max-height: calc(100vh - 28px);
  max-height: calc(100svh - 28px);
  padding: 22px;
  border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(11, 15, 24, 0.38);
}

body.is-touch .panel h2 {
  font-size: 30px;
}

body.is-touch .panel-tag {
  margin-bottom: 8px;
  font-size: 9px;
}

body.is-touch .panel-desc {
  font-size: 12px;
}

body.is-touch .panel .btn {
  min-height: 44px;
  padding: 11px 16px;
  font-size: 13px;
  border-radius: 9px;
}

body.is-touch .panel .btn kbd {
  display: none;
}

body.is-touch .panel-tip {
  display: block;
  margin-top: 12px;
  font-size: 9px;
}

body.is-touch .stat-row {
  margin-top: 14px;
}

body.is-touch .stat-cell {
  padding: 11px;
}

body.is-touch .stat-cell span {
  font-size: 8px;
}

body.is-touch .stat-cell b {
  font-size: 18px;
}

body.is-touch .pause-panel .panel-actions {
  flex-direction: column;
}

body.is-touch .pause-panel .panel-actions .btn {
  width: 100%;
  flex: none;
}

/* 手机端结算 */
body.is-touch .result-panel {
  width: min(100%, 560px);
}

body.is-touch .result-head {
  gap: 14px;
}

body.is-touch .result-title-wrap h2 {
  font-size: 30px;
  line-height: 1.04;
}

body.is-touch .result-title-wrap p {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
}

body.is-touch .grade-stamp {
  width: 74px;
  height: 74px;
  border-width: 3px;
}

body.is-touch .grade-stamp span {
  font-size: 32px;
}

body.is-touch .grade-stamp small {
  font-size: 7px;
}

body.is-touch .result-body {
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0;
  padding: 12px 0;
}

body.is-touch .result-money {
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

body.is-touch .result-money > span {
  font-size: 9px;
}

body.is-touch .result-money b {
  font-size: 44px;
}

body.is-touch .result-money em {
  display: block;
  width: 100%;
  font-size: 9px;
}

body.is-touch .result-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

body.is-touch .result-stats > div {
  padding: 8px 10px;
}

body.is-touch .result-stats span {
  font-size: 8px;
}

body.is-touch .result-stats b {
  font-size: 15px;
}

body.is-touch .rank-line {
  margin-top: 12px;
}

body.is-touch .rank-line__top {
  font-size: 9px;
}

body.is-touch .rank-line__top small {
  font-size: 8px;
}

body.is-touch .result-actions {
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

body.is-touch .result-actions .btn {
  width: 100%;
  flex: none;
}

body.is-touch .result-actions .btn-text {
  display: block;
}

/* 手机端商店 */
body.is-touch .shop-panel {
  width: min(100%, 680px);
  max-height: calc(100vh - 24px);
  max-height: calc(100svh - 24px);
  padding: 18px;
}

body.is-touch .shop-head {
  gap: 10px;
}

body.is-touch .shop-title h2 {
  font-size: 24px;
}

body.is-touch .shop-title p {
  display: none;
}

body.is-touch .shop-wallet {
  padding: 6px 10px;
}

body.is-touch .shop-wallet span {
  display: block;
  font-size: 8px;
}

body.is-touch .shop-wallet b {
  font-size: 20px;
}

body.is-touch .close-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
}

body.is-touch .upgrade-grid {
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 12px 0;
}

body.is-touch .upgrade-card {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 7px;
  padding: 12px;
  border-radius: 10px;
}

body.is-touch .upgrade-head {
  flex: none;
  align-items: center;
}

body.is-touch .upgrade-icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

body.is-touch .upgrade-name h3 {
  font-size: 14px;
}

body.is-touch .upgrade-level {
  font-size: 8px;
}

body.is-touch .upgrade-desc {
  display: block;
  font-size: 10px;
}

body.is-touch .upgrade-pips {
  width: auto;
  order: 0;
}

body.is-touch .upgrade-foot {
  width: auto;
  order: 0;
}

body.is-touch .upgrade-effect {
  font-size: 9px;
}

body.is-touch .buy-btn {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 11px;
  border-radius: 6px;
}

body.is-touch .shop-foot {
  padding-top: 10px;
  font-size: 9px;
}

/* 手机竖屏：舞台居中，操作区放在下方 */
@media (orientation: portrait) {
  body.is-touch .mobile-pad {
    top: calc(50% + 28.125vw + 14px);
    right: auto;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  body.is-touch .start-copy {
    width: min(88vw, 440px);
  }

  body.is-touch .toasts {
    position: fixed;
    top: calc(50% + 28.125vw + 88px);
    left: 50%;
    z-index: 950;
    width: min(88vw, 340px);
  }

  body.is-touch .result-money {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  body.is-touch .result-money em {
    width: auto;
  }
}

/* 手机横屏：紧凑开始界面，操作按钮叠在游戏右下 */
@media (orientation: landscape) and (max-height: 520px) {
  body.is-touch .mobile-pad {
    top: auto;
    right: calc((100vw - min(100vw, 100svh * 16 / 9)) / 2 + 16px + env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    left: auto;
    transform: none;
  }

  body.is-touch .start-inner {
    justify-content: center;
    padding:
      max(10px, env(safe-area-inset-top))
      max(24px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(24px, env(safe-area-inset-left));
  }

  body.is-touch .start-copy {
    width: min(92vw, 600px);
  }

  body.is-touch .eyebrow {
    margin-bottom: 5px;
    font-size: 8px;
  }

  body.is-touch .logo-main {
    font-size: 48px;
  }

  body.is-touch .logo-en {
    margin-top: 5px;
    font-size: 7px;
  }

  body.is-touch .lead,
  body.is-touch .howto {
    display: none;
  }

  body.is-touch .mobile-start-note {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 0;
    border-top: 0;
    font-size: 8px;
  }

  body.is-touch .mobile-start-note > span {
    display: none;
  }

  body.is-touch .difficulty-switch {
    margin-top: 7px;
    padding: 4px;
  }

  body.is-touch .difficulty-option {
    min-height: 38px;
    padding: 6px 8px;
  }

  body.is-touch .difficulty-name {
    font-size: 10px;
  }

  body.is-touch .difficulty-option small {
    font-size: 7px;
  }

  body.is-touch .overtime-config {
    margin-top: 5px;
    padding: 6px 8px;
  }

  body.is-touch .overtime-config__head {
    font-size: 8px;
  }

  body.is-touch .overtime-config__head b {
    font-size: 16px;
  }

  body.is-touch .multiplier-options {
    margin-top: 5px;
    gap: 4px;
  }

  body.is-touch .multiplier-option {
    min-height: 29px;
    padding: 4px 1px;
    font-size: 9px;
  }

  body.is-touch .overtime-readout {
    margin-top: 5px;
    gap: 8px;
    font-size: 8px;
  }

  body.is-touch .cta-row {
    margin-top: 7px;
  }

  body.is-touch .cta-row .btn {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 11px;
  }

  body.is-touch .start-stats {
    margin-top: 6px;
    font-size: 8px;
  }

  body.is-touch .upgrade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.is-touch .upgrade-card {
    padding: 9px;
  }

  body.is-touch .upgrade-desc {
    display: none;
  }

  body.is-touch .shop-panel {
    padding: 14px;
  }

  body.is-touch .shop-title h2 {
    font-size: 20px;
  }

  body.is-touch .result-head {
    gap: 12px;
  }

  body.is-touch .result-title-wrap h2 {
    font-size: 26px;
  }

  body.is-touch .result-title-wrap p {
    display: none;
  }

  body.is-touch .grade-stamp {
    width: 62px;
    height: 62px;
  }

  body.is-touch .grade-stamp span {
    font-size: 27px;
  }

  body.is-touch .result-money b {
    font-size: 36px;
  }

  body.is-touch .result-body {
    gap: 9px;
    margin: 8px 0;
    padding: 8px 0;
  }

  body.is-touch .result-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body.is-touch .result-stats > div {
    padding: 6px;
  }

  body.is-touch .result-actions {
    flex-direction: row;
  }

  body.is-touch .result-actions .btn {
    width: auto;
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
