/* ============ 基础 ============ */
:root {
  --bg: #040713;
  --ink: #f4f7ff;
  --soft: #c4d0ed;
  --muted: #8492b8;
  --dim: #5d698c;
  --line: rgba(150, 174, 255, .14);
  --line-strong: rgba(171, 196, 255, .26);
  --panel: linear-gradient(155deg, rgba(22, 31, 62, .88), rgba(8, 13, 31, .94));
  --gold: #ffd166;
  --amber: #ffab54;
  --cyan: #6ce8ff;
  --blue: #5f8cff;
  --violet: #b18cff;
  --pink: #ff91d0;
  --green: #6df0b0;
  --coral: #ff8378;
  --danger: #ff899a;
  --radius: 24px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.2, .9, .22, 1.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgba(108, 232, 255, .9);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ============ 背景 ============ */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% -20%, #1b2958 0, #080d22 42%, #03050c 100%);
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .32;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora-a {
  top: -28%;
  left: -10%;
  width: 70vw;
  height: 58vw;
  min-width: 460px;
  min-height: 400px;
  background: radial-gradient(circle, rgba(80, 81, 255, .66), transparent 67%);
  animation: auroraDrift 24s ease-in-out infinite alternate;
}

.aurora-b {
  top: 16%;
  right: -24%;
  width: 64vw;
  height: 55vw;
  min-width: 420px;
  min-height: 380px;
  background: radial-gradient(circle, rgba(255, 117, 152, .28), transparent 67%);
  animation: auroraDrift 29s ease-in-out -8s infinite alternate-reverse;
}

.aurora-c {
  left: 20%;
  bottom: -34%;
  width: 60vw;
  height: 48vw;
  min-width: 360px;
  min-height: 320px;
  background: radial-gradient(circle, rgba(255, 172, 61, .18), transparent 66%);
  animation: auroraDrift 26s ease-in-out -13s infinite alternate;
}

.star-field {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: var(--size, 1.5px);
  height: var(--size, 1.5px);
  border-radius: 50%;
  background: #fff;
  opacity: var(--alpha, .5);
  box-shadow: 0 0 6px rgba(186, 216, 255, .42);
  animation: twinkle var(--dur, 5s) ease-in-out var(--delay, 0s) infinite;
}

.ambient-ring {
  position: absolute;
  border: 1px solid rgba(150, 178, 255, .055);
  border-radius: 50%;
  transform: rotate(-24deg) scaleY(.34);
}

.ambient-ring-a {
  top: 8%;
  left: -18%;
  width: 78vw;
  height: 78vw;
}

.ambient-ring-b {
  right: -26%;
  bottom: -22%;
  width: 65vw;
  height: 65vw;
  transform: rotate(32deg) scaleY(.4);
}

/* ============ 页面骨架 ============ */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100% - 28px, 1100px);
  min-height: 100svh;
  margin: 0 auto;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 2px;
}

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

.brand-mark {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 60% 42%, rgba(255, 206, 105, .22), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(102, 85, 218, .3), transparent 70%);
  box-shadow: 0 0 24px rgba(126, 124, 255, .15), inset 0 0 12px rgba(164, 142, 255, .13);
}

.brand-orbit {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(167, 187, 255, .27);
  border-radius: 50%;
  transform: rotate(-32deg) scaleY(.56);
}

.orbit-two {
  inset: 1px;
  border-color: rgba(255, 200, 105, .22);
  transform: rotate(36deg) scaleY(.7);
}

.brand-orbit::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.orbit-two::after {
  top: auto;
  right: 7px;
  bottom: 0;
  left: auto;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.brand-sling {
  position: absolute;
  left: 16px;
  top: 12px;
  width: 14px;
  height: 20px;
  border-left: 2px solid #e8c987;
  border-bottom: 2px solid #e8c987;
  border-radius: 2px 0 6px 0;
  transform: rotate(-14deg);
  opacity: .85;
}

.brand-ammo {
  position: absolute;
  top: 10px;
  left: 20px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff4bc, #ffb34b 55%, #cb6c24);
  box-shadow: 0 0 10px rgba(255, 189, 90, .8);
}

.brand-copy h1 {
  margin: 0;
  color: #f5f8ff;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: .06em;
  line-height: 1.2;
}

.brand-copy p {
  margin: 2px 0 0;
  color: var(--dim);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .27em;
  line-height: 1;
}

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

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(126, 218, 255, .25);
  border-radius: 12px;
  color: #b8ecff;
  background: linear-gradient(160deg, rgba(31, 65, 104, .62), rgba(18, 27, 56, .55));
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s var(--ease-spring);
}

.mode-btn:hover {
  color: #fff;
  border-color: rgba(145, 236, 255, .55);
  background: rgba(39, 74, 118, .72);
  transform: translateY(-1px);
}

.mode-btn:active {
  transform: scale(.95);
}

.mode-btn b {
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .06em;
  line-height: 1;
}

.mode-btn small {
  margin-top: 2px;
  color: #7d96b7;
  font-size: 6px;
  letter-spacing: .12em;
  line-height: 1;
}

body.mode-3d .mode-btn {
  color: #d9c9ff;
  border-color: rgba(190, 157, 255, .38);
  background: linear-gradient(160deg, rgba(69, 49, 110, .68), rgba(23, 25, 58, .62));
}

body.mode-3d .arena-meta-left .meta-dot {
  background: #c29bff;
  box-shadow: 0 0 10px rgba(184, 137, 255, .8);
}

.vault-btn {
  position: relative;
}

.vault-count {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border: 1px solid rgba(8, 13, 28, .9);
  border-radius: 999px;
  color: #241a09;
  background: linear-gradient(180deg, #ffe7a2, #ffc35d);
  box-shadow: 0 0 9px rgba(255, 190, 82, .32);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 7.5px;
  font-weight: 750;
  line-height: 1;
}

.vault-count.is-empty {
  color: #8b96af;
  background: rgba(25, 34, 60, .92);
  border-color: rgba(1, 5, 15, .95);
  box-shadow: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--soft);
  background: rgba(18, 27, 56, .55);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s var(--ease-spring);
  backdrop-filter: blur(12px);
}

.icon-btn:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(39, 51, 92, .7);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: scale(.95);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.icon-btn.muted {
  color: var(--dim);
}

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

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

.game {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============ HUD ============ */
.hud {
  display: grid;
  grid-template-columns: .68fr 1.55fr .72fr .85fr;
  min-height: 70px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow:
    0 16px 38px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .055);
  backdrop-filter: blur(18px);
}

.hud-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 10px 17px;
  border-right: 1px solid rgba(147, 170, 255, .08);
}

.hud-cell:last-child {
  border-right: 0;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.2;
}

.level-cell {
  align-items: flex-start;
}

.level-cell strong {
  margin-top: 2px;
  color: var(--gold);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 18px rgba(255, 192, 89, .2);
}

.score-cell {
  min-width: 0;
}

.score-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  margin-top: 2px;
}

.score-line > strong {
  overflow: hidden;
  color: #f9fbff;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform-origin: left center;
}

.score-line > strong.pop {
  animation: scorePop .36s var(--ease-spring);
}

.best {
  flex: 0 0 auto;
  color: var(--dim);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .08em;
  white-space: nowrap;
}

.best b {
  color: #aebce0;
  font-weight: 600;
}

.cores-cell,
.shots-cell {
  align-items: flex-start;
}

.stat-line {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 3px;
}

.stat-line strong {
  color: #dce7ff;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 23px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-line small {
  color: var(--muted);
  font-size: 9px;
}

.cores-cell .stat-line strong {
  color: #9beeff;
}

.shots-cell .stat-line strong {
  color: var(--gold);
}

