:root {
  --night: #07100d;
  --night-soft: #0b1713;
  --panel: rgba(8, 17, 14, 0.88);
  --panel-solid: #0a1411;
  --ice: #8fe7ff;
  --ice-hot: #d8fbff;
  --ice-deep: #2f8fbd;
  --ember: #ffc86a;
  --ember-hot: #ffe3a3;
  --blood: #e25d59;
  --moss: #9ad379;
  --ink: #eef4ec;
  --muted: #8a9c94;
  --dim: #5e7069;
  --line: rgba(221, 242, 233, 0.16);
  --line-strong: rgba(221, 242, 233, 0.28);
  --font-sans: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "Baskerville", "Songti SC", serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", monospace;
  --topbar-height: 76px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--night);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overscroll-behavior: none;
}

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

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  text-decoration: none;
}

img,
canvas,
svg {
  display: block;
}

img {
  max-width: 100%;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #06100c;
  background: var(--ice);
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 4px;
}

::selection {
  color: #07100d;
  background: var(--ice);
}

.game-app {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 78% 18%, rgba(143, 231, 255, 0.12), transparent 26%),
    linear-gradient(145deg, #0a1713, #050b09 62%, #0b1511);
}

#game-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}

.game-noise,
.game-scanlines,
.game-vignette,
.damage-flash {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.game-noise {
  opacity: 0.2;
  background-image:
    radial-gradient(rgba(235, 252, 246, 0.12) 0.65px, transparent 0.7px),
    radial-gradient(rgba(0, 0, 0, 0.25) 0.65px, transparent 0.7px);
  background-position:
    0 0,
    4px 5px;
  background-size:
    7px 7px,
    9px 9px;
  mix-blend-mode: soft-light;
}

.game-scanlines {
  opacity: 0.24;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(3, 8, 6, 0.18) 4px
  );
}

.game-vignette {
  background:
    linear-gradient(to bottom, rgba(4, 9, 7, 0.68), transparent 17%),
    radial-gradient(ellipse at center, transparent 45%, rgba(2, 7, 5, 0.72) 100%);
}

.damage-flash {
  z-index: 8;
  opacity: 0;
  background:
    radial-gradient(circle at center, transparent 24%, rgba(177, 25, 21, 0.58) 100%),
    rgba(125, 10, 8, 0.08);
  transition: opacity 0.22s ease-out;
}

.damage-flash.is-active {
  opacity: 1;
  transition-duration: 0.04s;
}

.game-topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(var(--topbar-height) + var(--safe-top));
  padding: calc(16px + var(--safe-top)) calc(28px + var(--safe-right)) 12px
    calc(28px + var(--safe-left));
  border-bottom: 1px solid rgba(221, 242, 233, 0.09);
  background: linear-gradient(
    to bottom,
    rgba(4, 10, 8, 0.84),
    rgba(4, 10, 8, 0.22) 72%,
    transparent
  );
  pointer-events: none;
}

.game-brand,
.game-tools {
  pointer-events: auto;
}

.game-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  width: fit-content;
}

.game-brand__sigil {
  position: relative;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(143, 231, 255, 0.52);
  transform: rotate(45deg);
}

.game-brand__sigil::before {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(143, 231, 255, 0.76);
  content: "";
}

.game-brand__sigil i {
  position: absolute;
  width: 1px;
  height: 19px;
  background: rgba(143, 231, 255, 0.52);
}

.game-brand__sigil i:last-child {
  transform: rotate(90deg);
}

.game-brand__copy {
  display: grid;
  gap: 1px;
}

.game-brand__copy strong {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.game-brand__copy small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.47rem;
  letter-spacing: 0.12em;
}

.game-topbar__build {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(220, 237, 228, 0.42);
  font-family: var(--font-mono);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
}

.game-topbar__build i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 10px var(--ice);
}

