:root {
  --ice: #d9f2fb;
  --frost: #a9d8e8;
  --cyan: #7ed4ea;
  --cyan-bright: #c3f3ff;
  --ink: #071116;
  --ink-soft: #0c181e;
  --line: rgba(173, 219, 235, 0.24);
  --line-soft: rgba(173, 219, 235, 0.12);
  --muted: #7f9aa5;
  --paper: #e8f4f8;
  --blood: #ff5a44;
  --blood-dim: #b7392e;
  --amber: #f2c58d;
  --font-ui: "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-display: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #071116;
  color: var(--paper);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
}

body {
  overscroll-behavior: none;
}

button {
  font: inherit;
}

#stage,
#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  outline: none;
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------------------ */
/* Cinematic overlays / shared                                         */
/* ------------------------------------------------------------------ */

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  font-family: var(--font-ui);
  opacity: 0;
  animation: hud-in 0.9s 0.15s ease forwards;
}

@keyframes hud-in {
  to { opacity: 1; }
}

.hud-grade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 44%, rgba(3, 9, 12, 0.18) 78%, rgba(2, 7, 9, 0.62) 100%),
    linear-gradient(180deg, rgba(1, 7, 10, 0.48) 0%, transparent 16%, transparent 78%, rgba(1, 7, 10, 0.54) 100%);
  pointer-events: none;
}

.hud-grade::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.hud-panel {
  position: absolute;
  background:
    linear-gradient(135deg, rgba(16, 33, 40, 0.74), rgba(5, 13, 17, 0.62)),
    rgba(5, 14, 18, 0.54);
  border: 1px solid var(--line);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(218, 246, 255, 0.08);
  backdrop-filter: blur(12px) saturate(0.8);
  -webkit-backdrop-filter: blur(12px) saturate(0.8);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.hud-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 54px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(126, 212, 234, 0.55);
}

.panel-kicker {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}

.live-dot,
.telemetry-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: blink 2.4s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.25; }
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(189, 228, 240, 0.28);
  border-bottom-color: rgba(189, 228, 240, 0.14);
  background: rgba(159, 206, 221, 0.08);
  color: var(--ice);
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.04em;
  line-height: 1;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------------ */
/* Mission panel                                                       */
/* ------------------------------------------------------------------ */

#mission-panel {
  left: 28px;
  top: 24px;
  width: 286px;
  padding: 16px 18px 14px;
}

.wave-number {
  display: flex;
  align-items: baseline;
  margin-top: 7px;
  font-family: "Bahnschrift Condensed", "Bahnschrift", var(--font-ui);
  line-height: 0.9;
}

#wave-num {
  font-size: 50px;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--ice);
  text-shadow: 0 0 28px rgba(137, 222, 248, 0.25);
}

.wave-total {
  font-size: 15px;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-left: 9px;
}

.wave-name {
  margin-top: 4px;
  font-size: 18px;
  letter-spacing: 0.16em;
  font-weight: 500;
  color: var(--cyan-bright);
}

.wave-pips {
  display: flex;
  gap: 4px;
  margin: 12px 0 11px;
}

.wave-pips i {
  flex: 1;
  height: 3px;
  background: rgba(162, 207, 222, 0.16);
  transform: skewX(-26deg);
  transition: background 0.4s, box-shadow 0.4s;
}

.wave-pips i.done {
  background: rgba(140, 208, 226, 0.46);
}

.wave-pips i.active {
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(126, 212, 234, 0.55);
}

.mission-meta {
  display: flex;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: #9db7c1;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.mission-meta b {
  color: var(--paper);
  font-weight: 600;
  font-size: 12px;
  margin-right: 2px;
}

.mission-meta .alert-stat b {
  color: var(--blood);
}

.mission-objective {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 10px;
  font-size: 10px;
  color: #a9c4ce;
  letter-spacing: 0.07em;
}

.obj-diamond {
  width: 6px;
  height: 6px;
  border: 1px solid var(--amber);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(242, 197, 141, 0.5);
}

#objective-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#objective-dist {
  color: var(--amber);
  font-size: 9px;
  letter-spacing: 0.1em;
}

/* ------------------------------------------------------------------ */
/* Compass                                                             */
/* ------------------------------------------------------------------ */

#compass-wrap {
  position: absolute;
  top: 22px;
  left: 50%;
  width: min(640px, 46vw);
  transform: translateX(-50%);
  opacity: 0.96;
}

.compass-shell {
  position: relative;
  height: 58px;
  background: linear-gradient(180deg, rgba(6, 16, 21, 0.62), rgba(6, 16, 21, 0.16));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
}

.compass-shell::before,
.compass-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 62px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 221, 240, 0.3));
}

.compass-shell::before {
  left: 0;
}

.compass-shell::after {
  right: 0;
  transform: rotate(180deg);
}

#compass {
  width: 100%;
  height: 58px;
  display: block;
}

.compass-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
  color: rgba(174, 204, 215, 0.64);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.compass-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
}