.shots-cell.low .stat-line strong {
  color: var(--danger);
  text-shadow: 0 0 14px rgba(255, 104, 127, .35);
  animation: lowShots 1.1s ease-in-out infinite;
}

/* ============ 竞技场 ============ */
.arena-shell {
  position: relative;
  padding: 7px;
  border-radius: 31px;
  background:
    radial-gradient(120% 120% at 15% 0%, rgba(184, 204, 255, .25), transparent 36%),
    linear-gradient(155deg, rgba(131, 154, 255, .3), rgba(42, 53, 105, .25) 42%, rgba(255, 146, 85, .16) 100%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .52),
    0 0 0 1px rgba(255, 255, 255, .04),
    0 0 60px rgba(97, 104, 235, .12),
    inset 0 1px 0 rgba(255, 255, 255, .2);
}

.arena-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, .28), transparent 24%, transparent 65%, rgba(255, 187, 106, .2)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.arena {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(64svh, 640px);
  overflow: hidden;
  border-radius: 25px;
  background:
    radial-gradient(100% 90% at 74% 114%, rgba(255, 142, 77, .2), transparent 48%),
    radial-gradient(90% 80% at 11% 8%, rgba(69, 111, 255, .16), transparent 48%),
    radial-gradient(70% 90% at 50% 50%, rgba(44, 27, 89, .18), transparent 70%),
    linear-gradient(158deg, #0b1230 0%, #050a18 52%, #080e24 100%);
  box-shadow:
    inset 0 0 80px rgba(23, 38, 98, .3),
    inset 0 1px 0 rgba(255, 255, 255, .045);
  container-type: inline-size;
  isolation: isolate;
}

.arena::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 14%, rgba(104, 227, 255, .065), transparent 23%),
    linear-gradient(125deg, rgba(255, 255, 255, .035), transparent 24%);
}

.arena::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 76px 18px rgba(2, 4, 12, .3);
}

#scene3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body.mode-3d #scene3d {
  display: block;
}

body.mode-3d #gameCanvas {
  background: transparent;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.arena.is-aiming #gameCanvas {
  cursor: grabbing;
}

.assist-btn {
  position: relative;
  color: rgba(255, 197, 120, .82);
}

.assist-btn.is-active {
  color: #fff3d1;
  border-color: rgba(255, 188, 98, .66);
  background: linear-gradient(180deg, rgba(117, 67, 35, .92), rgba(52, 29, 21, .94));
  box-shadow: 0 0 14px rgba(255, 155, 79, .22), inset 0 0 0 1px rgba(255, 215, 151, .24);
}

.assist-btn.is-active::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ff9a63;
  box-shadow: 0 0 6px #ff8b54;
}

.assist-btn[disabled] {
  opacity: .32;
  filter: grayscale(1);
}

.arena-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 8, 20, .18), transparent 14%, transparent 84%, rgba(3, 6, 16, .34));
}

.arena-meta {
  position: absolute;
  top: 15px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(148, 168, 213, .55);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .14em;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.arena-meta b {
  color: rgba(187, 208, 255, .7);
  font-weight: 600;
}

.arena-meta-left {
  left: 18px;
}

.arena-meta-right {
  right: 18px;
  gap: 4px;
}

.relic-meta {
  color: rgba(148, 168, 213, .6);
}

.relic-meta b {
  color: #d4def5;
  font-variant-numeric: tabular-nums;
}

.relic-meta.is-empty {
  opacity: .42;
}

.relic-meta.has-progress b {
  color: #ffd77f;
  text-shadow: 0 0 12px rgba(255, 195, 85, .35);
}

.meta-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 7px rgba(109, 240, 176, .8);
}

/* ============ 连击 / Toast ============ */
.combo-banner {
  position: absolute;
  top: 29%;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: baseline;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.85);
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .5));
  white-space: nowrap;
}

.combo-banner.show {
  animation: comboBurst 1s var(--ease-spring) both;
}

.combo-banner span {
  color: #e1e9ff;
  font-size: clamp(11px, 2.2cqw, 17px);
  font-weight: 700;
  letter-spacing: .12em;
}

.combo-banner strong {
  color: var(--gold);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(32px, 6.5cqw, 50px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 192, 89, .38);
}

.game-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 12;
  max-width: calc(100% - 190px);
  overflow: hidden;
  padding: 8px 14px;
  border: 1px solid rgba(169, 192, 255, .18);
  border-radius: 999px;
  opacity: 0;
  color: #e4ebff;
  background: rgba(9, 14, 31, .86);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  font-size: clamp(8px, 1.6cqw, 10.5px);
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -7px);
  transition: opacity .24s ease, transform .24s var(--ease-out);
  backdrop-filter: blur(14px);
}

.game-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.game-toast.accent {
  border-color: rgba(255, 190, 105, .3);
  color: #ffe4b1;
}