.game-tools {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.icon-button {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid rgba(221, 242, 233, 0.16);
  background: rgba(7, 15, 12, 0.55);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.icon-button:hover {
  color: var(--ice-hot);
  border-color: rgba(143, 231, 255, 0.46);
  background: rgba(19, 39, 32, 0.72);
}

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

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

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

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

.is-paused [data-action="pause"] {
  color: var(--ice);
  border-color: rgba(143, 231, 255, 0.44);
}

.is-paused [data-action="pause"] svg {
  transform: rotate(0);
}

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

.screen--menu {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, 0.58fr);
  align-items: end;
  gap: clamp(40px, 7vw, 120px);
  padding: calc(var(--topbar-height) + 80px + var(--safe-top))
    clamp(32px, 6vw, 92px) calc(46px + var(--safe-bottom));
  background:
    linear-gradient(90deg, rgba(5, 12, 9, 0.12) 0%, rgba(5, 12, 9, 0.02) 54%, rgba(5, 12, 9, 0.82) 80%),
    linear-gradient(to top, rgba(4, 10, 7, 0.92), transparent 52%);
}

.menu-copy {
  position: relative;
  max-width: 880px;
  padding-bottom: 10px;
}

.menu-copy::before {
  position: absolute;
  bottom: 54px;
  left: -38px;
  width: 1px;
  height: 96px;
  background: linear-gradient(transparent, rgba(143, 231, 255, 0.4), transparent);
  content: "";
}

.menu-copy__eyebrow,
.screen-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 12px rgba(143, 231, 255, 0.75);
}

.live-dot::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(143, 231, 255, 0.34);
  border-radius: 50%;
  content: "";
  animation: pulse-ring 2.8s ease-out infinite;
}

.menu-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.22em;
  margin-top: clamp(22px, 3vw, 38px);
  font-family: var(--font-serif);
  font-size: clamp(5.5rem, 12.2vw, 11.8rem);
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: 0;
  text-shadow: 0 8px 56px rgba(0, 0, 0, 0.45);
}

.menu-title span {
  position: relative;
  display: inline-block;
}

.menu-title span::after {
  position: absolute;
  right: -0.1em;
  bottom: 0.17em;
  left: 0.03em;
  height: 1px;
  background: linear-gradient(90deg, rgba(143, 231, 255, 0.8), transparent);
  content: "";
}

.menu-title em {
  color: var(--ice);
  font-size: 0.78em;
  font-style: normal;
  text-shadow:
    0 0 28px rgba(143, 231, 255, 0.16),
    0 8px 56px rgba(0, 0, 0, 0.45);
}

.menu-copy__tagline {
  max-width: 390px;
  margin-top: clamp(24px, 4vw, 42px);
  color: rgba(231, 242, 235, 0.76);
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.15vw, 1.16rem);
  line-height: 1.85;
}

.menu-copy__meta {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 32px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
}

.menu-copy__meta span:first-child {
  color: var(--ice);
}

.menu-copy__meta i {
  width: 54px;
  height: 1px;
  background: rgba(221, 242, 233, 0.18);
}

.character-panel {
  position: relative;
  align-self: center;
  width: min(100%, 500px);
  margin-left: auto;
  padding: 24px 24px 20px;
  border: 1px solid rgba(221, 242, 233, 0.15);
  background:
    linear-gradient(135deg, rgba(143, 231, 255, 0.035), transparent 42%),
    rgba(6, 14, 11, 0.82);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(13px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.character-panel::before,
.character-panel::after {
  position: absolute;
  content: "";
}

.character-panel::before {
  top: -1px;
  left: -1px;
  width: 68px;
  height: 1px;
  background: var(--ice);
  box-shadow: 0 0 14px rgba(143, 231, 255, 0.45);
}

.character-panel::after {
  top: 12px;
  right: 12px;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(143, 231, 255, 0.5);
  transform: rotate(45deg);
}

.character-panel__header,
.character-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.51rem;
  letter-spacing: 0.13em;
}

.character-panel__header small {
  color: var(--ice);
  font-size: inherit;
}

.character-list {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.character-card {
  position: relative;
  display: grid;
  grid-template-columns: 24px 92px minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 116px;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(221, 242, 233, 0.12);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 72%),
    rgba(255, 255, 255, 0.016);
  text-align: left;
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    transform 0.22s ease;
}

.character-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: transparent;
  content: "";
  transition: background 0.22s ease;
}