.legend-dot.dormant {
  border: 1px solid var(--cyan);
  transform: rotate(45deg);
}

.legend-dot.alerted {
  background: var(--blood);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--blood);
}

/* ------------------------------------------------------------------ */
/* Minimap                                                             */
/* ------------------------------------------------------------------ */

#minimap-wrap {
  top: 24px;
  right: 28px;
  width: 224px;
  padding: 11px 12px 9px;
}

.minimap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px 8px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.16em;
}

#map-range {
  color: rgba(163, 216, 231, 0.65);
}

.minimap-disc {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #0a171d;
  border: 1px solid rgba(169, 220, 235, 0.25);
  box-shadow:
    inset 0 0 26px rgba(1, 6, 8, 0.8),
    0 0 0 4px rgba(116, 177, 195, 0.04);
}

#minimap {
  width: 100%;
  height: 100%;
  display: block;
}

.map-north {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--cyan);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-shadow: 0 0 8px rgba(126, 212, 234, 0.6);
}

.map-ring-label {
  position: absolute;
  color: rgba(174, 214, 227, 0.3);
  font-size: 7px;
  pointer-events: none;
}

.map-ring-label.e { right: 7px; top: 50%; transform: translateY(-50%); }
.map-ring-label.s { bottom: 5px; left: 50%; transform: translateX(-50%); }
.map-ring-label.w { left: 7px; top: 50%; transform: translateY(-50%); }

.minimap-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 7px;
  color: rgba(162, 198, 210, 0.55);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.map-player-key {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 7px solid var(--cyan-bright);
  display: inline-block;
}

.map-boss-key {
  width: 7px;
  height: 7px;
  background: var(--blood);
  transform: rotate(45deg);
  margin-left: auto;
  box-shadow: 0 0 8px var(--blood);
}

/* ------------------------------------------------------------------ */
/* Bottom HUD                                                          */
/* ------------------------------------------------------------------ */

#health-panel {
  left: 28px;
  bottom: 28px;
  width: 300px;
  padding: 14px 17px 13px;
}

.health-readout {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 4px;
}

#health-value {
  font-family: "Bahnschrift Condensed", "Bahnschrift", var(--font-ui);
  font-size: 47px;
  font-weight: 300;
  line-height: 0.95;
  color: var(--ice);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(145, 225, 246, 0.2);
}

.health-unit {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.health-state {
  margin-left: auto;
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.health-track {
  position: relative;
  height: 8px;
  margin-top: 10px;
  background: rgba(158, 202, 216, 0.09);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

.health-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  transform-origin: left;
  transition: width 0.18s ease-out;
}

#health-lag {
  background: rgba(201, 90, 72, 0.28);
  filter: blur(3px);
}

#health-fill {
  background: linear-gradient(90deg, #7fd2e6, #d8f6ff);
  box-shadow: 0 0 14px rgba(130, 220, 244, 0.45);
}

.health-ticks {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(3, 11, 14, 0.44) 18px 20px);
  pointer-events: none;
}

.health-track.low #health-fill {
  background: linear-gradient(90deg, #b53b2f, #ff7a5e);
  box-shadow: 0 0 18px rgba(255, 90, 68, 0.45);
}

.vital-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: rgba(154, 188, 200, 0.58);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.vital-foot b {
  color: rgba(191, 226, 238, 0.85);
  font-weight: 500;
}

#regen-state {
  color: var(--cyan);
}

#weapon-panel {
  right: 28px;
  bottom: 28px;
  width: 340px;
  padding: 14px 17px 12px;
}

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

.weapon-index {
  font-family: "Bahnschrift Condensed", var(--font-ui);
  font-size: 26px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.weapon-id {
  flex: 1;
  min-width: 0;
}

#weapon-name {
  color: var(--ice);
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 500;
}

#weapon-type {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.fire-mode {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--cyan);
  border: 1px solid rgba(126, 212, 234, 0.24);
  padding: 4px 6px;
}

.ammo-readout {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  margin-top: -3px;
  line-height: 1;
}

#ammo-mag {
  font-family: "Bahnschrift Condensed", "Bahnschrift", var(--font-ui);
  font-size: 56px;
  font-weight: 300;
  letter-spacing: -0.035em;
  color: var(--ice);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(155, 230, 250, 0.18);
}

#ammo-reserve {
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.weapon-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 5px;
}

.weapon-slot {
  position: relative;
  padding: 6px 6px 5px;
  border: 1px solid var(--line-soft);
  background: rgba(130, 185, 201, 0.035);
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s;
}

.weapon-slot.active {
  border-color: rgba(137, 219, 240, 0.52);
  background: rgba(126, 212, 234, 0.08);
}