/* ============ 遮罩 ============ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3.4cqw, 30px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .32s ease, visibility .32s ease;
  scrollbar-width: none;
}

.overlay::-webkit-scrollbar {
  display: none;
}

.overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.overlay.intro {
  background:
    radial-gradient(circle at 50% 8%, rgba(112, 89, 211, .28), transparent 55%),
    linear-gradient(180deg, rgba(4, 7, 18, .72), rgba(4, 7, 16, .9));
  backdrop-filter: blur(7px);
}

.intro-inner {
  width: 100%;
  max-width: 680px;
  margin: auto;
  text-align: center;
  animation: introRise .62s var(--ease-out) both;
}

.intro-emblem {
  position: relative;
  width: clamp(42px, 7cqw, 60px);
  height: clamp(42px, 7cqw, 60px);
  margin: 0 auto clamp(4px, 1.2cqw, 10px);
}

.intro-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(164, 187, 255, .32);
  border-radius: 50%;
  transform: rotate(-27deg) scaleY(.5);
}

.intro-ring-a {
  animation: slowSpin 16s linear infinite;
}

.intro-ring-b {
  inset: 5px;
  border-color: rgba(255, 196, 110, .26);
  transform: rotate(37deg) scaleY(.68);
  animation: slowSpinReverse 11s linear infinite;
}

.intro-ring::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px var(--cyan);
}

.intro-ring-b::after {
  top: auto;
  right: 7px;
  bottom: 0;
  left: auto;
  background: var(--gold);
  box-shadow: 0 0 9px var(--gold);
}

.intro-core {
  position: absolute;
  inset: 38%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff6ca, #ffbc52 52%, #ff8c68 100%);
  box-shadow:
    0 0 18px rgba(255, 190, 90, .65),
    0 0 40px rgba(160, 111, 255, .3);
}

.intro-kicker {
  margin: 0 0 5px;
  color: #8295c7;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(7px, 1.25cqw, 9px);
  font-weight: 600;
  letter-spacing: .27em;
}

.intro-title {
  margin: 0;
  color: #f8faff;
  font-size: clamp(31px, 6.8cqw, 54px);
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.06;
  text-shadow: 0 5px 30px rgba(0, 0, 0, .3);
}

.intro-title span {
  background: linear-gradient(100deg, #ffeaa0 4%, #ffc15c 48%, #ff8f6c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 178, 76, .18));
}

.intro-tagline {
  margin: clamp(5px, 1.2cqw, 9px) 0 0;
  color: #b8c5e8;
  font-size: clamp(10px, 1.85cqw, 13px);
  letter-spacing: .13em;
}

.intro-physics {
  margin: 4px 0 0;
  color: #9aa9ca;
  font-size: clamp(9px, 1.5cqw, 10.5px);
  letter-spacing: .06em;
}

.intro-rules {
  display: flex;
  width: min(100%, 610px);
  margin: clamp(13px, 2.6cqw, 21px) auto 0;
  border-top: 1px solid rgba(151, 173, 255, .1);
  border-bottom: 1px solid rgba(151, 173, 255, .1);
}

.intro-rule {
  flex: 1;
  min-width: 0;
  padding: clamp(7px, 1.4cqw, 11px) clamp(6px, 1.4cqw, 14px);
  border-right: 1px solid rgba(151, 173, 255, .075);
}

.intro-rule:last-child {
  border-right: 0;
}

.intro-rule b {
  display: block;
  color: var(--cyan);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(7px, 1.15cqw, 8px);
  font-weight: 600;
  letter-spacing: .13em;
  opacity: .8;
}

.intro-rule span {
  display: block;
  margin-top: 2px;
  color: #d7e0f7;
  font-size: clamp(10px, 1.7cqw, 12px);
  font-weight: 650;
}

.intro-rule small {
  display: block;
  margin-top: 2px;
  color: #7382a6;
  font-size: clamp(7px, 1.25cqw, 9px);
  line-height: 1.5;
}

.mode-picker {
  display: flex;
  width: min(100%, 280px);
  margin: clamp(12px, 2.4cqw, 18px) auto 0;
  padding: 3px;
  gap: 3px;
  border: 1px solid rgba(135, 164, 235, .14);
  border-radius: 14px;
  background: rgba(14, 21, 43, .58);
}

.mode-choice {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: clamp(30px, 4.2cqw, 36px);
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #7386aa;
  background: transparent;
  font-size: clamp(8px, 1.3cqw, 9.5px);
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.mode-choice b {
  color: inherit;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(10px, 1.7cqw, 12px);
  font-weight: 750;
  letter-spacing: .06em;
}

.mode-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-choice:hover {
  color: #c2d1f0;
}

.mode-choice.is-active {
  color: #fff1c9;
  border-color: rgba(255, 200, 107, .28);
  background: linear-gradient(180deg, rgba(83, 63, 38, .72), rgba(41, 34, 34, .52));
  box-shadow: inset 0 1px 0 rgba(255, 244, 205, .12);
}

.mode-choice[data-mode="3d"].is-active {
  color: #f0e2ff;
  border-color: rgba(190, 157, 255, .36);
  background: linear-gradient(180deg, rgba(63, 46, 94, .78), rgba(34, 30, 61, .56));
}

.start-btn {
  width: min(100%, 280px);
  height: clamp(44px, 6.8cqw, 52px);
  margin-top: clamp(9px, 1.7cqw, 13px);
  font-size: clamp(11px, 1.9cqw, 13px);
}

.intro-foot {
  margin: clamp(8px, 1.7cqw, 12px) 0 0;
  color: #6b7899;
  font-size: clamp(8px, 1.35cqw, 9.5px);
  letter-spacing: .03em;
}

.intro-foot b {
  color: #b5c2e3;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-weight: 600;
}

/* ============ 按钮 ============ */
.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  overflow: hidden;
  border-radius: 999px;
  color: #1b1022;
  background: linear-gradient(135deg, #ffe79d 0%, #ffc65c 48%, #ff9e57 100%);
  box-shadow:
    0 14px 30px rgba(255, 157, 67, .2),
    0 0 0 1px rgba(255, 246, 214, .35),
    inset 0 1px 0 rgba(255, 255, 255, .68);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform .2s var(--ease-spring), box-shadow .2s ease, filter .2s ease;
}

.primary-btn::after {
  content: "";
  position: absolute;
  top: -80%;
  left: -35%;
  width: 28%;
  height: 260%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: rotate(24deg);
  animation: buttonShine 5s ease-in-out infinite;
  pointer-events: none;
}

.primary-btn:hover {
  filter: brightness(1.045);
  box-shadow:
    0 18px 38px rgba(255, 157, 67, .28),
    0 0 0 1px rgba(255, 246, 214, .42),
    inset 0 1px 0 rgba(255, 255, 255, .72);
  transform: translateY(-2px);
}

.primary-btn:active {
  transform: scale(.98);
}

.start-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============ 结算 ============ */
.overlay.result {
  background:
    radial-gradient(circle at 50% 14%, rgba(101, 75, 185, .3), transparent 54%),
    rgba(4, 7, 17, .87);
  backdrop-filter: blur(9px);
}

.result-inner {
  width: 100%;
  max-width: 430px;
  margin: auto;
  text-align: center;
  animation: resultRise .45s var(--ease-out) both;
}

.result-kicker {
  margin: 0;
  color: var(--gold);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(7px, 1.2cqw, 9px);
  font-weight: 600;
  letter-spacing: .26em;
}

.result-inner h2 {
  margin: clamp(4px, 1cqw, 7px) 0 0;
  color: #f8faff;
  font-size: clamp(25px, 5cqw, 34px);
  font-weight: 850;
  letter-spacing: .03em;
  line-height: 1.15;
}

.result-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, .9cqw, 7px);
  margin: clamp(7px, 1.6cqw, 12px) 0 0;
}

.star-slot {
  display: grid;
  place-items: center;
  width: clamp(26px, 5.4cqw, 38px);
  height: clamp(26px, 5.4cqw, 38px);
}

.star-slot svg {
  width: 100%;
  height: 100%;
  fill: rgba(255, 255, 255, .045);
  stroke: rgba(168, 187, 231, .16);
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 0 transparent);
  transition: fill .2s ease, stroke .2s ease;
}

.star-slot:nth-child(2) svg {
  fill: rgba(255, 255, 255, .055);
}

.result-stars.is-zero .star-slot svg {
  fill: rgba(255, 255, 255, .025);
  stroke: rgba(161, 177, 214, .12);
}

.result-stars.is-revealed .star-slot.is-earned svg {
  fill: #ffd36a;
  stroke: #fff0b3;
  filter: drop-shadow(0 0 11px rgba(255, 190, 76, .55));
  animation: starPop .5s cubic-bezier(.2, 1.7, .45, 1) calc(var(--i, 0) * 110ms) both;
}

.result-stars.is-revealed .star-slot.is-earned:nth-child(2) svg {
  fill: #ffd978;
}

.result-stars.is-revealed .star-slot.is-earned:nth-child(3) svg {
  fill: #ffe5a2;
}

.result-stars-label {
  margin: 2px 0 0;
  color: #ffdc91;
  font-size: clamp(11px, 2.1cqw, 14px);
  font-weight: 750;
  letter-spacing: .12em;
  text-shadow: 0 0 16px rgba(255, 188, 80, .26);
}

.result-stars-label[data-stars="0"] {
  color: #a9b4ca;
  font-weight: 600;
  letter-spacing: .18em;
}

.result-star-hint {
  margin: 3px 0 0;
  color: #7e8dad;
  font-size: clamp(8px, 1.35cqw, 9.5px);
  letter-spacing: .02em;
}

.result-sub {
  max-width: 410px;
  margin: clamp(7px, 1.4cqw, 10px) auto 0;
  color: #96a5c8;
  font-size: clamp(9px, 1.55cqw, 11px);
  line-height: 1.65;
}

.result-total {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin: clamp(8px, 1.8cqw, 13px) auto 0;
}

.result-total > span {
  color: #7180a4;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(7px, 1.1cqw, 8px);
  letter-spacing: .15em;
}

.result-total > strong {
  color: #fff;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(34px, 7.2cqw, 48px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  line-height: 1.04;
  text-shadow: 0 0 26px rgba(143, 182, 255, .2);
}

