:root {
  --ink: #f4f4ff;
  --muted: #8585a8;
  --dim: #51516f;
  --void: #06060f;
  --panel: rgba(11, 11, 29, 0.78);
  --panel-strong: rgba(13, 13, 34, 0.94);
  --line: rgba(255, 255, 255, 0.1);
  --cyan: #24f5ce;
  --cyan-soft: #94ffe9;
  --pink: #ff3f9f;
  --gold: #ffd166;
  --danger: #ff4d67;
  --violet: #8467ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--void);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--void);
  touch-action: none;
  overscroll-behavior: none;
}

body {
  min-width: 300px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible + i {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

#app,
#game-canvas,
.screen {
  position: fixed;
  inset: 0;
}

#app {
  isolation: isolate;
  background: #070711 url("./assets/arena-keyart-hd.png") center / cover no-repeat;
}

#game-canvas {
  z-index: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 48%, rgba(11, 13, 31, 0.2) 0%, rgba(5, 5, 17, 0.42) 54%, rgba(2, 2, 9, 0.74) 100%),
    linear-gradient(90deg, rgba(255, 63, 159, 0.025), transparent 38%, transparent 62%, rgba(36, 245, 206, 0.025));
}

#app.overdrive #game-canvas {
  background:
    radial-gradient(circle at 50% 48%, rgba(83, 14, 65, 0.15) 0%, rgba(11, 5, 23, 0.4) 56%, rgba(3, 2, 10, 0.76) 100%),
    linear-gradient(90deg, rgba(255, 63, 159, 0.055), transparent 42%, transparent 58%, rgba(36, 245, 206, 0.035));
}

.vignette {
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 38%, rgba(0, 0, 10, 0.34) 78%, rgba(0, 0, 7, 0.78) 100%);
}

.scanlines {
  position: fixed;
  z-index: 8;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255, 255, 255, 0.025) 4px);
  mix-blend-mode: soft-light;
}

.screen {
  z-index: 10;
  display: grid;
  place-items: center;
}

.menu-screen {
  padding: max(24px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background:
    linear-gradient(180deg, rgba(3, 3, 11, 0.36), rgba(3, 3, 12, 0.1) 46%, rgba(3, 3, 11, 0.62)),
    linear-gradient(90deg, rgba(5, 5, 15, 0.7), rgba(6, 6, 15, 0.06) 50%, rgba(5, 5, 15, 0.7)),
    radial-gradient(circle at 50% 51%, rgba(7, 7, 18, 0.2) 0, rgba(6, 6, 16, 0.34) 38%, rgba(5, 5, 14, 0.68) 76%);
}

.menu-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.7;
  background:
    linear-gradient(115deg, transparent 26%, rgba(36, 245, 206, 0.035) 45%, transparent 62%),
    linear-gradient(245deg, transparent 25%, rgba(255, 63, 159, 0.04) 45%, transparent 65%);
  background-size: 180% 180%;
  mix-blend-mode: screen;
  animation: menu-light-sweep 12s ease-in-out infinite alternate;
}

.menu-shell {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  text-align: center;
  animation: enter-up 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ff77ba;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.23em;
  line-height: 1;
}

.eyebrow.cyan {
  color: var(--cyan);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 14px var(--pink);
  animation: status-pulse 1.6s ease-in-out infinite;
}

.logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0 10px;
  color: #f8f7ff;
  background: linear-gradient(180deg, #fff 0%, #f6f5ff 46%, #a6a4be 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(46px, 8.6vw, 104px);
  font-weight: 950;
  letter-spacing: -0.085em;
  line-height: 0.85;
  text-indent: -0.03em;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 26px rgba(115, 91, 255, 0.22));
}

.logo b {
  position: relative;
  z-index: 1;
  margin: 0 0.08em 0 0.04em;
  color: var(--pink);
  font-size: 0.56em;
  font-style: italic;
  letter-spacing: -0.2em;
  text-shadow: 0 0 28px rgba(255, 63, 159, 0.72);
  -webkit-text-fill-color: var(--pink);
  transform: translateY(0.02em) skewX(-10deg);
}

.tagline {
  margin: 0;
  color: #a7a6c1;
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.menu-actions {
  width: min(430px, 100%);
  margin: 46px auto 0;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 0 24px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(17, 17, 38, 0.72);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.18), transparent 80%);
  transform: translateX(-100%);
  transition: transform 450ms ease, opacity 150ms ease;
}

.button:hover {
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.button:hover::before {
  opacity: 1;
  transform: translateX(100%);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button-primary {
  border-color: var(--pink);
  color: #fff;
  background: linear-gradient(110deg, #e72d89, #ff4d9f);
  box-shadow: 0 8px 35px rgba(255, 38, 139, 0.27), inset 0 1px rgba(255, 255, 255, 0.24);
}

.button-primary:hover {
  border-color: #ff8dc6;
  box-shadow: 0 11px 48px rgba(255, 38, 139, 0.42), inset 0 1px rgba(255, 255, 255, 0.26);
}

.button-xl {
  width: 100%;
  min-height: 64px;
  font-size: 13px;
}

.button-ghost {
  background: rgba(11, 11, 27, 0.62);
}

.button-danger {
  border-color: rgba(255, 77, 103, 0.25);
  color: #ff8293;
  background: rgba(255, 77, 103, 0.06);
}

kbd {
  display: inline-grid;
  min-width: 22px;
  min-height: 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-color: rgba(255, 255, 255, 0.36);
  border-radius: 3px;
  padding: 2px 5px;
  color: rgba(255, 255, 255, 0.64);
  background: rgba(0, 0, 0, 0.17);
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 2px rgba(0, 0, 0, 0.2);
}

.secondary-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
  gap: 10px;
}

.secondary-actions .button {
  padding-right: 12px;
  padding-left: 12px;
  font-size: 10px;
}

.record-strip {
  display: grid;
  width: min(620px, 100%);
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: center;
  margin: 50px auto 0;
  padding: 17px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.025), transparent);
}

.record-strip div {
  display: grid;
  gap: 6px;
}

.record-strip span,
.menu-footer,
.hud-label,
.bar-label,
.timer-cluster span,
.combo-copy span,
.combo-cluster small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.pulse-status {
  position: absolute;
  top: 50%;
  right: max(20px, env(safe-area-inset-right));
  width: 142px;
  border-radius: 4px;
  padding: 12px 11px 10px;
  color: var(--ink);
  cursor: pointer;
  opacity: 0.62;
  pointer-events: auto;
  text-align: left;
  transform: translateY(-50%);
  transition: opacity 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pulse-status:hover {
  opacity: 1;
  border-color: rgba(36, 245, 206, 0.42);
}

.pulse-status.ready {
  opacity: 1;
  border-color: rgba(36, 245, 206, 0.68);
  box-shadow: 0 0 30px rgba(36, 245, 206, 0.2), inset 0 1px rgba(255, 255, 255, 0.08);
  animation: pulse-ready 1.15s ease-in-out infinite alternate;
}

.pulse-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
}