.weapon-slot.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.weapon-slot .slot-index {
  color: rgba(159, 191, 202, 0.5);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.weapon-slot .slot-name {
  display: block;
  margin-top: 1px;
  color: rgba(202, 231, 240, 0.8);
  font-size: 8px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weapon-slot .slot-ammo {
  position: absolute;
  right: 5px;
  top: 5px;
  color: rgba(173, 214, 227, 0.5);
  font-size: 7px;
  font-variant-numeric: tabular-nums;
}

.weapon-slot.active .slot-name {
  color: var(--ice);
}

.weapon-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  color: rgba(151, 184, 196, 0.5);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.weapon-foot kbd {
  min-width: 16px;
  height: 15px;
  font-size: 7px;
  padding: 0 3px;
  margin-right: 2px;
}

#weapon-ammo-hint {
  color: var(--cyan);
}

#weapon-ammo-hint.empty {
  color: var(--blood);
  animation: blink 1s infinite;
}

/* ------------------------------------------------------------------ */
/* Crosshair & feedback                                                */
/* ------------------------------------------------------------------ */

#crosshair {
  --gap: 9px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  transition: opacity 0.18s;
}

.cross-bar {
  position: absolute;
  display: block;
  background: rgba(226, 248, 255, 0.86);
  box-shadow: 0 0 6px rgba(25, 55, 66, 0.8);
}

.cross-bar.top,
.cross-bar.bottom {
  width: 1px;
  height: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.cross-bar.left,
.cross-bar.right {
  height: 1px;
  width: 7px;
  top: 50%;
  transform: translateY(-50%);
}

.cross-bar.top { top: calc(50% - var(--gap) - 7px); }
.cross-bar.bottom { bottom: calc(50% - var(--gap) - 7px); }
.cross-bar.left { left: calc(50% - var(--gap) - 7px); }
.cross-bar.right { right: calc(50% - var(--gap) - 7px); }

.cross-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  transform: translate(-50%, -50%);
  background: var(--cyan-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(168, 239, 255, 0.9);
}

#hud.is-scoped #crosshair {
  opacity: 0;
}

#hitmarker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0;
}

#hitmarker i {
  position: absolute;
  background: #fff;
  box-shadow: 0 0 8px rgba(208, 246, 255, 0.9);
}

#hitmarker i:nth-child(1),
#hitmarker i:nth-child(2) {
  width: 1px;
  height: 7px;
  left: 50%;
}

#hitmarker i:nth-child(1) { top: 0; }
#hitmarker i:nth-child(2) { bottom: 0; }

#hitmarker i:nth-child(3),
#hitmarker i:nth-child(4) {
  height: 1px;
  width: 7px;
  top: 50%;
}

#hitmarker i:nth-child(3) { left: 0; }
#hitmarker i:nth-child(4) { right: 0; }

#hitmarker.show {
  animation: hitmark 0.26s ease-out;
}

#hitmarker.headshot i {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(242, 197, 141, 0.85);
}

#hitmarker.kill i {
  background: var(--blood);
  box-shadow: 0 0 10px rgba(255, 90, 68, 0.8);
}

@keyframes hitmark {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1.35); }
  55% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(1); }
}

#center-status {
  position: absolute;
  left: 50%;
  top: calc(50% + 46px);
  transform: translateX(-50%);
  width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#reload-meter {
  width: 190px;
  padding: 8px 10px 9px;
  background: rgba(4, 13, 17, 0.72);
  border: 1px solid var(--line);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.reload-label {
  display: flex;
  justify-content: space-between;
  color: var(--frost);
  font-size: 8px;
  letter-spacing: 0.14em;
  margin-bottom: 5px;
}

#reload-time {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.reload-track {
  height: 2px;
  background: rgba(154, 207, 222, 0.15);
  overflow: hidden;
}

#reload-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transition: width 0.08s linear;
}

#action-hint {
  padding: 4px 9px;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--cyan-bright);
  background: rgba(5, 15, 19, 0.62);
  border: 1px solid rgba(126, 212, 234, 0.22);
}

#killfeed {
  position: absolute;
  right: 28px;
  top: 300px;
  width: 258px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.kill-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  background: linear-gradient(90deg, rgba(4, 12, 16, 0), rgba(4, 12, 16, 0.76));
  border-right: 1px solid rgba(155, 223, 243, 0.5);
  color: rgba(216, 241, 249, 0.88);
  font-size: 9px;
  letter-spacing: 0.08em;
  animation: feed-in 0.3s ease, feed-out 0.5s 2.6s ease forwards;
}

.kill-entry .kill-icon {
  width: 4px;
  height: 4px;
  transform: rotate(45deg);
  background: var(--cyan);
}

.kill-entry.head .kill-icon {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.kill-entry.boss {
  border-right-color: var(--blood);
  color: #ffd8ce;
}

.kill-entry.boss .kill-icon {
  background: var(--blood);
}

.kill-entry .kill-tag {
  color: var(--blood);
  font-size: 7px;
  letter-spacing: 0.12em;
}

@keyframes feed-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes feed-out {
  to { opacity: 0; transform: translateX(10px); }
}

#damage-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.dmg-number {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #e9fbff;
  font-family: "Bahnschrift Condensed", var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.03em;
  text-shadow: 0 0 9px rgba(7, 24, 30, 0.9);
  animation: dmg-float 0.75s ease-out forwards;
  pointer-events: none;
  white-space: nowrap;
}