.result-total em {
  position: absolute;
  top: 8px;
  left: calc(50% + clamp(47px, 9.5cqw, 68px));
  padding: 3px 6px;
  border: 1px solid rgba(255, 218, 137, .29);
  border-radius: 4px;
  color: #ffdb91;
  background: rgba(255, 184, 72, .08);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(6px, .9cqw, 7px);
  font-style: normal;
  font-weight: 700;
  letter-spacing: .1em;
  transform: rotate(-4deg);
  white-space: nowrap;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: clamp(8px, 1.8cqw, 13px) 0 clamp(10px, 2cqw, 15px);
  border-top: 1px solid rgba(147, 170, 255, .1);
  border-bottom: 1px solid rgba(147, 170, 255, .1);
}

.result-stats div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: clamp(6px, 1.2cqw, 9px) 4px;
  border-right: 1px solid rgba(147, 170, 255, .06);
}

.result-stats div:last-child {
  border-right: 0;
}

.result-stats span {
  color: #7785a8;
  font-size: clamp(7px, 1.15cqw, 9px);
}

.result-stats b {
  color: #e5edff;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: clamp(13px, 2.3cqw, 16px);
  font-weight: 650;
}

.result-breakdown {
  max-width: 410px;
  margin: -1px auto clamp(9px, 1.8cqw, 14px);
  padding: 7px 10px;
  border: 1px solid rgba(148, 173, 255, .08);
  border-radius: 9px;
  color: #8190b2;
  background: rgba(255, 255, 255, .018);
  font-size: clamp(7.5px, 1.3cqw, 9px);
  line-height: 1.6;
}

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.result-actions .primary-btn {
  width: min(100%, 250px);
  height: clamp(41px, 6.5cqw, 48px);
  font-size: clamp(10px, 1.65cqw, 12px);
}

.result-shop-btn {
  color: #d8b977;
  font-size: clamp(8px, 1.3cqw, 9.5px);
  letter-spacing: .02em;
}

.result-shop-btn b {
  color: #ffe09a;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-weight: 700;
}

.result-actions .result-shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 25px;
  margin-top: 1px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 207, 109, .16);
  border-radius: 999px;
  color: #d8b977;
  background: rgba(255, 190, 80, .038);
  font-size: clamp(8px, 1.3cqw, 9.5px);
}

.result-actions .result-shop-btn:hover {
  color: #ffe2a0;
  border-color: rgba(255, 214, 122, .35);
  background: rgba(255, 190, 80, .075);
}

.text-btn {
  padding: 4px 10px;
  color: #7e8db2;
  background: transparent;
  font-size: clamp(8px, 1.3cqw, 9.5px);
  cursor: pointer;
  transition: color .2s ease;
}

.text-btn:hover {
  color: #ffe0a4;
}

/* ============ 通关彩纸 ============ */
.confetti-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

/* ============ 特殊球右侧栏 ============ */
.special-rail {
  position: absolute;
  top: 46px;
  right: 7px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 50px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
}

.special-rail.is-visible {
  opacity: 1;
  visibility: visible;
}

.special-rail button {
  pointer-events: auto;
}

.rail-shop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 46px;
  height: 48px;
  padding: 3px;
  border: 1px solid rgba(255, 206, 111, .2);
  border-radius: 15px;
  color: #ffdf9c;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 219, 138, .13), transparent 55%),
    rgba(20, 23, 42, .72);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .04);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s var(--ease-spring);
  backdrop-filter: blur(12px);
}

.rail-shop:hover {
  border-color: rgba(255, 219, 138, .5);
  background-color: rgba(39, 35, 49, .82);
  transform: translateY(-1px);
}

.rail-shop .rail-star {
  font-size: 11px;
  line-height: 1;
  color: #ffd166;
  text-shadow: 0 0 9px rgba(255, 192, 75, .4);
}

.rail-shop b {
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.05;
}

.rail-shop small {
  color: #a49476;
  font-size: 6.5px;
  letter-spacing: .02em;
}

.special-rail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.special-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 46px;
  padding: 4px 3px 4px;
  border: 1px solid rgba(151, 171, 255, .1);
  border-radius: 15px;
  color: #dce6ff;
  background: rgba(14, 21, 41, .64);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .17), inset 0 1px 0 rgba(255, 255, 255, .035);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s var(--ease-spring), opacity .2s ease;
  backdrop-filter: blur(12px);
}

.special-slot:hover {
  border-color: rgba(177, 205, 255, .3);
  background: rgba(28, 40, 72, .8);
  transform: translateY(-1px);
}

.special-slot.is-selected {
  border-color: rgba(255, 220, 141, .63);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 211, 112, .16), transparent 65%),
    rgba(34, 31, 43, .9);
  box-shadow:
    0 0 0 1px rgba(255, 205, 108, .24),
    0 0 19px rgba(255, 180, 75, .17),
    inset 0 1px 0 rgba(255, 255, 255, .09);
}

.special-slot.is-empty {
  opacity: .45;
}

.special-slot.is-unavailable:not(.is-selected) {
  opacity: .62;
}

.special-orb {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 23%, rgba(255, 255, 255, .8) 0 5%, transparent 23%),
    radial-gradient(circle at 36% 28%, var(--og1) 0%, var(--og2) 55%, var(--og3) 100%);
  box-shadow:
    inset 0 1px 3px rgba(255, 255, 255, .3),
    inset 0 -4px 8px rgba(3, 7, 18, .22),
    inset 0 0 0 1px rgba(255, 255, 255, .16),
    0 0 13px var(--oglow);
}

.special-orb svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  color: rgba(255, 255, 255, .94);
  fill: currentColor;
  filter: drop-shadow(0 1px 2px rgba(18, 8, 28, .42));
}

.special-count {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 15px;
  padding: 0 3px;
  border: 1px solid rgba(7, 11, 24, .92);
  border-radius: 999px;
  color: #171b2a;
  background: #f1dfbb;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 8px;
  font-weight: 750;
  line-height: 1;
}

.special-slot small {
  color: #8f9bb9;
  font-size: 7px;
  letter-spacing: .04em;
}

.special-slot.is-selected small {
  color: #f4db9c;
}

.special-rail-note {
  margin: 0;
  color: #657495;
  font-size: 6px;
  line-height: 1.55;
  text-align: center;
  letter-spacing: .03em;
}

.special-slot.just-supplied {
  animation: specialSupply .85s var(--ease-out) both;
}

@keyframes specialSupply {
  0% { transform: scale(1); }
  32% {
    border-color: rgba(255, 215, 129, .58);
    box-shadow: 0 0 0 2px rgba(255, 200, 98, .12), 0 0 22px rgba(255, 180, 74, .2);
    transform: scale(1.055);
  }
  100% { transform: scale(1); }
}

.confetti {
  position: absolute;
  top: -8%;
  left: var(--x, 50%);
  width: var(--w, 6px);
  height: var(--h, 11px);
  border-radius: 1.5px;
  opacity: 0;
  background: var(--c, #ffd166);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c, #ffd166) 60%, transparent);
  animation: confettiFall var(--dur, 2.3s) cubic-bezier(.18, .7, .4, 1) var(--delay, 0s) forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -5%, 0) rotate(0deg);
  }
  8% {
    opacity: .95;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 20px), 660px, 0) rotate(var(--spin, 540deg));
  }
}

/* ============ 控制条 ============ */
.control-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.ammo-card {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-width: 142px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .045);
  backdrop-filter: blur(14px);
}

.ammo-orb {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, .92) 0 5%, rgba(255, 255, 255, .12) 11%, transparent 25%),
    radial-gradient(circle at 38% 30%, var(--og1) 0%, var(--og2) 57%, var(--og3) 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, .3),
    inset 0 -5px 9px rgba(2, 6, 18, .27),
    inset 0 0 0 1px rgba(255, 255, 255, .19),
    0 0 15px var(--oglow);
}

.ammo-orb::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 7px;
  width: 11px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  filter: blur(2px);
  transform: rotate(-24deg);
}