.pulse-copy span,
.pulse-status small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.pulse-copy strong {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.pulse-track {
  position: relative;
  height: 4px;
  margin: 8px 0 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.pulse-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 13px var(--cyan);
  transition: width 130ms ease;
}

.pulse-status small {
  display: block;
  padding-right: 23px;
  color: var(--dim);
  font-size: 6px;
  line-height: 1.35;
}

.pulse-status > kbd {
  position: absolute;
  right: 9px;
  bottom: 8px;
  color: var(--cyan);
}

.record-strip strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.record-strip i {
  width: 1px;
  height: 25px;
  background: var(--line);
}

.menu-footer {
  display: flex;
  justify-content: space-between;
  width: min(620px, 100%);
  margin: 18px auto 0;
  color: var(--dim);
  font-size: 8px;
}

.hud {
  position: fixed;
  z-index: 4;
  inset: 0;
  padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  pointer-events: none;
}

.hud-top {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto minmax(112px, 1fr);
  align-items: start;
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(135deg, rgba(20, 20, 45, 0.72), rgba(9, 9, 24, 0.5));
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.score-cluster {
  position: relative;
  display: grid;
  width: fit-content;
  min-width: 145px;
  gap: 2px;
  border-left: 2px solid var(--pink);
  border-radius: 3px;
  padding: 10px 15px;
}

.score-cluster strong {
  font-size: 24px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.score-pop {
  position: absolute;
  right: 8px;
  bottom: 11px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.score-pop.show {
  opacity: 1;
  transform: translateY(-8px);
}

.timer-cluster {
  display: grid;
  min-width: 118px;
  justify-items: center;
  gap: 2px;
  padding-top: 3px;
}

.timer-cluster strong {
  font-size: 29px;
  font-weight: 350;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.timer-cluster span {
  color: var(--pink);
}

.icon-button {
  display: flex;
  width: 47px;
  height: 47px;
  align-items: center;
  justify-self: end;
  justify-content: center;
  gap: 5px;
  border-radius: 3px;
  cursor: pointer;
  pointer-events: auto;
}

.icon-button span {
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: #b8b8cd;
}

.icon-button:hover {
  border-color: var(--cyan);
}

.combo-cluster {
  position: absolute;
  top: 50%;
  left: max(20px, env(safe-area-inset-left));
  width: 132px;
  opacity: 0.34;
  transform: translateY(-50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.combo-cluster.active {
  opacity: 1;
  transform: translateY(-50%) scale(1.04);
}

.combo-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.combo-copy strong {
  color: var(--pink);
  font-size: 24px;
  font-style: italic;
  text-shadow: 0 0 20px rgba(255, 63, 159, 0.65);
}

.combo-track,
.boss-track,
.meter {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.combo-track {
  height: 3px;
  margin: 3px 0 6px;
}

.combo-track i,
.boss-track i,
.meter i,
.meter em {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
}

.combo-track i {
  background: linear-gradient(90deg, var(--pink), var(--gold));
  box-shadow: 0 0 14px var(--pink);
  transition: width 100ms linear;
}

.combo-cluster small {
  display: block;
  color: #5d5d78;
  font-size: 7px;
}

.boss-cluster {
  position: absolute;
  top: 89px;
  left: 50%;
  width: min(440px, calc(100% - 200px));
  transform: translateX(-50%);
  animation: boss-enter 550ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.boss-cluster > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--pink);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.boss-cluster strong {
  color: #fff;
  font-size: 11px;
}

.boss-track {
  height: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.44);
}

.boss-track i {
  width: 100%;
  background: linear-gradient(90deg, #9e2f79, var(--pink), #ff7bbb);
  box-shadow: 0 0 18px rgba(255, 63, 159, 0.6);
  transition: width 90ms linear;
}

.hud-bottom {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  left: max(20px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(150px, 240px) 58px minmax(150px, 240px);
  align-items: end;
  justify-content: center;
  gap: 12px;
}

.vitals,
.dash-status {
  border-radius: 3px;
  padding: 10px 12px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 8px;
}

.bar-label strong {
  color: #b8b8d2;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.meter {
  height: 5px;
}

.health-meter i {
  width: 100%;
  z-index: 2;
  background: linear-gradient(90deg, #ff356e, var(--pink));
  box-shadow: 0 0 12px rgba(255, 52, 115, 0.6);
  transition: width 160ms ease;
}

.health-meter em {
  width: 100%;
  z-index: 1;
  background: rgba(255, 255, 255, 0.36);
  transition: width 650ms ease 180ms;
}

.dash-meter i {
  width: 100%;
  background: linear-gradient(90deg, #3ddfc0, var(--cyan));
  box-shadow: 0 0 12px rgba(36, 245, 206, 0.55);
}

.dash-status.ready {
  border-color: rgba(36, 245, 206, 0.32);
}

.dash-status.ready .bar-label strong {
  color: var(--cyan);
}

.level-core {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-content: center;
  justify-self: center;
  border-radius: 50%;
  color: var(--cyan);
  background: #0a0a1b;
  text-align: center;
  box-shadow: 0 0 28px rgba(36, 245, 206, 0.15);
}

.level-core span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.level-core strong {
  margin-top: -1px;
  font-size: 18px;
  line-height: 1;
}

.level-core svg {
  position: absolute;
  inset: 4px;
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.level-core circle {
  fill: none;
  stroke-width: 2;
}

.level-ring-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.level-ring {
  stroke: var(--cyan);
  stroke-dasharray: 119.38;
  stroke-dashoffset: 119.38;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px var(--cyan));
  transition: stroke-dashoffset 180ms ease;
}

.overdrive-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  display: grid;
  justify-items: center;
  opacity: 0;
  transform: translate(-50%, -5px) scale(0.9);
  transition: opacity 240ms ease, transform 240ms ease;
}

.overdrive-banner span {
  color: #fff;
  font-size: clamp(26px, 4vw, 48px);
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.03em;
  text-shadow: 3px 0 var(--pink), -3px 0 var(--cyan), 0 0 30px rgba(255, 63, 159, 0.8);
}

.overdrive-banner small {
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.3em;
}

#app.overdrive .overdrive-banner {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

#app.overdrive .vignette {
  background: radial-gradient(circle at center, transparent 42%, rgba(255, 30, 122, 0.13) 86%, rgba(0, 0, 7, 0.76) 100%);
}

.overlay-screen,
.modal-layer {
  padding: 24px;
  background: rgba(4, 4, 13, 0.73);
  backdrop-filter: blur(10px);
  animation: fade-in 180ms ease both;
}

.modal-layer {
  z-index: 30;
}

.upgrade-shell {
  width: min(1060px, 100%);
  text-align: center;
}

.upgrade-shell h2,
.modal-card h2,
.results-card h2 {
  margin: 12px 0 7px;
  font-size: clamp(31px, 5vw, 52px);
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.upgrade-shell > p,
.modal-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.upgrade-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 36px;
  gap: 16px;
}

.upgrade-card {
  position: relative;
  min-height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 24px;
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(150deg, rgba(24, 24, 55, 0.96), rgba(10, 10, 26, 0.96));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  text-align: left;
  transform: translateY(12px);
  animation: card-enter 420ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.upgrade-card:nth-child(2) { animation-delay: 55ms; }
.upgrade-card:nth-child(3) { animation-delay: 110ms; }

.upgrade-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--card-color, var(--cyan));
  box-shadow: 0 0 24px var(--card-color, var(--cyan));
}

.upgrade-card::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, color-mix(in srgb, var(--card-color, var(--cyan)) 16%, transparent), transparent 66%);
}

.upgrade-card:hover,
.upgrade-card:focus-visible {
  z-index: 2;
  border-color: color-mix(in srgb, var(--card-color, var(--cyan)) 60%, white);
  box-shadow: 0 22px 60px color-mix(in srgb, var(--card-color, var(--cyan)) 18%, transparent);
  transform: translateY(-8px) !important;
}

.upgrade-index {
  position: absolute;
  top: 15px;
  right: 16px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.upgrade-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--card-color, var(--cyan)) 40%, transparent);
  border-radius: 50%;
  color: var(--card-color, var(--cyan));
  background: color-mix(in srgb, var(--card-color, var(--cyan)) 8%, transparent);
  font-size: 25px;
  font-weight: 400;
  text-shadow: 0 0 18px var(--card-color, var(--cyan));
}

.upgrade-card h3 {
  margin: 28px 0 8px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.upgrade-card p {
  margin: 0;
  color: #9696b2;
  font-size: 12px;
  line-height: 1.55;
}

.upgrade-card footer {
  position: absolute;
  right: 24px;
  bottom: 20px;
  left: 24px;
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.upgrade-card footer strong {
  color: var(--card-color, var(--cyan));
}

.keyboard-tip {
  display: block;
  color: var(--dim);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.upgrade-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}

.reroll-button {
  min-height: 32px;
  border: 1px solid rgba(36, 245, 206, 0.22);
  border-radius: 3px;
  padding: 0 12px;
  color: var(--cyan);
  background: rgba(36, 245, 206, 0.055);
  cursor: pointer;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.12em;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.reroll-button:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(36, 245, 206, 0.1);
  transform: translateY(-1px);
}

.reroll-button:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--dim);
  background: rgba(255, 255, 255, 0.025);
  cursor: not-allowed;
}

.modal-card,
.results-card {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 38px;
  background: linear-gradient(150deg, rgba(22, 22, 52, 0.98), rgba(8, 8, 23, 0.98));
  box-shadow: var(--shadow);
  text-align: center;
  animation: modal-enter 320ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.modal-card::before,
.results-card::before {
  position: absolute;
  top: 0;
  right: 14%;
  left: 14%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--pink), transparent);
  box-shadow: 0 0 18px var(--pink);
}

.pause-card .button {
  width: 100%;
  margin-top: 10px;
}

.pause-card .button-primary {
  margin-top: 30px;
}

.results-card {
  width: min(560px, 100%);
}

.final-score {
  position: relative;
  display: grid;
  margin: 28px 0 20px;
  padding: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.final-score span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.final-score strong {
  margin-top: 3px;
  color: #fff;
  font-size: clamp(38px, 9vw, 64px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  text-shadow: 0 0 28px rgba(255, 63, 159, 0.25);
}

.final-score em {
  position: absolute;
  top: 13px;
  right: 12px;
  padding: 4px 6px;
  color: #08120f;
  background: var(--cyan);
  font-size: 7px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.12em;
  transform: rotate(3deg);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.result-grid div {
  display: grid;
  gap: 6px;
  padding: 17px 12px;
  background: #0d0d25;
}

.result-grid span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.result-grid strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.results-actions {
  display: grid;
  margin-top: 24px;
  gap: 9px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 32px;
  height: 32px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 23px;
  font-weight: 250;
}

.modal-close:hover {
  color: #fff;
}

.info-card {
  width: min(710px, 100%);
  text-align: left;
}

.info-card > .eyebrow,
.info-card > h2 {
  display: flex;
  justify-content: center;
  text-align: center;
}

.instruction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 28px 0 24px;
  gap: 10px;
}

.instruction {
  display: grid;
  min-height: 122px;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.022);
}

.instruction strong {
  font-size: 11px;
  letter-spacing: 0.12em;
}

.instruction p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.48;
}

.key-art {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--cyan);
  font-size: 27px;
  text-shadow: 0 0 15px rgba(36, 245, 206, 0.52);
}

.key-art span {
  display: flex;
  gap: 3px;
}

.key-art kbd {
  width: 23px;
  height: 23px;
  padding: 0;
  color: var(--cyan);
}

.dash-art {
  height: 55px;
  align-content: center;
  border: 1px solid rgba(36, 245, 206, 0.22);
  border-radius: 50%;
}

.dash-art small {
  color: var(--muted);
  font-size: 6px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.chain-art {
  color: var(--pink);
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 0 15px rgba(255, 63, 159, 0.6);
}

.pro-tip {
  border-left: 2px solid var(--pink);
  padding: 11px 14px;
  color: var(--muted);
  background: rgba(255, 63, 159, 0.05);
  font-size: 11px;
}

.pro-tip span {
  margin-right: 8px;
  color: var(--pink);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.info-card > .button {
  width: 100%;
}

.settings-card {
  text-align: left;
}

.settings-card > .eyebrow,
.settings-card > h2 {
  display: flex;
  justify-content: center;
  text-align: center;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.setting-row:first-of-type {
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.setting-row div {
  display: grid;
  gap: 3px;
}

.setting-row strong {
  font-size: 10px;
  letter-spacing: 0.1em;
}

.setting-row span {
  color: var(--muted);
  font-size: 10px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 43px;
  height: 23px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.switch i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  content: "";
  background: #85859e;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.switch input:checked + i {
  border-color: rgba(36, 245, 206, 0.38);
  background: rgba(36, 245, 206, 0.12);
}

.switch input:checked + i::after {
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(36, 245, 206, 0.65);
  transform: translateX(20px);
}

.settings-card > .button {
  width: 100%;
  margin-top: 24px;
}

.text-button {
  display: block;
  margin: 16px auto -12px;
  border: 0;
  color: #5f5f79;
  background: transparent;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.text-button:hover {
  color: var(--danger);
}

.toast-layer {
  position: fixed;
  z-index: 50;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  display: grid;
  width: min(330px, calc(100% - 36px));
  gap: 8px;
  pointer-events: none;
}

#app[data-state="playing"] .toast-layer,
#app[data-state="paused"] .toast-layer,
#app[data-state="upgrade"] .toast-layer {
  top: max(76px, calc(env(safe-area-inset-top) + 58px));
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(36, 245, 206, 0.26);
  border-radius: 4px;
  padding: 11px 14px;
  overflow: hidden;
  background: rgba(10, 11, 28, 0.94);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
  animation: toast-in 350ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.toast.leave {
  animation: toast-out 240ms ease both;
}

.toast-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(36, 245, 206, 0.09);
  font-size: 17px;
}

.toast div {
  display: grid;
  gap: 2px;
}

.toast strong {
  font-size: 10px;
  letter-spacing: 0.1em;
}

.toast span {
  color: var(--muted);
  font-size: 9px;
}

.touch-controls {
  position: fixed;
  z-index: 7;
  right: max(28px, env(safe-area-inset-right));
  bottom: max(30px, env(safe-area-inset-bottom));
  left: max(28px, env(safe-area-inset-left));
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
}

.joystick,
.touch-dash {
  position: relative;
  width: 106px;
  height: 106px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(16, 16, 38, 0.38);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(5px);
  pointer-events: auto;
}

.touch-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.touch-pulse {
  position: relative;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid rgba(132, 103, 255, 0.38);
  border-radius: 50%;
  color: #a795ff;
  background: rgba(20, 15, 50, 0.5);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  cursor: pointer;
  opacity: 0.52;
  pointer-events: auto;
}

.touch-pulse span {
  z-index: 2;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.touch-pulse i {
  position: absolute;
  inset: 7px;
  z-index: 1;
  border: 1px solid rgba(36, 245, 206, 0.22);
  border-radius: 50%;
  background: conic-gradient(var(--cyan) var(--pulse-charge, 0%), transparent 0);
  mask: radial-gradient(circle, transparent 56%, #000 58%);
  opacity: 0.75;
}

.touch-pulse.ready {
  border-color: var(--cyan);
  color: var(--cyan);
  opacity: 1;
  box-shadow: 0 0 25px rgba(36, 245, 206, 0.26), inset 0 0 24px rgba(36, 245, 206, 0.07);
  animation: pulse-ready 1s ease-in-out infinite alternate;
}

.touch-pulse:active {
  transform: scale(0.94);
}

.armory-card {
  width: min(690px, 100%);
}

.armory-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 10px;
  border: 1px solid rgba(36, 245, 206, 0.16);
  border-radius: 4px;
  padding: 11px 14px;
  background: rgba(36, 245, 206, 0.045);
}

.armory-balance span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.armory-balance strong {
  color: var(--cyan);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.protocol-list {
  display: grid;
  gap: 8px;
}

.protocol-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.022);
  text-align: left;
}

.protocol-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--protocol-color) 38%, transparent);
  border-radius: 50%;
  color: var(--protocol-color);
  background: color-mix(in srgb, var(--protocol-color) 8%, transparent);
  font-size: 19px;
  text-shadow: 0 0 12px var(--protocol-color);
}

.protocol-copy {
  display: grid;
  gap: 3px;
}

.protocol-copy header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.protocol-copy strong {
  font-size: 11px;
  letter-spacing: 0.07em;
}

.protocol-copy em {
  color: var(--protocol-color);
  font-size: 7px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.protocol-copy span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.protocol-buy {
  min-width: 110px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--protocol-color) 35%, transparent);
  border-radius: 3px;
  color: var(--protocol-color);
  background: color-mix(in srgb, var(--protocol-color) 6%, transparent);
  cursor: pointer;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.protocol-buy:hover:not(:disabled) {
  border-color: var(--protocol-color);
  background: color-mix(in srgb, var(--protocol-color) 12%, transparent);
}

.protocol-buy:disabled {
  border-color: rgba(255, 255, 255, 0.07);
  color: var(--dim);
  background: rgba(255, 255, 255, 0.02);
  cursor: not-allowed;
}

.armory-card > .button {
  width: 100%;
  margin-top: 18px;
}

.joystick::after {
  position: absolute;
  inset: 23px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.joystick i {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(36, 245, 206, 0.4);
  border-radius: 50%;
  background: rgba(36, 245, 206, 0.13);
  box-shadow: 0 0 24px rgba(36, 245, 206, 0.17);
  transform: translate(-50%, -50%);
}

.touch-dash {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border-color: rgba(255, 63, 159, 0.36);
  color: #ff88c2;
  cursor: pointer;
}

.touch-dash span {
  z-index: 1;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.touch-dash i {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 63, 159, 0.2);
  border-radius: 50%;
}

.touch-dash:active {
  background: rgba(255, 63, 159, 0.18);
  transform: scale(0.94);
}

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

.noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #fff;
  background: #070713;
  text-align: center;
}

#app.damage-flash::after {
  position: fixed;
  z-index: 20;
  inset: 0;
  content: "";
  pointer-events: none;
  background: radial-gradient(circle, transparent 25%, rgba(255, 32, 91, 0.34));
  animation: damage-flash 260ms ease-out both;
}

#app.pulse-fired #game-canvas {
  animation: pulse-camera 520ms cubic-bezier(0.12, 0.74, 0.22, 1) both;
}

#app.pulse-fired .vignette {
  animation: pulse-vignette 620ms ease-out both;
}