.dmg-number.head {
  color: var(--amber);
  font-size: 18px;
}

.dmg-number.kill {
  color: var(--blood);
}

@keyframes dmg-float {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  15% { opacity: 1; transform: translate(-50%, -70%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(0.92); }
}

#damage-vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(107, 15, 18, 0.34) 76%, rgba(94, 7, 10, 0.78) 100%);
  transition: opacity 0.16s ease-out;
}

#low-health-vignette {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 48%, rgba(96, 16, 17, 0.44) 100%);
  transition: opacity 0.5s;
}

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

@keyframes low-pulse {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.95; }
}

#damage-direction {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 5px;
  opacity: 0;
  transform-origin: 50% 50%;
  background: linear-gradient(90deg, rgba(255, 90, 68, 0), rgba(255, 90, 68, 0.9));
  clip-path: polygon(0 50%, 100% 0, 92% 50%, 100% 100%);
  filter: drop-shadow(0 0 8px rgba(255, 70, 50, 0.6));
  transition: opacity 0.25s;
}

/* ------------------------------------------------------------------ */
/* Scope                                                               */
/* ------------------------------------------------------------------ */

#scope-overlay {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
  background: transparent;
  overflow: hidden;
}

#scope-overlay.active {
  display: block;
}

#hud > *:not(#scope-overlay):not(.hud-grade) {
  z-index: 2;
}

.scope-mask {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 50%,
      transparent 0,
      transparent min(32vh, 32vw),
      rgba(1, 5, 7, 0.08) calc(min(32vh, 32vw) + 2px),
      rgba(1, 5, 7, 0.94) calc(min(35vh, 35vw)),
      #000 calc(min(45vh, 45vw))
    );
}

.scope-mask::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(64vh, 64vw);
  height: min(64vh, 64vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 38%, rgba(183, 230, 245, 0.06), transparent 36%),
    radial-gradient(circle at center, rgba(84, 132, 148, 0.02), rgba(0, 8, 11, 0.16));
  border: 1px solid rgba(178, 225, 240, 0.16);
  box-shadow: inset 0 0 70px rgba(0, 5, 8, 0.5);
}

.scope-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(66vh, 66vw);
  height: min(66vh, 66vw);
  transform: translate(-50%, -50%);
  opacity: 0.85;
}

.scope-line {
  position: absolute;
  background: rgba(194, 234, 246, 0.58);
}

.scope-line.horizontal {
  left: 5%;
  right: 5%;
  top: 50%;
  height: 1px;
}

.scope-line.vertical {
  top: 5%;
  bottom: 5%;
  left: 50%;
  width: 1px;
}

.scope-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  transform: translate(-50%, -50%);
  background: var(--blood);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--blood);
}

.scope-tick {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 1px;
  background: rgba(191, 232, 244, 0.48);
  transform: translateX(-50%);
}

.scope-tick.t1 { top: 34%; }
.scope-tick.t2 { top: 30%; }
.scope-tick.t3 { bottom: 34%; }
.scope-tick.t4 { bottom: 30%; }

.scope-data {
  position: absolute;
  left: 50%;
  bottom: 5vh;
  transform: translateX(-50%);
  width: min(60vw, 680px);
  display: flex;
  justify-content: space-between;
  color: rgba(169, 218, 232, 0.5);
  font-size: 8px;
  letter-spacing: 0.22em;
}

/* ------------------------------------------------------------------ */
/* Wave banners / intermission                                         */
/* ------------------------------------------------------------------ */

#wave-banner {
  position: absolute;
  left: 50%;
  top: 33%;
  transform: translate(-50%, -50%);
  text-align: center;
  min-width: 340px;
  padding: 20px 44px 22px;
  background: linear-gradient(90deg, transparent, rgba(4, 14, 18, 0.6) 18%, rgba(4, 14, 18, 0.6) 82%, transparent);
  border-top: 1px solid rgba(168, 224, 240, 0.2);
  border-bottom: 1px solid rgba(168, 224, 240, 0.12);
}

#wave-banner.show {
  animation: banner-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes banner-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.06); filter: blur(6px); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}

.banner-kicker {
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0.36em;
  margin-bottom: 7px;
}

.banner-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 54px);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--ice);
  text-shadow: 0 0 42px rgba(148, 229, 250, 0.25);
}

.banner-sub {
  margin-top: 7px;
  color: rgba(185, 218, 228, 0.62);
  font-size: 9px;
  letter-spacing: 0.18em;
}

#subtitle {
  position: absolute;
  left: 50%;
  bottom: 19%;
  transform: translateX(-50%);
  padding: 7px 18px;
  color: rgba(220, 242, 248, 0.84);
  background: rgba(3, 10, 13, 0.5);
  border-left: 1px solid var(--cyan);
  font-size: 11px;
  letter-spacing: 0.14em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

#subtitle.show {
  opacity: 1;
}