.ammo-orb svg {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  overflow: visible;
  color: rgba(255, 255, 255, .94);
  fill: currentColor;
  filter: drop-shadow(0 1px 2px rgba(20, 11, 38, .4));
}

.ammo-copy span {
  display: block;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: .04em;
}

.ammo-copy strong {
  display: block;
  margin-top: 1px;
  color: #dfe7fb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.ammo-copy {
  min-width: 0;
}

.ammo-trait {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: #91a0c3;
  font-size: 7.5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-tip {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #667494;
  font-size: 9.5px;
  letter-spacing: .02em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-tip span {
  color: #bea875;
}

.control-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #a0aed1;
  background: rgba(255, 255, 255, .027);
  font-size: 9.5px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s var(--ease-spring);
  backdrop-filter: blur(12px);
}

.ghost-btn:hover {
  color: #eaf0ff;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .055);
}

.ghost-btn:active {
  transform: scale(.97);
}

.ghost-btn:disabled {
  opacity: .34;
  pointer-events: none;
}

.ghost-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghost-btn.confirm {
  border-color: rgba(255, 129, 148, .34);
  color: #ffb4be;
  background: rgba(255, 104, 124, .07);
}

/* ============ 星核属性色 ============ */
.type-iron {
  --og1: #e1e9f4;
  --og2: #8794aa;
  --og3: #2e364a;
  --oglow: rgba(196, 211, 238, .38);
}

.type-silver {
  --og1: #f4ffff;
  --og2: #9ddff7;
  --og3: #3d6e9f;
  --oglow: rgba(126, 214, 255, .4);
}

.type-moss {
  --og1: #e2ffb5;
  --og2: #74de91;
  --og3: #237f52;
  --oglow: rgba(103, 225, 144, .42);
}

.type-feather {
  --og1: #ffe5fc;
  --og2: #f4a5de;
  --og3: #a64aa9;
  --oglow: rgba(245, 150, 225, .4);
}

.type-glass {
  --og1: #ccfeff;
  --og2: #5ed9f5;
  --og3: #1d73b5;
  --oglow: rgba(88, 216, 255, .4);
}

.type-clay {
  --og1: #ffd7a9;
  --og2: #e38f60;
  --og3: #8d4331;
  --oglow: rgba(233, 139, 95, .38);
}

.type-ruby {
  --og1: #ffd3d9;
  --og2: #e35f78;
  --og3: #8f2740;
  --oglow: rgba(245, 118, 143, .4);
}

.type-bomb {
  --og1: #ffd6a6;
  --og2: #ff7d4f;
  --og3: #b52f2b;
  --oglow: rgba(255, 105, 69, .5);
}

.type-bounce {
  --og1: #d8fdff;
  --og2: #69ecff;
  --og3: #2b7bc6;
  --oglow: rgba(95, 231, 255, .52);
}

.type-clone {
  --og1: #f0e8ff;
  --og2: #bfa0ff;
  --og3: #6846bd;
  --oglow: rgba(181, 145, 255, .5);
}

.type-grow {
  --og1: #e4ffd4;
  --og2: #9cf47f;
  --og3: #388c45;
  --oglow: rgba(139, 238, 112, .5);
}

.type-piercer {
  --og1: #e0f2ff;
  --og2: #78c3ff;
  --og3: #3958b9;
  --oglow: rgba(111, 184, 255, .52);
}

/* ============ 弹窗 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .24s ease, visibility .24s ease;
}

.modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, .77);
  backdrop-filter: blur(9px);
}

.modal-card {
  position: relative;
  width: min(100%, 510px);
  max-height: min(85svh, 700px);
  padding: 25px 24px 21px;
  overflow-y: auto;
  border: 1px solid rgba(160, 183, 255, .16);
  border-radius: 25px;
  background:
    radial-gradient(120% 80% at 0 0, rgba(84, 101, 190, .18), transparent 50%),
    linear-gradient(160deg, rgba(22, 30, 60, .99), rgba(7, 11, 27, .995));
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .56),
    inset 0 1px 0 rgba(255, 255, 255, .07);
  transform: translateY(14px) scale(.985);
  transition: transform .3s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: rgba(135, 153, 220, .35) transparent;
}

.modal.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(151, 171, 255, .1);
  border-radius: 50%;
  color: #8491b5;
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

.modal-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.modal-card h2 {
  margin: 5px 0 17px;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: .02em;
}

.help-list {
  display: grid;
  gap: 14px;
}

.help-item {
  display: flex;
  gap: 11px;
}

.help-item > b {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1px solid rgba(123, 219, 255, .17);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(103, 232, 255, .04);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 600;
}

.help-item strong {
  display: block;
  margin-bottom: 3px;
  color: #e4eaff;
  font-size: 12.5px;
  font-weight: 650;
}

.help-item p {
  margin: 0;
  color: #94a1c4;
  font-size: 11px;
  line-height: 1.75;
}

.core-guide {
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid rgba(151, 171, 255, .1);
}

.core-guide-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.core-guide-head strong {
  display: block;
  margin-top: 2px;
  color: #e3eaff;
  font-size: 11px;
  font-weight: 650;
}

.core-guide-head p {
  max-width: 220px;
  margin: 0;
  color: #7483a8;
  font-size: 8.5px;
  line-height: 1.55;
  text-align: right;
}

.core-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.core-card {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(151, 171, 255, .075);
  border-radius: 10px;
  background: rgba(255, 255, 255, .022);
}

.core-swatch {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 27px;
  height: 27px;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 31% 24%, rgba(255, 255, 255, .9) 0 5%, rgba(255, 255, 255, .12) 11%, transparent 25%),
    radial-gradient(circle at 38% 30%, var(--og1) 0%, var(--og2) 57%, var(--og3) 100%);
  box-shadow:
    inset 0 1px 3px rgba(255, 255, 255, .3),
    inset 0 -3px 6px rgba(2, 6, 18, .27),
    inset 0 0 0 1px rgba(255, 255, 255, .18),
    0 0 10px var(--oglow);
}

.core-swatch svg {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, .94);
  fill: currentColor;
  filter: drop-shadow(0 1px 1px rgba(20, 11, 38, .4));
}

.core-copy {
  min-width: 0;
}

.core-copy strong {
  display: block;
  overflow: hidden;
  color: #e4ebfc;
  font-size: 10.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-copy small {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: #8c9abc;
  font-size: 8.5px;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0;
  padding: 10px 12px;
  border: 1px solid rgba(151, 171, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .022);
  color: #7f8db0;
  font-size: 9px;
}

.help-note div {
  color: #b5c2e4;
  letter-spacing: .02em;
}

.help-note kbd {
  display: inline-block;
  min-width: 16px;
  margin: 0 2px;
  padding: 2px 4px;
  border: 1px solid rgba(151, 171, 255, .15);
  border-radius: 4px;
  color: #9babcf;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 8px;
  text-align: center;
}

.modal-ok {
  width: 100%;
  height: 44px;
  font-size: 12px;
}

/* ============ 宝物库 ============ */
.relic-sun {
  --og1: #fff1b5;
  --og2: #ffd05f;
  --og3: #d97a1d;
  --oglow: rgba(255, 197, 84, .42);
}

.relic-tide {
  --og1: #d9fbff;
  --og2: #77e5ff;
  --og3: #247fa8;
  --oglow: rgba(101, 224, 255, .4);
}

.relic-prism {
  --og1: #f1e2ff;
  --og2: #caa1ff;
  --og3: #7041b5;
  --oglow: rgba(188, 139, 255, .4);
}

.relic-bloom {
  --og1: #e3ffd2;
  --og2: #8ef2a9;
  --og3: #27865a;
  --oglow: rgba(111, 237, 154, .4);
}

.relic-nova {
  --og1: #ffe7fd;
  --og2: #ff9bdc;
  --og3: #9d3e99;
  --oglow: rgba(255, 145, 225, .42);
}

.relic-echo {
  --og1: #e8f5ff;
  --og2: #a9c8ff;
  --og3: #4e63b8;
  --oglow: rgba(154, 194, 255, .4);
}

.vault-card {
  width: min(100%, 540px);
}

.vault-sub {
  margin: -8px 0 15px;
  color: #8493b6;
  font-size: 10px;
  line-height: 1.65;
}

.vault-sub b {
  color: #e9f0ff;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-weight: 650;
}

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

.vault-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(151, 171, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .022);
  transition: border-color .25s ease, background .25s ease;
}

