/* =========================================================
   谢昀祺 · 打字大冒险
   Hand-made pixel / tactical theme. No external assets.
   ========================================================= */

:root {
  --bg: #070b13;
  --bg-soft: #0c1422;
  --panel: #101a2b;
  --panel-2: #142136;
  --ink: #eef5ff;
  --muted: #91a2bd;
  --muted-2: #65758e;
  --line: rgba(150, 180, 220, .16);
  --green: #7ee081;
  --green-2: #4fbf68;
  --mine: #72c93c;
  --mine-dark: #3c7a20;
  --delta: #8dff9f;
  --delta-dark: #1b5c3a;
  --amber: #ffb02e;
  --amber-2: #ffd166;
  --cyan: #4de0e6;
  --red: #ff5c72;
  --violet: #b88cff;
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-pixel: "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  --finger-lp: #ff6b9a;
  --finger-lr: #ff9f43;
  --finger-lm: #ffe066;
  --finger-li: #4dd4ff;
  --finger-ri: #5cffb0;
  --finger-rm: #8aa4ff;
  --finger-rr: #c77dff;
  --finger-rp: #ff7a5c;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-screen="game"] { overflow: hidden; }
body[data-screen="results"] { overflow-x: hidden; }
body.modal-open { overflow: hidden; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

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

::selection { background: var(--amber); color: #101010; }

#app { position: relative; min-height: 100vh; }

/* ---------------- ambient background ---------------- */
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(120, 170, 210, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 210, .055) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(600px) rotateX(56deg) translateY(20%);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .2) 48%, transparent 80%);
  opacity: .8;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .22;
  animation: orb-drift 18s ease-in-out infinite alternate;
}
.orb-a { width: 440px; height: 440px; left: -120px; top: 18%; background: #1d8a4b; }
.orb-b { width: 500px; height: 500px; right: -180px; top: 4%; background: #21618f; animation-delay: -6s; }
.orb-c { width: 360px; height: 360px; left: 44%; bottom: -190px; background: #6b3f12; animation-delay: -11s; }

.ambient-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 12%, transparent 10%, rgba(4, 8, 15, .34) 62%, rgba(4, 8, 15, .8) 100%),
    linear-gradient(to bottom, rgba(4, 8, 15, .2), rgba(4, 8, 15, .55));
}

.float-cubes { position: absolute; inset: 0; }
.float-cube {
  position: absolute;
  width: var(--s);
  height: var(--s);
  background: var(--c);
  border-radius: 4px;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, .22),
    inset -3px -3px 0 rgba(0, 0, 0, .26),
    0 12px 22px rgba(0, 0, 0, .28);
  opacity: var(--o, .45);
  transform: rotate(var(--r, 12deg));
  animation: cube-float var(--d, 12s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
.float-cube::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 2px;
}

@keyframes orb-drift {
  to { transform: translate3d(40px, -26px, 0) scale(1.08); }
}
@keyframes cube-float {
  from { transform: translateY(-8px) rotate(var(--r, 12deg)); }
  to { transform: translateY(20px) rotate(calc(var(--r, 12deg) + 18deg)); }
}

/* ---------------- header ---------------- */
.site-header {
  position: relative;
  z-index: 20;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 34px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

body[data-screen="game"] .site-header,
body[data-screen="results"] .site-header { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  text-align: left;
}

.brand-mark {
  display: flex;
  gap: 3px;
  padding: 6px;
  background: #0b1320;
  border: 1px solid rgba(160, 190, 220, .22);
  border-radius: 9px;
  box-shadow: 0 4px 0 #05080d;
}
.brand-key {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(#2b3b52, #172335);
  border: 1px solid #3c506a;
  color: #a6bbd4;
  font: 700 8px/13px var(--font-pixel);
  text-align: center;
}
.brand-key:nth-child(2) { color: var(--finger-li); }
.brand-key:nth-child(3) { color: var(--finger-lm); }
.brand-key:nth-child(4) { color: var(--finger-lr); }

.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text b { font-size: 15px; letter-spacing: .08em; }
.brand-text i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--muted);
  margin-top: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.save-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(14, 24, 40, .72);
  border: 1px solid var(--line);
  color: var(--amber-2);
  font: 700 13px var(--font-pixel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.save-pill span { font-size: 14px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  background: rgba(14, 24, 40, .76);
  border: 1px solid var(--line);
  color: #c4d3e7;
  font-size: 15px;
  line-height: 1;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.icon-btn:hover { background: rgba(29, 48, 76, .9); border-color: rgba(160, 200, 240, .35); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(1px); }

.ghost-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(14, 24, 40, .62);
  color: #c7d6e9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: .15s ease;
}
.ghost-btn:hover { background: rgba(29, 48, 76, .9); border-color: rgba(160, 200, 240, .36); }
.ghost-btn:active { transform: translateY(1px); }

/* ---------------- screens ---------------- */
.screen { display: none; position: relative; z-index: 2; }
.screen.is-active { display: flex; }

.screen-home {
  max-width: 1260px;
  margin: 0 auto;
  padding: 34px 34px 54px;
  flex-direction: column;
  animation: screen-in .55s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- home hero ---------------- */
.hero { max-width: 940px; margin: 16px auto 0; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9eb4cd;
  font: 700 10px var(--font-pixel);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(126, 224, 129, .12), 0 0 14px var(--green);
  animation: live-pulse 1.8s ease-in-out infinite;
}
@keyframes live-pulse {
  50% { transform: scale(.72); opacity: .6; }
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(40px, 6vw, 74px);
  line-height: 1.05;
  letter-spacing: -.055em;
  font-weight: 900;
  color: #f5f9ff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .3), 0 22px 60px rgba(0, 0, 0, .45);
}
.hero-name {
  background: linear-gradient(100deg, #b8ff65 6%, #6fe7a1 38%, #4de0e6 72%, #8dbdff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
}
.hero-name::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: .04em;
  height: .08em;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(126, 224, 129, .55), rgba(77, 224, 230, .5), transparent);
  filter: blur(1px);
}

.hero-sub {
  margin: 0 auto;
  max-width: 660px;
  color: #aabbd2;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.9;
  letter-spacing: .02em;
}
.hero-meta {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(14, 24, 40, .55);
  border: 1px solid rgba(150, 180, 220, .13);
  color: #9eb0c8;
  font-size: 11px;
  letter-spacing: .03em;
}
.hero-meta i { color: var(--green); font-style: normal; font-size: 12px; }

/* ---------------- world cards ---------------- */
.world-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 44px;
}

.world-card {
  position: relative;
  min-height: 388px;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(170, 200, 230, .15);
  background: #0c1720;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .35s ease, box-shadow .35s ease;
}
.world-card:hover {
  transform: translateY(-7px);
  border-color: rgba(190, 220, 250, .3);
  box-shadow: 0 36px 80px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.card-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.world-mine { background: linear-gradient(145deg, #13251a 0%, #0d1719 52%, #1a1510 100%); }
.world-mine .card-glow {
  background:
    radial-gradient(circle at 84% 32%, rgba(77, 224, 230, .15), transparent 33%),
    radial-gradient(circle at 70% 76%, rgba(114, 201, 60, .14), transparent 36%);
}
.world-mine::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, transparent 25%, #000 100%);
  opacity: .6;
}
.world-delta { background: linear-gradient(145deg, #0c1b1e 0%, #0b1216 56%, #111a12 100%); }
.world-delta .card-glow {
  background:
    radial-gradient(circle at 74% 40%, rgba(141, 255, 159, .12), transparent 36%),
    radial-gradient(circle at 86% 68%, rgba(255, 176, 46, .1), transparent 30%);
}
.world-delta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(141, 255, 159, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 255, 159, .04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(90deg, transparent 20%, #000 100%);
  opacity: .7;
}

.card-content {
  position: relative;
  z-index: 3;
  width: 58%;
  min-height: 388px;
  padding: 30px 0 28px 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-kicker {
  font: 700 9px var(--font-pixel);
  letter-spacing: .19em;
  color: #9fb7c8;
  text-transform: uppercase;
}
.world-mine .card-kicker { color: #9dcc7a; }
.world-delta .card-kicker { color: #94d7a0; }

.world-card h2 {
  margin: 11px 0 9px;
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 900;
  color: #f3f8ff;
}
.world-card h2 small {
  display: block;
  margin-top: 6px;
  font: 700 8px var(--font-pixel);
  letter-spacing: .2em;
  color: #8fa6b8;
}
.world-mine h2 small { color: #79ad55; }
.world-delta h2 small { color: #6bbd7e; }

.world-card p {
  margin: 0;
  color: #9badc0;
  font-size: 12.5px;
  line-height: 1.75;
  max-width: 300px;
}

.card-stats {
  display: flex;
  gap: 22px;
  margin: 20px 0 22px;
}
.card-stats div { display: flex; flex-direction: column; gap: 2px; }
.card-stats b {
  font: 800 22px var(--font-pixel);
  color: #e9f4ff;
  letter-spacing: -.04em;
}
.card-stats span {
  font-size: 9px;
  color: #788da3;
  letter-spacing: .06em;
}

.play-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 45px;
  padding: 0 20px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: #e7f6ff;
  color: #0b1520;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 5px 0 #7d8d9c, 0 12px 26px rgba(0, 0, 0, .25);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.play-btn:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 6px 0 #7d8d9c, 0 16px 30px rgba(0, 0, 0, .28); }
.play-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #7d8d9c, 0 5px 12px rgba(0, 0, 0, .2); }
.play-btn span { font-size: 16px; }

.mine-btn {
  margin-top: auto;
  background: linear-gradient(#b8f477, #7ee04a);
  color: #16250b;
  box-shadow: 0 5px 0 #3d7a22, 0 12px 26px rgba(48, 120, 28, .28);
}
.mine-btn:hover { box-shadow: 0 6px 0 #3d7a22, 0 16px 32px rgba(48, 120, 28, .34); }
.mine-btn:active { box-shadow: 0 1px 0 #3d7a22, 0 5px 12px rgba(0, 0, 0, .2); }

.delta-btn {
  margin-top: auto;
  background: linear-gradient(#ffd36e, #ffb02e);
  color: #261604;
  box-shadow: 0 5px 0 #9a6010, 0 12px 26px rgba(140, 80, 0, .28);
}
.delta-btn:hover { box-shadow: 0 6px 0 #9a6010, 0 16px 32px rgba(140, 80, 0, .34); }
.delta-btn:active { box-shadow: 0 1px 0 #9a6010, 0 5px 12px rgba(0, 0, 0, .2); }

.card-art {
  position: absolute;
  z-index: 1;
  right: -8px;
  bottom: -6px;
  width: 54%;
  max-width: 430px;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .5s ease;
}
.world-card:hover .card-art { transform: translateY(-7px) scale(1.025); }
.art-svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 24px 28px rgba(0, 0, 0, .32)); }

.floating-diamond { animation: diamond-bob 4.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes diamond-bob {
  0%, 100% { transform: translate(196px, 26px) rotate(0deg); }
  50% { transform: translate(196px, 38px) rotate(7deg); }
}
.card-pick { transform-box: fill-box; transform-origin: 50% 80%; animation: pick-sway 5s ease-in-out infinite; }
@keyframes pick-sway {
  0%, 100% { transform: translate(196px, 92px) rotate(16deg); }
  50% { transform: translate(196px, 86px) rotate(9deg); }
}
.art-torch { animation: torch-bob 3.4s ease-in-out infinite; }
@keyframes torch-bob { 50% { transform: translate(24px, 20px); } }

.radar-sweep-line { transform-box: fill-box; transform-origin: 80px 50px; animation: radar-sweep 4s linear infinite; }
@keyframes radar-sweep { to { transform: rotate(360deg); } }
.drone-art { animation: drone-hover 4.5s ease-in-out infinite; }
@keyframes drone-hover { 50% { transform: translate(92px, 56px); } }
.rotor { transform-box: fill-box; transform-origin: center; animation: rotor-spin .18s linear infinite; }
.rotor-r { animation-direction: reverse; }
@keyframes rotor-spin { to { transform: rotateY(180deg); } }

/* ---------------- pinyin home card ---------------- */
.pinyin-card {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 222px;
  margin-top: 18px;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(190, 165, 255, .22);
  background: linear-gradient(112deg, #17142b 0%, #101c25 54%, #151d29 100%);
  box-shadow: 0 24px 58px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .35s ease, box-shadow .35s ease;
}
.pinyin-card:hover {
  transform: translateY(-5px);
  border-color: rgba(210, 185, 255, .4);
  box-shadow: 0 34px 78px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.pinyin-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(184, 140, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 140, 255, .045) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, transparent 8%, #000 62%);
  opacity: .8;
}
.pinyin-card-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 83% 36%, rgba(184, 140, 255, .2), transparent 34%),
    radial-gradient(circle at 71% 84%, rgba(77, 224, 230, .09), transparent 34%);
}
.pinyin-card-copy {
  position: relative;
  z-index: 3;
  width: 56%;
  padding: 23px 30px 21px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.pinyin-new {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  margin-bottom: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, #c9a7ff, #82e8e0);
  color: #1a1027;
  font: 800 8px var(--font-pixel);
  letter-spacing: .14em;
  box-shadow: 0 0 16px rgba(184, 140, 255, .22);
}
.pinyin-card h2 {
  margin: 6px 0 6px;
  font-size: clamp(25px, 2.5vw, 33px);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 900;
  color: #f6f1ff;
}
.pinyin-card h2 small {
  display: block;
  margin-top: 5px;
  font: 700 8px var(--font-pixel);
  letter-spacing: .2em;
  color: #a98bd7;
}
.pinyin-card p {
  margin: 0;
  max-width: 460px;
  color: #a7a3bc;
  font-size: 12.5px;
  line-height: 1.75;
}
.pinyin-card .card-kicker { color: #bda0e8; }
.pinyin-card .card-stats { margin: 13px 0 14px; gap: 24px; }
.pinyin-card .card-stats b { color: #f2eaff; }
.pinyin-card .card-stats span { color: #8880a3; }
.pinyin-btn {
  margin-top: 0;
  background: linear-gradient(#dcc9ff, #ae85ff);
  color: #1b102b;
  box-shadow: 0 5px 0 #5a3c8a, 0 12px 26px rgba(94, 58, 150, .3);
}
.pinyin-btn:hover { box-shadow: 0 6px 0 #5a3c8a, 0 16px 32px rgba(94, 58, 150, .38); }
.pinyin-btn:active { box-shadow: 0 1px 0 #5a3c8a, 0 5px 12px rgba(0, 0, 0, .2); }
.pinyin-card-art {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 28px;
  pointer-events: none;
}
.pinyin-art-halo {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 140, 255, .24), transparent 68%);
  filter: blur(12px);
}
.pinyin-art-block {
  position: relative;
  z-index: 2;
  width: 116px;
  height: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 15px;
  border: 3px solid #c9a7ff;
  background: linear-gradient(145deg, #7864ae 0%, #51417d 48%, #372b55 100%);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, .2),
    inset -3px -3px 0 rgba(0, 0, 0, .26),
    0 0 0 5px rgba(184, 140, 255, .08),
    0 14px 30px rgba(0, 0, 0, .32);
  transform: rotate(-5deg);
  animation: pinyin-block-float 5s ease-in-out infinite;
}
.pinyin-art-block span {
  font-family: var(--font-ui);
  font-size: 58px;
  font-weight: 800;
  line-height: .95;
  color: #fbf7ff;
  text-shadow: 0 3px 0 #4b2b78, 0 0 22px rgba(220, 200, 255, .5);
}
.pinyin-art-block i {
  font-style: normal;
  font: 700 10px var(--font-pixel);
  letter-spacing: .04em;
  color: #e4d6ff;
}
.pinyin-float {
  position: absolute;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(24, 19, 43, .92);
  border: 1px solid rgba(206, 176, 255, .42);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .1);
  color: #d8c4ff;
  font: 700 11px var(--font-pixel);
  animation: pinyin-letter-float 4.2s ease-in-out infinite;
}
.pf-1 { left: 8%; top: 19%; animation-delay: -0.8s; color: #ffd166; }
.pf-2 { left: 2%; top: 61%; animation-delay: -1.9s; }
.pf-3 { right: 7%; top: 12%; animation-delay: -2.7s; color: #7ef0c8; }
.pf-4 { right: 1%; top: 69%; animation-delay: -3.4s; }
.pf-5 { left: 46%; bottom: 7%; animation-delay: -1.2s; color: #ff9f43; }
.pinyin-art-caption {
  position: absolute;
  right: 20px;
  bottom: 15px;
  font: 700 7px var(--font-pixel);
  letter-spacing: .15em;
  color: rgba(201, 167, 255, .48);
}
@keyframes pinyin-block-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-7px) rotate(-3deg); }
}
@keyframes pinyin-letter-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-9px) rotate(4deg); }
}

/* ---------------- home bottom ---------------- */
.home-bottom { display: flex; gap: 18px; margin-top: 20px; align-items: stretch; }

.badge-panel {
  flex: 1;
  min-width: 0;
  padding: 17px 19px 16px;
  border-radius: 19px;
  background: rgba(12, 20, 34, .62);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.badge-head { display: flex; align-items: center; justify-content: space-between; }
.badge-head b { font-size: 12px; letter-spacing: .04em; }
.badge-head span { font: 700 10px var(--font-pixel); color: var(--muted); }
.badge-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.badge {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  position: relative;
  font-size: 19px;
  background: linear-gradient(145deg, #1b2b42, #0f1928);
  border: 1px solid rgba(150, 180, 220, .16);
  filter: grayscale(1) brightness(.6);
  opacity: .55;
  transition: .2s ease;
}
.badge.is-unlocked {
  filter: none;
  opacity: 1;
  border-color: rgba(255, 209, 102, .38);
  background: linear-gradient(145deg, #2d2a1c, #141c26);
  box-shadow: 0 0 18px rgba(255, 176, 46, .14), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.badge.is-unlocked:hover { transform: translateY(-2px) scale(1.04); }
.badge .lock { position: absolute; font-size: 9px; right: 3px; bottom: 2px; opacity: .8; }
.badge.is-unlocked .lock { display: none; }

.trainer-card {
  width: 350px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 19px;
  text-align: left;
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0%, rgba(77, 224, 230, .14), transparent 40%),
    rgba(12, 20, 34, .68);
  border: 1px solid var(--line);
  transition: .2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.trainer-card:hover { border-color: rgba(160, 210, 240, .34); background-color: rgba(20, 34, 54, .8); transform: translateY(-2px); }
.trainer-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #203952, #0f1928);
  border: 1px solid rgba(120, 200, 240, .26);
  color: #a9e8ff;
  font-size: 21px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.trainer-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.trainer-copy b { font-size: 12.5px; }
.trainer-copy span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trainer-card i { margin-left: auto; font-style: normal; font-size: 10px; color: #86a7c5; white-space: nowrap; }

.fineprint { margin: 24px 0 0; text-align: center; font-size: 9px; letter-spacing: .06em; color: #56687f; }

/* ---------------- game screen ---------------- */
.screen-game {
  width: 100%;
  max-width: 1540px;
  height: 100dvh;
  min-height: 600px;
  margin: 0 auto;
  padding: 12px 18px 14px;
  flex-direction: column;
  gap: 9px;
  animation: none;
}

.game-hud {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
}
.hud-left, .hud-right { display: flex; align-items: center; gap: 9px; }
.hud-left { flex: 0 0 auto; }
.hud-right { flex: 0 0 auto; margin-left: auto; }

.back-btn { font-size: 18px; color: #dfeaff; }

.world-tag {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 6px;
  border-radius: 12px;
  background: rgba(12, 22, 37, .72);
  border: 1px solid var(--line);
}
.world-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #2a4425, #132019);
  border: 1px solid rgba(160, 220, 120, .23);
  font-size: 15px;
}
body[data-world="delta"] .world-icon {
  background: linear-gradient(145deg, #25352a, #101b16);
  border-color: rgba(141, 255, 159, .24);
}
.world-tag div { display: flex; flex-direction: column; line-height: 1.12; }
.world-tag b { font-size: 11px; letter-spacing: .04em; }
.world-tag i { font: 700 7px var(--font-pixel); letter-spacing: .16em; color: var(--muted); margin-top: 2px; }

.timer-wrap {
  flex: 1 1 auto;
  max-width: 390px;
  margin: 0 auto;
  min-width: 150px;
}
.timer-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.timer-top span { font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.timer-top b { font: 800 17px var(--font-pixel); color: #e7f2ff; line-height: 1; }
.timer-track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
.timer-fill {
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #72e58a, #b8f477);
  transition: width .12s linear, background .3s ease;
  box-shadow: 0 0 12px rgba(126, 224, 129, .3);
}
.timer-fill.is-mid { background: linear-gradient(90deg, #ffd166, #ffb02e); box-shadow: 0 0 12px rgba(255, 176, 46, .3); }
.timer-fill.is-low { background: linear-gradient(90deg, #ff7a5c, #ff4d66); box-shadow: 0 0 14px rgba(255, 77, 102, .4); animation: timer-blink .8s ease-in-out infinite; }
@keyframes timer-blink { 50% { opacity: .55; } }

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 4px 11px;
  min-width: 60px;
  border-radius: 10px;
  background: rgba(12, 22, 37, .6);
  border: 1px solid rgba(150, 180, 220, .1);
}
.stat span { font-size: 7px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); line-height: 1.1; }
.stat b { font: 800 16px var(--font-pixel); color: #edf6ff; line-height: 1.2; }
.score-stat b { color: #fff; }
.combo-stat b { display: flex; align-items: baseline; gap: 3px; }
.combo-stat i { font-style: normal; color: var(--amber-2); }
.combo-stat em { font-style: normal; font-size: 8px; color: var(--green); }
.combo-stat.is-hot { border-color: rgba(255, 176, 46, .35); box-shadow: 0 0 16px rgba(255, 176, 46, .1); }
.combo-stat.is-hot i { color: var(--amber); text-shadow: 0 0 12px rgba(255, 176, 46, .55); }
.acc-stat b { color: #a9e8b1; font-size: 14px; }

/* ---------------- stage ---------------- */
.game-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 300px;
  border-radius: 23px;
  overflow: hidden;
  background: #0a1017;
  border: 1px solid rgba(160, 190, 220, .18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .06);
  isolation: isolate;
}
#fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

.scene { position: absolute; inset: 0; display: none; overflow: hidden; }
.scene.is-active { display: block; animation: scene-in .35s ease both; }
@keyframes scene-in { from { opacity: 0; transform: scale(1.012); } to { opacity: 1; transform: none; } }

.scene-top {
  position: absolute;
  top: 13px;
  left: 15px;
  right: 15px;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.chip-label {
  display: block;
  font-size: 7px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8496a9;
  line-height: 1.2;
}

.depth-chip, .threat-chip, .kill-chip, .shield-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 11px;
  background: rgba(8, 15, 20, .72);
  border: 1px solid rgba(180, 210, 220, .14);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.depth-chip { flex-wrap: wrap; max-width: 240px; }
.depth-chip b, .threat-chip b, .kill-chip b, .shield-chip b { font: 800 18px var(--font-pixel); color: #f0fff6; line-height: 1; }
.depth-chip b i { font-style: normal; }
.depth-chip em, .threat-chip em, .kill-chip em { font-style: normal; font-size: 8px; color: #8ea2ac; letter-spacing: .04em; }
.depth-chip em { flex: 0 0 100%; font-size: 8px; color: #a5c98d; margin-top: 1px; }

.ore-bag {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 11px;
  background: rgba(8, 15, 20, .72);
  border: 1px solid rgba(180, 210, 220, .14);
  backdrop-filter: blur(8px);
}
.ore-item { display: flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 6px; background: rgba(255, 255, 255, .035); }
.ore-item b { font: 700 10px var(--font-pixel); color: #e7f4ff; }
.ore-item.is-bump { animation: ore-bump .35s ease; }
@keyframes ore-bump { 40% { transform: translateY(-4px) scale(1.12); background: rgba(255, 255, 255, .13); } }

.ore-ico { width: 10px; height: 10px; display: inline-block; border-radius: 2px; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .35), inset -1px -1px 0 rgba(0, 0, 0, .3); }
.ore-coal { background: #4a555f; }
.ore-iron { background: #cfd9e3; }
.ore-gold { background: #ffd23d; }
.ore-diamond { background: linear-gradient(135deg, #b8ffff, #4de0e6 45%, #1aa6bd); clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%); border-radius: 0; }

.pinyin-bag {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 6px;
  border-radius: 11px;
  background: rgba(12, 9, 22, .78);
  border: 1px solid rgba(190, 160, 255, .26);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
body[data-world="pinyin"] .pinyin-bag { display: flex; }
body[data-world="pinyin"] .ore-bag { display: none; }
.pinyin-bag-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(145deg, #7b5bb8, #3b2a60);
  border: 1px solid rgba(220, 195, 255, .42);
  color: #f4ecff;
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.pinyin-bag > span:last-child { display: flex; align-items: baseline; gap: 3px; }
.pinyin-bag b { font: 800 16px var(--font-pixel); color: #f0e6ff; line-height: 1; }
.pinyin-bag em { font-style: normal; font-size: 7px; color: #a995c4; letter-spacing: .03em; }
.pinyin-bag.is-bump { animation: ore-bump .35s ease; }

/* ---------------- mine scene ---------------- */
.scene-mine {
  background: radial-gradient(ellipse at 50% -10%, #412d20 0%, #211710 38%, #0d0c0b 78%);
}
.scene-mine.zone-2 {
  background: radial-gradient(ellipse at 50% -10%, #4a341c 0%, #241a12 40%, #0d0c0b 78%);
}
.scene-mine.zone-3 {
  background: radial-gradient(ellipse at 50% -10%, #1d3833 0%, #10211f 42%, #070d0e 80%);
}
.scene-mine.zone-2 .cave-glow { background: radial-gradient(ellipse, rgba(255, 176, 46, .2), transparent 64%); }
.scene-mine.zone-3 .cave-glow { background: radial-gradient(ellipse, rgba(77, 224, 230, .16), transparent 64%); }

body[data-world="pinyin"] .scene-mine {
  background: radial-gradient(ellipse at 50% -10%, #2b2143 0%, #171426 40%, #09090f 80%);
}
body[data-world="pinyin"] .cave-glow {
  background: radial-gradient(ellipse, rgba(184, 140, 255, .2), transparent 64%);
}
body[data-world="pinyin"] .scene-mine.zone-2 {
  background: radial-gradient(ellipse at 50% -10%, #35264f 0%, #1b1730 42%, #0a0912 80%);
}
body[data-world="pinyin"] .scene-mine.zone-3 {
  background: radial-gradient(ellipse at 50% -10%, #1d3550 0%, #141b2f 42%, #07090f 80%);
}
body[data-world="pinyin"] .scene-mine.zone-3 .cave-glow {
  background: radial-gradient(ellipse, rgba(77, 224, 230, .14), transparent 64%);
}
body[data-world="pinyin"] .ore-block {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .15), transparent 38%),
    linear-gradient(145deg, #747a9a 0%, #565b7d 48%, #474b68 100%);
  border-color: #393b54;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, .17),
    inset -3px -3px 0 rgba(0, 0, 0, .24),
    0 6px 0 #292a3b,
    0 12px 18px rgba(0, 0, 0, .24);
}
body[data-world="pinyin"] .ore-block.is-active {
  border-color: #d8c4ff;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, .22),
    inset -3px -3px 0 rgba(0, 0, 0, .24),
    0 0 0 3px rgba(216, 196, 255, .18),
    0 0 32px rgba(184, 140, 255, .38),
    0 8px 0 #292a3b,
    0 16px 22px rgba(0, 0, 0, .3);
}
body[data-world="pinyin"] .block-letter {
  font-family: var(--font-ui);
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 800;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .3), 0 0 20px rgba(220, 200, 255, .25);
}
body[data-world="pinyin"] .ore-block.is-active .block-letter {
  color: #fff8ff;
  text-shadow: 0 4px 0 #6d4a9a, 0 0 24px rgba(216, 196, 255, .75);
}
body[data-world="pinyin"] .torch::before {
  background: radial-gradient(circle, #f4ecff, #b88cff 45%, rgba(124, 92, 255, .1) 72%);
  box-shadow: 0 0 32px 10px rgba(184, 140, 255, .2);
}
body[data-world="pinyin"] .torch-flame {
  background: linear-gradient(#f4ecff, #b88cff 55%, #7c5cff);
}
.cave-bg { position: absolute; inset: 0; overflow: hidden; }
.cave-glow {
  position: absolute;
  left: 50%;
  top: -10%;
  width: 70%;
  height: 90%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255, 176, 46, .16), transparent 64%);
  filter: blur(18px);
}
.cave-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 30%, rgba(255, 255, 255, .07) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, .05) 0 2px, transparent 3px),
    radial-gradient(circle at 64% 68%, rgba(255, 255, 255, .06) 0 2px, transparent 3px),
    radial-gradient(circle at 24% 76%, rgba(255, 255, 255, .05) 0 3px, transparent 4px);
  background-size: 120px 120px, 170px 170px, 210px 210px, 150px 150px;
}
.layer-back { opacity: .5; transform: scale(1.1); }
.layer-front { opacity: .35; background-position: 30px 40px, 60px 20px, 100px 70px, 20px 110px; }
.wood-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  background:
    repeating-linear-gradient(90deg, #4c3321 0 5px, #5d3f29 5px 8px, #3c291b 8px 12px);
  border-left: 2px solid #2a1b11;
  border-right: 2px solid #2a1b11;
  opacity: .65;
  box-shadow: 0 0 26px rgba(0, 0, 0, .5);
}
.beam-left { left: 5.5%; transform: rotate(-1deg); }
.beam-right { right: 5.5%; transform: rotate(1deg); }
.rail {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 9%;
  height: 9px;
  background: repeating-linear-gradient(90deg, #3d3a35 0 9px, #24231f 9px 18px);
  border-top: 2px solid #6a6257;
  border-bottom: 2px solid #171615;
  opacity: .36;
  transform: perspective(200px) rotateX(24deg);
}
.torch {
  position: absolute;
  width: 8px;
  height: 34px;
  background: linear-gradient(90deg, #5b3c24, #8b5a2b 50%, #4d311c);
  border-radius: 2px;
  z-index: 4;
}
.torch::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 15px;
  height: 15px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fff3a6, #ffb02e 45%, rgba(255, 92, 28, .1) 72%);
  filter: blur(1px);
  box-shadow: 0 0 32px 10px rgba(255, 140, 40, .2);
}
.torch-left { left: 12%; top: 23%; transform: rotate(-7deg); }
.torch-right { right: 12%; top: 28%; transform: rotate(6deg); }
.torch-flame { position: absolute; left: 50%; top: -13px; width: 10px; height: 18px; transform: translateX(-50%); background: linear-gradient(#fff8bf, #ffb02e 55%, #ff5c28); border-radius: 50% 50% 42% 42%; animation: flame .45s ease-in-out infinite alternate; filter: blur(.4px); }
@keyframes flame { to { transform: translateX(-50%) scale(.82, 1.13) rotate(3deg); opacity: .85; } }
.dust { position: absolute; width: 3px; height: 3px; background: rgba(255, 220, 160, .5); border-radius: 50%; filter: blur(.5px); animation: dust-float 9s linear infinite; }
.dust-a { left: 28%; top: 62%; }
.dust-b { left: 66%; top: 34%; animation-delay: -3s; }
.dust-c { left: 80%; top: 72%; animation-delay: -6s; }
@keyframes dust-float {
  0% { transform: translate(0, 20px); opacity: 0; }
  20% { opacity: .8; }
  100% { transform: translate(-30px, -70px); opacity: 0; }
}

.miner-wrap {
  position: absolute;
  left: 7.5%;
  bottom: 7.5%;
  width: clamp(96px, 11vw, 148px);
  z-index: 7;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .4));
  animation: miner-bob 3.2s ease-in-out infinite;
}
@keyframes miner-bob { 50% { transform: translateY(-4px); } }
.miner-svg { display: block; width: 100%; height: auto; overflow: visible; }
.miner-arm { transform-box: view-box; transform-origin: 74px 54px; }
.miner-svg.is-mining .miner-arm { animation: pick-swing .28s cubic-bezier(.2, .8, .3, 1); }
@keyframes pick-swing {
  0% { transform: rotate(0deg); }
  36% { transform: rotate(-52deg); }
  72% { transform: rotate(18deg); }
  100% { transform: rotate(0deg); }
}
.miner-name {
  margin-top: -7px;
  text-align: center;
  font: 700 8px var(--font-pixel);
  letter-spacing: .12em;
  color: #cbb58a;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}

.mine-wall {
  --block: clamp(52px, 6vw, 80px);
  position: absolute;
  left: 54%;
  top: 49%;
  transform: translate(-50%, -47%);
  display: grid;
  grid-template-columns: repeat(5, var(--block));
  gap: clamp(6px, .8vw, 11px);
  z-index: 8;
}
.ore-block {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .14), transparent 38%),
    linear-gradient(145deg, #7c8791 0%, #59646e 48%, #4a545e 100%);
  border: 3px solid #3c454e;
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, .16),
    inset -3px -3px 0 rgba(0, 0, 0, .22),
    0 6px 0 #293139,
    0 12px 18px rgba(0, 0, 0, .22);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, filter .15s ease;
  isolation: isolate;
  overflow: hidden;
}
.ore-block::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 24%, rgba(255, 255, 255, .18) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 70%, rgba(0, 0, 0, .22) 0 2px, transparent 3px),
    linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .06) 43%, transparent 44%);
  opacity: .8;
  pointer-events: none;
}
.ore-block::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 4%;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
  pointer-events: none;
}
.ore-block.is-active {
  border-color: #ffe66d;
  transform: translateY(-6px) scale(1.045);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, .2),
    inset -3px -3px 0 rgba(0, 0, 0, .22),
    0 0 0 3px rgba(255, 230, 109, .2),
    0 0 30px rgba(255, 230, 109, .3),
    0 8px 0 #293139,
    0 16px 22px rgba(0, 0, 0, .28);
  z-index: 15;
}
.block-letter {
  position: relative;
  z-index: 4;
  font: 900 clamp(25px, 3.1vw, 40px)/1 var(--font-pixel);
  color: #f7fbff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .28), 0 0 20px rgba(255, 255, 255, .18);
  transform: translateY(-2px);
  user-select: none;
}

.block-pinyin {
  display: none;
  position: absolute;
  z-index: 5;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 92%;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(8, 6, 16, .46);
  color: rgba(218, 198, 255, .88);
  font: 700 clamp(10px, 1vw, 13px)/1 var(--font-pixel);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
body[data-world="pinyin"] .block-pinyin { display: block; }
body[data-world="pinyin"] .block-letter { transform: translateY(6px); }
body[data-world="pinyin"] .ore-block.is-active .block-pinyin {
  color: #fff4cc;
  background: rgba(70, 48, 12, .46);
  text-shadow: 0 0 8px rgba(255, 230, 109, .35);
}
.ore-block.is-active .block-letter { color: #fff9cf; text-shadow: 0 4px 0 #7b5b10, 0 0 24px rgba(255, 230, 109, .7); }
.block-arrow {
  position: absolute;
  z-index: 5;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffe66d;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}
.ore-block.is-active .block-arrow { opacity: 1; animation: arrow-bounce .7s ease-in-out infinite; }
@keyframes arrow-bounce { 50% { transform: translate(-50%, 4px); } }
.block-hard {
  position: absolute;
  z-index: 6;
  top: 3px;
  right: 4px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .55);
  color: #ffd166;
  font: 700 7px var(--font-pixel);
  opacity: 0;
  pointer-events: none;
}
.ore-block.is-hard .block-hard { opacity: 1; }
.block-speck {
  position: absolute;
  z-index: 2;
  width: 9%;
  height: 9%;
  border-radius: 1px;
  opacity: .88;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .22);
  pointer-events: none;
}
.block-speck.is-coal { background: #252b31; }
.block-speck.is-iron { background: #aeb9c4; }
.block-speck.is-gold { background: #f0c23a; }
.block-speck.is-diamond { background: #4de0e6; box-shadow: 0 0 7px rgba(77, 224, 230, .55); }
.cracks {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  background:
    linear-gradient(125deg, transparent 45%, rgba(10, 10, 10, .55) 46%, transparent 48%),
    linear-gradient(40deg, transparent 56%, rgba(10, 10, 10, .45) 57%, transparent 59%),
    linear-gradient(165deg, transparent 63%, rgba(10, 10, 10, .35) 64%, transparent 66%);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.ore-block.is-cracked .cracks { opacity: 1; }
.ore-block.is-shattering { animation: block-shatter .28s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes block-shatter {
  0% { transform: translateY(-6px) scale(1.045); opacity: 1; filter: brightness(1.5); }
  100% { transform: translateY(8px) scale(.62) rotate(7deg); opacity: 0; filter: brightness(2); }
}
.ore-block.is-new { animation: block-pop .3s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes block-pop {
  0% { transform: translateY(14px) scale(.72); opacity: 0; filter: brightness(1.8); }
  100% { transform: none; opacity: 1; filter: none; }
}

.ore-block.is-wrong { animation: block-wrong .22s ease; }
@keyframes block-wrong {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.mine-hotbar {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(12, 10, 8, .63);
  border: 1px solid rgba(220, 210, 190, .16);
  box-shadow: 0 5px 20px rgba(0, 0, 0, .35);
  z-index: 9;
  backdrop-filter: blur(4px);
}
.hot-slot {
  width: clamp(23px, 2.4vw, 31px);
  height: clamp(23px, 2.4vw, 31px);
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.hot-slot.is-active { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .12); }
.hot-pick { width: 4px; height: 17px; background: #8b5a2b; transform: rotate(38deg); position: relative; border-radius: 1px; }
.hot-pick::before { content: ""; position: absolute; left: -7px; top: -3px; width: 18px; height: 5px; background: linear-gradient(90deg, #4de0e6, #b8ffff); border-radius: 2px; }
.hot-torch { width: 4px; height: 15px; background: #8b5a2b; position: relative; }
.hot-torch::before { content: ""; position: absolute; left: -3px; top: -7px; width: 10px; height: 10px; background: radial-gradient(circle, #fff3a6, #ff8c2e); border-radius: 50%; }
.hot-ore { width: 9px; height: 9px; border-radius: 2px; }
.hot-ore.coal { background: #333d45; }
.hot-ore.iron { background: #d6e0e8; }
.hot-ore.gold { background: #ffd23d; }
.hot-ore.diamond { background: #4de0e6; clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%); }

/* ---------------- delta scene ---------------- */
.scene-delta { background: #07100f; }
.range-bg { position: absolute; inset: 0; overflow: hidden; }
.range-scenery { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: .78; }
.scan-cone {
  position: absolute;
  left: 8%;
  bottom: 8%;
  z-index: 2;
  width: 46%;
  height: 69%;
  transform-origin: bottom left;
  background: linear-gradient(68deg, rgba(141, 255, 159, .11), transparent 62%);
  clip-path: polygon(0 100%, 100% 0, 100% 30%, 7% 100%);
  filter: blur(22px);
  opacity: .28;
  pointer-events: none;
}
.range-lane {
  position: absolute;
  left: 16%;
  right: 4%;
  z-index: 2;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(141, 255, 159, .17), transparent);
  opacity: .7;
  pointer-events: none;
}
.range-lane span {
  position: absolute;
  left: 0;
  top: -10px;
  font: 6px var(--font-pixel);
  letter-spacing: .14em;
  color: rgba(141, 255, 159, .38);
}
.range-lane.lane-1 { top: 39%; }
.range-lane.lane-2 { top: 61%; }
.range-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 62% 44%, rgba(141, 255, 159, .16), transparent 30%),
    linear-gradient(180deg, #071114 0%, #0a1a18 48%, #07100f 100%);
}
.range-horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 55%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(141, 255, 159, .45), transparent);
  box-shadow: 0 0 30px 6px rgba(141, 255, 159, .12);
}
.range-grid {
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -12%;
  height: 72%;
  background-image:
    linear-gradient(rgba(141, 255, 159, .2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 255, 159, .2) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(330px) rotateX(61deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, #000 12%, rgba(0, 0, 0, .5) 48%, transparent 88%);
  opacity: .5;
}
.range-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, .12) 3px 4px);
  opacity: .55;
  mix-blend-mode: multiply;
}
.range-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 55% 50%, transparent 28%, rgba(0, 0, 0, .4) 78%, rgba(0, 0, 0, .7) 100%);
}
.range-radar {
  position: absolute;
  right: 6%;
  bottom: 15%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(141, 255, 159, .18);
  box-shadow: inset 0 0 26px rgba(141, 255, 159, .05);
  opacity: .55;
}
.range-radar::before, .range-radar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(141, 255, 159, .18);
}
.range-radar::before { inset: 18px; }
.range-radar::after { inset: 36px; }
.range-radar i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  height: 1px;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(141, 255, 159, .7), transparent);
  animation: radar-sweep 3.4s linear infinite;
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }

.threat-chip { flex-direction: row; align-items: center; gap: 7px; }
.threat-chip .chip-label { display: block; font-size: 6px; color: #6f8f7a; letter-spacing: .08em; }
.threat-chip b { color: var(--amber-2); font-size: 16px; }
.threat-chip em { color: #c2e6c7; }
.threat-bars { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.threat-bars i { width: 3px; height: 5px; background: rgba(141, 255, 159, .2); border-radius: 1px; }
.threat-bars i:nth-child(2) { height: 8px; }
.threat-bars i:nth-child(3) { height: 9px; }
.threat-bars i:nth-child(4) { height: 12px; }
.threat-bars i.on { background: var(--amber); box-shadow: 0 0 6px rgba(255, 176, 46, .6); }

.kill-chip { flex-direction: row; align-items: center; }
.kill-chip .chip-label { display: block; font-size: 6px; color: #6f8f7a; letter-spacing: .08em; }
.kill-chip b { color: #d9ffe1; font-size: 15px; }
.kill-chip em { color: #7f9c86; }

.shield-chip { margin-left: auto; flex-direction: row; align-items: center; }
.shield-chip .chip-label { display: block; font-size: 6px; color: #6f8f7a; letter-spacing: .08em; }
.shield-chip b { color: #d9ffe1; font-size: 15px; }
.shield-icons { display: flex; gap: 3px; margin-left: 2px; }
.shield-icons i {
  width: 12px;
  height: 13px;
  display: inline-block;
  background: linear-gradient(#b8ffd0, #58d98a);
  clip-path: polygon(50% 0, 100% 18%, 90% 72%, 50% 100%, 10% 72%, 0 18%);
  box-shadow: 0 0 8px rgba(141, 255, 159, .3);
  transition: .2s ease;
}
.shield-icons i.off { background: #34413a; box-shadow: none; opacity: .5; }
.shield-chip.is-low { border-color: rgba(255, 92, 114, .5); box-shadow: 0 0 18px rgba(255, 92, 114, .12); animation: shield-pulse 1s ease-in-out infinite; }
@keyframes shield-pulse { 50% { border-color: rgba(255, 92, 114, .24); } }

.drone-layer { position: absolute; inset: 0; z-index: 6; }
.drone {
  position: absolute;
  width: clamp(88px, 9.5vw, 128px);
  transform: translate(-50%, -50%);
  will-change: left;
  z-index: 6;
  transition: opacity .2s ease;
}
.drone-inner { animation: drone-float 3.4s ease-in-out infinite; }
@keyframes drone-float { 50% { transform: translateY(-7px); } }
.drone-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .45)) drop-shadow(0 0 8px rgba(141, 255, 159, .12)); }
.drone .rotor { transform-box: fill-box; transform-origin: center; animation: rotor-spin .16s linear infinite; }
.drone .rotor-r { animation-direction: reverse; }
.drone-word {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(3, 10, 8, .8);
  border: 1px solid rgba(141, 255, 159, .22);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .3);
  white-space: nowrap;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.drone-word-en { display: flex; align-items: center; gap: 2px; }
.drone-word-cn {
  font: 700 clamp(11px, .95vw, 14px)/1.15 var(--font-ui);
  color: #ffdf9c;
  letter-spacing: .02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}
.w-letter {
  min-width: 8px;
  text-align: center;
  font: 800 clamp(13px, 1.35vw, 18px)/1 var(--font-pixel);
  color: #93b59c;
  text-shadow: 0 1px 0 #000;
}
.w-letter.is-typed { color: #6c8a74; opacity: .55; }
.w-letter.is-current { color: #ffcf6a; text-shadow: 0 0 8px rgba(255, 176, 46, .75); transform: translateY(-1px); }
.drone.is-active .drone-word {
  border-color: rgba(255, 176, 46, .7);
  box-shadow: 0 0 0 1px rgba(255, 176, 46, .14), 0 0 20px rgba(255, 176, 46, .18), 0 5px 14px rgba(0, 0, 0, .3);
}
.drone.is-active::before {
  content: "";
  position: absolute;
  inset: -9px -5px -3px;
  border: 1px solid rgba(255, 176, 46, .62);
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(255, 176, 46, .13), inset 0 0 14px rgba(255, 176, 46, .06);
  animation: reticle-pulse 1.3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes reticle-pulse { 50% { opacity: .45; transform: scale(1.03); } }
.drone.is-active .drone-svg { filter: drop-shadow(0 0 10px rgba(255, 176, 46, .28)) drop-shadow(0 10px 12px rgba(0, 0, 0, .45)); }
.drone.is-golden .drone-svg { filter: drop-shadow(0 0 12px rgba(255, 209, 102, .35)) drop-shadow(0 10px 12px rgba(0, 0, 0, .4)); }
.drone.is-golden .drone-word { border-color: rgba(255, 209, 102, .55); }
.drone.is-wrong .drone-inner { animation: drone-shake .22s ease; }
@keyframes drone-shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.drone.is-destroyed { animation: drone-fall .62s cubic-bezier(.3, .7, .4, 1) forwards; pointer-events: none; }
@keyframes drone-fall {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); filter: brightness(2); }
  35% { opacity: 1; transform: translate(-50%, -55%) scale(1.08) rotate(-7deg); filter: brightness(1.4); }
  100% { opacity: 0; transform: translate(-50%, 35%) scale(.55) rotate(-32deg); filter: brightness(.5); }
}
.drone.is-escaped { animation: drone-escape .42s ease-in forwards; }
@keyframes drone-escape {
  to { opacity: 0; transform: translate(-160%, -50%) scale(.7); filter: blur(3px); }
}
.drone-star {
  position: absolute;
  right: -7px;
  top: -7px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffd166;
  color: #3a2500;
  font-size: 9px;
  box-shadow: 0 0 12px rgba(255, 209, 102, .6);
}

.defense-line {
  position: absolute;
  left: 13.5%;
  top: 17%;
  bottom: 17%;
  z-index: 4;
  border-left: 2px dashed rgba(255, 92, 114, .52);
  filter: drop-shadow(0 0 6px rgba(255, 92, 114, .35));
}
.defense-line::after {
  content: "";
  position: absolute;
  left: -11px;
  top: -20px;
  width: 20px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 92, 114, .55);
  box-shadow: 0 0 10px rgba(255, 92, 114, .35);
}
.defense-line span {
  position: absolute;
  left: 7px;
  top: -19px;
  font: 700 7px var(--font-pixel);
  letter-spacing: .13em;
  color: rgba(255, 130, 145, .8);
  white-space: nowrap;
}

.turret-wrap {
  position: absolute;
  left: 4.5%;
  bottom: 7.5%;
  width: clamp(94px, 10vw, 138px);
  z-index: 7;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .45));
}
.turret-svg { display: block; width: 100%; height: auto; overflow: visible; }
.turret-barrel { transform-box: view-box; transform-origin: 68px 60px; transition: transform .12s ease; }
.scene-delta.is-firing .turret-barrel { animation: turret-recoil .12s ease; }
@keyframes turret-recoil { 50% { transform: translateX(-4px) rotate(-3deg); } }
.turret-label {
  margin-top: -3px;
  text-align: center;
  font: 700 6px var(--font-pixel);
  letter-spacing: .16em;
  color: #5e8d72;
}
.turret-base {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 70%;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(141, 255, 159, .2), transparent 70%);
  filter: blur(2px);
}

.delta-bottom {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 10px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.base-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(5, 13, 10, .62);
  border: 1px solid rgba(141, 255, 159, .13);
}
.base-status b { font-size: 8px; letter-spacing: .08em; color: #a9d9b3; }
.base-status i { font-style: normal; font-size: 7px; color: #5f7a66; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--delta); box-shadow: 0 0 8px var(--delta); animation: live-pulse 1.8s infinite; }
.delta-tip { font: 700 7px var(--font-pixel); letter-spacing: .14em; color: rgba(141, 255, 159, .42); }

/* ---------------- countdown / pause / toast ---------------- */
.countdown {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 12, .58);
  backdrop-filter: blur(5px);
}
.countdown.is-active { display: flex; }
.countdown-inner { text-align: center; transform: translateY(-2%); }
.countdown-inner span {
  display: block;
  font: 700 9px var(--font-pixel);
  letter-spacing: .28em;
  color: #a9c1d6;
  text-transform: uppercase;
}
.countdown-inner b {
  display: block;
  margin: 8px 0 10px;
  font: 900 clamp(74px, 12vw, 138px)/.85 var(--font-pixel);
  letter-spacing: -.09em;
  color: #fff;
  text-shadow: 0 8px 0 rgba(0, 0, 0, .3), 0 0 60px rgba(126, 224, 129, .25);
}
.countdown-inner i { font-style: normal; font-size: 11px; letter-spacing: .08em; color: #8da3ba; }
.countdown-inner.is-pop b { animation: count-pop .34s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes count-pop { 0% { transform: scale(.55); opacity: .2; } 100% { transform: scale(1); opacity: 1; } }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 12, .64);
  backdrop-filter: blur(7px);
}
.overlay.is-active { display: flex; }
.overlay-card {
  width: min(430px, calc(100% - 32px));
  padding: 27px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(22, 35, 54, .97), rgba(10, 18, 30, .98));
  border: 1px solid rgba(160, 200, 240, .2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
  text-align: center;
  animation: overlay-in .2s ease both;
}
@keyframes overlay-in { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.overlay-kicker { font: 700 8px var(--font-pixel); letter-spacing: .24em; color: var(--green); }
.overlay-card h3 { margin: 9px 0 7px; font-size: 26px; letter-spacing: -.03em; }
.overlay-card p { margin: 0 0 19px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.overlay-actions { display: flex; flex-direction: column; gap: 8px; }
.overlay-actions .play-btn { width: 100%; }
.overlay-actions .ghost-btn { width: 100%; }

.toast {
  position: absolute;
  left: 50%;
  top: 14px;
  z-index: 60;
  transform: translate(-50%, -16px);
  max-width: calc(100% - 40px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 15, 24, .92);
  border: 1px solid rgba(180, 220, 255, .22);
  color: #eaf5ff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-good { border-color: rgba(126, 224, 129, .4); color: #d8ffdb; }
.toast.is-warn { border-color: rgba(255, 176, 46, .4); color: #ffe4b3; }

.screen-flash {
  position: absolute;
  inset: 0;
  z-index: 42;
  pointer-events: none;
  opacity: 0;
}
.screen-flash.is-red { animation: flash-red .36s ease-out; }
.screen-flash.is-green { animation: flash-green .3s ease-out; }
@keyframes flash-red { 0% { opacity: .5; background: radial-gradient(circle, transparent 20%, rgba(255, 50, 80, .7)); } 100% { opacity: 0; } }
@keyframes flash-green { 0% { opacity: .35; background: radial-gradient(circle, rgba(126, 224, 129, .6), transparent 70%); } 100% { opacity: 0; } }

.game-stage.is-shaking { animation: stage-shake .22s linear; }
@keyframes stage-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(3px, -1px); }
}

/* ---------------- typing dock ---------------- */
.typing-dock {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 9px;
  min-height: 340px;
}

.target-panel, .keyboard-panel {
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(18, 30, 48, .9), rgba(8, 14, 24, .92));
  border: 1px solid rgba(160, 195, 230, .16);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.target-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 17px 12px;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.target-panel::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(126, 224, 129, .12), transparent 68%);
  pointer-events: none;
}
body[data-world="delta"] .target-panel::before { background: radial-gradient(circle, rgba(255, 176, 46, .12), transparent 68%); }
.target-panel.is-wrong { animation: target-shake .25s ease; border-color: rgba(255, 92, 114, .55); box-shadow: 0 0 0 1px rgba(255, 92, 114, .18), 0 0 28px rgba(255, 92, 114, .12); }
@keyframes target-shake { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
.target-panel.is-complete { border-color: rgba(126, 224, 129, .5); box-shadow: 0 0 0 1px rgba(126, 224, 129, .14), 0 0 26px rgba(126, 224, 129, .1); }

.target-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.target-label {
  font: 700 8px var(--font-pixel);
  letter-spacing: .17em;
  text-transform: uppercase;
  color: #88b995;
}
body[data-world="delta"] .target-label { color: #d2b46d; }
.finger-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px 4px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(180, 210, 240, .13);
  white-space: nowrap;
}
.finger-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--finger-color, var(--finger-li));
  box-shadow: 0 0 8px var(--finger-color, var(--finger-li));
}
.finger-chip b { font-size: 8.5px; color: #c9d9ea; font-weight: 700; }
.finger-chip em {
  font: 700 8px var(--font-pixel);
  font-style: normal;
  color: #0b1520;
  background: var(--finger-color, var(--finger-li));
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.target-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  margin: 2px 0 1px;
  font-family: var(--font-pixel);
}
.target-letter {
  display: inline-block;
  font-size: clamp(46px, 5vw, 68px);
  font-weight: 900;
  line-height: .9;
  color: #f5fff5;
  text-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 0 30px rgba(126, 224, 129, .25);
  animation: target-pop .22s cubic-bezier(.2, 1.4, .4, 1);
}
body[data-world="delta"] .target-letter { color: #fff3cf; text-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 0 30px rgba(255, 176, 46, .25); }
@keyframes target-pop { from { transform: scale(.78); opacity: .2; } to { transform: scale(1); opacity: 1; } }
.target-display.is-word { gap: 4px; }
.target-display.is-word .word-letter {
  width: clamp(32px, 3.2vw, 48px);
  height: clamp(44px, 4.3vw, 62px);
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(4, 10, 18, .8);
  border: 2px solid #2b3a4e;
  color: #dce9f8;
  font-size: clamp(21px, 2.2vw, 31px);
  font-weight: 900;
  line-height: 1;
  transition: .12s ease;
}
.target-display.is-word .word-letter.is-typed {
  color: #83e695;
  border-color: rgba(126, 224, 129, .55);
  background: rgba(48, 120, 60, .16);
}
.target-display.is-word .word-letter.is-current {
  color: #ffcf6a;
  border-color: var(--amber);
  box-shadow: 0 0 16px rgba(255, 176, 46, .2);
  transform: translateY(-2px);
}

.target-display.is-pinyin { gap: 10px; }
.pinyin-char-card {
  width: 61px;
  height: 60px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2d2247, #171225);
  border: 2px solid rgba(184, 140, 255, .6);
  box-shadow: 0 0 18px rgba(184, 140, 255, .13), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.pinyin-char {
  font-family: var(--font-ui);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: #faf4ff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.pinyin-tone {
  font: 700 9px var(--font-pixel);
  color: #cbb5ed;
  letter-spacing: .04em;
  line-height: 1;
}
.pinyin-word { display: flex; align-items: center; gap: 4px; }
.target-display.is-pinyin .word-letter {
  width: clamp(23px, 2.35vw, 32px);
  height: clamp(33px, 3.3vw, 42px);
  border-width: 2px;
  border-radius: 6px;
  font-size: clamp(15px, 1.6vw, 21px);
}
.target-display.is-pinyin .word-letter.is-current {
  color: #e3d4ff;
  border-color: #c9a7ff;
  box-shadow: 0 0 16px rgba(184, 140, 255, .28);
  background: rgba(90, 65, 130, .2);
}
.target-display.is-pinyin.is-long { gap: 5px; }
.target-display.is-pinyin.is-long .pinyin-word { gap: 2px; }
.target-display.is-pinyin.is-long .word-letter {
  width: clamp(20px, 1.9vw, 24px);
  height: clamp(30px, 2.9vw, 36px);
  font-size: clamp(13px, 1.35vw, 17px);
  border-radius: 5px;
}

.target-letter.pinyin-ready-char,
.target-letter.pinyin-result-char {
  font-family: var(--font-ui);
  font-size: clamp(46px, 5vw, 64px);
  font-weight: 800;
  color: #f6efff;
  text-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 0 30px rgba(184, 140, 255, .4);
}
body[data-world="pinyin"] .target-panel::before {
  background: radial-gradient(circle, rgba(184, 140, 255, .16), transparent 68%);
}
body[data-world="pinyin"] .target-label { color: #c9a7ff; }
body[data-world="pinyin"] .target-panel.is-complete {
  border-color: rgba(184, 140, 255, .55);
  box-shadow: 0 0 0 1px rgba(184, 140, 255, .16), 0 0 26px rgba(184, 140, 255, .12);
}
.target-sub { min-height: 14px; text-align: center; font-size: 9px; line-height: 1.5; color: #7e91a8; }
.target-sub .target-meaning {
  display: block;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 800;
  line-height: 1.3;
  color: #ffdf9c;
  text-shadow: 0 0 18px rgba(255, 176, 46, .18);
}
body[data-world="delta"] .target-sub { min-height: 22px; }
.target-extra { min-height: 13px; text-align: center; font-size: 9px; line-height: 1.4; color: var(--amber-2); font-weight: 700; }

.keyboard-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 18px 12px;
  min-width: 0;
}
.keyboard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.keyboard-top > span:first-child { font: 700 9px var(--font-pixel); letter-spacing: .15em; color: #94a9bf; text-transform: uppercase; }
.keyboard-legend { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: #6f8299; }
.keyboard-legend i { width: 5px; height: 5px; border-radius: 50%; background: #8397ad; display: inline-block; margin-left: 4px; }
.keyboard-legend .lg-left { background: #6f8299; }
.keyboard-legend .lg-right { background: #6f8299; }
.kb-note { margin-left: auto; font-size: 8.5px; color: #5d7189; white-space: nowrap; }

.keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, .55vw, 9px);
  --key: clamp(48px, 5.6vw, 82px);
}
.kb-row { display: flex; gap: clamp(4px, .5vw, 8px); justify-content: center; }
.kb-row:nth-child(2) { padding-left: calc(var(--key) * .32); }
.kb-row:nth-child(3) { padding-left: calc(var(--key) * .8); }
.kb-key {
  position: relative;
  width: var(--key);
  height: var(--key);
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #1c2a3d, #111a28);
  border: 1px solid #2d3e55;
  box-shadow: 0 4px 0 #070b11, inset 0 1px 0 rgba(255, 255, 255, .08);
  color: #a9bcd2;
  font: 700 clamp(15px, 1.45vw, 22px)/1 var(--font-pixel);
  text-transform: uppercase;
  transition: transform .1s ease, background .1s ease, color .1s ease, border-color .1s ease, box-shadow .1s ease;
  user-select: none;
}
.kb-key::after {
  content: "";
  position: absolute;
  left: 19%;
  right: 19%;
  bottom: 5px;
  height: 4px;
  border-radius: 99px;
  background: var(--finger-color, #60738a);
  opacity: .75;
  transition: .12s ease;
}
.kb-key.is-home::before {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 50%;
  width: 6px;
  height: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .4);
}
.kb-key.next {
  color: #08111b;
  background: var(--finger-color, var(--finger-li));
  border-color: #fff;
  box-shadow: 0 0 18px var(--finger-color, var(--finger-li)), 0 3px 0 rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
  transform: translateY(-2px) scale(1.055);
  z-index: 3;
  animation: next-glow 1.25s ease-in-out infinite;
}
.kb-key.next::after { background: rgba(0, 0, 0, .28); }
@keyframes next-glow { 50% { box-shadow: 0 0 26px var(--finger-color, var(--finger-li)), 0 3px 0 rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .5); } }
.kb-key.pressed { animation: key-press .13s ease; }
@keyframes key-press { 50% { transform: translateY(2px) scale(.96); filter: brightness(1.5); } }
.kb-key.wrong { background: #ff5c72; color: #fff; border-color: #ffb3bd; box-shadow: 0 0 18px rgba(255, 92, 114, .55), 0 3px 0 #6d1522; }
.kb-key.dim { opacity: .3; }

/* ---------------- results ---------------- */
.screen-results {
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
}
.results-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.screen-results[data-world="mine"] .results-bg { background: radial-gradient(ellipse at 50% 30%, rgba(114, 201, 60, .14), transparent 55%), radial-gradient(ellipse at 80% 80%, rgba(255, 176, 46, .08), transparent 45%); }
.screen-results[data-world="delta"] .results-bg { background: radial-gradient(ellipse at 50% 30%, rgba(141, 255, 159, .12), transparent 55%), radial-gradient(ellipse at 80% 80%, rgba(255, 176, 46, .08), transparent 45%); }
.screen-results[data-world="pinyin"] .results-bg { background: radial-gradient(ellipse at 50% 30%, rgba(184, 140, 255, .16), transparent 55%), radial-gradient(ellipse at 80% 80%, rgba(77, 224, 230, .07), transparent 45%); }
.screen-results[data-world="pinyin"] .results-card::before { background: linear-gradient(90deg, transparent, rgba(184, 140, 255, .68), transparent); }
.confetti { position: absolute; inset: 0; overflow: hidden; }

.results-wrap { position: relative; z-index: 2; width: 100%; max-width: 760px; }
.results-card {
  position: relative;
  padding: 30px 34px 28px;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(20, 33, 52, .96), rgba(8, 15, 26, .98));
  border: 1px solid rgba(170, 205, 240, .19);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .07);
  text-align: center;
  animation: results-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes results-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.results-card::before {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 224, 129, .6), transparent);
}
.results-kicker { font: 700 8px var(--font-pixel); letter-spacing: .26em; color: #8fd39b; text-transform: uppercase; }
.results-card h2 { margin: 9px 0 2px; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.04em; font-weight: 900; }
.stars { display: flex; justify-content: center; gap: 8px; margin: 10px 0 4px; min-height: 48px; }
.star {
  font-size: clamp(37px, 4.4vw, 48px);
  line-height: 1;
  color: #2c3a4e;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .2);
  transform: scale(.6);
  opacity: .5;
}
.star.is-on {
  color: #ffd166;
  text-shadow: 0 4px 0 #8f5a0b, 0 0 28px rgba(255, 209, 102, .48);
  animation: star-pop .38s cubic-bezier(.2, 1.5, .4, 1) forwards;
}
.star:nth-child(2) { animation-delay: .1s; }
.star:nth-child(3) { animation-delay: .2s; }
@keyframes star-pop { 0% { transform: scale(.2) rotate(-18deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.results-message { margin: 4px auto 18px; max-width: 480px; color: #a5b8ce; font-size: 12.5px; line-height: 1.75; }

.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-stat {
  padding: 10px 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(170, 205, 240, .1);
  text-align: left;
}
.result-stat span { display: block; font-size: 8px; letter-spacing: .1em; color: #7488a0; text-transform: uppercase; margin-bottom: 3px; }
.result-stat b { font: 800 20px var(--font-pixel); color: #edf7ff; letter-spacing: -.03em; }
.result-stat b small { font-size: 9px; color: #849ab1; font-weight: 500; margin-left: 2px; }
.result-stat.is-highlight { border-color: rgba(255, 209, 102, .27); background: rgba(255, 176, 46, .055); }
.result-stat.is-highlight b { color: #ffd166; }

.new-record {
  display: inline-block;
  margin: 13px 0 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 209, 102, .12);
  border: 1px solid rgba(255, 209, 102, .4);
  color: #ffe29a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  animation: record-glow 1.5s ease-in-out infinite;
}
@keyframes record-glow { 50% { box-shadow: 0 0 18px rgba(255, 209, 102, .2); } }
.unlock-box {
  margin-top: 13px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(126, 224, 129, .055);
  border: 1px solid rgba(126, 224, 129, .2);
  text-align: left;
}
.unlock-box > b { font-size: 10px; color: #9fe8aa; letter-spacing: .06em; }
.unlock-list { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.unlock-item { display: flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 7px; background: rgba(255, 255, 255, .05); font-size: 9px; color: #d6e9d8; }
.unlock-item i { font-style: normal; font-size: 14px; }

.results-actions { display: flex; justify-content: center; gap: 8px; margin-top: 19px; flex-wrap: wrap; }
.results-actions .play-btn { min-width: 145px; }

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 7px;
  height: 13px;
  border-radius: 2px;
  opacity: .8;
  animation: confetti-fall var(--d, 3.6s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0); opacity: 0; }
  8% { opacity: .9; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ---------------- modal / guide ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 11, .72);
  backdrop-filter: blur(8px);
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  z-index: 2;
  width: min(820px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: 28px 30px 27px;
  border-radius: 24px;
  background: linear-gradient(145deg, #132138, #0a1321 70%);
  border: 1px solid rgba(170, 205, 240, .2);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .07);
  animation: modal-in .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-card::-webkit-scrollbar { width: 8px; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(150, 180, 220, .2); border-radius: 99px; }
.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #8fa4bb;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(170, 205, 240, .12);
}
.modal-close:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.modal-head { padding-right: 30px; }
.modal-head h2 { margin: 8px 0 4px; font-size: 30px; letter-spacing: -.04em; }
.modal-head p { margin: 0; font-size: 12px; color: var(--muted); }
.guide-tabs { display: flex; gap: 5px; margin: 20px 0 16px; padding: 4px; border-radius: 11px; background: rgba(4, 10, 18, .55); border: 1px solid rgba(170, 205, 240, .1); width: fit-content; }
.guide-tab { padding: 7px 13px; border-radius: 8px; font-size: 10px; font-weight: 700; color: #8196ad; transition: .15s ease; }
.guide-tab:hover { color: #c4d8ec; }
.guide-tab.is-active { background: #22344d; color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.guide-pane { display: none; }
.guide-pane.is-active { display: block; animation: pane-in .2s ease; }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.guide-steps { display: grid; gap: 9px; }
.guide-step { display: flex; gap: 13px; padding: 13px 15px; border-radius: 12px; background: rgba(255, 255, 255, .032); border: 1px solid rgba(170, 205, 240, .09); }
.step-no { font: 800 11px var(--font-pixel); color: var(--green); padding-top: 2px; }
.guide-step b { font-size: 12px; }
.guide-step p { margin: 4px 0 0; font-size: 11px; line-height: 1.7; color: #95a9bf; }
.guide-step kbd { display: inline-block; min-width: 19px; padding: 1px 4px; border-radius: 4px; background: #203149; border: 1px solid #3b5471; box-shadow: 0 2px 0 #0a1220; font: 700 10px var(--font-pixel); color: #d7e8ff; text-align: center; }
.guide-callout { margin-top: 13px; padding: 13px 15px; border-radius: 12px; background: linear-gradient(100deg, rgba(126, 224, 129, .08), rgba(77, 224, 230, .035)); border: 1px solid rgba(126, 224, 129, .18); }
.guide-callout span { font: 700 8px var(--font-pixel); letter-spacing: .16em; color: var(--green); }
.guide-callout p { margin: 5px 0 0; font-size: 11px; line-height: 1.65; color: #b9d8c2; }
.guide-callout b { color: #d9ffd9; }

.guide-keyboard { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 17px 10px 13px; border-radius: 14px; background: rgba(4, 10, 18, .45); border: 1px solid rgba(170, 205, 240, .09); }
.guide-keyboard { --key: clamp(28px, 3.5vw, 42px); }
.guide-keyboard .kb-key { font-size: 11px; }
.guide-keyboard .kb-key::after { opacity: .95; }
.finger-table { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 14px; }
.finger-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; background: rgba(255, 255, 255, .025); }
.finger-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 8px currentColor; }
.finger-row b { font-size: 9.5px; min-width: 70px; color: #c9d9ea; }
.finger-row code { font: 700 9px var(--font-pixel); color: #8299b1; letter-spacing: .12em; }
.guide-note { margin: 12px 0 0; font-size: 9px; color: #6d8198; text-align: center; }
.guide-tip-line { margin: 10px 0 0; font-size: 9px; line-height: 1.6; color: #7f94aa; text-align: center; }

.parent-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tip-item { padding: 13px 14px; border-radius: 12px; background: rgba(255, 255, 255, .032); border: 1px solid rgba(170, 205, 240, .09); }
.tip-item b { font-size: 11.5px; color: #dcecff; }
.tip-item p { margin: 5px 0 0; font-size: 10px; line-height: 1.7; color: #8fa4bb; }
.reset-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 15px; padding: 13px 14px; border-radius: 12px; background: rgba(255, 92, 114, .045); border: 1px solid rgba(255, 92, 114, .16); }
.reset-zone b { display: block; font-size: 10.5px; color: #ffc1c9; }
.reset-zone span { display: block; margin-top: 3px; font-size: 9px; color: #9c7b82; }
.danger-btn { flex: 0 0 auto; min-height: 32px; padding: 0 11px; border-radius: 8px; background: rgba(255, 92, 114, .12); border: 1px solid rgba(255, 92, 114, .28); color: #ffb3bd; font-size: 9px; font-weight: 700; }
.danger-btn:hover { background: rgba(255, 92, 114, .2); }


/* =========================================================
   DELTA LOOT · 保险箱 / 战利品仓库 / 背包
   ========================================================= */
.q-blue { --q-color: #4ea3ff; --q-soft: rgba(78, 163, 255, .15); }
.q-purple { --q-color: #b06bff; --q-soft: rgba(176, 107, 255, .16); }
.q-gold { --q-color: #ffbf3f; --q-soft: rgba(255, 191, 63, .16); }
.q-red { --q-color: #ff4d5e; --q-soft: rgba(255, 77, 94, .16); }

.stash-icon-btn { position: relative; overflow: visible; }
.stash-icon-btn span { font-size: 16px; line-height: 1; }
.stash-icon-btn b {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 999px;
  background: linear-gradient(#ffd36e, #ffb02e);
  color: #1a1204;
  font: 800 8px/17px var(--font-pixel);
  text-align: center;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .4);
}

/* ---------------- home stash card ---------------- */
.stash-card {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 190px;
  margin-top: 18px;
  border-radius: 26px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 191, 63, .18);
  background: linear-gradient(112deg, #0f1d18 0%, #0b1514 53%, #19140b 100%);
  box-shadow: 0 24px 58px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .35s ease, box-shadow .35s ease;
}
.stash-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 205, 105, .34);
  box-shadow: 0 34px 78px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.stash-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 191, 63, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 191, 63, .04) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(90deg, transparent 10%, #000 65%);
  opacity: .8;
}
.stash-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 38%, rgba(255, 191, 63, .14), transparent 32%),
    radial-gradient(circle at 70% 88%, rgba(77, 224, 230, .06), transparent 36%);
}
.stash-copy {
  position: relative;
  z-index: 3;
  width: 58%;
  padding: 22px 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.stash-copy .card-kicker { color: #c9b06c; }
.stash-copy h2 {
  margin: 6px 0 6px;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 900;
  color: #f8f3e5;
}
.stash-copy p {
  margin: 0;
  max-width: 470px;
  color: #a5a798;
  font-size: 12px;
  line-height: 1.7;
}
.stash-stats { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 13px 0 14px; }
.stash-stats div { display: flex; flex-direction: column; gap: 1px; }
.stash-stats b { font: 800 20px var(--font-pixel); color: #f0d898; line-height: 1.1; }
.stash-stats span { font-size: 8px; color: #898d7e; letter-spacing: .06em; }
.stash-open-btn {
  min-height: 34px;
  padding: 0 13px;
  color: #e9d7a8;
  border-color: rgba(255, 205, 105, .28);
  background: rgba(255, 191, 63, .06);
}
.stash-open-btn:hover { background: rgba(255, 191, 63, .13); border-color: rgba(255, 205, 105, .48); }
.stash-preview {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-content: center;
  padding: 20px 28px 20px 0;
}
.stash-preview-item {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--q-color);
  background: linear-gradient(145deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 14px var(--q-soft);
  font-size: clamp(18px, 2vw, 25px);
  overflow: hidden;
}
.stash-preview-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--q-color), transparent);
  opacity: .85;
}
.stash-preview-item b {
  position: absolute;
  right: 4px;
  bottom: 3px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font: 800 8px var(--font-pixel);
}
.stash-empty {
  grid-column: 1 / -1;
  align-self: center;
  text-align: center;
  color: #9b9b88;
  font-size: 10px;
  line-height: 1.8;
}
.stash-empty span { color: #666b60; font-size: 8.5px; }

/* ---------------- results loot banner ---------------- */
.loot-reward {
  --loot-color: #ffbf3f;
  --loot-soft: rgba(255, 191, 63, .15);
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 4px 0 12px;
  padding: 10px 11px;
  border-radius: 13px;
  border: 1px solid var(--loot-color);
  background:
    linear-gradient(100deg, var(--loot-soft), transparent 70%),
    rgba(255, 255, 255, .025);
  box-shadow: 0 0 20px var(--loot-soft);
  text-align: left;
}
.loot-reward-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--loot-soft);
  border: 1px solid var(--loot-color);
  font-size: 18px;
}
.loot-reward-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.loot-reward-copy b { font-size: 10.5px; color: #f6efdf; letter-spacing: .03em; }
.loot-reward-copy span { font-size: 8.5px; color: #9a9a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loot-reward-btn {
  min-height: 34px;
  padding: 0 13px;
  font-size: 10px;
  background: linear-gradient(#ffd36e, #ffb02e);
  color: #221605;
  box-shadow: 0 3px 0 #8a5a0e, 0 6px 14px rgba(0, 0, 0, .2);
}
.loot-reward-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a5a0e; }

/* ---------------- safe overlay ---------------- */
.safe-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.safe-overlay.is-visible { display: flex; }
.safe-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 10, .8);
  backdrop-filter: blur(9px);
  animation: fade-in .2s ease;
}
.safe-panel {
  position: relative;
  z-index: 2;
  width: min(790px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 23px 26px 20px;
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 191, 63, .08), transparent 48%),
    linear-gradient(145deg, #111c1c, #080e12 74%);
  border: 1px solid rgba(255, 191, 63, .3);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .07);
  animation: modal-in .26s cubic-bezier(.2, .8, .2, 1);
}
.safe-panel::-webkit-scrollbar { width: 8px; }
.safe-panel::-webkit-scrollbar-thumb { background: rgba(255, 191, 63, .2); border-radius: 99px; }
.safe-head { text-align: center; }
.safe-head .eyebrow { color: #d8b15e; }
.safe-head h2 { margin: 7px 0 4px; font-size: 29px; letter-spacing: -.04em; color: #f8f0dc; }
.safe-head p { margin: 0; color: #8f998e; font-size: 10.5px; line-height: 1.6; }
.safe-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 254px;
  margin: 4px auto 0;
}
.safe-body {
  position: relative;
  width: 246px;
  height: 202px;
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .1), transparent 30%),
    linear-gradient(160deg, #454b4d, #22282b 52%, #151a1d);
  border: 3px solid #5d6467;
  box-shadow:
    inset 0 0 0 5px #181d1f,
    inset 0 0 0 7px #3d4447,
    0 18px 34px rgba(0, 0, 0, .5);
}
.safe-inner {
  position: absolute;
  inset: 13px;
  z-index: 0;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255, 255, 255, .022) 31px 32px),
    linear-gradient(180deg, #070a0b, #11171a 58%, #090d0f);
  border: 1px solid #303a3d;
  overflow: hidden;
}
.safe-shelves {
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 36%;
  height: 2px;
  background: #394346;
  box-shadow: 0 37px 0 #2d3639;
  opacity: .65;
}
.safe-bars {
  position: absolute;
  left: 17%;
  bottom: 8%;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.safe-bars i {
  width: 18px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(#ffd76b, #b67a1f);
  box-shadow: 0 0 8px rgba(255, 191, 63, .25);
}
.safe-bars i:nth-child(2) { width: 14px; height: 11px; }
.safe-bars i:nth-child(3) { width: 21px; height: 7px; }
.safe-inner-glow {
  position: absolute;
  inset: 13px;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 55%, rgba(255, 226, 130, .9), rgba(255, 177, 46, .28) 45%, transparent 72%);
  opacity: 0;
  transition: opacity .7s ease .18s;
  filter: blur(3px);
}
.safe-visual.is-open .safe-inner-glow { opacity: .62; }
.safe-door {
  position: absolute;
  inset: -3px;
  z-index: 2;
  border-radius: 17px;
  border: 3px solid #626a6d;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .16), transparent 27%),
    repeating-linear-gradient(105deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 13px),
    linear-gradient(155deg, #555d60, #2b3134 46%, #1b2022);
  box-shadow: inset 0 0 0 7px #333a3d, inset 0 0 0 9px #202629, 6px 10px 20px rgba(0, 0, 0, .3);
  transform-origin: left center;
  transition: transform .95s cubic-bezier(.2, .8, .2, 1);
  backface-visibility: visible;
}
.safe-visual.is-open .safe-door { transform: perspective(900px) rotateY(-72deg); }
.safe-brand {
  position: absolute;
  left: 17px;
  top: 14px;
  font: 800 8px var(--font-pixel);
  letter-spacing: .18em;
  color: #aeb8b4;
  opacity: .8;
}
.safe-dial {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid #777f82;
  background: radial-gradient(circle at 35% 30%, #6c7477, #2c3336 60%, #171c1f);
  box-shadow: inset 0 0 0 4px #232a2d, 0 0 0 4px #1b2123;
  display: grid;
  place-items: center;
}
.safe-dial::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px dashed #7d8587;
  opacity: .6;
}
.safe-dial i {
  position: absolute;
  left: 50%;
  top: 18px;
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: #d6d8d4;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(32deg);
  box-shadow: 0 0 6px rgba(255, 255, 255, .3);
}
.safe-handle {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 58px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 5px;
  background: linear-gradient(#949b9d, #4a5154);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.safe-sticker {
  position: absolute;
  right: -13px;
  top: 17px;
  z-index: 3;
  padding: 3px 6px;
  border-radius: 4px;
  background: #c9323e;
  border: 1px solid #ff8a8a;
  color: #ffe8e8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  transform: rotate(6deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
.safe-open-btn { position: relative; z-index: 4; margin-top: 12px; min-height: 38px; padding: 0 18px; font-size: 11px; }
.safe-loot {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 8px;
}
.safe-overlay.is-open .safe-loot { display: grid; }
.loot-card {
  position: relative;
  padding: 10px 10px 9px;
  border-radius: 11px;
  border: 1px solid var(--q-color);
  background:
    linear-gradient(150deg, var(--q-soft), transparent 64%),
    rgba(8, 13, 17, .85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 16px var(--q-soft);
  overflow: hidden;
  text-align: left;
  opacity: 0;
  transform: translateY(10px) scale(.96);
}
.loot-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--q-color), transparent);
}
.safe-overlay.is-open .loot-card {
  animation: loot-reveal .48s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes loot-reveal {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.loot-card-icon { display: block; font-size: 25px; line-height: 1; margin-bottom: 5px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.loot-card-name { display: block; font-size: 10.5px; font-weight: 800; line-height: 1.35; color: #f2f6fa; }
.loot-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 3px; font-size: 7.5px; color: #8c9aa2; }
.loot-card-quality { color: var(--q-color); font-weight: 800; }
.loot-card-price { display: block; margin-top: 5px; font: 800 10px var(--font-pixel); color: #ffe0a0; }
.loot-card-price i { font-style: normal; font-size: 7px; color: #8d8066; }
.safe-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 191, 63, .14);
}
.safe-total { font-size: 9px; color: #96917f; }
.safe-total b { display: block; margin-top: 2px; font: 800 21px var(--font-pixel); color: #ffd166; letter-spacing: -.03em; }
.safe-total span { font-size: 8px; color: #8f8060; }
.safe-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.safe-actions .play-btn, .safe-actions .ghost-btn { min-height: 35px; padding: 0 13px; font-size: 10px; }
.loot-price-note { margin: 10px 0 0; text-align: center; font-size: 8px; line-height: 1.6; color: #68776f; }

/* ---------------- stash modal ---------------- */
.stash-modal-card { max-width: 980px; }
.stash-head { text-align: left; }
.stash-head h2 { margin-bottom: 3px; }
.stash-summary { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 9px; font-size: 9px; color: #899b90; }
.stash-summary b { color: #ffd166; font: 800 13px var(--font-pixel); }
.stash-filters { display: flex; flex-wrap: wrap; gap: 5px; margin: 16px 0 12px; padding: 4px; width: fit-content; border-radius: 10px; background: rgba(4, 10, 14, .5); border: 1px solid rgba(170, 205, 240, .09); }
.stash-filter { padding: 7px 12px; border-radius: 7px; font-size: 9px; font-weight: 700; color: #7f9388; transition: .15s ease; }
.stash-filter:hover { color: #cfe0d5; }
.stash-filter.is-active { background: #253633; color: #f1f8ed; box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.stash-filter[data-filter="blue"].is-active { background: #1b3d5a; color: #c4e4ff; }
.stash-filter[data-filter="purple"].is-active { background: #3b2458; color: #e3ceff; }
.stash-filter[data-filter="gold"].is-active { background: #4b3a12; color: #ffe6a8; }
.stash-filter[data-filter="red"].is-active { background: #4b1820; color: #ffd1d6; }
.stash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 9px; }
.stash-item {
  position: relative;
  min-height: 118px;
  padding: 10px 10px 9px;
  border-radius: 11px;
  border: 1px solid var(--q-color);
  background:
    linear-gradient(150deg, var(--q-soft), transparent 68%),
    rgba(255, 255, 255, .025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stash-item:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .25), 0 0 18px var(--q-soft); }
.stash-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--q-color), transparent);
}
.stash-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; }
.stash-item-icon { font-size: 25px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.stash-item-qty { font: 800 9px var(--font-pixel); color: #f5f1e7; background: rgba(0, 0, 0, .4); border-radius: 4px; padding: 2px 4px; }
.stash-item-name { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 800; line-height: 1.35; color: #eff5f1; }
.stash-item-meta { display: block; margin-top: 2px; font-size: 7.5px; color: #8b9c92; }
.stash-item-price { display: block; margin-top: 4px; font: 800 9.5px var(--font-pixel); color: #ffdf9c; }
.stash-item-price i { font-style: normal; font-size: 7px; color: #887b61; }
.stash-empty-state { grid-column: 1 / -1; padding: 38px 18px; text-align: center; color: #94a49a; font-size: 11px; line-height: 1.8; }
.stash-empty-state span { display: block; margin-top: 3px; font-size: 9px; color: #66776d; }

/* ---------------- responsive loot ---------------- */
@media (max-width: 900px) {
  .stash-copy { width: 64%; padding: 21px 22px; }
  .stash-preview { padding: 18px 18px 18px 0; }
  .safe-panel { width: min(700px, 100%); }
  .stash-modal-card { max-width: 820px; }
}

@media (max-width: 620px) {
  .stash-card { flex-direction: column; min-height: 0; }
  .stash-copy { width: 100%; padding: 21px 22px 14px; }
  .stash-preview { padding: 0 22px 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stash-stats { gap: 8px 18px; }
  .stash-stats b { font-size: 17px; }
  .loot-reward { flex-wrap: wrap; }
  .loot-reward-copy { flex-basis: calc(100% - 50px); }
  .loot-reward-btn { width: 100%; }
  .safe-overlay { padding: 9px; }
  .safe-panel { padding: 20px 14px 17px; border-radius: 20px; max-height: 94vh; }
  .safe-head h2 { font-size: 25px; }
  .safe-visual { min-height: 228px; }
  .safe-body { width: 218px; height: 180px; }
  .safe-dial { width: 56px; height: 56px; }
  .safe-dial i { top: 15px; height: 18px; }
  .safe-loot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safe-foot { flex-direction: column; align-items: stretch; }
  .safe-actions { justify-content: stretch; }
  .safe-actions .play-btn, .safe-actions .ghost-btn { flex: 1; }
  .stash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stash-filters { width: 100%; }
  .stash-filter { flex: 1; padding: 7px 5px; }
  .stash-summary { flex-direction: column; gap: 3px; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1120px) {
  .card-content { width: 62%; padding-left: 25px; }
  .card-art { width: 50%; right: -16px; }
  .typing-dock { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
  .keyboard { --key: clamp(44px, 5vw, 64px); }

  body[data-world="pinyin"] .block-pinyin { font-size: 9px; }
}

@media (max-width: 900px) {
  body[data-screen="game"] { overflow-y: auto; }
  .site-header { padding: 18px 20px 6px; }
  .screen-home { padding: 24px 20px 40px; }
  .world-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 30px; }
  .world-card { min-height: 350px; }
  .card-content { width: 64%; min-height: 350px; }
  .card-art { width: 45%; max-width: 320px; }
  .home-bottom { flex-direction: column; }
  .trainer-card { width: 100%; }
  .pinyin-card { min-height: 236px; }
  .pinyin-card-copy { width: 63%; padding: 21px 23px; }
  .pinyin-card-art { width: 37%; padding-right: 12px; opacity: .88; }
  .pinyin-art-block { width: 100px; height: 100px; }
  .pinyin-art-block span { font-size: 50px; }
  .screen-game { height: auto; min-height: 100dvh; padding: 9px 10px 12px; }
  .game-hud { flex-wrap: wrap; gap: 8px; }
  .hud-left { order: 1; }
  .timer-wrap { order: 2; flex: 1 1 160px; max-width: none; margin: 0; }
  .hud-right { order: 3; }
  .hud-right .stat { min-width: 54px; }
  .typing-dock { grid-template-columns: minmax(230px, 260px) minmax(0, 1fr); }
  .keyboard { --key: clamp(36px, 5.4vw, 52px); gap: 5px; }
  .kb-row { gap: 4px; }
  .game-stage { min-height: 320px; }
  .mine-wall { --block: clamp(44px, 9vw, 68px); left: 57%; }
  .miner-wrap { left: 4%; width: 104px; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .finger-table { grid-template-columns: 1fr; }
  .parent-tips { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .typing-dock { grid-template-columns: 1fr; min-height: 0; }
  .target-panel { min-height: 156px; }
  .keyboard { --key: clamp(30px, 7vw, 44px); }
}

@media (max-width: 620px) {
  .threat-chip .chip-label, .kill-chip .chip-label, .shield-chip .chip-label { display: none; }
  .pinyin-card { min-height: 312px; align-items: flex-start; }
  .pinyin-card-copy { width: 100%; padding: 21px 22px; }
  .pinyin-card p { max-width: 84%; }
  .pinyin-card-art {
    position: absolute;
    right: -34px;
    top: 57%;
    width: 74%;
    padding: 0;
    opacity: .28;
    transform: translateY(-50%) scale(.9);
  }
  .pinyin-art-caption { display: none; }
  .hero h1 { font-size: 37px; letter-spacing: -.045em; }
  .hero-sub { font-size: 13px; }
  .hero-meta span { font-size: 9.5px; padding: 6px 9px; }
  .world-card { min-height: 410px; }
  .card-content { width: 100%; min-height: 410px; padding: 23px 22px; }
  .card-art { width: 65%; opacity: .32; right: -20px; bottom: 34px; }
  .card-content p { max-width: 75%; }
  .card-stats { margin-top: 14px; }
  .play-btn { min-height: 43px; }
  .brand-text i { display: none; }
  .header-actions .guide-open { display: none; }
  .save-pill { padding: 0 10px; }
  .game-hud .world-tag i { display: none; }
  .keyboard { --key: clamp(27px, 7.6vw, 34px); gap: 4px; }
  .kb-row { gap: 3px; }
  .keyboard-top { margin-bottom: 6px; }
  .keyboard-top > span:first-child { font-size: 8px; }
  .keyboard-legend { font-size: 7.5px; }
  .hud-right .combo-stat, .hud-right .acc-stat { display: none; }
  .stat { min-width: 50px; padding: 3px 8px; }
  .stat b { font-size: 14px; }
  .miner-wrap { width: 85px; bottom: 13%; }
  .mine-wall { --block: clamp(39px, 10.8vw, 52px); left: 59%; top: 52%; gap: 5px; }
  body[data-world="pinyin"] .block-letter { font-size: 28px; transform: translateY(6px); }
  body[data-world="pinyin"] .block-pinyin { top: 2px; font-size: 8px; padding: 0 2px; }
  .mine-hotbar { bottom: 7px; }
  .hot-slot { width: 21px; height: 21px; }
  .depth-chip em { display: none; }
  .ore-item { padding: 2px 3px; }
  .ore-item b { font-size: 8px; }
  .ore-ico { width: 8px; height: 8px; }
  .drone { width: 86px; }
  .turret-wrap { width: 88px; left: 2%; }
  .delta-tip, .base-status i { display: none; }
  .defense-line { left: 18%; }
  .results-card { padding: 24px 18px 22px; border-radius: 20px; }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .results-actions { flex-direction: column; }
  .results-actions .play-btn, .results-actions .ghost-btn { width: 100%; }
  .modal { padding: 10px; }
  .modal-card { padding: 22px 17px 20px; max-height: 92vh; }
  .guide-tabs { width: 100%; }
  .guide-tab { flex: 1; padding: 7px 6px; font-size: 9px; }
  .reset-zone { flex-direction: column; align-items: stretch; }
  .danger-btn { width: 100%; }
}

@media (max-height: 650px) {
  body[data-screen="game"] { overflow-y: auto; }
  .screen-game { height: auto; }
}

@media (max-width: 700px), (max-height: 700px) {
  .screen-results { align-items: flex-start; padding-top: 22px; padding-bottom: 22px; }
}

@media (max-height: 780px) and (min-width: 901px) {
  .screen-game { padding-top: 8px; padding-bottom: 9px; gap: 7px; }
  .game-hud { min-height: 44px; }
  .game-stage { min-height: 240px; }
  .typing-dock { min-height: 300px; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .target-panel { padding-top: 10px; padding-bottom: 9px; }
  .target-display { min-height: 64px; }
  .target-letter { font-size: 56px; }
  .keyboard { --key: clamp(50px, 4.6vw, 68px); }
  .keyboard-panel { padding-top: 9px; padding-bottom: 8px; }
  .keyboard-top { margin-bottom: 5px; }
  .mine-wall { --block: clamp(44px, 5vw, 64px); }
  .miner-wrap { width: clamp(84px, 9vw, 120px); }
}

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

/* =========================================================
   SAFE OPENING SEQUENCE · 开箱演出
   ========================================================= */
.safe-panel { --safe-accent: #ffbf3f; --safe-soft: rgba(255, 191, 63, .2); }
.safe-flash {
  position: absolute;
  inset: 0;
  z-index: 9;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .95), var(--safe-soft) 24%, transparent 62%);
  mix-blend-mode: screen;
}
.safe-flash.is-active { animation: safe-flash .65s ease-out; }
@keyframes safe-flash {
  0% { opacity: 0; }
  12% { opacity: .85; }
  100% { opacity: 0; }
}
.safe-sparks {
  position: absolute;
  inset: 0;
  z-index: 8;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.safe-spark {
  position: absolute;
  width: var(--size, 6px);
  height: var(--size, 6px);
  border-radius: 2px;
  background: var(--spark-color, #ffd166);
  box-shadow: 0 0 10px var(--spark-color, #ffd166);
  opacity: 0;
  animation: safe-spark-fly var(--dur, .9s) cubic-bezier(.15, .8, .3, 1) forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes safe-spark-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(var(--x, 0), var(--y, -120px)) scale(.15) rotate(240deg); }
}
.safe-rays {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 390px;
  height: 390px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: repeating-conic-gradient(
    from 0deg,
    var(--safe-soft) 0deg 4deg,
    transparent 4deg 17deg
  );
  mask-image: radial-gradient(circle, transparent 0 16%, #000 42%, transparent 72%);
  transition: opacity .32s ease;
}
.safe-overlay.is-bursting .safe-rays,
.safe-overlay.is-open .safe-rays {
  opacity: .75;
  animation: safe-rays-spin 9s linear infinite;
}
@keyframes safe-rays-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.safe-shockwave {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 110px;
  height: 110px;
  z-index: 1;
  border-radius: 50%;
  border: 3px solid var(--safe-accent);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}
.safe-overlay.is-bursting .safe-shockwave { animation: safe-shockwave .8s ease-out; }
@keyframes safe-shockwave {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.3); filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.6); filter: blur(2px); }
}
.safe-panel.is-shaking { animation: safe-panel-shake .38s ease; }
@keyframes safe-panel-shake {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-5px, 2px); }
  35% { transform: translate(5px, -3px); }
  52% { transform: translate(-4px, 2px); }
  70% { transform: translate(3px, -1px); }
  86% { transform: translate(-2px, 1px); }
}
.safe-overlay.is-unlocking .safe-body {
  animation: safe-rattle .16s linear infinite;
}
@keyframes safe-rattle {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-2px, 1px) rotate(-.35deg); }
  50% { transform: translate(2px, -1px) rotate(.35deg); }
  75% { transform: translate(-1px, 1px) rotate(-.2deg); }
}
.safe-overlay.is-unlocking .safe-dial {
  animation: safe-dial-spin .85s ease-in-out infinite;
}
@keyframes safe-dial-spin {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  30% { transform: translate(-50%, -50%) rotate(42deg); }
  58% { transform: translate(-50%, -50%) rotate(-18deg); }
  80% { transform: translate(-50%, -50%) rotate(12deg); }
}
.safe-lock-light {
  position: absolute;
  right: 17px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d5e;
  box-shadow: 0 0 12px rgba(255, 77, 94, .9);
  z-index: 4;
}
.safe-overlay.is-unlocking .safe-lock-light { animation: safe-lock-blink .3s steps(2) infinite; }
.safe-overlay.is-open .safe-lock-light {
  background: #7effa0;
  box-shadow: 0 0 14px rgba(126, 255, 160, .9);
  animation: none;
}
@keyframes safe-lock-blink {
  0% { background: #ff4d5e; box-shadow: 0 0 12px rgba(255, 77, 94, .9); }
  100% { background: #ffd166; box-shadow: 0 0 14px rgba(255, 209, 102, .9); }
}
.safe-charge {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 192px;
  margin-top: 7px;
}
.safe-overlay.is-unlocking .safe-charge { display: flex; }
.safe-charge span {
  font: 700 8px var(--font-pixel);
  letter-spacing: .18em;
  color: #cbbd96;
  animation: charge-text-pulse .6s ease-in-out infinite alternate;
}
@keyframes charge-text-pulse { to { opacity: .5; } }
.safe-charge i {
  position: relative;
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}
.safe-charge i::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #ff8a3c, #ffd166 48%, var(--safe-accent));
  box-shadow: 0 0 14px var(--safe-accent);
  animation: safe-charge-fill 1.2s linear forwards;
}
@keyframes safe-charge-fill { to { transform: scaleX(1); } }
.safe-reveal-callout {
  display: none;
  text-align: center;
  margin: 0 0 6px;
}
.safe-reveal-callout.is-visible { display: block; animation: callout-pop .5s cubic-bezier(.2, 1.5, .4, 1); }
.safe-reveal-callout span {
  display: block;
  font: 800 9px var(--font-pixel);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--safe-accent);
  text-shadow: 0 0 14px var(--safe-accent);
}
.safe-reveal-callout b {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  line-height: 1.2;
  color: #fff4d8;
  text-shadow: 0 0 22px var(--safe-accent), 0 2px 0 rgba(0, 0, 0, .3);
}
@keyframes callout-pop {
  0% { opacity: 0; transform: scale(.6) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.safe-overlay.is-open .safe-door {
  transition-duration: .55s;
  transition-timing-function: cubic-bezier(.15, 1.5, .35, 1);
}
.safe-overlay.is-open .safe-body {
  box-shadow:
    inset 0 0 0 5px #181d1f,
    inset 0 0 0 7px #3d4447,
    0 18px 34px rgba(0, 0, 0, .5),
    0 0 38px var(--safe-soft);
}
.safe-overlay.is-open .safe-inner-glow {
  background: radial-gradient(circle at 50% 55%, rgba(255, 248, 205, .95), var(--safe-soft) 38%, transparent 72%);
}
.safe-loot { perspective: 800px; }
.loot-card {
  transform: translateY(22px) scale(.78) rotateY(62deg);
  transform-origin: center bottom;
}
.safe-overlay.is-open .loot-card {
  animation: loot-reveal .6s cubic-bezier(.16, 1.4, .3, 1) forwards;
}
@keyframes loot-reveal {
  0% { opacity: 0; transform: translateY(22px) scale(.78) rotateY(62deg); filter: brightness(2); }
  60% { opacity: 1; filter: brightness(1.3); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotateY(0); filter: brightness(1); }
}
.loot-card::after {
  content: "";
  position: absolute;
  inset: -30% -60%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .42) 50%, transparent 64%);
  transform: translateX(-120%);
  opacity: 0;
}
.safe-overlay.is-open .loot-card::after {
  animation: loot-shine .75s ease-out forwards;
  animation-delay: calc(var(--delay, 0ms) + 380ms);
}
@keyframes loot-shine {
  0% { opacity: 0; transform: translateX(-120%); }
  40% { opacity: .8; }
  100% { opacity: 0; transform: translateX(120%); }
}
.loot-card.is-best {
  border-width: 2px;
  box-shadow: 0 0 0 1px var(--q-color), 0 0 28px var(--q-soft), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.loot-best {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 5;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--q-color);
  color: #100c08;
  font: 800 7px var(--font-pixel);
  letter-spacing: .04em;
  box-shadow: 0 0 10px var(--q-soft);
}
@media (max-width: 620px) {
  .safe-rays { width: 310px; height: 310px; }
  .safe-shockwave { width: 90px; height: 90px; }
  .safe-charge { width: 168px; }
  .loot-best { font-size: 6px; }
}

/* extra anticipation: placeholder slots, full-screen flash, bigger callout */
.safe-loading {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 8px;
}
.safe-overlay.is-unlocking .safe-loading { display: grid; }
.safe-loading-card {
  min-height: 98px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px dashed rgba(255, 191, 63, .28);
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 191, 63, .07) 48%, transparent 66%),
    rgba(255, 255, 255, .018);
  color: rgba(255, 209, 102, .42);
  font: 800 23px var(--font-pixel);
  animation: safe-loading-breathe 1.1s ease-in-out infinite alternate;
}
.safe-loading-card:nth-child(2) { animation-delay: .14s; }
.safe-loading-card:nth-child(3) { animation-delay: .28s; }
.safe-loading-card:nth-child(4) { animation-delay: .42s; }
.safe-loading-card:nth-child(5) { animation-delay: .56s; }
@keyframes safe-loading-breathe {
  from { opacity: .35; transform: translateY(2px); }
  to { opacity: .95; transform: translateY(-2px); box-shadow: 0 0 18px rgba(255, 191, 63, .08); }
}
.safe-overlay.is-bursting::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .9), var(--safe-soft) 16%, transparent 54%);
  mix-blend-mode: screen;
  animation: safe-full-flash .6s ease-out;
}
@keyframes safe-full-flash {
  0% { opacity: 0; }
  10% { opacity: .95; }
  45% { opacity: .34; }
  100% { opacity: 0; }
}
.safe-overlay.is-open .safe-body {
  animation: safe-body-pop .52s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes safe-body-pop {
  0% { transform: scale(1); }
  28% { transform: scale(1.07); }
  58% { transform: scale(.985); }
  100% { transform: scale(1); }
}
.safe-reveal-callout span { font-size: 10px; }
.safe-reveal-callout span::before { content: "✦ "; }
.safe-reveal-callout b { font-size: 22px; }
@media (max-width: 620px) {
  .safe-loading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safe-loading-card { min-height: 84px; }
  .safe-reveal-callout b { font-size: 19px; }
}

/* keep the lock light clear of the 机密 sticker */
.safe-lock-light { left: 17px; right: auto; top: auto; bottom: 17px; }

/* Chinese meaning directly under the delta word cards */
.target-display.is-word.has-meaning { flex-direction: column; gap: 6px; }
.target-word-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.target-word-meaning {
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 800;
  line-height: 1.15;
  color: #ffdf9c;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(255, 176, 46, .2);
}

/* hero title: slow floating drift */
.hero h1 {
  transform-origin: 50% 78%;
  will-change: transform;
  animation: title-float 8.6s ease-in-out infinite;
}
@keyframes title-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25% { transform: translate3d(1.5px, -4px, 0) rotate(.16deg); }
  50% { transform: translate3d(0, -9px, 0) rotate(-.2deg); }
  75% { transform: translate3d(-1.5px, -4px, 0) rotate(.12deg); }
}