#intermission {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 330px;
  padding: 24px 26px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 26, 32, 0.88), rgba(4, 12, 16, 0.78));
  border: 1px solid rgba(169, 225, 241, 0.22);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  backdrop-filter: blur(14px);
}

.inter-kicker {
  color: var(--cyan);
  font-size: 8px;
  letter-spacing: 0.32em;
}

.inter-title {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--ice);
}

.inter-sub {
  margin-top: 7px;
  color: rgba(185, 217, 227, 0.58);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.inter-timer {
  margin-top: 15px;
  font-family: "Bahnschrift Condensed", var(--font-ui);
  font-size: 54px;
  line-height: 1;
  color: var(--cyan-bright);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.inter-timer-label {
  color: rgba(165, 198, 209, 0.45);
  font-size: 8px;
  letter-spacing: 0.18em;
}

#boss-bar {
  position: absolute;
  left: 50%;
  bottom: 112px;
  transform: translateX(-50%);
  width: min(540px, 48vw);
  padding: 8px 12px 10px;
  background: linear-gradient(90deg, transparent, rgba(28, 8, 8, 0.78) 12%, rgba(28, 8, 8, 0.78) 88%, transparent);
  border-bottom: 1px solid rgba(255, 94, 71, 0.36);
}

.boss-head {
  display: flex;
  justify-content: space-between;
  color: #ffd2c8;
  font-size: 9px;
  letter-spacing: 0.2em;
  margin-bottom: 5px;
}

#boss-hp {
  color: rgba(255, 156, 137, 0.65);
  font-variant-numeric: tabular-nums;
}

.boss-track {
  height: 3px;
  background: rgba(255, 92, 66, 0.12);
}

#boss-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #7d211d, #ff654c);
  box-shadow: 0 0 12px rgba(255, 90, 68, 0.45);
  transition: width 0.15s;
}

#tutorial-hint {
  position: absolute;
  left: 50%;
  bottom: 23px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  padding: 7px 14px;
  background: rgba(4, 13, 17, 0.52);
  border: 1px solid var(--line-soft);
  color: rgba(164, 198, 209, 0.55);
  font-size: 8px;
  letter-spacing: 0.05em;
  transition: opacity 0.8s;
}

#tutorial-hint span {
  display: flex;
  align-items: center;
  gap: 4px;
}

#tutorial-hint kbd {
  height: 16px;
  min-width: 17px;
  font-size: 7px;
}

#tutorial-hint.fade {
  opacity: 0;
}