@keyframes enter-up { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes status-pulse { 50% { opacity: 0.42; transform: scale(0.72); } }
@keyframes modal-enter { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes card-enter { to { opacity: 1; transform: translateY(0); } }
@keyframes boss-enter { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(18px); } }
@keyframes damage-flash { to { opacity: 0; } }
@keyframes pulse-ready { to { filter: brightness(1.25); } }
@keyframes menu-light-sweep { to { background-position: 100% 0, 0 100%; opacity: 0.94; } }
@keyframes pulse-camera { 0% { filter: brightness(2.4) saturate(0.2); } 18% { filter: brightness(1.35) saturate(1.8) contrast(1.2); } 100% { filter: none; } }
@keyframes pulse-vignette { 0% { background: radial-gradient(circle at center, rgba(255,255,255,0.72), rgba(36,245,206,0.2) 28%, rgba(8,4,25,0.85) 70%); } 100% { opacity: 1; } }

@media (hover: none), (pointer: coarse) {
  .touch-controls:not([hidden]) { display: flex; }
  .keyboard-tip { display: none; }
  .upgrade-options { margin-top: 14px; }
  .hud-bottom { bottom: max(10px, env(safe-area-inset-bottom)); }
  .combo-cluster { top: 38%; }
  .pulse-status { display: none; }
}

@media (max-width: 720px) {
  .menu-shell { transform: translateY(-1vh); }
  .menu-actions { margin-top: 34px; }
  .record-strip { margin-top: 32px; padding-right: 8px; padding-left: 8px; }
  .record-strip span { font-size: 7px; letter-spacing: 0.1em; }
  .record-strip strong { font-size: 14px; }
  .menu-footer span:nth-child(1), .menu-footer span:nth-child(3) { display: none; }
  .menu-footer { justify-content: center; }
  .hud { padding-right: 12px; padding-left: 12px; }
  .hud-top { grid-template-columns: 1fr auto 1fr; }
  .score-cluster { min-width: 103px; padding: 8px 10px; }
  .score-cluster strong { font-size: 18px; }
  .timer-cluster strong { font-size: 22px; }
  .icon-button { width: 41px; height: 41px; }
  .boss-cluster { top: 73px; width: calc(100% - 90px); }
  .boss-cluster > div:first-child span { display: none; }
  .combo-cluster { left: 12px; width: 105px; }
  .combo-copy strong { font-size: 19px; }
  .combo-cluster small { display: none; }
  .pulse-status { right: 12px; width: 108px; padding: 9px 8px; }
  .pulse-copy span { font-size: 6px; }
  .pulse-status small { display: none; }
  .pulse-status > kbd { bottom: 5px; }
  .hud-bottom { right: 12px; left: 12px; grid-template-columns: minmax(105px, 1fr) 48px minmax(105px, 1fr); gap: 6px; }
  .vitals, .dash-status { padding: 7px 8px; }
  .level-core { width: 46px; height: 46px; }
  .level-core svg { inset: 1px; }
  .bar-label span { font-size: 7px; letter-spacing: 0.09em; }
  .bar-label strong { font-size: 7px; }
  .upgrade-shell { max-height: 100%; overflow-y: auto; padding: 26px 0; }
  .upgrade-shell h2 { font-size: 30px; }
  .upgrade-options { margin-top: 14px; gap: 10px; }
  .keyboard-tip { display: none; }
  .upgrade-cards { grid-template-columns: 1fr; margin-top: 22px; gap: 9px; }
  .upgrade-card { min-height: 132px; padding: 17px 52px 17px 82px; }
  .upgrade-icon { position: absolute; top: 19px; left: 16px; width: 50px; height: 50px; margin: 0; font-size: 21px; }
  .upgrade-card h3 { margin: 7px 0 5px; font-size: 16px; }
  .upgrade-card p { font-size: 11px; }
  .upgrade-card footer { right: 16px; bottom: 12px; left: 82px; }
  .upgrade-index { top: 12px; right: 12px; }
  .modal-card, .results-card { max-height: calc(100vh - 28px); padding: 28px 22px; overflow-y: auto; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .protocol-row { grid-template-columns: 40px 1fr; padding: 10px; }
  .protocol-icon { width: 38px; height: 38px; }
  .protocol-buy { grid-column: 1 / -1; min-height: 34px; }
  .instruction-grid { grid-template-columns: 1fr; }
  .instruction { min-height: 100px; }
  .overdrive-banner { top: 18%; }
}

@media (max-height: 680px) and (min-width: 721px) {
  .logo { font-size: min(12vh, 84px); margin-top: 16px; }
  .menu-actions { margin-top: 28px; }
  .record-strip { margin-top: 28px; }
  .upgrade-card { min-height: 240px; }
  .upgrade-cards { margin-top: 22px; }
}

@media (max-height: 540px) and (orientation: landscape) {
  .menu-screen { padding: 12px 22px; }
  .logo { margin: 9px 0 6px; font-size: 53px; }
  .tagline { font-size: 10px; }
  .menu-actions { margin-top: 18px; }
  .button-xl { min-height: 50px; }
  .record-strip { margin-top: 16px; padding: 9px; }
  .menu-footer { margin-top: 9px; }
  .upgrade-shell { display: grid; grid-template-columns: 1fr 3fr; grid-template-rows: auto auto 1fr; align-items: center; gap: 2px 20px; }
  .upgrade-shell .eyebrow, .upgrade-shell h2, .upgrade-shell > p { grid-column: 1; }
  .upgrade-shell h2 { font-size: 26px; }
  .upgrade-cards { grid-column: 2; grid-row: 1 / 4; margin: 0; }
  .upgrade-card { min-height: 245px; padding: 17px; }
  .upgrade-card h3 { margin-top: 18px; }
  .keyboard-tip { display: none; }
  .upgrade-options { grid-column: 1; margin-top: 8px; }
  .info-card { width: min(850px, 100%); }
  .instruction-grid { grid-template-columns: 1fr 1fr; margin: 13px 0; }
  .instruction { min-height: 86px; }
  .instruction p { font-size: 9px; }
  .pro-tip { display: none; }
  .touch-controls { bottom: 18px; }
  .joystick { width: 88px; height: 88px; }
  .touch-dash { width: 74px; height: 74px; }
  .touch-pulse { width: 62px; height: 62px; }
}

#app[data-reduced-motion="true"] *,
#app[data-reduced-motion="true"] *::before,
#app[data-reduced-motion="true"] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 1ms !important;
}

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

/* ================================================================== */
/* PIXELFORGE THEME — premium pixel-art skin (generated asset pack)   */
/* Layered on top of the base layout rules; later rules win.          */
/* ================================================================== */

@font-face {
  font-family: "Break Pixel";
  src: url("./assets/fonts/BreakPixel.woff2") format("woff2"),
       url("./assets/fonts/BreakPixel.ttf") format("truetype");
  font-display: swap;
}

:root {
  --font-pixel: "Break Pixel", "Courier New", monospace;
  --steel: #39418a;
  --steel-hi: #5560b3;
  --deep: #0d0f24;
}

img {
  image-rendering: pixelated;
}

#app {
  background: #070711 url("./assets/arena-keyart-hd.png") center / cover no-repeat;
  image-rendering: pixelated;
}