.character-card:hover {
  border-color: rgba(221, 242, 233, 0.28);
  background:
    linear-gradient(90deg, rgba(143, 231, 255, 0.055), transparent 70%),
    rgba(255, 255, 255, 0.026);
  transform: translateX(3px);
}

.character-card.is-selected {
  border-color: rgba(143, 231, 255, 0.46);
  background:
    linear-gradient(90deg, rgba(143, 231, 255, 0.09), transparent 74%),
    rgba(255, 255, 255, 0.035);
}

.character-card.is-selected::before {
  background: var(--ice);
  box-shadow: 0 0 12px rgba(143, 231, 255, 0.65);
}

.character-card__index {
  align-self: start;
  padding-top: 13px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.47rem;
  text-align: center;
}

.character-card__portrait {
  position: relative;
  display: grid;
  height: 114px;
  place-items: center;
}

.character-card__portrait::after {
  position: absolute;
  right: 10%;
  bottom: 10px;
  left: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(143, 231, 255, 0.3), transparent);
  content: "";
}

.character-card__portrait img {
  width: 84px;
  height: 100px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.character-card:hover .character-card__portrait img,
.character-card.is-selected .character-card__portrait img {
  transform: translateY(-3px) scale(1.03);
}

.character-card__copy {
  display: grid;
  gap: 0;
  padding: 12px 10px 12px 0;
}

.character-card__copy small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.47rem;
  letter-spacing: 0.12em;
}

.character-card__copy strong {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
}

.character-card__copy > span {
  margin-top: 5px;
  color: var(--dim);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.character-card__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(221, 242, 233, 0.13);
  color: var(--dim);
}

.character-card__mark svg {
  width: 14px;
  height: 14px;
}

.character-card.is-selected .character-card__mark {
  color: var(--ice);
  border-color: rgba(143, 231, 255, 0.4);
}

.character-card[data-character="liefeng"].is-selected .character-card__mark {
  color: var(--ember);
  border-color: rgba(255, 138, 61, 0.48);
}

.character-card[data-character="liefeng"].is-selected {
  border-color: rgba(255, 138, 61, 0.5);
  background:
    linear-gradient(90deg, rgba(255, 106, 42, 0.1), transparent 74%),
    rgba(255, 255, 255, 0.035);
}

.character-card[data-character="liefeng"].is-selected::before {
  background: var(--ember);
  box-shadow: 0 0 12px rgba(255, 138, 61, 0.62);
}

.character-card[data-character="liefeng"] .character-card__portrait::after {
  background: linear-gradient(90deg, transparent, rgba(255, 138, 61, 0.34), transparent);
}

.primary-cta,
.secondary-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 18px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.primary-cta {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(143, 231, 255, 0.65);
  color: #06100c;
  background: var(--ice);
}

.primary-cta:hover {
  background: var(--ice-hot);
}

.primary-cta svg,
.secondary-cta svg {
  width: 17px;
  height: 17px;
}

.secondary-cta {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
}

.secondary-cta:hover {
  border-color: rgba(143, 231, 255, 0.44);
  color: var(--ice-hot);
  background: rgba(143, 231, 255, 0.05);
}

.character-panel__footer {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(221, 242, 233, 0.08);
  font-size: 0.44rem;
}

.hud {
  position: absolute;
  z-index: 7;
  top: calc(var(--topbar-height) + 8px + var(--safe-top));
  right: calc(24px + var(--safe-right));
  left: calc(24px + var(--safe-left));
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(280px, 1fr);
  align-items: start;
  pointer-events: none;
}

.hud__player {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 360px);
}

.hud__portrait {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(221, 242, 233, 0.24);
  background: rgba(4, 10, 8, 0.7);
}

.hud__portrait img {
  width: 44px;
  height: 47px;
  object-fit: contain;
  image-rendering: pixelated;
}