/* ------------------------------------------------------------------ */
/* Splash / title                                                      */
/* ------------------------------------------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
}

#splash {
  background:
    radial-gradient(ellipse at 74% 46%, rgba(113, 153, 170, 0.11), transparent 42%),
    linear-gradient(90deg, rgba(3, 9, 12, 0.97) 0%, rgba(3, 9, 12, 0.92) 32%, rgba(5, 12, 16, 0.62) 58%, rgba(4, 11, 15, 0.4) 100%),
    linear-gradient(180deg, rgba(4, 11, 15, 0.5), rgba(3, 9, 12, 0.76));
  transition: opacity 0.7s ease, visibility 0.7s;
}

#splash.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.splash-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 64% 46%, transparent 22%, rgba(1, 5, 7, 0.22) 58%, rgba(1, 5, 7, 0.72) 100%),
    linear-gradient(180deg, rgba(1, 5, 7, 0.6), transparent 22%, transparent 74%, rgba(1, 5, 7, 0.7));
  pointer-events: none;
}

.splash-grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.splash-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 4vw;
  border-bottom: 1px solid rgba(168, 220, 235, 0.1);
}

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

.brand-sigil {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(149, 219, 238, 0.3);
  transform: rotate(45deg);
  font-size: 15px;
}

.brand-sigil > * {
  transform: rotate(-45deg);
}

.brand-name {
  color: rgba(221, 244, 250, 0.86);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.brand-code {
  margin-top: 2px;
  color: rgba(145, 183, 196, 0.5);
  font-size: 7px;
  letter-spacing: 0.18em;
}

.splash-telemetry {
  display: flex;
  gap: 18px;
  align-items: center;
  color: rgba(165, 203, 215, 0.52);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.telemetry-live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
}

.splash-main {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4vw;
  padding: 92px 4vw 64px;
}

.splash-copy {
  width: min(760px, 58vw);
  animation: copy-in 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes copy-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 30px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(126, 212, 234, 0.55);
}

.splash-copy h1 {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(74px, 8.5vw, 146px);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: #e8f7fd;
  text-shadow:
    0 6px 50px rgba(4, 11, 15, 0.5),
    0 0 80px rgba(139, 207, 226, 0.1);
}

.splash-copy h1 span {
  color: transparent;
  -webkit-text-stroke: 1px rgba(196, 237, 249, 0.72);
  margin-left: 0.08em;
}

.title-latin {
  margin-top: 9px;
  color: rgba(157, 203, 218, 0.48);
  font-size: clamp(9px, 0.9vw, 13px);
  letter-spacing: 0.52em;
}

.tagline {
  margin: 24px 0 0;
  color: rgba(214, 235, 242, 0.72);
  font-size: 13px;
  line-height: 2;
  letter-spacing: 0.12em;
  font-weight: 300;
}

.mission-card {
  margin-top: 24px;
  width: min(620px, 100%);
  padding: 15px 17px 14px;
  border: 1px solid rgba(172, 222, 237, 0.14);
  background: linear-gradient(110deg, rgba(9, 24, 30, 0.8), rgba(5, 14, 18, 0.36));
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  backdrop-filter: blur(10px);
}

.mission-card-head {
  display: flex;
  justify-content: space-between;
  color: rgba(147, 187, 200, 0.52);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.mission-status {
  color: var(--amber);
}

.mission-card p {
  margin: 9px 0 12px;
  color: rgba(197, 223, 232, 0.62);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.06em;
}

.wave-previews {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.wave-previews div {
  padding: 6px 7px 7px;
  border-top: 1px solid rgba(160, 216, 233, 0.18);
  background: rgba(131, 193, 211, 0.035);
}

.wave-previews b {
  display: block;
  color: rgba(137, 210, 230, 0.7);
  font-family: "Bahnschrift Condensed", var(--font-ui);
  font-size: 12px;
  font-weight: 400;
}

.wave-previews span {
  display: block;
  margin-top: 2px;
  color: rgba(187, 217, 227, 0.56);
  font-size: 8px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.loadout {
  display: flex;
  gap: 16px;
  margin-top: 11px;
  color: rgba(150, 189, 202, 0.45);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.loadout span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.loadout-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 5px var(--cyan);
}

.deploy-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 236px;
  height: 50px;
  padding: 0 17px 0 21px;
  border: 1px solid rgba(160, 230, 248, 0.6);
  background: linear-gradient(100deg, rgba(143, 223, 243, 0.17), rgba(122, 207, 229, 0.05));
  color: #e8faff;
  font-size: 11px;
  letter-spacing: 0.18em;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: 0 0 38px rgba(110, 210, 237, 0.08), inset 0 0 0 1px rgba(221, 249, 255, 0.03);
  transition: background 0.25s, box-shadow 0.25s, border-color 0.25s, transform 0.2s;
}

.primary-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(100deg, rgba(143, 223, 243, 0.28), rgba(122, 207, 229, 0.09));
  border-color: rgba(195, 244, 255, 0.9);
  box-shadow: 0 0 46px rgba(110, 210, 237, 0.2);
  transform: translateX(2px);
}

.primary-btn:active:not(:disabled) {
  transform: translateX(2px) scale(0.99);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-key {
  color: rgba(177, 223, 235, 0.46);
  font-size: 7px;
  letter-spacing: 0.16em;
  border: 1px solid rgba(177, 223, 235, 0.18);
  padding: 4px 5px;
}

.ghost-btn {
  height: 50px;
  padding: 0 20px;
  border: 1px solid rgba(172, 222, 236, 0.16);
  background: rgba(137, 195, 211, 0.025);
  color: rgba(198, 228, 238, 0.66);
  font-size: 10px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.ghost-btn:hover {
  border-color: rgba(172, 222, 236, 0.46);
  color: var(--ice);
  background: rgba(137, 195, 211, 0.07);
}

.ghost-btn.small {
  height: 38px;
  padding: 0 13px;
  font-size: 8px;
}

.deploy-note {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: rgba(142, 178, 191, 0.42);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.deploy-note span {
  position: relative;
  padding-left: 9px;
}

.deploy-note span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(126, 212, 234, 0.5);
}

.splash-aside {
  width: min(316px, 27vw);
  min-width: 270px;
  margin-top: 80px;
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: copy-in 1.1s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.weather-card {
  padding: 15px 16px 12px;
  border: 1px solid rgba(172, 222, 237, 0.14);
  background: linear-gradient(135deg, rgba(8, 22, 28, 0.64), rgba(4, 12, 16, 0.3));
  backdrop-filter: blur(10px);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

.weather-head {
  display: flex;
  justify-content: space-between;
  color: rgba(139, 179, 192, 0.5);
  font-size: 7px;
  letter-spacing: 0.17em;
}

.weather-warn {
  color: rgba(255, 111, 87, 0.72);
}

.weather-readout {
  margin-top: 4px;
  font-family: "Bahnschrift Condensed", var(--font-ui);
  font-size: 54px;
  font-weight: 300;
  color: rgba(225, 246, 252, 0.9);
  line-height: 1;
}

.weather-readout span {
  font-size: 17px;
  vertical-align: top;
  margin-left: 3px;
  color: rgba(189, 227, 240, 0.45);
}

.weather-lines {
  display: flex;
  justify-content: space-between;
  color: rgba(146, 184, 196, 0.46);
  font-size: 7px;
  letter-spacing: 0.04em;
  padding: 8px 0 10px;
}

.weather-lines b {
  color: rgba(198, 229, 239, 0.7);
  font-weight: 400;
}

.weather-wave {
  height: 18px;
  opacity: 0.55;
  background:
    linear-gradient(90deg, transparent, rgba(126, 212, 234, 0.2) 20%, transparent 40%, rgba(126, 212, 234, 0.14) 68%, transparent),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(139, 202, 219, 0.08) 8px 9px);
  clip-path: polygon(0 78%, 4% 54%, 9% 68%, 14% 25%, 20% 70%, 27% 44%, 33% 72%, 41% 8%, 46% 62%, 54% 37%, 60% 68%, 67% 23%, 73% 65%, 81% 48%, 88% 72%, 94% 33%, 100% 58%, 100% 100%, 0 100%);
  background-color: rgba(126, 212, 234, 0.08);
}

.control-card {
  padding: 13px 15px 14px;
  border: 1px solid rgba(172, 222, 237, 0.12);
  background: rgba(4, 12, 16, 0.42);
  backdrop-filter: blur(10px);
}

.control-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(169, 220, 235, 0.1);
  color: rgba(209, 237, 245, 0.77);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.control-head span {
  color: rgba(137, 178, 192, 0.4);
  font-size: 7px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  padding-top: 10px;
}

.control-grid div,
.pause-controls div {
  display: flex;
  align-items: center;
  gap: 3px;
  color: rgba(160, 194, 205, 0.5);
  font-size: 8px;
}

.control-grid div span,
.pause-controls div span {
  margin-left: 4px;
  white-space: nowrap;
}

.control-grid kbd,
.pause-controls kbd {
  min-width: 17px;
  height: 17px;
  font-size: 7px;
  padding: 0 4px;
}

.splash-foot {
  position: absolute;
  left: 4vw;
  right: 4vw;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(132, 169, 182, 0.34);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.splash-foot-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(156, 211, 228, 0.14), transparent);
}

.build-tag {
  margin-left: auto;
}

#loading-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(5, 15, 19, 0.92), rgba(2, 7, 9, 0.985));
  transition: opacity 0.7s, visibility 0.7s;
}

#loading-layer.done {
  opacity: 0;
  visibility: hidden;
}

.loading-inner {
  width: 260px;
  text-align: center;
}

.loading-glyph {
  color: var(--cyan);
  font-size: 26px;
  animation: spin 5s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-label {
  margin-top: 12px;
  color: rgba(183, 222, 234, 0.6);
  font-size: 9px;
  letter-spacing: 0.26em;
}

.loading-track {
  margin-top: 16px;
  height: 2px;
  background: rgba(155, 211, 227, 0.12);
  overflow: hidden;
}

#loading-fill {
  display: block;
  width: 8%;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  transition: width 0.4s;
}

/* ------------------------------------------------------------------ */
/* Pause                                                               */
/* ------------------------------------------------------------------ */