.vault-item.is-owned {
  border-color: rgba(255, 207, 116, .17);
  background:
    radial-gradient(120% 100% at 0 0, rgba(255, 199, 99, .06), transparent 55%),
    rgba(255, 255, 255, .026);
}

.vault-icon {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background:
    radial-gradient(circle at 30% 23%, rgba(255, 255, 255, .72) 0 5%, transparent 23%),
    radial-gradient(circle at 36% 28%, var(--og1) 0%, var(--og2) 55%, var(--og3) 100%);
  box-shadow:
    inset 0 1px 3px rgba(255, 255, 255, .3),
    inset 0 -5px 10px rgba(4, 7, 17, .2),
    inset 0 0 0 1px rgba(255, 255, 255, .15),
    0 0 18px var(--oglow);
}

.vault-icon svg {
  width: 25px;
  height: 25px;
  overflow: visible;
  color: rgba(255, 255, 255, .9);
  fill: currentColor;
  filter: drop-shadow(0 1px 2px rgba(16, 9, 30, .36));
}

.vault-icon i {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 15px;
  padding: 0 4px;
  border: 1px solid rgba(8, 13, 28, .9);
  border-radius: 999px;
  color: #2d200b;
  background: linear-gradient(180deg, #ffe7a2, #ffc45f);
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
}

.vault-copy {
  min-width: 0;
}

.vault-copy strong {
  display: block;
  color: #e7eeff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}

.vault-copy span {
  display: block;
  margin-top: 2px;
  color: #8d9abb;
  font-size: 8px;
}

.vault-copy p {
  margin: 5px 0 0;
  color: #7483a6;
  font-size: 8.5px;
  line-height: 1.55;
}

.vault-item.is-locked {
  opacity: .72;
}

.vault-item.is-locked .vault-icon {
  filter: grayscale(1) brightness(.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.vault-item.is-locked .vault-copy strong {
  color: #9ca8c4;
}

.vault-item.is-locked .vault-copy span {
  color: #687592;
}

.vault-note {
  margin: 14px 0 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(151, 171, 255, .08);
  color: #657392;
  font-size: 8.5px;
  line-height: 1.6;
}

/* ============ 特殊球兑换 ============ */
.shop-card {
  width: min(100%, 560px);
}

.shop-sub {
  margin: -8px 0 13px;
  color: #8493b6;
  font-size: 10px;
  line-height: 1.65;
}

.shop-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 209, 109, .13);
  border-radius: 11px;
  background: rgba(255, 199, 84, .035);
}

.shop-balance > span {
  color: #908b76;
  font-size: 9px;
  letter-spacing: .08em;
}

.shop-balance strong {
  color: #ffd875;
  font-family: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .05em;
  text-shadow: 0 0 13px rgba(255, 194, 84, .25);
}

.shop-balance strong b {
  font-weight: inherit;
}

.shop-list {
  display: grid;
  gap: 9px;
}

.shop-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid rgba(151, 171, 255, .085);
  border-radius: 14px;
  background: rgba(255, 255, 255, .022);
}

.shop-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 23%, rgba(255, 255, 255, .75) 0 5%, transparent 24%),
    radial-gradient(circle at 36% 28%, var(--og1) 0%, var(--og2) 55%, var(--og3) 100%);
  box-shadow:
    inset 0 1px 3px rgba(255, 255, 255, .3),
    inset 0 -5px 10px rgba(4, 7, 17, .2),
    inset 0 0 0 1px rgba(255, 255, 255, .15),
    0 0 16px var(--oglow);
}

.shop-icon svg {
  width: 31px;
  height: 31px;
  color: rgba(255, 255, 255, .94);
  fill: currentColor;
  filter: drop-shadow(0 1px 2px rgba(16, 9, 30, .36));
}

.shop-copy {
  min-width: 0;
}

.shop-copy strong {
  display: block;
  color: #e9efff;
  font-size: 12px;
  font-weight: 700;
}

.shop-copy span {
  display: inline-block;
  margin-top: 2px;
  color: #91a0bf;
  font-size: 8px;
}

.shop-copy p {
  margin: 4px 0 0;
  color: #7382a4;
  font-size: 8.5px;
  line-height: 1.5;
}

.shop-buy {
  min-width: 70px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 208, 109, .26);
  border-radius: 9px;
  color: #ffdf96;
  background: rgba(255, 190, 72, .07);
  font-size: 8px;
  font-weight: 650;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}

.shop-buy:hover:not(:disabled) {
  border-color: rgba(255, 216, 126, .5);
  background: rgba(255, 190, 72, .12);
}