.hud__portrait > span {
  position: absolute;
  right: -1px;
  bottom: -1px;
  min-width: 18px;
  padding: 1px 3px;
  color: #06100c;
  background: var(--ice);
  font-family: var(--font-mono);
  font-size: 0.42rem;
  font-weight: 700;
  text-align: center;
}

.hud__vitals {
  display: grid;
  flex: 1;
  gap: 5px;
}

.hud__name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hud__name-row strong {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 400;
}

.hud__name-row span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.46rem;
  letter-spacing: 0.1em;
}

.meter {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(221, 242, 233, 0.16);
  background: rgba(3, 8, 6, 0.7);
}

.meter i {
  position: absolute;
  inset: 0;
  width: 100%;
  transform-origin: left center;
  transition: transform 0.15s linear;
}

.meter span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 0.39rem;
  letter-spacing: 0.06em;
  text-align: right;
}

.meter--health {
  height: 10px;
}

.meter--health i {
  background: linear-gradient(90deg, #be4f4d, #ef8171);
  box-shadow: 0 0 10px rgba(226, 93, 89, 0.22);
}

.meter--xp {
  height: 5px;
}

.meter--xp i {
  background: linear-gradient(90deg, #3b90b2, var(--ice));
  box-shadow: 0 0 10px rgba(143, 231, 255, 0.35);
}

.hud__timer {
  display: grid;
  min-width: 150px;
  justify-items: center;
  padding-top: 2px;
}

.hud__timer span,
.hud__timer small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.42rem;
  letter-spacing: 0.18em;
}

.hud__timer strong {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 1.36rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.hud__timer small {
  margin-top: 3px;
  color: var(--ice);
}

.hud__score {
  display: flex;
  justify-self: end;
  gap: clamp(24px, 4vw, 54px);
  padding-top: 4px;
}

.hud__score div {
  display: grid;
  justify-items: end;
}

.hud__score span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.46rem;
  letter-spacing: 0.12em;
}

.hud__score strong {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.hud__weapons {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
}

.weapon-chip {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(221, 242, 233, 0.15);
  background: rgba(5, 12, 9, 0.74);
  color: var(--ice);
  backdrop-filter: blur(5px);
}

.weapon-chip svg {
  width: 17px;
  height: 17px;
}

.weapon-chip::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 4px;
  height: 4px;
  background: var(--ice);
  content: "";
}

.weapon-chip[data-weapon="fire"] {
  color: var(--ember);
}

.weapon-chip[data-weapon="fire"]::after {
  background: var(--ember);
}

.weapon-chip[data-weapon="orbit"] {
  color: #a5dcff;
}

.weapon-chip[data-weapon="nova"] {
  color: #b7f4ff;
}

.weapon-chip[data-weapon="storm"] {
  color: #d1b8ff;
}

.weapon-chip[data-weapon="trail"] {
  color: var(--moss);
}

.weapon-chip small {
  position: absolute;
  top: -5px;
  right: -3px;
  min-width: 13px;
  padding: 0 2px;
  color: var(--ink);
  background: #13211c;
  font-family: var(--font-mono);
  font-size: 0.35rem;
  text-align: center;
}

.hud__dash {
  position: fixed;
  right: calc(28px + var(--safe-right));
  bottom: calc(22px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.hud__dash svg {
  width: 15px;
  height: 15px;
}

.hud__dash > span {
  position: relative;
  display: block;
  width: 58px;
  height: 3px;
  background: rgba(221, 242, 233, 0.12);
}

.hud__dash i {
  position: absolute;
  inset: 0;
  background: var(--ice);
  transform-origin: left;
}

.boss-bar {
  position: absolute;
  z-index: 9;
  top: calc(var(--topbar-height) + 92px + var(--safe-top));
  left: 50%;
  width: min(560px, calc(100% - 40px));
  padding: 10px 12px 8px;
  border: 1px solid rgba(226, 93, 89, 0.32);
  background: rgba(12, 8, 8, 0.78);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.boss-bar__copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.boss-bar__copy span {
  color: rgba(255, 211, 201, 0.6);
  font-family: var(--font-mono);
  font-size: 0.42rem;
  letter-spacing: 0.12em;
}

.boss-bar__copy strong {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 400;
}

.boss-bar__track {
  position: relative;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.boss-bar__track i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #7d1718, #e25d59);
  box-shadow: 0 0 14px rgba(226, 93, 89, 0.35);
  transform-origin: left;
}

.screen--levelup {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: calc(var(--topbar-height) + 26px) 30px 40px;
  background:
    radial-gradient(circle at 50% 42%, rgba(143, 231, 255, 0.1), transparent 34%),
    rgba(4, 10, 8, 0.82);
  backdrop-filter: blur(9px);
}

.levelup-heading {
  text-align: center;
}

.levelup-heading .menu-copy__eyebrow {
  justify-content: center;
}

.levelup-heading h2 {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 5vw, 4.6rem);
  font-weight: 400;
  line-height: 1;
}

.levelup-heading > p:last-child {
  margin-top: 10px;
  color: var(--ice);
  font-family: var(--font-mono);
  font-size: 0.53rem;
  letter-spacing: 0.15em;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 290px));
  gap: 12px;
  width: min(100%, 930px);
  margin-top: clamp(26px, 4vw, 45px);
}

.upgrade-card {
  position: relative;
  display: flex;
  min-height: 290px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(221, 242, 233, 0.16);
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(143, 231, 255, 0.07), transparent 46%),
    rgba(7, 16, 13, 0.88);
  text-align: left;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 17px), calc(100% - 17px) 100%, 0 100%);
  transition:
    color 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    transform 0.22s ease;
}