#pause-screen {
  background: rgba(2, 8, 11, 0.74);
  backdrop-filter: blur(16px) saturate(0.6);
  -webkit-backdrop-filter: blur(16px) saturate(0.6);
}

.pause-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 24%, rgba(1, 5, 7, 0.36) 76%, rgba(1, 5, 7, 0.8) 100%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(146, 204, 221, 0.015) 3px 4px);
}

.pause-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 88vw);
  padding: 32px 36px 28px;
  border: 1px solid rgba(174, 226, 241, 0.2);
  background: linear-gradient(145deg, rgba(10, 27, 33, 0.93), rgba(4, 12, 16, 0.9));
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}

.pause-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 96px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 20px rgba(126, 212, 234, 0.6);
}

.pause-panel h2 {
  margin: 14px 0 0;
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 300;
  letter-spacing: 0.16em;
  color: var(--ice);
}

.pause-sub {
  margin: 7px 0 24px;
  color: rgba(173, 207, 218, 0.5);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.pause-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.pause-controls div {
  font-size: 9px;
}

.pause-tip {
  margin-top: 16px;
  color: rgba(157, 192, 203, 0.52);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.pause-tip span {
  color: var(--amber);
  border: 1px solid rgba(242, 197, 141, 0.3);
  padding: 1px 5px;
  margin-right: 8px;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.pause-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.pause-actions .primary-btn {
  min-width: 190px;
  height: 46px;
}

.pause-actions .ghost-btn {
  height: 46px;
  padding: 0 14px;
  font-size: 9px;
}

.pause-actions .ghost-btn.small {
  margin-left: auto;
  height: 34px;
  font-size: 8px;
}

/* ------------------------------------------------------------------ */
/* End screen                                                          */
/* ------------------------------------------------------------------ */

#end-screen {
  background:
    radial-gradient(ellipse at center, rgba(5, 15, 19, 0.6), rgba(2, 7, 9, 0.96)),
    rgba(2, 7, 9, 0.84);
  backdrop-filter: blur(12px);
}

#end-screen.defeat {
  background:
    radial-gradient(ellipse at center, rgba(32, 8, 9, 0.55), rgba(4, 5, 7, 0.97)),
    rgba(2, 7, 9, 0.88);
}

.end-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 20%, rgba(1, 4, 6, 0.4) 68%, rgba(1, 4, 6, 0.9) 100%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(149, 210, 226, 0.014) 3px 4px);
}