.shop-buy:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.shop-note {
  margin: 13px 0 16px;
  padding-top: 11px;
  border-top: 1px solid rgba(151, 171, 255, .08);
  color: #657392;
  font-size: 8.5px;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

/* ============ 动画 ============ */
@keyframes auroraDrift {
  0% { transform: translate3d(-3%, -2%, 0) scale(1); }
  50% { transform: translate3d(4%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 5%, 0) scale(.98); }
}

@keyframes twinkle {
  0%, 100% { opacity: var(--alpha, .5); transform: scale(.85); }
  50% { opacity: calc(var(--alpha, .5) * .26); transform: scale(.6); }
}

@keyframes scorePop {
  0% { transform: scale(1); }
  42% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

@keyframes lowShots {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

@keyframes introRise {
  0% { opacity: 0; transform: translateY(15px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes resultRise {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes starPop {
  0% {
    opacity: .3;
    transform: scale(.45) rotate(-24deg);
  }
  62% {
    opacity: 1;
    transform: scale(1.18) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes slowSpin {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@keyframes slowSpinReverse {
  from { rotate: 360deg; }
  to { rotate: 0deg; }
}

@keyframes buttonShine {
  0%, 55% { left: -35%; }
  82%, 100% { left: 125%; }
}

@keyframes comboBurst {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translate(-50%, -50%) scale(.64);
  }
  16% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1.08);
  }
  30% { transform: translate(-50%, -50%) scale(1); }
  72% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(.99); }
}

/* ============ 响应式 ============ */
@media (max-width: 760px) {
  .app {
    width: calc(100% - 20px);
    gap: 9px;
    padding-top: max(9px, env(safe-area-inset-top));
    padding-bottom: max(11px, env(safe-area-inset-bottom));
  }

  .site-header {
    min-height: 35px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-sling {
    left: 14px;
    top: 11px;
    width: 13px;
    height: 18px;
  }

  .brand-ammo {
    top: 9px;
    left: 18px;
  }

  .brand-copy h1 {
    font-size: 16px;
  }

  .brand-copy p {
    font-size: 7px;
    letter-spacing: .22em;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .hud {
    grid-template-columns: .62fr 1.32fr .66fr .78fr;
    min-height: 61px;
    border-radius: 17px;
  }

  .hud-cell {
    padding: 8px 9px;
  }

  .eyebrow {
    font-size: 7px;
    letter-spacing: .1em;
  }

  .level-cell strong {
    font-size: 21px;
  }

  .score-line {
    gap: 5px;
    margin-top: 2px;
  }

  .score-line > strong {
    font-size: 24px;
  }

  .best {
    font-size: 6.5px;
    letter-spacing: .04em;
  }

  .stat-line strong {
    font-size: 19px;
  }

  .stat-line small {
    font-size: 7px;
  }

  .arena {
    aspect-ratio: 4 / 5;
    max-height: min(60svh, 560px);
    border-radius: 21px;
  }

  .arena-shell {
    padding: 5px;
    border-radius: 26px;
  }

  .arena-meta {
    display: none;
  }

  .game-toast {
    top: 10px;
    max-width: calc(100% - 26px);
    font-size: 9px;
  }

  .control-bar {
    gap: 7px;
    min-height: 43px;
  }

  .ammo-card {
    min-width: 118px;
    padding: 6px 9px 6px 6px;
    border-radius: 14px;
  }

  .ammo-orb {
    width: 30px;
    height: 30px;
  }

  .ammo-orb svg {
    width: 14px;
    height: 14px;
  }

  .ammo-copy span {
    font-size: 7px;
  }

  .ammo-copy strong {
    font-size: 10px;
  }

  .ammo-trait {
    font-size: 6.5px;
  }

  .control-tip {
    display: none;
  }

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

  .core-guide-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .core-guide-head p {
    max-width: none;
    font-size: 8px;
    text-align: left;
  }

  .core-card {
    padding: 5px 6px;
  }

  .control-actions {
    margin-left: auto;
  }

  .ghost-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 9px;
  }

  .modal-card {
    padding: 22px 18px 18px;
    border-radius: 22px;
  }

  .modal-card h2 {
    font-size: 21px;
  }

  .help-item p {
    font-size: 10px;
  }

  .help-note {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .intro-rule small {
    display: none;
  }

  .intro-rule {
    padding: 8px 5px;
  }
}

@container (max-width: 520px) {
  .intro-emblem {
    width: 39px;
    height: 39px;
    margin-bottom: 2px;
  }

  .intro-kicker {
    display: none;
  }

  .intro-title {
    font-size: 30px;
  }

  .intro-tagline {
    font-size: 10px;
    letter-spacing: .08em;
  }

  .intro-rules {
    margin-top: 11px;
  }

  .intro-rule {
    padding: 7px 4px;
  }

  .intro-rule b {
    font-size: 6.5px;
  }

  .intro-rule span {
    font-size: 9.5px;
  }

  .intro-rule small {
    display: none;
  }

  .start-btn {
    width: min(100%, 230px);
    height: 43px;
    margin-top: 11px;
    font-size: 11px;
  }

  .intro-foot {
    margin-top: 7px;
    font-size: 8px;
  }

  .overlay {
    padding: 12px;
  }

  .result-total em {
    display: none;
  }

  .result-stats {
    margin-top: 7px;
    margin-bottom: 9px;
  }

  .result-actions .primary-btn {
    height: 40px;
  }
}

@container (max-width: 350px) {
  .intro-rule small {
    display: none;
  }

  .intro-title {
    font-size: 27px;
  }

  .intro-rules {
    border-bottom: 0;
  }

  .result-sub {
    font-size: 8.5px;
    line-height: 1.5;
  }

  .game-toast {
    font-size: 8px;
  }
}

@media (max-height: 700px) {
  .app {
    gap: 8px;
    padding-top: 7px;
    padding-bottom: 8px;
  }

  .hud {
    min-height: 57px;
  }

  .site-header {
    min-height: 32px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-copy h1 {
    font-size: 15px;
  }

  .arena {
    max-height: min(58svh, 520px);
  }

  .control-bar {
    min-height: 41px;
  }

  .ammo-card {
    min-width: 128px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}

@media (max-width: 760px) and (max-height: 700px) and (orientation: landscape) {
  .arena {
    aspect-ratio: 16 / 9;
    max-height: none;
  }
}

/* 横屏手机：把页面变成一整块游戏面板，避免滚动和入场按钮被挤出视口 */
@media (orientation: landscape) and (max-height: 560px) {
  .app {
    width: min(100% - 16px, 1180px);
    height: 100svh;
    min-height: 0;
    gap: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
    overflow: hidden;
  }

  .site-header {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 2px;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .brand-orbit {
    inset: 3px;
  }

  .brand-sling {
    left: 10px;
    top: 8px;
    width: 11px;
    height: 15px;
  }

  .brand-ammo {
    top: 6px;
    left: 14px;
    width: 7px;
    height: 7px;
  }

  .brand-copy h1 {
    font-size: 14px;
  }

  .brand-copy p {
    display: none;
  }

  .icon-btn {
    width: 28px;
    height: 28px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .game {
    flex: 1;
    min-height: 0;
    gap: 5px;
  }

  .hud {
    flex: 0 0 auto;
    min-height: 44px;
    border-radius: 15px;
  }

  .hud-cell {
    padding: 4px 12px;
  }

  .eyebrow {
    font-size: 7px;
  }

  .level-cell strong {
    font-size: 18px;
  }

  .score-line {
    margin-top: 0;
  }

  .score-line > strong {
    font-size: 23px;
  }

  .best {
    font-size: 7px;
  }

  .stat-line {
    margin-top: 1px;
  }

  .stat-line strong {
    font-size: 18px;
  }

  .stat-line small {
    font-size: 7px;
  }

  .arena-shell {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 4px;
    border-radius: 21px;
  }

  .arena {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    max-height: none;
    border-radius: 17px;
  }

  .arena-meta {
    top: 8px;
    font-size: 6px;
  }

  .control-bar {
    flex: 0 0 auto;
    min-height: 30px;
    gap: 6px;
  }

  .ammo-card {
    min-width: 112px;
    padding: 3px 8px 3px 5px;
    border-radius: 12px;
  }

  .ammo-orb {
    width: 26px;
    height: 26px;
  }

  .ammo-orb svg {
    width: 13px;
    height: 13px;
  }

  .ammo-copy span {
    font-size: 6.5px;
  }

  .ammo-copy strong {
    font-size: 9px;
  }

  .control-tip {
    display: none;
  }

  .control-actions {
    margin-left: auto;
  }

  .ghost-btn {
    height: 27px;
    padding: 0 9px;
    font-size: 8px;
  }

  .ghost-btn svg {
    width: 11px;
    height: 11px;
  }

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

  .overlay {
    padding: 6px;
  }

  .intro-emblem,
  .intro-kicker,
  .intro-tagline,
  .intro-physics {
    display: none;
  }

  .intro-title {
    font-size: 24px;
    line-height: 1.08;
  }

  .intro-rules {
    width: min(100%, 380px);
    margin-top: 6px;
  }

  .intro-rule {
    padding: 4px 6px;
  }

  .intro-rule b,
  .intro-rule small {
    display: none;
  }

  .intro-rule span {
    margin: 0;
    font-size: 9px;
  }

  .start-btn {
    width: min(100%, 205px);
    height: 34px;
    margin-top: 7px;
    font-size: 10px;
  }

  .intro-foot {
    margin-top: 4px;
    font-size: 7px;
  }

  .result-inner {
    max-width: 370px;
  }

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

  .result-inner h2 {
    margin-top: 2px;
    font-size: 22px;
  }

  .result-sub {
    max-width: 320px;
    margin-top: 2px;
    font-size: 8px;
    line-height: 1.45;
  }

  .result-total {
    margin-top: 3px;
  }

  .result-total > span {
    font-size: 6.5px;
  }

  .result-total > strong {
    font-size: 29px;
  }

  .result-total em {
    display: none;
  }

  .result-stats {
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .result-stats div {
    gap: 1px;
    padding: 3px;
  }

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

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

  .result-actions {
    gap: 2px;
  }

  .result-actions .primary-btn {
    width: min(100%, 205px);
    height: 33px;
    font-size: 9.5px;
  }

  .text-btn {
    padding: 0;
    font-size: 8px;
  }

  .modal {
    padding: 8px;
  }

  .modal-card {
    max-height: 94svh;
    padding: 16px 18px 14px;
  }

  .modal-card h2 {
    margin-bottom: 10px;
    font-size: 19px;
  }

  .help-list {
    gap: 8px;
  }

  .help-item p {
    font-size: 9px;
    line-height: 1.55;
  }

  .help-rate {
    margin: 10px 0;
    padding: 7px 10px;
  }

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

  .core-guide-head {
    margin-bottom: 5px;
  }

  .core-guide-head p {
    display: none;
  }

  .core-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .core-card {
    padding: 4px 5px;
    gap: 5px;
    border-radius: 8px;
  }

  .core-swatch {
    width: 20px;
    height: 20px;
  }

  .core-swatch svg {
    width: 12px;
    height: 12px;
  }

  .core-copy strong {
    font-size: 8.5px;
  }

  .core-copy small {
    font-size: 6.5px;
  }

  .modal-ok {
    height: 36px;
  }
}

@media (max-width: 760px) {
  .result-stars {
    margin-top: 7px;
  }

  .result-stars-label {
    font-size: 11px;
  }

  .result-star-hint {
    font-size: 8px;
  }

  .result-breakdown {
    padding: 6px 8px;
    font-size: 8px;
  }

  .vault-card {
    padding: 21px 17px 17px;
  }

  .vault-sub {
    font-size: 9px;
  }

  .vault-grid {
    gap: 7px;
  }

  .vault-item {
    gap: 8px;
    padding: 9px;
    border-radius: 12px;
  }

  .vault-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .vault-icon svg {
    width: 21px;
    height: 21px;
  }

  .vault-copy strong {
    font-size: 11px;
  }

  .vault-copy span {
    font-size: 7.5px;
  }

  .vault-copy p {
    font-size: 8px;
  }

  .vault-note {
    margin: 11px 0 13px;
    padding-top: 10px;
    font-size: 8px;
  }
}

@media (max-height: 700px) {
  .result-stars {
    margin-top: 4px;
  }

  .star-slot {
    width: 24px;
    height: 24px;
  }

  .result-stars-label {
    font-size: 10px;
  }

  .result-star-hint {
    margin-top: 1px;
    font-size: 7.5px;
  }

  .result-sub {
    margin-top: 5px;
    line-height: 1.5;
  }

  .result-total {
    margin-top: 6px;
  }

  .result-breakdown {
    margin-bottom: 7px;
    padding: 4px 7px;
    font-size: 7.5px;
  }

  .result-stats {
    margin-top: 6px;
    margin-bottom: 7px;
  }

  .vault-card {
    padding-top: 18px;
    padding-bottom: 15px;
  }

  .vault-sub {
    margin-bottom: 10px;
  }

  .vault-grid {
    gap: 6px;
  }

  .vault-item {
    padding: 8px;
  }

  .vault-note {
    margin: 9px 0 10px;
    padding-top: 8px;
  }
}

@media (max-width: 760px) {
  .special-rail {
    top: 42px;
    right: 5px;
    gap: 7px;
    width: 46px;
  }

  .rail-shop {
    width: 42px;
    height: 44px;
    border-radius: 13px;
  }

  .special-rail-list {
    gap: 7px;
  }

  .special-slot {
    width: 42px;
    padding: 3px 2px;
    border-radius: 13px;
  }

  .special-orb {
    width: 29px;
    height: 29px;
  }

  .special-orb svg {
    width: 20px;
    height: 20px;
  }

  .special-count {
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    font-size: 7px;
  }

  .special-slot small {
    font-size: 6.5px;
  }

  .special-rail-note {
    font-size: 5.5px;
  }

  .shop-card {
    padding: 21px 17px 16px;
  }

  .shop-sub {
    font-size: 9px;
  }

  .shop-item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px 9px;
    padding: 9px;
  }

  .shop-icon {
    width: 42px;
    height: 42px;
  }

  .shop-icon svg {
    width: 27px;
    height: 27px;
  }

  .shop-copy strong {
    font-size: 11px;
  }

  .shop-copy p {
    font-size: 8px;
  }

  .shop-buy {
    grid-column: 2;
    justify-self: start;
    height: 27px;
    margin-top: 1px;
    font-size: 7.5px;
  }

  .shop-note {
    margin: 10px 0 12px;
    padding-top: 9px;
    font-size: 8px;
  }

  .result-shop-btn {
    font-size: 8px;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .overlay.result {
    padding: 4px 6px;
  }

  .special-rail {
    top: 22px;
    right: 4px;
    gap: 3px;
    width: 36px;
  }

  .rail-shop {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .rail-shop .rail-star {
    font-size: 8px;
  }

  .rail-shop b {
    font-size: 10px;
  }

  .rail-shop small {
    display: none;
  }

  .special-rail-list {
    gap: 3px;
  }

  .special-slot {
    width: 32px;
    padding: 2px;
    border-radius: 9px;
  }

  .special-orb {
    width: 24px;
    height: 24px;
  }

  .special-orb svg {
    width: 16px;
    height: 16px;
  }

  .special-count {
    top: 0;
    right: 0;
    min-width: 12px;
    height: 12px;
    font-size: 6px;
  }

  .special-slot small {
    display: none;
  }

  .special-rail-note {
    display: none;
  }

  .result-actions .result-shop-btn {
    min-height: 21px;
    padding: 2px 9px;
    font-size: 7px;
  }

  .shop-card {
    padding: 17px 18px 14px;
  }

  .shop-sub {
    margin-bottom: 8px;
    font-size: 8px;
  }

  .shop-balance {
    margin-bottom: 8px;
    padding: 6px 9px;
  }

  .shop-list {
    gap: 6px;
  }

  .shop-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 7px;
  }

  .shop-icon {
    width: 38px;
    height: 38px;
  }

  .shop-icon svg {
    width: 24px;
    height: 24px;
  }

  .shop-copy strong {
    font-size: 10px;
  }

  .shop-copy p {
    margin-top: 2px;
    font-size: 7.5px;
  }

  .shop-buy {
    grid-column: auto;
    height: 25px;
    font-size: 7px;
  }

  .shop-note {
    margin: 8px 0 9px;
    padding-top: 7px;
    font-size: 7px;
  }

  .overlay.result.is-win .result-sub,
  .overlay.result.is-win .result-star-hint {
    display: none;
  }

  .result-stars {
    margin-top: 2px;
    gap: 2px;
  }

  .star-slot {
    width: 22px;
    height: 22px;
  }

  .result-stars-label {
    margin-top: 0;
    font-size: 9px;
  }

  .result-total {
    margin-top: 2px;
  }

  .result-total > strong {
    font-size: 27px;
  }

  .result-stats {
    margin-top: 3px;
    margin-bottom: 5px;
  }

  .result-breakdown {
    margin-bottom: 5px;
    padding: 3px 6px;
    font-size: 7px;
  }

  .result-actions .primary-btn {
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora,
  .star,
  .intro-ring,
  .primary-btn::after,
  .confetti,
  .shots-cell.low .stat-line strong,
  .result-stars.is-revealed .star-slot.is-earned svg {
    animation: none !important;
  }

  .overlay,
  .modal,
  .modal-card,
  .game-toast {
    transition-duration: .01ms !important;
  }

  .combo-banner.show {
    animation-duration: .01ms !important;
  }
}