.scanlines {
  opacity: 0.22;
}

/* ------------------------------------------------ pixel typography */
.eyebrow,
.button,
kbd,
.tagline,
.record-strip span,
.record-strip strong,
.menu-footer,
.hud-label,
#score-value,
.timer-cluster span,
.timer-cluster strong,
.combo-copy span,
.combo-copy strong,
.combo-cluster small,
.pulse-copy span,
.pulse-copy strong,
.pulse-status small,
.bar-label span,
.bar-label strong,
.level-core span,
.level-core strong,
.boss-cluster span,
.boss-cluster strong,
.overdrive-banner span,
.overdrive-banner small,
.upgrade-shell h2,
.modal-card h2,
.results-card h2,
.upgrade-card h3,
.upgrade-card footer span,
.upgrade-card footer strong,
.upgrade-index,
.keyboard-tip,
.reroll-button,
.final-score span,
.final-score strong,
.final-score em,
.result-grid span,
.result-grid strong,
.results-actions .button,
.instruction strong,
.key-art,
.dash-art small,
.chain-art,
.pro-tip span,
.protocol-copy header strong,
.protocol-copy header em,
.protocol-buy,
.armory-balance span,
.armory-balance strong,
.setting-row strong,
.text-button,
.toast strong,
.touch-pulse span,
.touch-dash span {
  font-family: var(--font-pixel);
  font-weight: 400;
}