.upgrade-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--ice);
  content: "";
  transition: width 0.28s ease;
}

.upgrade-card:hover {
  border-color: rgba(143, 231, 255, 0.5);
  background:
    linear-gradient(145deg, rgba(143, 231, 255, 0.13), transparent 54%),
    rgba(10, 23, 18, 0.94);
  transform: translateY(-5px);
}

.upgrade-card:hover::before {
  width: 100%;
}

.upgrade-card__number {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.45rem;
  letter-spacing: 0.12em;
}

.upgrade-card__icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin-top: 20px;
  place-items: center;
  border: 1px solid rgba(143, 231, 255, 0.28);
  color: var(--ice);
  background: rgba(143, 231, 255, 0.035);
  transform: rotate(45deg);
}

.upgrade-card__icon svg {
  width: 25px;
  height: 25px;
  transform: rotate(-45deg);
}

.upgrade-card__copy {
  display: grid;
  gap: 8px;
  margin-top: 30px;
}

.upgrade-card__copy small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.45rem;
  letter-spacing: 0.13em;
}

.upgrade-card__copy strong {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 400;
}

.upgrade-card__copy p {
  color: rgba(220, 236, 226, 0.65);
  font-size: 0.72rem;
  line-height: 1.7;
}

.upgrade-card__level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid rgba(221, 242, 233, 0.09);
}

.upgrade-card__level span {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.42rem;
  letter-spacing: 0.1em;
}

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

.upgrade-card__pips i {
  display: block;
  width: 10px;
  height: 3px;
  background: rgba(221, 242, 233, 0.13);
}

.upgrade-card__pips i.is-filled {
  background: var(--ice);
}

.screen--pause,
.screen--result {
  display: grid;
  place-items: center;
  padding: 100px 24px 32px;
  background:
    radial-gradient(circle at center, rgba(143, 231, 255, 0.05), transparent 40%),
    rgba(3, 8, 6, 0.82);
  backdrop-filter: blur(10px);
}

.pause-panel,
.result-panel {
  width: min(100%, 540px);
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(221, 242, 233, 0.16);
  background:
    linear-gradient(140deg, rgba(143, 231, 255, 0.055), transparent 52%),
    rgba(7, 15, 12, 0.9);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.screen-kicker {
  color: var(--ice);
  font-size: 0.48rem;
}

.pause-panel h2,
.result-panel h2 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 6vw, 4.8rem);
  font-weight: 400;
  line-height: 1;
}

