﻿* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #3a2b20;
  --cream: #fff6e3;
  --yellow: #ffcf3f;
  --pink: #ff7bac;
  --blue: #5ec8f2;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #183b37;
  font-family: "ZCOOL KuaiLe", "Comic Sans MS", "Microsoft YaHei", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* 资源就绪前挡住 WebGL 画布，使用与日间晴空舞台一致的渐变动效底色 */
#boot-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, #2d9ae6 0%, #73cefa 52%, #fff0ca 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity .55s ease, visibility 0s linear .55s;
}
#boot-backdrop.done {
  opacity: 0;
  visibility: hidden;
}

#popups {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  overflow: hidden;
}
.popup {
  position: absolute;
  top: 40%;
  transform: translateX(-50%);
  font-size: clamp(24px, 5vw, 36px);
  white-space: nowrap;
  text-shadow:
    2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
  animation: popupRise 1.1s ease-out forwards;
}
@keyframes popupRise {
  0% { opacity: 0; margin-top: 20px; scale: .6; }
  15% { opacity: 1; scale: 1.1; }
  30% { scale: 1; }
  100% { opacity: 0; margin-top: -90px; scale: 1; }
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  pointer-events: none;
  z-index: 5;
}
.hud-left { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.hud-score, .hud-coins {
  border: 1px solid #fff1cf4d;
  background: #213a34e6;
  box-shadow: 0 3px 9px #17342d30;
  font-variant-numeric: tabular-nums;
}
.hud-score {
  border-radius: 13px;
  padding: 7px 11px 8px;
  font-size: 31px;
  line-height: 1.05;
  color: var(--cream);
}
.hud-score small { font-size: 13px; margin-left: 5px; color: #eadcbc; }
.hud-coins-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hud-coins {
  border-radius: 11px;
  padding: 3px 8px 4px;
  font-size: 17px;
  line-height: 1.12;
  color: #ffd489;
}
.hud-overdrive {
  border-radius: 11px;
  padding: 3px 9px 4px;
  font-size: 14px;
  line-height: 1.15;
  color: #fff6df;
  border: 1px solid #ff9c6e;
  background: linear-gradient(135deg, #d93829ee, #f27a24ee);
  box-shadow: 0 3px 10px #9e1b1066;
  white-space: nowrap;
  animation: overdrivePulse 1.15s ease-in-out infinite;
}
@keyframes overdrivePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.hud-right { display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.icon-btn {
  width: 44px; height: 44px;
  border-radius: 14px;
  border: 1px solid var(--ink);
  background: var(--cream);
  font-size: 20px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 6px #17342c5c;
  transition: transform .08s, background .12s;
}
.icon-btn:hover { background: #fffbf0; }
.icon-btn:active { transform: translateY(3px); box-shadow: none; }

.volume-widget {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.menu-volume {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
}
.volume-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid #fff1cf59;
  background: #1d3631f2;
  box-shadow: 0 8px 22px #0b201d85;
  backdrop-filter: blur(6px);
  z-index: 20;
}
.volume-mute-btn {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  border: 1px solid #fff1cf47;
  background: #2b4a43;
  color: var(--cream);
  font-size: 16px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background .12s, transform .08s;
}
.volume-mute-btn:hover { background: #365c54; }
.volume-mute-btn:active { transform: scale(.94); }
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 112px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd479 0%, #ffd479 var(--vol, 85%), #ffffff33 var(--vol, 85%), #ffffff33 100%);
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff6e3;
  border: 2px solid #9f6335;
  box-shadow: 0 2px 5px #0b201d80;
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff6e3;
  border: 2px solid #9f6335;
  box-shadow: 0 2px 5px #0b201d80;
  cursor: pointer;
}
.volume-value {
  min-width: 36px;
  text-align: right;
  font-size: 13px;
  color: #ffe29d;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#powerbars { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.pu-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #253e36e6;
  border: 1px solid #fff1cf4d;
  border-radius: 12px;
  padding: 4px 8px;
  width: fit-content;
}
.pu-ic { font-size: 18px; }
.pu-name { font-size: 13px; color: var(--cream); text-shadow: 1px 1px 0 var(--ink); white-space: nowrap; }
.pu-track {
  display: inline-block;
  width: 90px; height: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 5px;
  overflow: hidden;
}
.pu-fill { display: block; height: 100%; border-radius: 5px; transition: width .1s linear; }
.pu-time { font-size: 12px; color: var(--yellow); min-width: 34px; text-align: right; text-shadow: 1px 1px 0 var(--ink); white-space: nowrap; }

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at 50% 26%, #31554cde, #112b2bed 78%);
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  text-align: center;
  overflow-y: auto;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
}

#menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-content: stretch;
  justify-items: start;
  padding: clamp(30px, 7.2vw, 128px);
  background: linear-gradient(96deg, rgba(13, 52, 77, .64) 0%, rgba(16, 63, 90, .40) 27%,
    rgba(20, 76, 108, .12) 48%, rgba(20, 76, 108, 0) 64%);
  text-align: left;
}
#menu.leaving {
  opacity: 0;
  transform: scale(1.012);
  pointer-events: none;
  transition: opacity .22s ease-out, transform .22s ease-out;
}

.home-panel {
  width: min(100%, 500px);
  color: #fff3dd;
  animation: homeIn .52s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes homeIn {
  from { opacity: .86; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-title {
  font-size: clamp(54px, 7.7vw, 110px);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: -.055em;
  white-space: nowrap;
  color: #ffdc86;
  text-shadow: 0 4px 0 #8f4f2e, 0 10px 22px #0a2828c9;
}

.tagline {
  margin-top: 17px;
  color: #fff6e3;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.5;
  letter-spacing: .04em;
  text-shadow: 0 2px 10px rgba(9, 41, 64, .58);
}

.home-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 30px;
}

.home-start {
  min-width: 200px;
  min-height: 61px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 15px 10px 23px;
  border: 1px solid #fce1a4;
  border-radius: 14px;
  background: #ffd479;
  box-shadow: 0 5px 0 #9f6335, 0 12px 24px #102c25a8;
  color: #263831;
  font-family: inherit;
  font-weight: 800;
  font-size: 25px;
  cursor: pointer;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.home-start:not(:disabled):hover { transform: translateY(-2px); background: #ffe298; }
.home-start:not(:disabled):active { transform: translateY(3px); box-shadow: 0 2px 0 #9f6335; }
.home-start:disabled { cursor: progress; filter: saturate(.75); }
button:focus-visible { outline: 3px solid #fff7c9; outline-offset: 5px; }
.start-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #33453a;
  color: #fff3d8;
  line-height: 1;
}
.home-panel .best-line {
  display: grid;
  gap: 3px;
  color: #fff8e8;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(9, 41, 64, .58);
}
.best-line > small { color: #e5f3fa; font-size: 13px; }
.best-line strong { font-size: 26px; }
.best-line strong small { margin-inline-start: 6px; font-size: 12px; font-weight: 400; }

.loading-panel {
  display: grid;
  gap: 7px;
  width: min(100%, 330px);
  min-height: 28px;
  margin: 17px 0 6px;
  transition: opacity .22s, visibility 0s linear .22s;
}
.loading-panel.ready { visibility: hidden; opacity: 0; }
.loading-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #dedfd0;
  font-size: 12px;
  line-height: 1.2;
}
#loading-percent { color: #ffd889; font-variant-numeric: tabular-nums; }
.loading-track { height: 4px; background: #ffffff35; overflow: hidden; border-radius: 5px; }
.loading-fill { display: block; height: 100%; width: 0; border-radius: 5px; background: #ffd479; transition: width .15s; }

.howto {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 380px);
}
.howto-item {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #fff3d64d;
  border-radius: 10px;
  background: rgba(14, 47, 68, .44);
  backdrop-filter: blur(4px);
  color: #f3f7ee;
  font-size: 13px;
}
.howto-item .key {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  font: 700 13px/1.15 "Microsoft YaHei", system-ui, sans-serif;
  color: #ffdeb1;
  white-space: nowrap;
}
.howto .touch-key { display: none; }
.home-panel #menu-tip {
  margin-top: 17px;
  font-size: 13px;
  line-height: 1.5;
  color: #f3f6ebee;
  text-shadow: 0 1px 6px rgba(9, 41, 64, .58);
}

#coach {
  position: absolute;
  max-width: calc(100% - 24px);
  width: max-content;
  left: 50%;
  bottom: max(23px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 7;
  border: 1px solid #fff4cb83;
  border-radius: 14px;
  background: #163b36ed;
  box-shadow: 0 4px 14px #1b2b2650;
  color: #fff5d7;
  font-size: clamp(13px, 2.6vw, 16px);
  line-height: 1.4;
  text-align: center;
  padding: 9px 16px;
  pointer-events: none;
}

@media (pointer: coarse) {
  .howto .desktop-key { display: none; }
  .howto .touch-key { display: inline-grid; }
}

@media (max-aspect-ratio: 19/20) {
  #menu {
    align-content: start;
    justify-items: center;
    padding: max(37px, env(safe-area-inset-top)) 23px 21px;
    background: linear-gradient(180deg, rgba(13, 52, 77, .64) 0%, rgba(16, 64, 92, .36) 36%, rgba(16, 64, 92, 0) 60%);
  }
  .home-panel { width: min(100%, 400px); text-align: center; }
  .game-title { font-size: clamp(51px, 13vw, 78px); }
  .tagline { margin-top: 13px; font-size: 17px; }
  .home-actions { justify-content: center; gap: 16px; margin-top: 22px; }
  .home-start { min-width: 162px; min-height: 55px; font-size: 22px; padding: 8px 11px 8px 18px; }
  .loading-panel { width: 100%; margin: 17px 0 3px; }
  .howto { width: 100%; }
  .howto-item { justify-items: center; padding: 6px; gap: 3px; }
  .home-panel #menu-tip { display: none; }
}
@media (max-height: 560px) {
  #menu { padding-top: 19px; padding-bottom: 19px; }
  .tagline { margin-top: 9px; }
  .home-actions { margin-top: 15px; }
  .loading-panel { margin-top: 13px; }
  .home-panel #menu-tip { display: none; }
}

.big-btn {
  font-family: inherit;
  font-size: clamp(24px, 5vw, 32px);
  color: var(--ink);
  background: linear-gradient(180deg, #ffe08a, var(--yellow));
  border: 4px solid var(--ink);
  border-radius: 20px;
  padding: 12px 52px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ink), 0 12px 24px rgba(0,0,0,.35);
  transition: transform .08s, box-shadow .08s;
  animation: pulse 1.6s ease-in-out infinite;
}
.big-btn:hover { transform: scale(1.04); }
.big-btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }

.best-line { color: var(--blue); font-size: 17px; text-shadow: 1px 1px 0 var(--ink); }
.meme-foot { color: rgba(255,255,255,.5); font-size: 13px; }

.pause-title { font-size: 48px; color: var(--cream); text-shadow: 3px 3px 0 var(--ink); }
.pause-quip {
  color: var(--cream);
  opacity: .88;
  font-size: clamp(15px, 3vw, 20px);
  max-width: 520px;
  text-shadow: 1px 1px 0 var(--ink);
}
.pause-volume {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid #fff1cf59;
  background: #1d3631e8;
  box-shadow: 0 6px 18px #0b201d66;
}
.pause-volume-label {
  font-size: 14px;
  color: #efe1c4;
  white-space: nowrap;
}
.pause-volume .volume-slider { width: 138px; }

.over-title {
  font-size: clamp(44px, 9vw, 72px);
  color: var(--pink);
  text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
  transform: rotate(-3deg);
  animation: bounceIn .5s cubic-bezier(.2, 1.6, .4, 1);
}
.verdict { color: var(--cream); font-size: clamp(16px, 3.6vw, 22px); max-width: 480px; }
.over-stats {
  display: flex;
  gap: 14px;
}
.over-stats > div {
  background: rgba(255, 246, 227, .12);
  border: 2px solid rgba(255, 246, 227, .35);
  border-radius: 16px;
  padding: 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.over-stats b { font-size: 30px; color: var(--yellow); text-shadow: 2px 2px 0 var(--ink); }
.over-stats b .stat-unit { font-size: 14px; margin-left: 3px; color: #ffe6a8; text-shadow: 1px 1px 0 var(--ink); }
.over-stats small { font-size: 13px; color: rgba(255,255,255,.7); }
.new-record {
  color: var(--yellow);
  font-size: 20px;
  animation: pulse .8s ease-in-out infinite;
  text-shadow: 1px 1px 0 var(--ink);
}

@keyframes bounceIn {
  0% { transform: scale(.3) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(-2deg); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---------- 站点主题变量 ---------- */
:root {
  --site-bg: #183b37;
  --site-fg: #fff6e3;
  --site-accent: #ffcf3f;
  --site-on-accent: #3a2b20;
  --site-surface: #fff6e3;
  --site-muted: rgba(255, 255, 255, 0.5);
  --site-border: #3a2b20;
  --site-font: "ZCOOL KuaiLe", "Comic Sans MS", "Microsoft YaHei", sans-serif;
  --site-radius: 16px;
  --site-space: 1;
  --site-type: 1;
  --site-motion: 1;
}
body { background: var(--site-bg); font-family: var(--site-font); }
.overlay {
  padding: max(calc(20px * var(--site-space, 1)), env(safe-area-inset-top))
    max(calc(20px * var(--site-space, 1)), env(safe-area-inset-right))
    max(calc(20px * var(--site-space, 1)), env(safe-area-inset-bottom))
    max(calc(20px * var(--site-space, 1)), env(safe-area-inset-left));
  gap: calc(18px * var(--site-space, 1));
}
.big-btn {
  background: linear-gradient(180deg, #ffe08a, var(--site-accent));
  color: var(--site-on-accent);
  border-color: var(--site-border);
  border-radius: var(--site-radius);
  font-size: calc(clamp(24px, 5vw, 32px) * var(--site-type, 1));
  transition: transform calc(180ms * var(--site-motion, 1)), box-shadow calc(180ms * var(--site-motion, 1));
}
#hud button { background: var(--site-surface); border-color: var(--site-border); border-radius: var(--site-radius); }
.meme-foot { color: var(--site-muted); }
.howto-item { color: var(--site-fg); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.over-btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.ghost-btn {
  background: rgba(255, 246, 227, 0.12);
  color: var(--cream);
  border-color: rgba(255, 246, 227, 0.6);
  animation: none;
  font-size: calc(clamp(20px, 4vw, 26px) * var(--site-type, 1));
  padding: 12px 32px;
}

/* ---------- 开场动画 ---------- */
#intro {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
  font-family: "ZCOOL KuaiLe", "Comic Sans MS", "Microsoft YaHei", sans-serif;
}
.intro-bar {
  position: absolute;
  left: 0; right: 0;
  height: 10.5vh;
  background: #0b1414;
  transition: transform .55s cubic-bezier(.2, .8, .3, 1);
}
.intro-bar-top { top: 0; transform: translateY(-101%); }
.intro-bar-bottom { bottom: 0; transform: translateY(101%); }
#intro.bars-in .intro-bar { transform: translateY(0); }
#intro.bars-out .intro-bar { transform: translateY(var(--bar-out, -101%)); transition-duration: .5s; }
#intro.bars-out .intro-bar-bottom { --bar-out: 101%; }

.intro-flash {
  position: absolute; inset: 0;
  background: #fff6e3;
  opacity: 0;
}
.intro-flash.on { animation: introFlash .32s ease-out; }
@keyframes introFlash { 0% { opacity: .85; } 100% { opacity: 0; } }

.intro-card {
  position: absolute;
  left: clamp(22px, 7vw, 120px);
  top: calc(10.5vh + clamp(20px, 6vh, 64px));
  display: grid;
  gap: 6px;
  color: #fff3dd;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity .4s ease, transform .5s cubic-bezier(.2, .8, .3, 1);
}
.intro-card small { font-size: 14px; letter-spacing: .2em; color: #ffd479; }
.intro-card strong {
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1;
  color: #ffcf3f;
  text-shadow: 0 4px 0 #8a4f12, 0 10px 24px #0008;
}
.intro-card span { font-size: clamp(14px, 1.8vw, 18px); color: #fff3ddcc; text-shadow: 0 2px 6px #000a; }
.intro-card.on { opacity: 1; transform: none; }

.intro-line {
  position: absolute;
  left: 50%;
  bottom: calc(10.5vh + clamp(14px, 3.5vh, 36px));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 720px);
  padding: 12px 22px 12px 12px;
  border-radius: 999px;
  background: #fff6e3;
  color: #3a2b20;
  box-shadow: 0 5px 0 #3a2b20, 0 14px 30px #0007;
  opacity: 0;
  transform: translate(-50%, 16px) scale(.92);
  transition: opacity .18s ease, transform .18s ease;
}
.intro-line.on { opacity: 1; transform: translate(-50%, 0) scale(1); animation: lineIn .34s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes lineIn { from { transform: translate(-50%, 16px) scale(.8); } to { transform: translate(-50%, 0) scale(1); } }
.intro-speaker {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 15px;
  color: #3a2b20;
  background: #ffcf3f;
  white-space: nowrap;
}
.intro-line[data-who="teacher"] .intro-speaker { background: #e8503f; color: #fff6e3; }
.intro-text { font-size: clamp(17px, 2.6vw, 25px); line-height: 1.3; }

.intro-sfx {
  position: absolute;
  left: 50%; top: 21%;
  font-size: clamp(46px, 10vw, 112px);
  line-height: 1;
  color: #ffcf3f;
  white-space: nowrap;
  -webkit-text-stroke: 3px #3a2b20;
  paint-order: stroke fill;
  text-shadow: 0 6px 0 #3a2b20, 0 18px 34px #0009;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-7deg) scale(.4);
}
.intro-sfx.on { animation: sfxPop 1.05s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.intro-sfx.small { font-size: clamp(30px, 6vw, 64px); color: #fff6e3; }
.intro-sfx.alarm { color: #ff6b4a; }
@keyframes sfxPop {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-12deg) scale(.4); }
  22% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -50%) rotate(-5deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) rotate(-4deg) scale(1.04); }
}
#intro.shake { animation: introShake .36s linear; }
@keyframes introShake {
  0%, 100% { transform: none; }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(3px, 3px); }
}

.intro-skip {
  position: absolute;
  right: clamp(14px, 3vw, 36px);
  top: calc(10.5vh - 46px);
  pointer-events: auto;
  padding: 8px 16px;
  border: 1px solid #fff3dd55;
  border-radius: 999px;
  background: #0b141499;
  color: #fff3dd;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  opacity: .82;
  transition: opacity .2s, background .2s;
}
.intro-skip:hover, .intro-skip:focus-visible { opacity: 1; background: #0b1414dd; outline: none; }
#intro.bars-out .intro-skip { opacity: 0; pointer-events: none; }
#hud.hud-in { animation: hudIn .5s ease-out; }
@keyframes hudIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .intro-sfx.on, .intro-line.on, #intro.shake { animation-duration: .01s; }
}

/* ---------- 成就系统：入口按钮 & 结算新成就条 ---------- */
.home-ach-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}
.ach-entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px 9px 12px;
  border-radius: 13px;
  border: 1px solid #ffe4a159;
  background: linear-gradient(135deg, #1b423be6, #14322ee6);
  box-shadow: 0 5px 14px #091d1980, inset 0 1px 0 #fff5d824;
  color: var(--cream);
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.ach-entry-btn:hover {
  transform: translateY(-2px);
  border-color: #ffd978b8;
  background: linear-gradient(135deg, #225148f0, #193d38f0);
}
.ach-entry-btn:active { transform: translateY(1px); }
.ach-entry-trophy {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px #0006);
}
.ach-entry-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  gap: 2px;
}
.ach-entry-text strong { font-size: 16px; color: #ffdf89; letter-spacing: .02em; }
.ach-entry-text small { font-size: 12px; color: #dce5d8; }
.ach-entry-count {
  margin-left: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ffd47926;
  border: 1px solid #ffd47966;
  color: #ffe399;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ach-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ach-pill-num {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffd4792b;
  color: #ffe293;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.over-ach-strip {
  width: min(100%, 480px);
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #ffd97866;
  background: linear-gradient(135deg, #24463ee0, #17322de8);
  box-shadow: 0 8px 22px #091b1870;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  flex: none;
}
.over-ach-head {
  font-size: 13px;
  color: #ffe192;
  letter-spacing: .02em;
}
.over-ach-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: #ffd97888 transparent;
}
.over-ach-list.is-scroll {
  justify-content: flex-start;
}
.over-ach-list::-webkit-scrollbar {
  height: 5px;
}
.over-ach-list::-webkit-scrollbar-track {
  background: transparent;
}
.over-ach-list::-webkit-scrollbar-thumb {
  background: #ffd97877;
  border-radius: 999px;
}
.over-ach-pill {
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
  max-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #ffe4a188;
  background: #2f544ae8;
  color: var(--cream);
  font-family: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .14s, background .14s;
}
.over-ach-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.over-ach-pill[data-tier="rare"] { border-color: #6ef0c2aa; background: #1e4d45f0; }
.over-ach-pill[data-tier="legend"] { border-color: #ffd454dd; background: linear-gradient(135deg, #5d4316f0, #382a10f0); color: #fff2be; }
.over-ach-pill[data-tier="secret"] { border-color: #c792ffbb; background: linear-gradient(135deg, #3c2658f0, #271a3ff0); color: #f2e4ff; }
.over-ach-pill:hover { transform: translateY(-2px) scale(1.03); }
.over-ach-ic { font-size: 17px; line-height: 1; flex: none; }

/* ---------- 顶部成就解锁 Toast 动效（z-index: 30，预热复用 + 纯 GPU 合成，零首帧掉帧） ---------- */
#ach-toast-layer {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  width: min(92vw, 430px);
  z-index: 30;
  pointer-events: none;
  display: flex;
  justify-content: center;
  contain: layout style;
}
.ach-toast {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-radius: 18px;
  border: 2px solid #ffd978c9;
  background: linear-gradient(135deg, #1d3c36f5, #122826f7);
  box-shadow: 0 8px 18px #0719178c;
  color: var(--cream);
  overflow: visible;
  will-change: transform, opacity;
  contain: layout style;
}
.ach-toast.is-idle,
.ach-toast.is-prep {
  opacity: 0;
  transform: translate3d(0, -110px, 0) scale(.92);
  animation: none;
}
.ach-toast.is-show {
  animation: achToastIn .48s cubic-bezier(.22, 1.44, .36, 1) forwards;
}
.ach-toast.is-leave {
  animation: achToastOut .28s ease-in forwards;
}
.ach-toast[data-tier="rare"] {
  border-color: #6ef0c2e0;
  background: linear-gradient(135deg, #16403af7, #102b2df7);
}
.ach-toast[data-tier="legend"] {
  border-color: #ffd75ef0;
  background: linear-gradient(135deg, #4b3614f7, #261c0df7);
}
.ach-toast[data-tier="secret"] {
  border-color: #c894ffe8;
  background: linear-gradient(135deg, #351f54f7, #1d1233f7);
}
.ach-toast-sheen {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
}
.ach-toast-sheen-bar {
  position: absolute;
  top: -20%;
  left: 0;
  width: 36%;
  height: 150%;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 214, .4), transparent);
  transform: translate3d(-150%, 0, 0) skewX(-24deg);
  will-change: transform;
}
.ach-toast.is-show .ach-toast-sheen-bar {
  animation: achSheen 1.05s ease-out .14s forwards;
}
.ach-toast-badge {
  position: relative;
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: radial-gradient(circle at 32% 28%, #ffe99e, #d99728);
  border: 2px solid #fff4cf;
  box-shadow: 0 3px 10px #00000047;
  will-change: transform;
}
.ach-toast.is-show .ach-toast-badge {
  animation: achBadgePop .52s cubic-bezier(.22, 1.5, .36, 1) .04s both;
}
.ach-toast[data-tier="rare"] .ach-toast-badge { background: radial-gradient(circle at 32% 28%, #aefce0, #23967a); }
.ach-toast[data-tier="legend"] .ach-toast-badge { background: radial-gradient(circle at 32% 28%, #fff6bd, #e89a16); }
.ach-toast[data-tier="secret"] .ach-toast-badge { background: radial-gradient(circle at 32% 28%, #ecd4ff, #7c3fd1); }
.ach-badge-front, .ach-badge-back {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.ach-badge-front { opacity: 0; }
.ach-badge-back { opacity: 1; }
.ach-toast.is-show .ach-toast-badge.is-secret {
  animation: achBadgePop .62s cubic-bezier(.22, 1.5, .36, 1) .04s both;
}
.ach-toast.is-show .ach-toast-badge.is-secret .ach-badge-front {
  animation: achSecretFront .56s ease-in-out .06s both;
}
.ach-toast.is-show .ach-toast-badge.is-secret .ach-badge-back {
  animation: achSecretBack .64s cubic-bezier(.22, 1.45, .36, 1) .06s both;
}

.ach-toast-body { min-width: 0; flex: 1; text-align: left; }
.ach-toast-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ach-toast-tag { font-size: 12px; color: #ffdf87; letter-spacing: .04em; }
.ach-toast[data-tier="rare"] .ach-toast-tag { color: #8af7d2; }
.ach-toast[data-tier="secret"] .ach-toast-tag { color: #e0beff; }
.ach-toast-queue {
  padding: 1px 7px;
  border-radius: 999px;
  background: #ffffff22;
  color: #fff3d6;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ach-toast-title {
  font-size: 18px;
  line-height: 1.22;
  color: #fffaf0;
  text-shadow: 0 2px 4px #0008;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ach-toast-sub {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  color: #e2e8dc;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ach-confetti-wrap {
  position: absolute;
  left: 38px;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.ach-confetti {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  opacity: 0;
  will-change: transform, opacity;
}
.ach-toast.is-show .ach-confetti {
  animation: achConfettiBurst .78s cubic-bezier(.15, .8, .25, 1) .06s forwards;
}

@keyframes achToastIn {
  0% { opacity: 0; transform: translate3d(0, -28px, 0) scale(.88); }
  65% { opacity: 1; transform: translate3d(0, 4px, 0) scale(1.02); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes achToastOut {
  0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(0, -22px, 0) scale(.94); }
}
@keyframes achSheen {
  0% { transform: translate3d(-150%, 0, 0) skewX(-24deg); }
  100% { transform: translate3d(380%, 0, 0) skewX(-24deg); }
}
@keyframes achBadgePop {
  0% { transform: scale(.4) rotate(-18deg); }
  65% { transform: scale(1.14) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes achSecretFront {
  0% { opacity: 1; transform: scaleX(1); }
  44% { opacity: 1; transform: scaleX(0); }
  45%, 100% { opacity: 0; transform: scaleX(0); }
}
@keyframes achSecretBack {
  0%, 44% { opacity: 0; transform: scaleX(0); }
  75% { opacity: 1; transform: scaleX(1.12); }
  100% { opacity: 1; transform: scaleX(1); }
}
@keyframes achConfettiBurst {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1.1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--cx), var(--cy), 0) rotate(var(--cr)) scale(.45); }
}

/* ---------- 成就图鉴弹窗（z-index: 25） ---------- */
.ach-modal {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(7, 22, 21, .76);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  animation: achModalFade .2s ease-out;
}
@keyframes achModalFade { from { opacity: 0; } to { opacity: 1; } }

.ach-dialog {
  width: min(100%, 860px);
  max-height: min(90vh, 90dvh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 2px solid #ffe4a16e;
  background: linear-gradient(180deg, #173632f8, #102725fa);
  box-shadow: 0 22px 54px #041210cc;
  color: var(--cream);
  overflow: hidden;
  animation: achDialogIn .26s cubic-bezier(.22, 1.25, .36, 1);
}
@keyframes achDialogIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

.ach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #fff2cf26;
  background: #1c3f39a8;
}
.ach-header-title { text-align: left; }
.ach-header-title h2 { font-size: clamp(22px, 3.6vw, 28px); color: #ffde86; line-height: 1.15; }
.ach-header-title small { display: block; margin-top: 3px; font-size: 12px; color: #c7d6cc; }
.ach-close-btn { width: 38px; height: 38px; font-size: 18px; border-radius: 12px; flex: none; }

.ach-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.ach-rank-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #ffd97859;
  background: linear-gradient(135deg, #214940e0, #16332fe6);
}
.ach-rank-icon {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: radial-gradient(circle at 30% 28%, #ffea9f, #d79628);
  border: 2px solid #fff5d6;
  box-shadow: 0 5px 14px #00000045;
}
.ach-rank-main { flex: 1; min-width: 0; text-align: left; }
.ach-rank-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ach-rank-head strong { font-size: 21px; color: #ffe38f; }
.ach-rank-count { font-size: 14px; color: #d5e8dc; font-variant-numeric: tabular-nums; }
.ach-rank-desc { margin-top: 3px; font-size: 13px; color: #d9e2d4; line-height: 1.4; }
.ach-rank-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  overflow: hidden;
}
.ach-rank-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcf3f, #6ef0c2);
  transition: width .35s ease;
}

.ach-lifetime-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.ach-stat-chip {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #fff2cf24;
  background: #ffffff0c;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ach-stat-chip small { font-size: 11px; color: #bdd0c6; }
.ach-stat-chip b { font-size: 16px; color: #ffdf89; font-variant-numeric: tabular-nums; }

.ach-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ach-tab {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #fff2cf2e;
  background: #ffffff10;
  color: #dbe4d9;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.ach-tab:hover { background: #ffffff1c; }
.ach-tab.active {
  background: #ffd479;
  border-color: #ffe8ad;
  color: #26362f;
  font-weight: 700;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.ach-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 15px;
  border: 1px solid #fff2cf24;
  background: #ffffff0b;
  color: var(--cream);
  font-family: inherit;
  text-align: left;
  transition: transform .15s, border-color .15s, background .15s;
}
.ach-card.unlocked {
  cursor: pointer;
  border-color: #ffd9786b;
  background: linear-gradient(135deg, #21453de0, #16322ee6);
}
.ach-card.unlocked[data-tier="rare"] { border-color: #6ef0c27d; }
.ach-card.unlocked[data-tier="legend"] {
  border-color: #ffd454b8;
  background: linear-gradient(135deg, #3e3116e0, #232012eb);
}
.ach-card.unlocked[data-tier="secret"] {
  border-color: #c792ff99;
  background: linear-gradient(135deg, #31204ce0, #1f1735eb);
}
.ach-card.unlocked:hover { transform: translateY(-2px); border-color: #ffe49ad9; }
.ach-card.locked { opacity: .82; }
.ach-card.secret-locked {
  border-color: #b784f54d;
  background: linear-gradient(135deg, #271a3da8, #191328b8);
}

.ach-card-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: #ffffff14;
  border: 1px solid #fff2cf2e;
}
.ach-card.unlocked .ach-card-icon {
  background: radial-gradient(circle at 30% 25%, #ffeaa6, #cf8f24);
  border-color: #fff4cf99;
}
.ach-card.unlocked[data-tier="rare"] .ach-card-icon { background: radial-gradient(circle at 30% 25%, #b2fde2, #1f8f73); }
.ach-card.unlocked[data-tier="secret"] .ach-card-icon { background: radial-gradient(circle at 30% 25%, #edd5ff, #773bc9); }
.ach-card.locked .ach-card-icon { filter: grayscale(.65); }
.ach-card.secret-locked .ach-card-icon { filter: none; background: #492a7380; border-color: #c894ff66; }

.ach-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ach-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ach-card-head h3 { font-size: 16px; color: #fff6df; line-height: 1.2; }
.ach-tier-pill {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: #ffd47926;
  color: #ffe294;
  border: 1px solid #ffd47952;
}
.ach-tier-pill[data-tier="rare"] { background: #5de8ba24; color: #8cf7d3; border-color: #5de8ba5c; }
.ach-tier-pill[data-tier="legend"] { background: #ffcf3f36; color: #fff0a8; border-color: #ffcf3f8c; }
.ach-tier-pill[data-tier="secret"] { background: #bd80ff2e; color: #e4c7ff; border-color: #bd80ff6e; }

.ach-card-cond { font-size: 12px; color: #ffd988; line-height: 1.35; }
.ach-card.secret-locked .ach-card-cond { color: #d8b8ff; }
.ach-card-desc {
  font-size: 12px;
  color: #cfe0d6;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ach-card-foot {
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}
.ach-card-time { color: #9ad8bc; }
.ach-card-more { color: #ffe292; }

.ach-card-prog {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ach-prog-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .36);
  overflow: hidden;
}
.ach-prog-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcf3f, #ffe89e);
}
.ach-prog-num { font-size: 11px; color: #d6e3da; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ach-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 20px;
  border-top: 1px solid #fff2cf22;
  background: #112926d8;
}
.ach-footer-tip { font-size: 12px; color: #9eb7ad; }
.ach-reset-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #ff8c8c55;
  background: #ff5c5c1a;
  color: #ffb6b6;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ach-reset-btn:hover { background: #ff5c5c2e; border-color: #ff8c8c99; }
.ach-reset-btn.armed {
  background: #d94141;
  border-color: #ffd1d1;
  color: #fff6f6;
}

/* ---------- 二级浮层：成就详情勋章卡（详细说明 + 豆包老师批注） ---------- */
.ach-detail {
  position: absolute;
  inset: 0;
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 16, 16, .72);
  backdrop-filter: blur(4px);
}
.ach-detail-card {
  position: relative;
  width: min(100%, 460px);
  max-height: min(88vh, 88dvh);
  overflow-y: auto;
  padding: 22px 20px 18px;
  border-radius: 22px;
  border: 2px solid #ffd978b5;
  background: linear-gradient(175deg, #1d4039fb, #112826fc);
  box-shadow: 0 20px 50px #000000b3, 0 0 36px #ffd47933;
  color: var(--cream);
  text-align: left;
  animation: achDialogIn .24s cubic-bezier(.22, 1.35, .36, 1);
}
.ach-detail-card[data-tier="rare"] { border-color: #6ef0c2cc; box-shadow: 0 20px 50px #000b, 0 0 38px #5de8ba3b; }
.ach-detail-card[data-tier="legend"] {
  border-color: #ffd75ee8;
  background: linear-gradient(175deg, #433214fb, #20190cfc);
  box-shadow: 0 20px 52px #000c, 0 0 42px #ffcf3f55;
}
.ach-detail-card[data-tier="secret"] {
  border-color: #c894ffe0;
  background: linear-gradient(175deg, #342052fb, #1b122efc);
  box-shadow: 0 20px 52px #000c, 0 0 42px #b97dff4d;
}
.ach-detail-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #fff2cf44;
  background: #ffffff18;
  color: var(--cream);
  font-size: 16px;
  cursor: pointer;
}
.ach-detail-x:hover { background: #ffffff2b; }
.ach-detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 14px;
}
.ach-detail-icon {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 44px;
  background: radial-gradient(circle at 30% 26%, #ffefae, #d49020);
  border: 3px solid #fff6d9;
  box-shadow: 0 10px 24px #00000059;
}
.ach-detail-card[data-tier="rare"] .ach-detail-icon { background: radial-gradient(circle at 30% 26%, #b2fde2, #1d9074); }
.ach-detail-card[data-tier="secret"] .ach-detail-icon { background: radial-gradient(circle at 30% 26%, #efd9ff, #773bc9); }
.ach-detail-icon.pop { animation: achBadgePop .55s cubic-bezier(.22, 1.55, .36, 1); }
.ach-detail-title { font-size: 25px; color: #fff8e4; text-shadow: 0 2px 6px #0008; }

.ach-detail-section {
  padding: 11px 13px;
  border-radius: 14px;
  background: #ffffff0e;
  border: 1px solid #fff2cf1f;
  margin-bottom: 10px;
}
.ach-detail-label { font-size: 12px; color: #ffdc82; margin-bottom: 4px; letter-spacing: .04em; }
.ach-detail-cond { font-size: 14px; color: #fff6df; line-height: 1.45; }
.ach-detail-snap { margin-top: 5px; font-size: 12px; color: #8ef0c6; }
.ach-detail-story { font-size: 14px; color: #e4ede6; line-height: 1.65; }

.ach-detail-teacher {
  padding: 10px 13px;
  border-radius: 14px;
  background: #ff6b4a1f;
  border: 1px solid #ff8c6b59;
  margin-bottom: 10px;
}
.ach-teacher-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8503f;
  color: #fff6e3;
  font-size: 11px;
  margin-bottom: 5px;
}
.ach-detail-teacher p { font-size: 13px; color: #ffe5d9; line-height: 1.5; }
.ach-detail-meta {
  font-size: 12px;
  color: #a9c4b8;
  text-align: center;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.ach-detail-actions { display: flex; justify-content: center; }
.ach-replay-btn {
  padding: 9px 20px;
  border-radius: 12px;
  border: 1px solid #ffe5a380;
  background: linear-gradient(180deg, #ffe28d, #f5bd32);
  color: #2f2318;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #8f5c1e;
  transition: transform .1s, box-shadow .1s;
}
.ach-replay-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f5c1e; }

@media (max-width: 680px) {
  .ach-grid { grid-template-columns: 1fr; }
  .ach-lifetime-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ach-header, .ach-scroll, .ach-footer { padding-left: 14px; padding-right: 14px; }
  .ach-footer { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (max-aspect-ratio: 19/20) {
  .home-ach-row { justify-content: center; }
}
@media (max-height: 560px) {
  .home-ach-row { margin-top: 9px; }
  .ach-entry-btn { padding: 6px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .ach-toast.is-show, .ach-toast.is-leave, .ach-toast.is-show .ach-toast-badge,
  .ach-toast.is-show .ach-toast-badge.is-secret, .ach-toast.is-show .ach-toast-sheen-bar,
  .ach-toast.is-show .ach-confetti, .ach-dialog, .ach-detail-card, .ach-detail-icon.pop {
    animation-duration: .01s !important;
  }
}

/* ---------- 首页奶瓶商店（测试版） ---------- */
.shop-entry-btn {
  border-color: #ffd97885;
  background: linear-gradient(135deg, #274d3de8, #19382fe8);
}
.shop-entry-btn:hover {
  border-color: #ffe291d9;
  background: linear-gradient(135deg, #305e4af2, #1f463bf2);
}
.shop-entry-count {
  background: #ffcf3f2e;
  border-color: #ffd86b88;
  color: #ffe89e;
  font-weight: 700;
}

.shop-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.shop-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1.5px solid #ffd978a6;
  background: linear-gradient(135deg, #2b4c3df0, #1b342cf0);
  box-shadow: inset 0 1px 0 #fff6dc29, 0 4px 10px #06181566;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.shop-wallet-icon { font-size: 18px; line-height: 1; }
.shop-wallet-label { font-size: 12px; color: #cfe0d5; }
.shop-wallet-pill strong {
  font-size: 18px;
  color: #ffe07d;
  text-shadow: 0 1px 2px #0008;
}
.shop-wallet-pill.bounce {
  animation: achBadgePop .45s cubic-bezier(.22, 1.55, .36, 1);
}
.shop-wallet-pill.shake {
  animation: introShake .34s linear;
  border-color: #ff7b6be0;
}

.shop-notice {
  padding: 10px 14px;
  border-radius: 13px;
  border: 1px solid #ffd9784d;
  background: #ffffff10;
  color: #e6efe9;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}
.shop-notice[data-tone="ok"] {
  border-color: #6ef0c299;
  background: linear-gradient(135deg, #1b4b3fe6, #14362fe6);
  color: #d8fff0;
}
.shop-notice[data-tone="warn"] {
  border-color: #ff8a7599;
  background: linear-gradient(135deg, #4c2320e6, #321817e6);
  color: #ffe2dc;
}
.shop-notice.pop {
  animation: homeIn .22s ease-out;
}

.shop-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.shop-main-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 15px;
  border: 1.5px solid #fff2cf2e;
  background: #ffffff0d;
  color: #dbe4d9;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.shop-main-tab:hover {
  background: #ffffff18;
  border-color: #ffd97866;
}
.shop-main-tab.active {
  background: linear-gradient(135deg, #ffd87d, #f2b72c);
  border-color: #fff2c4;
  color: #25332c;
  box-shadow: 0 5px 14px #081b1775;
}
.shop-main-tab-ic {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #00000024;
}
.shop-main-tab.active .shop-main-tab-ic {
  background: #25332c1f;
}
.shop-main-tab-txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.shop-main-tab-txt strong {
  font-size: 16px;
  line-height: 1.2;
}
.shop-main-tab-txt strong small {
  font-weight: 400;
  opacity: .8;
}
.shop-main-tab-txt > small {
  font-size: 11px;
  line-height: 1.3;
  color: #bdd0c5;
}
.shop-main-tab.active .shop-main-tab-txt > small {
  color: #35473e;
}

.shop-sections-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shop-sub-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px 14px;
  border-radius: 18px;
  border: 1px solid #fff2cf21;
  background: #0b1f1c52;
}
.shop-sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #fff2cf18;
}
.shop-sub-head h3 {
  font-size: 16px;
  color: #ffe291;
}
.shop-sub-head small {
  font-size: 12px;
  color: #b7ccc1;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.shop-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #fff2cf26;
  background: #ffffff0c;
  color: var(--cream);
  text-align: left;
  transition: transform .15s, border-color .15s, background .15s;
}
.shop-card:hover {
  transform: translateY(-2px);
  border-color: #ffd97866;
  background: #ffffff12;
}
.shop-card.owned {
  border-color: #ffd97875;
  background: linear-gradient(145deg, #20443ce0, #152f2be6);
}
.shop-card.equipped {
  border-color: #6ef0c2b8;
  box-shadow: 0 0 18px #5de8ba24;
}
.shop-card-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.shop-card-icon {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: radial-gradient(circle at 30% 25%, #ffeaa638, #cf8f2424);
  border: 1px solid #ffe4a147;
}
.shop-card.owned .shop-card-icon {
  background: radial-gradient(circle at 30% 25%, #ffeaa6, #cf8f24);
  border-color: #fff4cf99;
}
.shop-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.shop-card-head h3 {
  font-size: 16px;
  color: #fff7e2;
  line-height: 1.2;
}
.shop-kind-pill {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: #ffd47926;
  color: #ffe294;
  border: 1px solid #ffd47952;
}
.shop-kind-pill[data-kind="upgrade"] {
  background: #5de8ba24;
  color: #8cf7d3;
  border-color: #5de8ba5c;
}
.shop-kind-pill[data-kind="skin"] {
  background: #bd80ff2e;
  color: #e4c7ff;
  border-color: #bd80ff6e;
}
.shop-card-effect {
  font-size: 12px;
  color: #ffd988;
  line-height: 1.35;
}
.shop-card-desc {
  font-size: 12px;
  color: #cde0d5;
  line-height: 1.45;
}
.shop-card-foot {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 8px;
  border-top: 1px solid #fff2cf18;
}
.shop-card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
}
.shop-stock-pill {
  font-size: 12px;
  color: #b7ccc1;
}
.shop-stock-pill.has-stock {
  color: #8ef0c6;
}
.shop-arm-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  background: #ffffff14;
  color: #bfd0c6;
}
.shop-arm-badge.on {
  background: #5de8ba29;
  border: 1px solid #6ef0c266;
  color: #98fadb;
}
.shop-btn-row {
  display: flex;
  gap: 7px;
}
.shop-btn-row .is-equip {
  flex: 1.3;
  padding: 8px 10px;
  font-size: 13px;
}
.shop-btn-row .shop-buy-more {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
}
.shop-upg-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shop-lv-compare {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  line-height: 1.35;
}
.shop-lv-compare .cur { color: #cfe2d8; }
.shop-lv-compare .nxt { color: #8ef0c6; }
.shop-lv-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.shop-lv-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .38);
  overflow: hidden;
}
.shop-lv-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffcf3f, #6ef0c2);
  transition: width .25s ease;
}
.shop-lv-num {
  font-size: 12px;
  color: #ffe294;
  font-variant-numeric: tabular-nums;
}

.shop-buy-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid #ffe6a699;
  background: linear-gradient(180deg, #ffe28a, #f4bc33);
  box-shadow: 0 3px 0 #8f5c1e;
  color: #2b2116;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.shop-buy-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}
.shop-buy-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8f5c1e;
}
.shop-buy-btn.lacking {
  background: linear-gradient(180deg, #354c46, #273a35);
  border-color: #fff2cf33;
  box-shadow: 0 3px 0 #152420;
  color: #cfdad3;
}
.shop-buy-btn.lacking .shop-price {
  color: #ff9c8b;
}
.shop-buy-btn.is-maxed {
  justify-content: center;
  background: #ffffff14;
  border-color: #6ef0c259;
  box-shadow: none;
  color: #8ef0c6;
  cursor: default;
}
.shop-buy-btn.is-equip {
  justify-content: center;
  background: linear-gradient(180deg, #2b5a4d, #1f443a);
  border-color: #6ef0c280;
  box-shadow: 0 3px 0 #102922;
  color: #e6fff4;
}
.shop-buy-btn.is-equip.active {
  background: linear-gradient(180deg, #6ef0c2, #36c495);
  border-color: #c4ffea;
  box-shadow: 0 3px 0 #196b50;
  color: #132e25;
}
.shop-price {
  font-variant-numeric: tabular-nums;
}

.shop-footer-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.shop-test-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #6ef0c277;
  background: #5de8ba22;
  color: #98f7d4;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.shop-test-btn:hover {
  background: #5de8ba38;
  border-color: #6ef0c2bb;
}

/* ---------- 暂停界面画质特效切换 ---------- */
.pause-quality {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid #fff2cf44;
  background: rgba(14, 38, 35, .78);
  box-shadow: 0 8px 20px #06181566;
}
.gfx-toggle-btn {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1.5px solid #ffd97899;
  background: linear-gradient(135deg, #2d5a47, #1c3d32);
  color: #ffe79e;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, filter .15s, border-color .15s;
}
.gfx-toggle-btn:hover { filter: brightness(1.08); }
.gfx-toggle-btn:active { transform: scale(.96); }
.gfx-toggle-btn.is-lite {
  border-color: #9ed9df66;
  background: #ffffff14;
  color: #cfe4dc;
}

/* ---------- 商店 3D 试衣间分栏展台与互动控制条 ---------- */
.shop-try-btn {
  flex: 0.85;
  justify-content: center;
  padding: 8px 9px;
  border-radius: 11px;
  border: 1px solid #bd80ff80;
  background: linear-gradient(180deg, #3c2a5c, #281c40);
  box-shadow: 0 3px 0 #171026;
  color: #ecd9ff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, filter .15s, border-color .15s;
}
.shop-try-btn:hover { filter: brightness(1.08); }
.shop-try-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #171026; }
.shop-try-btn.active {
  background: linear-gradient(180deg, #b87dff, #894be6);
  border-color: #ebd6ff;
  box-shadow: 0 3px 0 #472280;
  color: #fff;
}
.shop-btn-row .shop-buy-btn { flex: 1.25; }

.shop-stage-toggle-btn {
  display: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1.5px solid #bd80ff88;
  background: linear-gradient(135deg, #432b6b, #281b44);
  color: #f0e0ff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.shop-stage-pane {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.shop-stage-pane.dragging { cursor: grabbing; }

.shop-preview-banner {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid #e0b8ff99;
  background: rgba(29, 19, 52, .82);
  box-shadow: 0 10px 24px #06091288;
  color: #f4e6ff;
  font-size: 13px;
  font-weight: 700;
}
.shop-preview-clear {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #ffd978aa;
  background: #ffd93f26;
  color: #ffe694;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.shop-preview-clear:hover { background: #ffd93f44; }

.shop-fitting-bar {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1.5px solid #fff2cf44;
  background: rgba(14, 34, 31, .78);
  box-shadow: 0 12px 28px #04121099;
}
.shop-fitting-hint {
  font-size: 12px;
  color: #ffe49c;
  letter-spacing: 0.4px;
}
.shop-fitting-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}
.shop-fit-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #fff2cf4a;
  background: #ffffff14;
  color: #f4f2e8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.shop-fit-btn:hover { background: #ffe49c30; border-color: #ffd978aa; }
.shop-fit-btn:active { transform: scale(.96); }
.shop-fit-back {
  display: none;
  border-color: #6ef0c299;
  background: linear-gradient(135deg, #2b5a4d, #1c3f35);
  color: #d8fff0;
}

@media (min-width: 900px) {
  #shop-modal.shop-modal {
    justify-content: flex-start;
    gap: 16px;
    padding: 18px 20px 18px 24px;
    background: linear-gradient(90deg, rgba(7, 22, 21, .84) 0%, rgba(7, 22, 21, .68) 47%, rgba(7, 22, 21, .14) 60%, transparent 74%);
    backdrop-filter: none;
  }
  #shop-modal .shop-dialog {
    width: min(53vw, 650px);
    max-height: min(92vh, 790px);
    flex: none;
  }
  #shop-modal .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #shop-modal .shop-stage-pane {
    display: flex;
    flex: 1;
    height: min(92vh, 790px);
    padding: 10px 8px 12px;
  }
}
@media (max-width: 899px) {
  .shop-stage-toggle-btn { display: inline-flex; align-items: center; gap: 4px; }
  #shop-modal.mobile-preview {
    padding: max(12px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    background: transparent;
    backdrop-filter: none;
  }
  #shop-modal.mobile-preview .shop-dialog { display: none; }
  #shop-modal.mobile-preview .shop-stage-pane {
    display: flex;
    width: 100%;
    height: 100%;
  }
  #shop-modal.mobile-preview .shop-fit-back { display: inline-flex; }
}

@media (max-width: 820px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #hud {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  }
  .hud-score { font-size: 25px; padding: 6px 10px; }
  .hud-coins { font-size: 15px; }
  .hud-overdrive { font-size: 12px; padding: 3px 7px; }
  .icon-btn { width: 40px; height: 40px; font-size: 18px; }
  .pu-row { padding: 3px 7px; gap: 5px; }
  .pu-ic { font-size: 15px; }
  .pu-name { font-size: 12px; }
  .pu-track { width: 64px; height: 7px; }
  .volume-slider { width: 92px; }

  #gameover, #pause {
    justify-content: flex-start;
    gap: 11px;
    padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  #gameover > :first-child, #pause > :first-child { margin-top: auto; }
  #gameover > :last-child, #pause > :last-child { margin-bottom: auto; }
  .over-title { font-size: clamp(34px, 9vw, 48px); }
  .pause-title { font-size: clamp(32px, 8.5vw, 42px); }
  .verdict { font-size: clamp(14px, 3.8vw, 18px); }
  .over-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 340px);
    gap: 8px;
  }
  .over-stats > div { padding: 8px 12px; border-radius: 13px; }
  .over-stats b { font-size: 22px; }
  .over-ach-strip { padding: 8px 10px; gap: 6px; }
  .over-ach-head { font-size: 12px; }
  .over-ach-list { gap: 6px; }
  .over-ach-pill {
    flex: 0 0 calc((100% - 12px) / 3);
    padding: 5px 7px;
    font-size: 12px;
    gap: 4px;
  }
  .over-ach-ic { font-size: 15px; }
  .over-btns { gap: 9px; width: min(100%, 360px); }
  .big-btn { padding: 10px 26px; font-size: clamp(18px, 4.8vw, 23px); border-width: 3px; }
  .ghost-btn { padding: 9px 18px; font-size: clamp(16px, 4.2vw, 20px); }
  .pause-volume { padding: 8px 12px; }
  .pause-volume .volume-slider { width: 112px; }

  .intro-line {
    width: max-content;
    max-width: 94vw;
    padding: 8px 15px 8px 9px;
    gap: 8px;
  }
  .intro-speaker { font-size: 13px; padding: 4px 10px; }
  .intro-text { font-size: clamp(14px, 4vw, 18px); }
  .intro-skip {
    top: max(12px, env(safe-area-inset-top));
    padding: 6px 13px;
    font-size: 13px;
  }

  .ach-tabs:not(.shop-tabs) {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .ach-tabs:not(.shop-tabs)::-webkit-scrollbar { display: none; }
  .ach-tabs:not(.shop-tabs) .ach-tab { flex: none; }

  .home-ach-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .ach-entry-btn {
    width: 100%;
    justify-content: space-between;
    padding: 8px 9px;
    gap: 6px;
  }
  .ach-entry-trophy { font-size: 20px; }
  .ach-entry-text { min-width: 0; flex: 1; }
  .ach-entry-text strong { font-size: 14px; white-space: nowrap; }
  .ach-entry-text small {
    font-size: 11px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ach-entry-count { padding: 3px 7px; font-size: 12px; margin-left: 2px; flex: none; }
}
@media (max-width: 560px) {
  .shop-tabs { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: 1fr; }
  .shop-wallet-label { display: none; }
  .shop-wallet-pill { padding: 4px 10px; }
  .shop-wallet-pill strong { font-size: 15px; }
  .ach-header-title h2 { font-size: clamp(17px, 4.6vw, 22px); }
  .ach-header-title small { font-size: 11px; }
  .ach-detail-card { padding: 18px 15px 15px; }
  .ach-detail-title { font-size: 21px; }
  .shop-footer-btns { justify-content: center; }
}
@media (max-height: 620px) {
  #gameover, #pause {
    justify-content: flex-start;
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  #gameover > :first-child, #pause > :first-child { margin-top: auto; }
  #gameover > :last-child, #pause > :last-child { margin-bottom: auto; }
  .intro-skip { top: max(10px, env(safe-area-inset-top)); }
}
@media (max-width: 380px) {
  .ach-entry-btn { padding: 7px 7px; gap: 4px; }
  .ach-entry-trophy { font-size: 17px; }
  .ach-entry-text strong { font-size: 13px; }
  .ach-entry-count { padding: 2px 6px; font-size: 11px; }
  .over-stats > div { padding: 7px 9px; }
  .over-stats b { font-size: 20px; }
}