.end-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 90vw);
  text-align: center;
  animation: end-in 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes end-in {
  from { opacity: 0; transform: translate(-50%, -47%) scale(0.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.end-panel .eyebrow {
  justify-content: center;
}

#end-screen.defeat .end-panel .eyebrow {
  color: var(--blood);
}

#end-screen.defeat .end-panel .eyebrow > span {
  background: var(--blood);
}

.end-panel h2 {
  margin: 18px 0 0;
  font-size: clamp(46px, 6vw, 84px);
  font-weight: 300;
  letter-spacing: 0.13em;
  color: var(--ice);
  text-shadow: 0 0 80px rgba(151, 232, 252, 0.15);
}

#end-screen.defeat .end-panel h2 {
  color: #ffe3db;
  text-shadow: 0 0 80px rgba(255, 81, 60, 0.1);
}

#end-sub {
  margin: 13px auto 0;
  max-width: 560px;
  color: rgba(177, 211, 222, 0.56);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.09em;
}

.end-rule {
  width: 80px;
  height: 1px;
  margin: 30px auto 24px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 14px rgba(126, 212, 234, 0.4);
}

.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.end-stats div {
  padding: 17px 10px 15px;
  border-right: 1px solid var(--line-soft);
}

.end-stats div:nth-child(3n) {
  border-right: 0;
}

.end-stats span {
  display: block;
  color: rgba(143, 181, 194, 0.48);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.end-stats b {
  display: block;
  margin-top: 5px;
  font-family: "Bahnschrift Condensed", var(--font-ui);
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--ice);
  font-variant-numeric: tabular-nums;
}

.end-menace {
  margin-top: 16px;
  color: rgba(143, 191, 207, 0.4);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.end-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.end-actions .primary-btn {
  min-width: 208px;
}

.end-actions .ghost-btn {
  min-width: 150px;
}

.end-foot {
  margin-top: 26px;
  color: rgba(128, 165, 178, 0.25);
  font-size: 7px;
  letter-spacing: 0.26em;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

#rotate-notice {
  display: none;
}

@media (max-width: 1100px) {
  #mission-panel { width: 248px; }
  #weapon-panel { width: 306px; }
  #health-panel { width: 264px; }
  .splash-copy { width: 64vw; }
  .splash-aside { width: 260px; min-width: 0; }
  .splash-telemetry span:nth-last-child(2) { display: none; }
}

@media (max-width: 860px) {
  #compass-wrap { width: 42vw; }
  #minimap-wrap { width: 190px; }
  #killfeed { top: 260px; width: 210px; }
  #tutorial-hint { display: none; }
  .splash-main { padding: 84px 5vw 56px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 18px; }
  .splash-copy { width: 100%; }
  .splash-aside { width: 100%; margin-top: 0; flex-direction: row; align-self: auto; }
  .weather-card { display: none; }
  .control-card { width: 100%; }
  .splash-top { padding: 16px 5vw; }
  .splash-telemetry { display: none; }
  .splash-copy h1 { font-size: clamp(58px, 15vw, 100px); }
  .tagline { margin-top: 15px; }
  .mission-card { margin-top: 16px; }
  .deploy-row { margin-top: 16px; }
  #health-panel, #weapon-panel { width: 240px; }
  #weapon-slots { display: none; }
  .weapon-foot { display: none; }
  .mission-objective { display: none; }
}

@media (max-height: 720px) {
  .splash-main { padding-top: 76px; padding-bottom: 44px; }
  .splash-copy h1 { font-size: clamp(60px, 7vw, 106px); }
  .tagline { margin-top: 15px; font-size: 11px; line-height: 1.8; }
  .mission-card { margin-top: 15px; padding: 12px 14px; }
  .mission-card p { margin: 6px 0 8px; line-height: 1.6; }
  .deploy-row { margin-top: 15px; }
  .weather-card { display: none; }
  .splash-aside { margin-top: 0; align-self: flex-end; }
  .pause-panel { padding: 24px 28px 22px; }
  .pause-panel h2 { font-size: 40px; }
  .pause-sub { margin-bottom: 15px; }
  .pause-controls { gap: 7px 16px; padding: 13px 0; }
  .pause-actions { margin-top: 16px; }
  .end-panel h2 { font-size: clamp(42px, 5vw, 64px); }
  .end-rule { margin: 20px auto 16px; }
  .end-stats div { padding: 12px 8px 11px; }
  .end-stats b { font-size: 25px; }
  .end-actions { margin-top: 20px; }
}

@media (max-width: 620px), (pointer: coarse) {
  #rotate-notice {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(2, 8, 11, 0.94);
    color: rgba(199, 232, 242, 0.7);
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.12em;
    line-height: 2;
  }
  .overlay { display: none !important; }
}