.pause-actions,
.result-actions {
  display: grid;
  gap: 7px;
  margin-top: 34px;
}

.pause-actions .primary-cta,
.result-actions .primary-cta {
  margin-top: 0;
  min-height: 52px;
}

.pause-actions .secondary-cta,
.result-actions .secondary-cta {
  min-height: 50px;
}

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

.result-panel__subtitle {
  margin-top: 15px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 0.92rem;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-stats div {
  display: grid;
  gap: 5px;
  padding: 17px 10px;
}

.result-stats div + div {
  border-left: 1px solid var(--line);
}

.result-stats span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.44rem;
  letter-spacing: 0.1em;
}

.result-stats strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 400;
}

.result-panel.is-victory .screen-kicker {
  color: var(--ember);
}

.result-panel.is-victory h2 {
  color: var(--ember-hot);
}

.wave-toast {
  position: absolute;
  z-index: 12;
  top: 33%;
  left: 50%;
  min-width: 230px;
  padding: 12px 22px;
  opacity: 0;
  border-top: 1px solid rgba(143, 231, 255, 0.3);
  border-bottom: 1px solid rgba(143, 231, 255, 0.3);
  color: var(--ice-hot);
  background: linear-gradient(90deg, transparent, rgba(5, 14, 10, 0.78) 18% 82%, transparent);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

.wave-toast.is-visible {
  animation: toast-wave 2.4s ease both;
}

.wave-toast.is-danger {
  color: #ffb2a6;
  border-color: rgba(226, 93, 89, 0.34);
  background: linear-gradient(90deg, transparent, rgba(38, 8, 8, 0.8) 18% 82%, transparent);
}

.mobile-controls {
  position: absolute;
  z-index: 9;
  right: 0;
  bottom: calc(24px + var(--safe-bottom));
  left: 0;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 calc(26px + var(--safe-right)) 0 calc(26px + var(--safe-left));
  pointer-events: none;
}

.joystick,
.dash-button {
  pointer-events: auto;
  touch-action: none;
}

.joystick {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid rgba(221, 242, 233, 0.13);
  border-radius: 50%;
  background: rgba(4, 10, 8, 0.16);
}

.joystick__ring {
  position: absolute;
  width: 64%;
  height: 64%;
  border: 1px solid rgba(143, 231, 255, 0.18);
  border-radius: 50%;
}

.joystick__knob {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(143, 231, 255, 0.48);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(143, 231, 255, 0.22), rgba(7, 16, 13, 0.66));
  box-shadow: 0 0 22px rgba(143, 231, 255, 0.08);
  will-change: transform;
}

.dash-button {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(143, 231, 255, 0.32);
  border-radius: 50%;
  color: var(--ice);
  background: rgba(5, 13, 10, 0.58);
}

.dash-button svg {
  width: 24px;
  height: 24px;
}

.dash-button span {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  height: 2px;
  background: rgba(221, 242, 233, 0.12);
}

.dash-button span::after {
  position: absolute;
  inset: 0;
  background: var(--ice);
  content: "";
  transform: scaleX(var(--dash-ready, 1));
  transform-origin: left;
}

.dash-button:disabled {
  opacity: 0.42;
}

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

.noscript {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--night);
  font-family: var(--font-mono);
}