.eyebrow { font-size: 8px; letter-spacing: 2px; }
.tagline { font-size: 8px; letter-spacing: 3px; }
.menu-footer { font-size: 8px; letter-spacing: 1px; }
.record-strip span { font-size: 8px; letter-spacing: 1px; }
.record-strip strong { font-size: 16px; }
.hud-label, .timer-cluster span, .combo-copy span, .pulse-copy span,
.bar-label span, .bar-label strong, .boss-cluster span, .level-core span,
.combo-cluster small, .pulse-status small { font-size: 8px; letter-spacing: 1px; }
#score-value { font-size: 24px; }
.timer-cluster strong { font-size: 16px; }
.combo-copy strong { font-size: 16px; }
.pulse-copy strong { font-size: 8px; letter-spacing: 1px; }
.level-core strong { font-size: 16px; }
.boss-cluster strong { font-size: 16px; letter-spacing: 1px; }
.overdrive-banner span { font-size: 24px; letter-spacing: 4px; }
.overdrive-banner small { font-size: 8px; letter-spacing: 2px; }
.upgrade-shell h2, .modal-card h2, .results-card h2 { font-size: 24px; letter-spacing: 1px; }
.upgrade-card h3 { font-size: 16px; letter-spacing: 0; }
.upgrade-card footer span, .upgrade-card footer strong { font-size: 8px; letter-spacing: 1px; }
.upgrade-index { font-size: 8px; }
.keyboard-tip { font-size: 8px; letter-spacing: 1px; }
.reroll-button { font-size: 8px; letter-spacing: 1px; }
.final-score span { font-size: 8px; letter-spacing: 2px; }
.final-score strong { font-size: 40px; }
.final-score em { font-size: 8px; letter-spacing: 1px; }
.result-grid span { font-size: 8px; letter-spacing: 1px; }
.result-grid strong { font-size: 16px; }
.instruction strong { font-size: 8px; letter-spacing: 1px; }
.pro-tip span { font-size: 8px; }
.protocol-copy header strong { font-size: 8px; letter-spacing: 1px; }
.protocol-copy header em { font-size: 8px; }
.protocol-buy { font-size: 8px; letter-spacing: 1px; }
.armory-balance span { font-size: 8px; letter-spacing: 1px; }
.armory-balance strong { font-size: 16px; }
.setting-row strong { font-size: 8px; letter-spacing: 1px; }
.text-button { font-size: 8px; letter-spacing: 1px; }
.toast strong { font-size: 8px; letter-spacing: 1px; }
.button { font-size: 8px; letter-spacing: 1px; }
.button-xl { font-size: 16px; letter-spacing: 1px; }
kbd { font-size: 8px; }

/* ------------------------------------------------------- the logo */
.logo {
  margin: 26px 0 14px;
  filter: drop-shadow(0 0 22px rgba(255, 63, 159, 0.28)) drop-shadow(0 0 30px rgba(36, 245, 206, 0.16));
}

.logo img {
  width: min(624px, 86vw);
  height: auto;
  image-rendering: pixelated;
}

/* ------------------------------------------------- panel surfaces */
.glass-panel,
.toast,
.boss-cluster,
.combo-cluster,
.protocol-row {
  border: 10px solid transparent;
  border-image: url("./assets/ui/panel.png") 10 fill stretch;
  border-radius: 0;
  background: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.modal-card,
.results-card {
  border: 24px solid transparent;
  border-image: url("./assets/ui/panel_modal.png") 12 fill stretch;
  border-radius: 0;
  background: none;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.42), 0 30px 90px rgba(0, 0, 0, 0.55);
}

.modal-card::before,
.results-card::before {
  border-radius: 0;
}

.upgrade-card {
  border: 12px solid transparent;
  border-image: url("./assets/ui/panel_card.png") 10 fill stretch;
  border-radius: 0;
  background: none;
}

.upgrade-card:hover,
.upgrade-card:focus-visible {
  border-image: url("./assets/ui/panel_card.png") 10 fill stretch;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 26px color-mix(in srgb, var(--card-color, var(--cyan)) 36%, transparent);
  transform: translateY(-4px);
}

.upgrade-card::before,
.upgrade-card::after {
  border-radius: 0;
}

.reroll-button,
.armory-balance {
  border: 10px solid transparent;
  border-image: url("./assets/ui/panel_gold.png") 10 fill stretch;
  border-radius: 0;
  background: none;
  color: var(--gold);
}

/* ---------------------------------------------------------- buttons */
.button {
  border: 10px solid transparent;
  border-image: url("./assets/ui/btn_ghost.png") 5 fill stretch;
  border-radius: 0;
  background: none;
  color: var(--cyan-soft);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.button:hover {
  border-image: url("./assets/ui/btn_ghost.png") 5 fill stretch;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4);
}

.button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.button-primary,
.button-primary:hover {
  border-image: url("./assets/ui/btn_danger.png") 5 fill stretch;
  color: #fff;
  text-shadow: 0 2px 0 rgba(5, 6, 15, 0.6);
  background: none;
}

.button-primary { box-shadow: 0 4px 0 rgba(92, 12, 58, 0.9), 0 10px 34px rgba(255, 38, 139, 0.3); }
.button-primary:hover { box-shadow: 0 6px 0 rgba(92, 12, 58, 0.9), 0 14px 44px rgba(255, 38, 139, 0.45); }
.button-primary:active { box-shadow: 0 1px 0 rgba(92, 12, 58, 0.9); }

.button-danger {
  border-image: none;
  border: 2px solid rgba(255, 77, 103, 0.4);
  color: #ff8293;
  background: rgba(255, 77, 103, 0.07);
  padding-top: 8px;
  padding-bottom: 8px;
}

.button kbd { background: rgba(5, 6, 15, 0.5); }

kbd {
  border: 1px solid var(--steel);
  border-bottom: 3px solid #05060f;
  border-radius: 0;
  background: var(--deep);
  color: var(--cyan-soft);
  box-shadow: none;
}

.modal-close {
  color: transparent;
  background: url("./assets/icons/close.png") center / 24px no-repeat;
  image-rendering: pixelated;
  border-radius: 0;
}

.modal-close:hover { filter: brightness(1.5); }

.text-button { color: var(--muted); }

/* ----------------------------------------------------------- meters */
.meter,
.combo-track,
.boss-track,
.pulse-track {
  height: 12px;
  border: 2px solid #05060f;
  border-radius: 0;
  background: var(--deep);
  box-shadow: 0 0 0 1px var(--steel);
  overflow: hidden;
}

.combo-track { height: 8px; }
.pulse-track { height: 10px; }

.meter i,
.combo-track i,
.boss-track i,
.pulse-track i,
.meter em {
  border-radius: 0;
}

.health-meter i {
  background: repeating-linear-gradient(90deg, #24f5ce 0 10px, #17c4a8 10px 20px);
  box-shadow: none;
}

.dash-meter i {
  background: repeating-linear-gradient(90deg, #9affea 0 10px, #24f5ce 10px 20px);
}

.combo-track i {
  background: repeating-linear-gradient(90deg, #ffd166 0 8px, #d99b2e 8px 16px);
}

.pulse-track i {
  background: repeating-linear-gradient(90deg, #ff8cc5 0 8px, #ff3f9f 8px 16px);
}

.boss-track i {
  background: repeating-linear-gradient(90deg, #ff4d67 0 10px, #d4304d 10px 20px);
}

/* ------------------------------------------------------ icon slots */
.upgrade-icon {
  border-radius: 0;
  border: 2px solid color-mix(in srgb, var(--card-color, var(--cyan)) 45%, transparent);
  background: rgba(5, 6, 15, 0.55);
  text-shadow: none;
  width: 64px;
  height: 64px;
}

.upgrade-icon img { width: 48px; height: 48px; }

.toast-icon {
  border-radius: 0;
  border: 1px solid var(--steel);
  background: var(--deep);
}

.toast-icon img { width: 24px; height: 24px; }

.protocol-icon img { width: 40px; height: 40px; }

/* ---------------------------------------------------------- switch */
.switch { width: 46px; height: 22px; }

.switch i {
  border: 2px solid var(--steel);
  border-radius: 0;
  background: var(--deep);
}

.switch i::after {
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: #51516f;
}

.switch input:checked + i {
  border-color: var(--cyan);
  background: rgba(36, 245, 206, 0.14);
}

.switch input:checked + i::after {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(36, 245, 206, 0.8);
  transform: translateX(24px);
}

/* ------------------------------------------------------ status dot */
.status-dot { border-radius: 0; }

/* ----------------------------------------------------- touch pads */
.touch-pulse,
.touch-dash {
  border-radius: 0;
  border: 3px solid rgba(36, 245, 206, 0.5);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

.touch-pulse { border-color: rgba(255, 63, 159, 0.55); }

.joystick {
  border-radius: 0;
  border: 3px solid rgba(85, 96, 179, 0.55);
}

#joystick-knob { border-radius: 0; }

/* ------------------------------------------------------- upgrade UI */
.upgrade-index {
  border-radius: 0;
  border: 1px solid var(--steel);
  background: var(--deep);
  color: var(--cyan-soft);
}

.protocol-buy {
  border-radius: 0;
  font-family: var(--font-pixel);
}

/* ------------------------------------------------------ score pop */
.score-pop { font-family: var(--font-pixel); font-size: 8px; }

#wave-label { font-family: var(--font-pixel); font-size: 8px; letter-spacing: 1px; }

#achievement-count { font-family: var(--font-pixel); font-size: 8px; }

.dash-art { font-family: var(--font-pixel); }

/* ---------------------------------------------- HUD de-clutter pass */
.hud { opacity: 0.97; }

.glass-panel,
.boss-cluster,
.combo-cluster {
  border: 6px solid transparent;
  border-image: url("./assets/ui/panel_hud.png") 6 fill stretch;
  box-shadow: none;
  backdrop-filter: none;
}

.score-cluster { min-width: 122px; padding: 5px 10px; }
#score-value { font-size: 16px; }
.timer-cluster strong { font-size: 16px; }
.icon-button { width: 38px; height: 38px; opacity: 0.8; }
.combo-cluster { width: 118px; }
.pulse-status { width: 126px; padding: 8px 9px 7px; opacity: 0.55; }
.pulse-status.ready { opacity: 1; }
.hud-bottom { grid-template-columns: minmax(140px, 210px) 52px minmax(140px, 210px); gap: 10px; }
.vitals, .dash-status { padding: 6px 9px 7px; }
.boss-cluster { top: 78px; width: min(380px, calc(100% - 230px)); }

/* toasts: compact + tucked away during a run */
#app[data-state="playing"] .toast-layer {
  width: min(252px, calc(100% - 36px));
  gap: 6px;
}

#app[data-state="playing"] .toast {
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 7px 10px;
  opacity: 0.94;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

#app[data-state="playing"] .toast-icon { width: 28px; height: 28px; }
#app[data-state="playing"] .toast-icon img { width: 20px; height: 20px; }
#app[data-state="playing"] .toast span { font-size: 8.5px; }

/* ------------------------------------------------- premium polish pass */
.logo img {
  animation: logo-float 5.2s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); filter: none; }
  50% { transform: translateY(-6px); filter: brightness(1.07); }
}

@media (prefers-reduced-motion: reduce) {
  .logo img { animation: none; }
}

.eyebrow {
  border: 1px solid rgba(255, 63, 159, 0.3);
  background: rgba(255, 63, 159, 0.07);
  padding: 5px 10px 4px;
}

.eyebrow.cyan {
  border-color: rgba(36, 245, 206, 0.3);
  background: rgba(36, 245, 206, 0.06);
}

.menu-footer span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 8, 22, 0.6);
  padding: 5px 9px 4px;
}

.strip-ic {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -3px;
  image-rendering: pixelated;
}

.record-strip strong { color: var(--cyan-soft); }

.button-ghost::after {
  content: "▸";
  margin-left: 2px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.button-ghost:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.upgrade-shell h2,
.modal-card h2,
.results-card h2 {
  text-shadow: 0 3px 0 rgba(5, 6, 15, 0.8), 0 0 26px rgba(36, 245, 206, 0.18);
}

/* upgrade cards: colored top strip + level pips */
.upgrade-card {
  box-shadow: inset 0 3px 0 var(--card-color, var(--cyan)), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.upgrade-card:hover,
.upgrade-card:focus-visible {
  box-shadow: inset 0 3px 0 var(--card-color, var(--cyan)), 0 6px 0 rgba(0, 0, 0, 0.4),
              0 0 26px color-mix(in srgb, var(--card-color, var(--cyan)) 36%, transparent);
}

.level-pips {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.level-pips .pip {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.level-pips .pip.on {
  background: var(--card-color, var(--cyan));
  border-color: var(--card-color, var(--cyan));
}

.level-pips .pip.next {
  border-color: var(--card-color, var(--cyan));
  background: color-mix(in srgb, var(--card-color, var(--cyan)) 34%, transparent);
  animation: pip-blink 1s steps(2) infinite;
}

@keyframes pip-blink {
  50% { background: var(--card-color, var(--cyan)); }
}

/* toasts: colored signal edge */
.toast {
  border-left: 3px solid var(--cyan);
}

/* protocol lab: scrollable list w/ pixel scrollbar */
.protocol-list {
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #39418a #0b0d20;
}

.protocol-list::-webkit-scrollbar { width: 10px; }
.protocol-list::-webkit-scrollbar-track { background: #0b0d20; border: 1px solid #181c3d; }
.protocol-list::-webkit-scrollbar-thumb { background: #39418a; border: 2px solid #0b0d20; }
.protocol-list::-webkit-scrollbar-thumb:hover { background: #5560b3; }

/* settings rows: icons */
.setting-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
}

.setting-ic {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  border: 1px solid var(--steel);
  background: var(--deep);
  padding: 3px;
}

.boss-cluster .strip-ic { width: 12px; height: 12px; vertical-align: -2px; }

.armory-balance strong { color: var(--gold); }

kbd { color: #05060f; background: rgba(255, 255, 255, 0.85); border-color: rgba(255,255,255,0.9); border-bottom-color: #9aa; }
.button-ghost kbd, .pulse-status kbd, .instruction kbd, .keyboard-tip kbd, .pro-tip kbd, .pause-card kbd {
  color: var(--cyan-soft); background: var(--deep); border-color: var(--steel); border-bottom-color: #05060f;
}

/* ================================================================== */
/* V2.0 ASCENDANT — hangar, contracts, victory, ascension              */
/* ================================================================== */

.secondary-actions.four { grid-template-columns: repeat(4, 1fr); }
.hangar-cta { color: var(--gold); }

.loadout-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 12px 5px;
  border: 1px solid var(--steel);
  background: rgba(7, 8, 22, 0.7);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--cyan-soft);
}

.loadout-chip img { width: 16px; height: 16px; image-rendering: pixelated; }
.loadout-chip span { color: var(--muted); }

/* ---------------------------------------------------------- ascension */
.ascension-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px auto 0;
  font-family: var(--font-pixel);
}

.asc-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--gold);
}

.asc-label img { width: 14px; height: 14px; image-rendering: pixelated; }

.asc-chip {
  width: 26px;
  height: 26px;
  border: 1px solid var(--steel);
  background: var(--deep);
  color: var(--muted);
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
  transition: transform 120ms ease;
}

.asc-chip:hover { transform: translateY(-2px); border-color: var(--gold); }
.asc-chip.lit { border-color: rgba(255, 209, 102, 0.5); color: var(--gold); background: rgba(255, 209, 102, 0.08); }
.asc-chip.active { border-color: var(--gold); color: #05060f; background: var(--gold); box-shadow: 0 0 14px rgba(255, 209, 102, 0.4); }
.asc-hint { font-size: 8px; letter-spacing: 1px; color: var(--muted); font-style: normal; margin-left: 4px; }

/* -------------------------------------------------------------- hangar */
.hangar-card-shell { width: min(880px, calc(100% - 32px)); }

.hangar-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 12px;
}

.hangar-tab {
  padding: 9px 0 8px;
  border: 1px solid var(--steel);
  background: var(--deep);
  color: var(--muted);
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 2px;
  cursor: pointer;
}

.hangar-tab.active { border-color: var(--cyan); color: var(--cyan); background: rgba(36, 245, 206, 0.08); }

.hangar-pane { display: none; max-height: 46vh; overflow-y: auto; padding: 2px 6px 2px 2px;
  scrollbar-width: thin; scrollbar-color: #39418a #0b0d20; }
.hangar-pane.active { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 10px; }
.hangar-pane h4 { grid-column: 1 / -1; margin: 8px 0 0; font-family: var(--font-pixel); font-size: 8px;
  letter-spacing: 2px; color: var(--muted); }

.hangar-card {
  position: relative;
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 14px 10px 12px;
  border: 10px solid transparent;
  border-image: url("./assets/ui/panel.png") 10 fill stretch;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: transform 130ms ease;
}

.hangar-card:hover { transform: translateY(-3px); }
.hangar-card b { font-family: var(--font-pixel); font-size: 8px; letter-spacing: 1px; }
.hangar-card p { margin: 0; color: #9696b2; font-size: 10.5px; line-height: 1.45; min-height: 30px; }
.hangar-card em {
  font-family: var(--font-pixel); font-size: 8px; font-style: normal; letter-spacing: 1px;
  padding: 5px 10px 4px; border: 1px solid var(--steel); color: var(--cyan-soft); background: var(--deep);
}

.hangar-ic { display: grid; place-items: center; width: 46px; height: 46px;
  border: 2px solid rgba(36, 245, 206, 0.3); background: rgba(5, 6, 15, 0.6); }
.hangar-ic img { width: 32px; height: 32px; image-rendering: pixelated; }
.hangar-ship img { height: 42px; image-rendering: pixelated; }

.hangar-card.equipped { border-image: url("./assets/ui/panel_card.png") 10 fill stretch; }
.hangar-card.equipped em { border-color: var(--cyan); color: #05060f; background: var(--cyan); }
.hangar-card.locked { opacity: 0.82; }
.hangar-card.locked em { color: var(--gold); border-color: rgba(255, 209, 102, 0.5); }
.hangar-card.locked[data-poor="1"] em { color: var(--danger); border-color: rgba(255, 77, 103, 0.4); }

/* ------------------------------------------------------------ contracts */
.beacon-objective .contract-extra {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-family: var(--font-pixel);
}

.contract-extra b { font-size: 8px; letter-spacing: 1px; }
.contract-extra span { font-size: 8px; color: var(--muted); }
.ct-bar { display: block; height: 6px; border: 1px solid #05060f; background: var(--deep);
  box-shadow: 0 0 0 1px var(--steel); }
.ct-bar em { display: block; height: 100%; transition: width 120ms linear; }

/* -------------------------------------------------------------- victory */
.victory-actions { display: grid; gap: 10px; margin-top: 6px; }

.gameover-screen .victory-actions .button, #victory-actions .button { width: 100%; }

.button-overclock,
.button-overclock:hover {
  border-image: none;
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.16), rgba(255, 63, 159, 0.1));
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(5, 6, 15, 0.7);
}

.button-overclock:hover { box-shadow: 0 0 26px rgba(255, 209, 102, 0.3); transform: translateY(-2px); }

.victory .eyebrow { border-color: rgba(255, 209, 102, 0.5); background: rgba(255, 209, 102, 0.1); color: var(--gold); }
.victory h2 { color: var(--gold); text-shadow: 0 3px 0 rgba(5, 6, 15, 0.8), 0 0 30px rgba(255, 209, 102, 0.35); }

/* --------------------------------------------------- restored v2 UI layer */
.menu-actions {
  width: min(560px, 100%);
  margin-top: 30px;
}

.button-daily {
  display: grid;
  width: 100%;
  min-height: 46px;
  grid-template-columns: 1fr auto;
  margin-top: 9px;
  border-color: rgba(36, 245, 206, 0.38);
  padding: 0 16px;
  color: var(--cyan-soft);
  background: linear-gradient(90deg, rgba(36, 245, 206, 0.08), rgba(138, 112, 255, 0.08));
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.button-daily > span { justify-self: start; }
.button-daily small { display: flex; align-items: center; gap: 12px; font: inherit; letter-spacing: 1px; }
.button-daily em { color: var(--muted); font-style: normal; }
.button-daily b { color: var(--cyan); font-weight: 400; }
.button-daily strong { color: var(--ink); font-weight: 400; }

.secondary-actions.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.secondary-actions.four .button {
  min-width: 0;
  min-height: 46px;
  white-space: nowrap;
}

.loadout-chip {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--loadout-color, var(--cyan)) 48%, var(--steel));
  border-left: 3px solid var(--loadout-color, var(--cyan));
  padding: 8px 12px 7px;
  color: var(--cyan-soft);
  background: linear-gradient(90deg, color-mix(in srgb, var(--loadout-color, var(--cyan)) 10%, transparent), rgba(7, 8, 22, 0.78) 42%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
  font-family: var(--font-pixel);
}

.loadout-chip .loadout-label { color: var(--muted); font-size: 7px; letter-spacing: 1.5px; }
.loadout-chip strong { display: inline-flex; min-width: 0; align-items: center; gap: 8px; color: var(--loadout-color, var(--cyan)); font-size: 8px; font-weight: 400; letter-spacing: 1px; }
.loadout-chip img { width: 20px; height: 20px; flex: none; image-rendering: pixelated; }
.loadout-chip .loadout-system { overflow: hidden; color: #9494b2; font-size: 7px; letter-spacing: 0.7px; text-overflow: ellipsis; white-space: nowrap; }

.record-strip { margin-top: 28px; }
.menu-footer { margin-top: 14px; }

/* --------------------------------------------------- game feel feedback */
.low-health-vignette {
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 44%, rgba(188, 8, 45, 0.2) 71%, rgba(137, 3, 32, 0.72) 100%);
  transition: opacity 220ms ease;
}

#app.low-health .low-health-vignette { opacity: 1; animation: low-health-pulse 1.05s ease-in-out infinite; }

@keyframes low-health-pulse { 50% { opacity: 0.48; } }

/* ---------------------------------------------------------- objectives */
.beacon-objective {
  position: absolute;
  z-index: 8;
  top: 78px;
  left: 50%;
  display: grid;
  min-width: 240px;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  border-color: rgba(36, 245, 206, 0.32);
  padding: 8px 12px;
  transform: translateX(-50%);
}

.boss-cluster:not([hidden]) + .beacon-objective { top: 142px; }
.beacon-objective > span { color: var(--cyan); font-size: 16px; filter: drop-shadow(0 0 7px var(--cyan)); }
.beacon-objective > div { display: grid; gap: 3px; text-align: left; }
.beacon-objective small, .beacon-objective strong { font-family: var(--font-pixel); font-size: 8px; letter-spacing: 1px; }
.beacon-objective small { color: var(--muted); }
.beacon-objective strong { color: var(--cyan-soft); font-weight: 400; }

/* --------------------------------------------------------- build recap */
.build-recap {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 0;
  text-align: left;
}

.build-recap header { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-pixel); font-size: 7px; letter-spacing: 1px; }
.build-recap header span { color: var(--cyan-soft); }
.build-recap header strong { color: var(--muted); font-weight: 400; }
.build-recap-list { display: grid; max-height: 142px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow-y: auto; }
.build-recap.compact .build-recap-list { max-height: 96px; }
.build-chip { display: grid; min-width: 0; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; border: 1px solid var(--steel); padding: 5px 7px; background: rgba(7, 8, 22, 0.72); font-family: var(--font-pixel); }
.build-chip img { width: 26px; height: 26px; image-rendering: pixelated; }
.build-chip b { overflow: hidden; color: var(--ink); font-size: 7px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.build-chip em { color: var(--cyan); font-size: 7px; font-style: normal; }
.build-chip.evolution { border-color: rgba(255, 209, 102, 0.5); background: rgba(255, 209, 102, 0.06); }
.build-chip.evolution em { color: var(--gold); }

/* -------------------------------------------------- golden evolutions */
.upgrade-card.evolution-card { border-image: none; border: 2px solid var(--gold); background: linear-gradient(150deg, rgba(255, 209, 102, 0.15), rgba(255, 63, 159, 0.07) 52%, rgba(9, 9, 24, 0.95)); box-shadow: 0 0 30px rgba(255, 209, 102, 0.12); }
.evolution-card::after { position: absolute; inset: 0; content: ""; pointer-events: none; background: linear-gradient(110deg, transparent 25%, rgba(255, 244, 190, 0.14) 48%, transparent 68%); transform: translateX(-100%); animation: evolution-glint 2.8s ease-in-out infinite; }
.evolution-kicker { color: var(--gold); font-family: var(--font-pixel); font-size: 7px; letter-spacing: 2px; }
@keyframes evolution-glint { 55%, 100% { transform: translateX(100%); } }

/* -------------------------------------------------------- hangar polish */
.hangar-pane[data-pane="ships"].active { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hangar-card { align-content: start; }
.hangar-card p { min-height: 46px; }
.hangar-stats { display: flex; min-height: 18px; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; }
.hangar-stats i { border: 1px solid rgba(36, 245, 206, 0.22); padding: 3px 5px 2px; color: var(--muted); background: rgba(36, 245, 206, 0.035); font-family: var(--font-pixel); font-size: 6px; font-style: normal; letter-spacing: 0.7px; }
.hangar-card.equipped .hangar-stats i { border-color: rgba(36, 245, 206, 0.45); color: var(--cyan-soft); }

@media (max-width: 760px) {
  .menu-actions { width: min(500px, 100%); margin-top: 24px; }
  .secondary-actions.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-strip { margin-top: 22px; }
  .hangar-pane[data-pane="ships"].active { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .beacon-objective { top: 72px; min-width: 210px; padding: 6px 10px; }
  .boss-cluster:not([hidden]) + .beacon-objective { top: 124px; }
  .build-recap-list, .build-recap.compact .build-recap-list { grid-template-columns: 1fr; max-height: 112px; }
  .build-chip { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .build-chip img { width: 22px; height: 22px; }
}

@media (max-width: 460px) {
  .menu-screen { padding-right: 14px; padding-left: 14px; }
  .logo { margin-top: 17px; }
  .button-daily { grid-template-columns: 1fr; gap: 5px; padding-top: 8px; padding-bottom: 8px; }
  .button-daily > span, .button-daily small { justify-self: center; }
  .secondary-actions.four .button { padding-right: 7px; padding-left: 7px; font-size: 8px; letter-spacing: 0.8px; }
  .loadout-chip { grid-template-columns: auto 1fr; }
  .loadout-chip .loadout-label { grid-column: 1 / -1; }
  .loadout-chip .loadout-system { display: none; }
  .hangar-pane[data-pane="ships"].active { grid-template-columns: 1fr; }
}

@media (max-height: 760px) and (min-width: 721px) {
  .menu-actions { margin-top: 18px; }
  .secondary-actions.four .button { min-height: 40px; }
  .record-strip { margin-top: 18px; padding-top: 11px; padding-bottom: 11px; }
  .menu-footer { margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  #app.low-health .low-health-vignette, .boss-cluster.phase-two, .evolution-card::after { animation: none; }
}

/* ================================================================ */
/* V2.1 OVERDRIVE — tactical cards, mastery and run intelligence      */
/* ================================================================ */
.hangar-tabs { grid-template-columns: repeat(3, 1fr); }
.weapon-kicker {
  color: var(--cyan-soft); font-family: var(--font-pixel); font-size: 7px; letter-spacing: 1.5px;
}
.upgrade-tags { display: flex; min-height: 20px; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 8px 0 2px; }
.upgrade-tags i {
  border: 1px solid color-mix(in srgb, var(--card-color) 45%, var(--steel)); padding: 3px 5px 2px;
  color: color-mix(in srgb, var(--card-color) 72%, white); background: rgba(5, 6, 15, 0.46);
  font-family: var(--font-pixel); font-size: 6px; font-style: normal; letter-spacing: 0.8px;
}
.banish-button { color: var(--pink-soft); border-color: rgba(255, 63, 159, 0.35); }
.banish-button:disabled { opacity: 0.35; }
.seed-button { width: 100%; min-height: 38px; margin: 0 0 9px; font-size: 8px; }
.codex-pane.active { display: block; text-align: left; }
.codex-pane h4 { margin: 10px 0 7px; color: var(--gold); }
.mastery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mastery-grid article {
  display: grid; grid-template-columns: 1fr auto; gap: 7px; border: 1px solid var(--steel);
  padding: 10px; background: rgba(7, 8, 22, 0.78); font-family: var(--font-pixel);
}
.mastery-grid b, .mastery-grid strong { font-size: 8px; font-weight: 400; }
.mastery-grid b { color: var(--cyan-soft); } .mastery-grid strong { color: var(--gold); }
.mastery-grid span { grid-column: 1 / -1; color: var(--muted); font-size: 7px; }
.codex-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codex-summary span { border: 1px solid var(--steel); padding: 10px; color: var(--cyan-soft); background: var(--deep); font-family: var(--font-pixel); font-size: 7px; text-align: center; }
.history-list { display: grid; gap: 5px; max-height: 150px; overflow-y: auto; }
.history-list > span { display: grid; grid-template-columns: 1fr auto; gap: 5px; border-bottom: 1px solid rgba(255,255,255,.08); padding: 7px; font-family: var(--font-pixel); }
.history-list b, .history-list em { font-size: 7px; font-style: normal; font-weight: 400; }
.history-list b { color: var(--cyan-soft); } .history-list em { color: var(--gold); }
.history-list small { grid-column: 1 / -1; color: var(--muted); font-size: 6px; }

@media (max-width: 560px) {
  .hangar-tabs { grid-template-columns: repeat(2, 1fr); }
  .mastery-grid, .codex-summary { grid-template-columns: 1fr; }
}

#app.evolution-installed::after {
  position: absolute; z-index: 60; inset: 0; content: ""; pointer-events: none;
  background: radial-gradient(circle at center, rgba(255,255,255,.82), rgba(255,209,102,.3) 22%, rgba(138,112,255,.16) 48%, transparent 72%);
  animation: evolution-install 760ms cubic-bezier(.16,.8,.24,1) both;
}
@keyframes evolution-install { 0% { opacity: 0; transform: scale(.55); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { #app.evolution-installed::after { animation: none; opacity: 0; } }