@keyframes pulse-ring {
  0% {
    opacity: 0.8;
    transform: scale(0.5);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes toast-wave {
  0% {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  15%,
  72% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}

@media (max-width: 1120px) {
  .screen--menu {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 0.72fr);
    gap: 44px;
    padding-inline: 42px;
  }

  .menu-title {
    font-size: clamp(5.2rem, 12vw, 8.4rem);
  }

  .character-card {
    grid-template-columns: 21px 84px minmax(0, 1fr) 32px;
  }

  .character-card__portrait img {
    width: 74px;
  }

  .game-topbar__build {
    display: none;
  }

  .game-topbar {
    grid-template-columns: 1fr auto;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 68px;
  }

  .game-topbar {
    padding-inline: 18px;
  }

  .screen--menu {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 22px;
    overflow-y: auto;
    padding: calc(var(--topbar-height) + 52px + var(--safe-top)) 22px
      calc(24px + var(--safe-bottom));
    background:
      linear-gradient(to top, rgba(4, 10, 7, 0.96), rgba(4, 10, 7, 0.2) 68%),
      linear-gradient(90deg, rgba(5, 12, 9, 0.5), transparent 68%);
  }

  .menu-copy {
    padding: 0;
  }

  .menu-copy::before,
  .menu-copy__meta {
    display: none;
  }

  .menu-title {
    margin-top: 17px;
    font-size: clamp(4.25rem, 17vw, 7.6rem);
    line-height: 0.8;
  }

  .menu-copy__tagline {
    max-width: 340px;
    margin-top: 20px;
    font-size: 0.88rem;
  }

  .character-panel {
    width: 100%;
    margin: 0;
    padding: 17px;
  }

  .character-card {
    min-height: 102px;
    grid-template-columns: 20px 75px minmax(0, 1fr) 30px;
  }

  .character-card__portrait {
    height: 99px;
  }

  .character-card__portrait img {
    width: 65px;
    height: 86px;
  }

  .character-card__copy strong {
    font-size: 1.38rem;
  }

  .hud {
    right: 16px;
    left: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hud__timer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }

  .hud__timer span,
  .hud__timer small {
    display: none;
  }

  .hud__timer strong {
    margin: 0;
    font-size: 1rem;
  }

  .hud__player {
    width: 230px;
  }

  .hud__score {
    grid-column: 2;
    grid-row: 1;
    gap: 18px;
  }

  .hud__score div:last-child {
    display: none;
  }

  .boss-bar {
    top: calc(var(--topbar-height) + 76px + var(--safe-top));
  }

  .upgrade-grid {
    grid-template-columns: 1fr;
    width: min(100%, 480px);
    max-height: min(57vh, 540px);
    overflow-y: auto;
    padding-bottom: 2px;
  }

  .upgrade-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 0;
    gap: 16px;
    align-items: center;
    padding: 17px;
  }

  .upgrade-card__number {
    position: absolute;
    top: 10px;
    right: 12px;
  }

  .upgrade-card__icon {
    width: 50px;
    height: 50px;
    margin: 0;
  }

  .upgrade-card__icon svg {
    width: 21px;
    height: 21px;
  }

  .upgrade-card__copy {
    gap: 3px;
    margin: 0;
  }

  .upgrade-card__copy small {
    display: none;
  }

  .upgrade-card__copy strong {
    font-size: 1.24rem;
  }

  .upgrade-card__copy p {
    font-size: 0.67rem;
  }

  .upgrade-card__level {
    grid-column: 1 / -1;
    margin-top: 0;
    padding-top: 9px;
  }
}

@media (max-width: 560px) {
  .game-brand__copy small,
  .icon-button--back {
    display: none;
  }

  .game-brand__sigil {
    width: 27px;
    height: 27px;
  }

  .game-tools {
    gap: 5px;
  }

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

  .screen--menu {
    padding: calc(var(--topbar-height) + 28px + var(--safe-top)) 16px
      calc(14px + var(--safe-bottom));
  }

  .menu-copy__eyebrow {
    font-size: 0.46rem;
  }

  .menu-title {
    margin-top: 13px;
    font-size: clamp(3.7rem, 18vw, 5.4rem);
  }

  .menu-copy__tagline {
    margin-top: 15px;
    font-size: 0.76rem;
  }

  .character-panel {
    padding: 13px;
  }

  .character-panel__header {
    font-size: 0.45rem;
  }

  .character-list {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .character-card {
    display: flex;
    min-height: 174px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    padding: 11px;
  }

  .character-card__index {
    position: absolute;
    top: 7px;
    left: 9px;
    padding: 0;
  }

  .character-card__portrait {
    position: absolute;
    top: 16px;
    right: 12px;
    left: 12px;
    height: 98px;
  }

  .character-card__portrait img {
    width: 70px;
    height: 89px;
  }

  .character-card__copy {
    padding: 0;
  }

  .character-card__copy small,
  .character-card__copy > span {
    display: none;
  }

  .character-card__copy strong {
    margin-top: 8px;
    font-size: 1.28rem;
  }

  .character-card__mark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
  }

  .character-card__mark svg {
    width: 11px;
    height: 11px;
  }

  .primary-cta {
    min-height: 48px;
  }

  .character-panel__footer {
    margin-top: 11px;
    padding-top: 9px;
    font-size: 0.39rem;
  }

  .hud {
    top: calc(var(--topbar-height) + 3px + var(--safe-top));
  }

  .hud__portrait {
    width: 43px;
    height: 43px;
  }

  .hud__portrait img {
    width: 36px;
    height: 39px;
  }

  .hud__player {
    width: 166px;
    gap: 7px;
  }

  .hud__name-row strong {
    font-size: 0.78rem;
  }

  .hud__name-row span {
    display: none;
  }

  .meter--health {
    height: 8px;
  }

  .meter span {
    display: none;
  }

  .hud__score {
    padding-top: 0;
  }

  .hud__score span {
    font-size: 0.38rem;
  }

  .hud__score strong {
    font-size: 0.74rem;
  }

  .hud__timer {
    top: 2px;
  }

  .hud__timer strong {
    padding: 2px 6px;
    background: rgba(4, 10, 8, 0.52);
    font-size: 0.82rem;
  }

  .hud__weapons {
    bottom: calc(12px + var(--safe-bottom));
  }

  .weapon-chip {
    width: 34px;
    height: 34px;
  }

  .hud__dash {
    display: none;
  }

  .screen--levelup {
    padding: calc(var(--topbar-height) + 14px + var(--safe-top)) 14px
      calc(14px + var(--safe-bottom));
  }

  .levelup-heading .menu-copy__eyebrow {
    display: none;
  }

  .levelup-heading h2 {
    margin: 0;
    font-size: 2.5rem;
  }

  .levelup-heading > p:last-child {
    margin-top: 5px;
  }

  .upgrade-grid {
    margin-top: 16px;
    max-height: calc(100svh - 158px - var(--safe-top) - var(--safe-bottom));
  }

  .upgrade-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .upgrade-card__icon {
    width: 42px;
    height: 42px;
  }

  .upgrade-card__icon svg {
    width: 18px;
    height: 18px;
  }

  .upgrade-card__copy p {
    font-size: 0.62rem;
    line-height: 1.55;
  }

  .upgrade-card__level {
    display: none;
  }

  .pause-panel,
  .result-panel {
    padding: 26px 20px;
  }

  .pause-panel h2,
  .result-panel h2 {
    font-size: 2.8rem;
  }

  .result-stats {
    grid-template-columns: 1fr 1fr;
  }

  .result-stats div:nth-child(3) {
    border-left: 0;
  }

  .result-stats div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .boss-bar {
    top: calc(var(--topbar-height) + 64px + var(--safe-top));
    width: calc(100% - 28px);
  }
}

@media (hover: none), (pointer: coarse) {
  .mobile-controls:not([hidden]) {
    display: flex;
  }

  .character-card:hover {
    transform: none;
  }

  .character-card:hover .character-card__portrait img {
    transform: none;
  }

  .character-card.is-selected .character-card__portrait img {
    transform: translateY(-3px) scale(1.03);
  }
}

@media (max-height: 660px) and (max-width: 820px) {
  .screen--menu {
    align-content: start;
  }

  .menu-title {
    font-size: 3.65rem;
  }

  .menu-copy__tagline {
    display: none;
  }

  .character-card {
    min-height: 78px;
    grid-template-columns: 18px 63px minmax(0, 1fr) 28px;
  }

  .character-card__portrait {
    height: 77px;
  }

  .character-card__portrait img {
    width: 55px;
    height: 70px;
  }
}

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