:root {
  color-scheme: dark;
  --bg: #020617;
  --ink: #f8fafc;
  --muted: #a8b3c7;
  --panel: #080b10;
  --line: #334155;
  --accent: #5f8fa8;
  --accent-dark: #0284c7;
  --field: #020617;
  --canvas: #000000;
  --green: #22c55e;
  --red: #b64a5a;
  --blue: #5f8fa8;
  --purple: #e879f9;
  --gold: #facc15;
  --ui-font: "Bahnschrift", "Segoe UI Variable Text", "Segoe UI", "Aptos", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui-font);
}

button,
input {
  font: inherit;
}

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

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.panel {
  width: min(900px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(8, 11, 16, 0.98), rgba(2, 6, 23, 0.98));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin: 4px 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.control-group {
  margin-top: 22px;
}

.control-label {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.nickname-field {
  display: block;
}

.nickname-input {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0;
  padding: 10px 12px;
}

.nickname-input::placeholder {
  color: #64748b;
}

.nickname-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 143, 168, 0.18);
}

.nickname-input:invalid:not(:placeholder-shown) {
  border-color: var(--red);
}

.field-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.ship-select-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  gap: 22px;
  align-items: stretch;
}

.ship-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(68px, 1fr));
  gap: 10px;
}

.ship-option {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 38%, rgba(56, 189, 248, 0.16), transparent 58%),
    #030712;
  cursor: pointer;
  overflow: hidden;
}

.ship-option img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.16));
}

.ship-option:hover,
.ship-option:focus-visible,
.primary-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.ship-option.is-selected {
  border-color: var(--green);
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.2),
    inset 0 0 18px rgba(34, 197, 94, 0.12);
}

.ship-option.is-selected::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  content: "";
}

.ship-info {
  min-height: 100%;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
}

.ship-role {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ship-info p {
  color: var(--muted);
  line-height: 1.45;
}

.ship-stats {
  margin-top: 18px;
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.primary-button:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.primary-button:disabled {
  border-color: #64748b;
  background: #475569;
  cursor: not-allowed;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.world {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--canvas);
  cursor: none;
}

#world-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: var(--canvas);
  box-shadow: none;
  cursor: none;
}

.ability-range-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.ability-range-overlay.is-hidden {
  display: none;
}

.ability-range-overlay-halo {
  fill: none;
  stroke: rgba(192, 132, 252, 0.035);
  stroke-width: 18;
  vector-effect: non-scaling-stroke;
}

.ability-range-overlay-ring {
  fill: none;
  stroke: rgba(192, 132, 252, 0.18);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ability-range-overlay-inner-ring {
  fill: none;
  stroke: rgba(5, 0, 8, 0.18);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.game-hud,
.game-hud * {
  cursor: none !important;
}

.custom-cursor-dom {
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  --cursor-x: 0px;
  --cursor-y: 0px;
  width: 16px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: rgba(57, 255, 154, 0.82);
  clip-path: polygon(50% 0, 84% 86%, 50% 64%, 16% 86%);
  filter:
    drop-shadow(0 0 4px rgba(220, 255, 236, 0.9))
    drop-shadow(0 0 12px rgba(57, 255, 154, 0.85));
  contain: layout style paint;
  pointer-events: none;
  transform: translate3d(var(--cursor-x), var(--cursor-y), 0) translate(-50%, 0) rotate(-45deg);
  transform-origin: 50% 0;
  will-change: transform;
}

.custom-cursor-dom::after {
  position: absolute;
  inset: 2px 5px 9px;
  background: rgba(220, 255, 236, 0.88);
  clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%);
  content: "";
}

.custom-cursor-dom.is-targeting {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  clip-path: none;
  filter:
    drop-shadow(0 0 1px rgba(216, 180, 254, 0.62))
    drop-shadow(0 0 3px rgba(126, 34, 206, 0.28));
  transform: translate3d(var(--cursor-x), var(--cursor-y), 0) translate(-50%, -50%);
}

.custom-cursor-dom.is-weapon-target {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  clip-path: none;
  filter:
    drop-shadow(0 0 4px rgba(255, 228, 230, 0.86))
    drop-shadow(0 0 12px rgba(239, 68, 68, 0.78));
  transform: translate3d(var(--cursor-x), var(--cursor-y), 0) translate(-50%, -50%);
}

.custom-cursor-dom.is-map-ping {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  clip-path: none;
  filter:
    drop-shadow(0 0 4px rgba(254, 240, 138, 0.95))
    drop-shadow(0 0 12px rgba(250, 204, 21, 0.78));
  transform: translate3d(var(--cursor-x), var(--cursor-y), 0) translate(-50%, -50%);
}

.custom-cursor-dom.is-minimap-grab,
.custom-cursor-dom.is-minimap-grabbing {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  clip-path: none;
  filter:
    drop-shadow(0 0 3px rgba(224, 242, 254, 0.64))
    drop-shadow(0 0 7px rgba(125, 211, 252, 0.34));
  transform: translate3d(var(--cursor-x), var(--cursor-y), 0) translate(-50%, -50%);
}

.custom-cursor-dom .ping-cursor-icon {
  display: none;
}

.custom-cursor-dom .grab-cursor-icon {
  display: none;
}

.custom-cursor-dom .weapon-target-cursor-icon {
  display: none;
}

.custom-cursor-dom .ability-cursor-icon {
  display: none;
}

.custom-cursor-dom.is-map-ping .ping-cursor-icon {
  display: block;
  width: 32px;
  height: 32px;
}

.custom-cursor-dom.is-minimap-grab .grab-cursor-icon,
.custom-cursor-dom.is-minimap-grabbing .grab-cursor-icon {
  display: block;
  width: 32px;
  height: 32px;
  color: #b9cbd5;
}

.custom-cursor-dom.is-weapon-target .weapon-target-cursor-icon {
  display: block;
  width: 32px;
  height: 32px;
  color: #ef4444;
  animation: weapon-target-cursor-pulse 960ms ease-in-out infinite;
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.custom-cursor-dom.is-weapon-target.has-weapon-target .weapon-target-cursor-icon {
  color: #f87171;
  animation-name: weapon-target-cursor-valid-pulse;
}

.custom-cursor-dom.is-targeting .ability-cursor-icon {
  display: block;
  width: 40px;
  height: 40px;
  color: #c084fc;
}

.ability-cursor-arc,
.ability-cursor-inner-arc,
.ability-cursor-bar-outline,
.ability-cursor-bar,
.ability-cursor-ticks path,
.ability-cursor-mask-sweep path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: butt;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.ability-cursor-arc {
  stroke-width: 3.2;
}

.ability-cursor-inner-ring {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: ability-cursor-inner-scan 4.8s cubic-bezier(0.35, 0, 0.2, 1) infinite;
}

.ability-cursor-inner-arc {
  opacity: 0.76;
  stroke-width: 1.7;
}

.ability-cursor-bars {
  transform-box: view-box;
  transform-origin: 50% 50%;
  shape-rendering: geometricPrecision;
  transition: transform 160ms ease;
}

.ability-cursor-bar-outline {
  stroke: #050008;
  stroke-width: 2.7;
}

.ability-cursor-bar {
  stroke-width: 1.55;
}

.custom-cursor-dom.has-ability-target .ability-cursor-bars {
  animation: ability-cursor-target-pulse 880ms ease-in-out infinite;
}

.ability-cursor-ticks {
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: ability-cursor-outer-scan 4.8s cubic-bezier(0.35, 0, 0.2, 1) infinite;
}

.ability-cursor-ticks path {
  stroke-width: 1.25;
}

.ability-cursor-mask-sweep {
  color: white;
  transform-box: view-box;
  transform-origin: 50% 50%;
  animation: ability-cursor-mask-scan 6.2s ease-in-out infinite;
}

.ability-cursor-mask-sweep path {
  stroke: white;
  stroke-linecap: round;
  stroke-width: 6.4;
}

.ability-cursor-mask-sweep .ability-cursor-mask-trail {
  opacity: 0.42;
  stroke-width: 5.2;
}

.custom-cursor-dom.has-ability-target .ability-cursor-inner-ring,
.custom-cursor-dom.has-ability-target .ability-cursor-ticks,
.custom-cursor-dom.has-ability-target .ability-cursor-mask-sweep {
  animation-play-state: paused;
}

.grab-cursor-open,
.grab-cursor-closed {
  fill: rgba(2, 6, 23, 0.72);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.grab-cursor-closed {
  display: none;
}

.custom-cursor-dom.is-minimap-grabbing .grab-cursor-open {
  display: none;
}

.custom-cursor-dom.is-minimap-grabbing .grab-cursor-closed {
  display: block;
  color: #d9e7ec;
  transform: translateY(1px) scale(0.96);
  transform-origin: 50% 50%;
}

.ping-cursor-sweep {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.custom-cursor-dom.is-map-ping .ping-cursor-sweep {
  animation: ping-cursor-scan 6.4s ease-in-out infinite;
}

.custom-cursor-dom.is-map-ping::before,
.custom-cursor-dom.is-map-ping::after,
.custom-cursor-dom.is-weapon-target::before,
.custom-cursor-dom.is-weapon-target::after,
.custom-cursor-dom.is-targeting::before,
.custom-cursor-dom.is-targeting::after,
.custom-cursor-dom.is-minimap-grab::before,
.custom-cursor-dom.is-minimap-grab::after,
.custom-cursor-dom.is-minimap-grabbing::before,
.custom-cursor-dom.is-minimap-grabbing::after {
  content: none;
}

.weapon-target-cursor-icon circle,
.weapon-target-cursor-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

@keyframes weapon-target-cursor-pulse {
  0%,
  100% {
    opacity: 0.86;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes weapon-target-cursor-valid-pulse {
  0%,
  100% {
    opacity: 0.92;
    transform: scale(1.25);
  }

  50% {
    opacity: 1;
    transform: scale(1.34);
  }
}

@keyframes ability-cursor-outer-scan {
  0%,
  8% {
    transform: rotate(0deg);
  }

  28% {
    transform: rotate(48deg);
  }

  46% {
    transform: rotate(-24deg);
  }

  70% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(720deg);
  }
}

@keyframes ability-cursor-inner-scan {
  0%,
  10% {
    transform: rotate(0deg);
  }

  30% {
    transform: rotate(-42deg);
  }

  48% {
    transform: rotate(26deg);
  }

  74% {
    transform: rotate(-360deg);
  }

  100% {
    transform: rotate(-720deg);
  }
}

@keyframes ability-cursor-mask-scan {
  0%,
  10% {
    transform: rotate(-18deg);
  }

  32% {
    transform: rotate(34deg);
  }

  54% {
    transform: rotate(-64deg);
  }

  78% {
    transform: rotate(226deg);
  }

  100% {
    transform: rotate(342deg);
  }
}

@keyframes ability-cursor-target-pulse {
  0%,
  100% {
    transform: scale(1.24);
  }

  50% {
    transform: scale(1.52);
  }
}

@keyframes ping-cursor-scan {
  0%,
  8% {
    transform: rotate(-45deg);
  }

  18% {
    transform: rotate(45deg);
  }

  28%,
  52% {
    transform: rotate(-45deg);
  }

  68%,
  92% {
    transform: rotate(135deg);
  }

  100% {
    transform: rotate(-45deg);
  }
}

.score-display {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: grid;
  box-sizing: border-box;
  grid-template-columns: 1fr auto 1fr;
  width: calc(clamp(150px, 14vw, 220px) + 16px);
  height: 38px;
  align-items: center;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: transparent;
  clip-path: none;
  box-shadow: none;
  pointer-events: none;
}

.hud-minimap-frame {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  box-sizing: border-box;
  --minimap-size: clamp(150px, 14vw, 220px);
  --minimap-side-pad: 8px;
  width: calc(var(--minimap-size) + (var(--minimap-side-pad) * 2));
  height: calc(86px + clamp(150px, 14vw, 220px));
  border: 0;
  border-radius: 0;
  background: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
  pointer-events: none;
}

.minimap-collapse-toggle {
  position: absolute;
  top: calc(64px + var(--minimap-map-offset, clamp(150px, 14vw, 220px)));
  left: calc(14px + clamp(150px, 14vw, 220px) - 19px);
  z-index: 6;
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #8bb8ca;
  cursor: none;
  filter: none;
  pointer-events: auto;
  transform: rotate(-45deg);
  transition:
    color 140ms ease,
    filter 140ms ease;
}

.minimap-collapse-toggle::after {
  position: absolute;
  z-index: 2;
  top: calc(100% + 24px);
  left: 50%;
  display: inline-flex;
  width: max-content;
  max-width: 130px;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(125, 211, 252, 0.62);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.96);
  color: #e0f2fe;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: none;
  transform: translateX(-50%) rotate(45deg);
}

.minimap-collapse-toggle:hover,
.minimap-collapse-toggle:focus-visible {
  color: #bae6fd;
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.28));
  outline: none;
}

.minimap-collapse-toggle:hover::after {
  opacity: 1;
}

.minimap-chevron {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  filter:
    drop-shadow(0 0 4px rgba(14, 165, 233, 0.5))
    drop-shadow(0 0 8px rgba(14, 165, 233, 0.18));
  transform: rotate(45deg);
  transform-origin: 33.333% 33.333%;
  transition:
    filter 140ms ease,
    transform 160ms ease;
}

.minimap-collapse-toggle:hover .minimap-chevron,
.minimap-collapse-toggle:focus-visible .minimap-chevron {
  filter:
    drop-shadow(0 0 8px rgba(186, 230, 253, 0.9))
    drop-shadow(0 0 16px rgba(14, 165, 233, 0.56));
}

.minimap-collapse-toggle:hover .minimap-chevron,
.minimap-collapse-toggle:focus-visible .minimap-chevron {
  transform: scale(1.16) rotate(45deg);
}

.minimap-collapse-toggle.is-collapsed .minimap-chevron {
  transform: rotate(225deg);
}

.minimap-collapse-toggle.is-collapsed:hover .minimap-chevron,
.minimap-collapse-toggle.is-collapsed:focus-visible .minimap-chevron {
  transform: scale(1.16) rotate(225deg);
}

.fps-counter {
  position: absolute;
  top: 17px;
  right: 14px;
  z-index: 7;
  min-width: 58px;
  color: #86efac;
  font-family: "Bahnschrift", "Cascadia Mono", "Consolas", "Segoe UI Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-align: right;
  text-shadow:
    0 0 5px rgba(34, 197, 94, 0.9),
    0 0 12px rgba(34, 197, 94, 0.45);
  pointer-events: none;
}

.score-team-side {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  padding: 3px 8px;
  line-height: 1;
}

.score-team-side.is-blue {
  --team-score-color: #5f8fa8;
}

.score-team-side.is-red {
  --team-score-color: #b64a5a;
}

.score-team-side strong {
  color: var(--team-score-color);
  font-size: 20px;
  font-weight: 650;
  text-shadow: 0 0 8px color-mix(in srgb, var(--team-score-color) 42%, transparent);
}

.score-team-side span {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
}

.score-timer {
  min-width: 54px;
  padding: 5px 10px;
  border-inline: 0;
  background: transparent;
  color: #b9cbd5;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 8px rgba(95, 143, 168, 0.34);
}

.game-banner {
  position: absolute;
  top: 74px;
  left: 50%;
  z-index: 5;
  max-width: min(720px, calc(100vw - 48px));
  transform: translateX(-50%);
  padding: 12px 18px;
  border: 1px solid rgba(250, 204, 21, 0.72);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.86);
  color: #fef3c7;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.24);
  pointer-events: none;
}

.game-banner.is-message {
  border-color: rgba(34, 197, 94, 0.74);
  color: #bbf7d0;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.22);
}

.game-banner.is-notification {
  border-color: rgba(250, 204, 21, 0.76);
  color: #fef08a;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.24);
}

.game-banner.is-warning {
  border-color: rgba(248, 113, 113, 0.82);
  color: #fecaca;
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.3);
}

.game-banner.is-spam {
  top: 50%;
  border-color: rgba(248, 113, 113, 0.88);
  background: rgba(15, 23, 42, 0.92);
  color: #fecaca;
  font-size: 20px;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.34);
  transform: translate(-50%, -50%);
}

.game-chat-feed {
  position: absolute;
  top: 32px;
  left: 50%;
  z-index: 5;
  display: grid;
  width: clamp(260px, calc(100vw - 340px), 520px);
  gap: 4px;
  pointer-events: none;
  transform: translateX(-50%);
}

.game-chat-message {
  display: flex;
  max-width: 100%;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 2px 8px 3px;
  justify-self: stretch;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(2, 6, 23, 0.66), rgba(2, 6, 23, 0.38) 58%, rgba(2, 6, 23, 0) 100%);
  color: #b9cbd5;
  font: 700 14px/1.25 var(--ui-font);
  overflow-wrap: anywhere;
  text-align: left;
  text-shadow:
    0 0 2px rgba(2, 6, 23, 1),
    0 0 8px rgba(2, 6, 23, 0.96),
    0 1px 0 rgba(0, 0, 0, 0.92);
  transition:
    opacity 640ms ease,
    filter 640ms ease;
}

.game-chat-message.is-newest {
  opacity: calc(var(--chat-feed-fade, 1) * 1);
}

.game-chat-message.is-previous {
  opacity: calc(var(--chat-feed-fade, 1) * 0.58);
  filter: brightness(0.78);
}

.game-chat-message.is-oldest {
  opacity: calc(var(--chat-feed-fade, 1) * 0.42);
  filter: brightness(0.66);
}

.game-chat-message.is-self,
.chat-message.is-self {
  color: #35b96a;
}

.game-chat-message.is-self strong {
  color: #24884c;
}

.game-chat-message.is-friendly,
.chat-message.is-friendly {
  color: #b9cbd5;
}

.game-chat-message.is-friendly strong {
  color: #7d929e;
}

.game-chat-message.is-enemy,
.chat-message.is-enemy {
  color: #b64a5a;
}

.game-chat-message.is-enemy strong {
  color: #84313e;
}

.game-hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  min-height: 0;
  background: transparent;
  pointer-events: none;
}

.world.is-paused #world-canvas {
  filter: brightness(0.46) saturate(0.72);
}

.hud-minimap-space {
  display: none;
}

.hud-minimap-dock {
  position: absolute;
  top: calc(52px + var(--minimap-map-offset, clamp(150px, 14vw, 220px)));
  left: 14px;
  display: grid;
  box-sizing: border-box;
  width: calc(clamp(150px, 14vw, 220px) + 16px);
  min-height: 48px;
  gap: 6px;
  padding: 8px 10px 10px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
  pointer-events: auto;
}

.hud-minimap-dock::before {
  content: none;
}

.hud-center {
  --command-pod-tab-width: 306px;
  --hud-frame-border: 1px;
  --command-pod-corner: 12px;
  position: absolute;
  bottom: 14px;
  left: 50%;
  display: grid;
  width: max-content;
  min-width: 0;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  align-content: end;
  justify-items: center;
  gap: 3px;
  padding: 10px 22px 12px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.hud-center::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0), rgba(56, 189, 248, 0.04) 58%, rgba(125, 211, 252, 0.085)),
    linear-gradient(90deg, rgba(15, 23, 42, 0.68), rgba(30, 41, 59, 0.62)),
    rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  clip-path: polygon(var(--command-pod-corner) 0, calc(100% - var(--command-pod-corner)) 0, 100% var(--command-pod-corner), 100% calc(100% - var(--command-pod-corner)), calc(100% - var(--command-pod-corner)) 100%, var(--command-pod-corner) 100%, 0 calc(100% - var(--command-pod-corner)), 0 var(--command-pod-corner));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(2, 6, 23, 0.34);
  content: "";
  pointer-events: none;
}

.hud-center::after {
  position: absolute;
  z-index: 4;
  inset: 0;
  --command-pod-border-alpha: 0;
  --command-pod-trail-alpha: 0;
  background:
    linear-gradient(90deg, rgb(14 165 233 / 0), rgb(14 165 233 / calc(var(--command-pod-trail-alpha) * 0.12)) 34%, rgb(125 211 252 / calc(var(--command-pod-trail-alpha) * 0.48)) 68%, rgb(186 230 253 / calc(var(--command-pod-trail-alpha) * 0.94)) 88%, rgb(14 165 233 / 0) 100%) calc(0% - 56px) top / 52px 2px no-repeat,
    linear-gradient(90deg, rgb(14 165 233 / 0), rgb(14 165 233 / calc(var(--command-pod-border-alpha) * 0.2)) 24%, rgb(186 230 253 / calc(var(--command-pod-border-alpha) * 0.72)) 50%, rgb(14 165 233 / calc(var(--command-pod-border-alpha) * 0.2)) 76%, rgb(14 165 233 / 0)) center top / 84% 1.6px no-repeat;
  clip-path: polygon(var(--command-pod-corner) 0, calc(100% - var(--command-pod-corner)) 0, 100% var(--command-pod-corner), 100% calc(100% - var(--command-pod-corner)), calc(100% - var(--command-pod-corner)) 100%, var(--command-pod-corner) 100%, 0 calc(100% - var(--command-pod-corner)), 0 var(--command-pod-corner));
  filter:
    drop-shadow(0 0 7px rgba(14, 165, 233, 0.26))
    drop-shadow(0 0 12px rgba(125, 211, 252, 0.13));
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  opacity: 0.86;
  animation: command-pod-border-trail 7350ms linear infinite;
  content: "";
  pointer-events: none;
}

.hud-center > :not(.hud-upgrade-toggle) {
  position: relative;
  z-index: 5;
}

.hud-upgrade-toggle {
  z-index: 1;
}

.hud-center.is-in-combat::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 18px rgba(239, 68, 68, 0.18),
    0 0 42px rgba(127, 29, 29, 0.18);
}

.hud-center.is-in-combat::after {
  background:
    linear-gradient(90deg, rgb(239 68 68 / 0), rgb(239 68 68 / calc(var(--command-pod-trail-alpha) * 0.12)) 34%, rgb(248 113 113 / calc(var(--command-pod-trail-alpha) * 0.4)) 68%, rgb(254 202 202 / calc(var(--command-pod-trail-alpha) * 0.84)) 88%, rgb(239 68 68 / 0) 100%) calc(0% - 56px) top / 52px 2px no-repeat,
    linear-gradient(90deg, rgb(239 68 68 / 0), rgb(239 68 68 / calc(var(--command-pod-border-alpha) * 0.18)) 24%, rgb(254 202 202 / calc(var(--command-pod-border-alpha) * 0.58)) 50%, rgb(239 68 68 / calc(var(--command-pod-border-alpha) * 0.18)) 76%, rgb(239 68 68 / 0)) center top / 84% 1.6px no-repeat;
  filter:
    drop-shadow(0 0 8px rgba(239, 68, 68, 0.3))
    drop-shadow(0 0 13px rgba(248, 113, 113, 0.16));
}

@property --command-pod-border-alpha {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

@property --command-pod-trail-alpha {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

@keyframes command-pod-border-trail {
  0% {
    background-position:
      calc(0% - 56px) top,
      center top;
    --command-pod-border-alpha: 0;
    --command-pod-trail-alpha: 0;
  }

  3% {
    --command-pod-border-alpha: 0;
    --command-pod-trail-alpha: 0;
  }

  6% {
    --command-pod-border-alpha: 0;
    --command-pod-trail-alpha: 0;
  }

  10% {
    --command-pod-border-alpha: 0;
    --command-pod-trail-alpha: 0.9;
  }

  16% {
    --command-pod-border-alpha: 0;
    --command-pod-trail-alpha: 1;
  }

  18% {
    --command-pod-border-alpha: 0.28;
    --command-pod-trail-alpha: 1;
  }

  22% {
    --command-pod-border-alpha: 1;
    --command-pod-trail-alpha: 0.68;
  }

  25% {
    background-position:
      88% top,
      center top;
    --command-pod-border-alpha: 0.32;
    --command-pod-trail-alpha: 0;
  }

  28% {
    background-position:
      calc(100% + 56px) top,
      center top;
    --command-pod-border-alpha: 0;
    --command-pod-trail-alpha: 0;
  }

  100% {
    background-position:
      calc(100% + 56px) top,
      center top;
    --command-pod-border-alpha: 0;
    --command-pod-trail-alpha: 0;
  }
}

.hud-center.is-upgrade-available {
  border-radius: 0;
}

.hud-center.is-upgrade-open {
  border-radius: 0;
  padding-right: 12px;
  padding-bottom: 22px;
}

.hud-upgrade-toggle {
  --upgrade-tab-y: 0;
  position: absolute;
  bottom: calc(100% - 2px);
  left: 50%;
  right: auto;
  display: inline-flex;
  width: min(148px, calc(100vw - 32px));
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  --upgrade-tab-border-color: rgba(250, 204, 21, 0.62);
  --upgrade-tab-angle-border-color: rgba(250, 204, 21, 0.92);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(250, 204, 21, 0), rgba(250, 204, 21, 0.34) 22%, rgba(254, 240, 138, 0.78) 50%, rgba(250, 204, 21, 0.34) 78%, rgba(250, 204, 21, 0)) 12px 0 / calc(100% - 24px) 1px no-repeat,
    linear-gradient(135deg, rgba(250, 204, 21, 0) calc(50% - 1.2px), rgba(250, 204, 21, 0.48) 50%, rgba(250, 204, 21, 0) calc(50% + 1.2px)) left top / 12px 12px no-repeat,
    linear-gradient(45deg, rgba(250, 204, 21, 0) calc(50% - 1.2px), rgba(250, 204, 21, 0.48) 50%, rgba(250, 204, 21, 0) calc(50% + 1.2px)) right top / 12px 12px no-repeat,
    linear-gradient(180deg, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.08) 46%, rgba(250, 204, 21, 0.02) 70%, rgba(250, 204, 21, 0)) left 12px / 1px calc(100% - 12px) no-repeat,
    linear-gradient(180deg, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.08) 46%, rgba(250, 204, 21, 0.02) 70%, rgba(250, 204, 21, 0)) right 12px / 1px calc(100% - 12px) no-repeat,
    radial-gradient(ellipse at top, rgba(120, 89, 18, 0.56), rgba(120, 89, 18, 0.34) 38%, rgba(120, 89, 18, 0) 78%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.84) 38%, rgba(2, 6, 23, 0.92)),
    rgba(2, 6, 23, 0.88);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 2px), 0 calc(100% - 2px), 0 12px);
  color: #fff7ad;
  cursor: pointer;
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0.92;
  padding: 7px 18px;
  pointer-events: auto;
  text-shadow:
    0 1px 0 rgba(2, 6, 23, 0.96),
    1px 0 0 rgba(2, 6, 23, 0.78),
    -1px 0 0 rgba(2, 6, 23, 0.78),
    0 -1px 0 rgba(2, 6, 23, 0.64),
    0 1px 0 rgba(0, 0, 0, 0.72);
  text-transform: uppercase;
  backdrop-filter: blur(5px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateX(-50%);
  translate: 0 var(--upgrade-tab-y);
  will-change: translate;
  animation: upgrade-tab-attention 2.6s ease-in-out infinite;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    color 140ms ease,
    translate 620ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
  visibility: visible;
}

.hud-upgrade-toggle::before {
  position: absolute;
  inset: 1px 2px auto;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 62%, rgba(255, 255, 255, 0));
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px);
  content: "";
  pointer-events: none;
}

.hud-upgrade-toggle::after {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -45%;
  width: 34px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: rotate(18deg);
}

.hud-upgrade-toggle:not(.is-active):not(.is-hidden)::after {
  opacity: 0.74;
  animation: tab-idle-sheen 3.4s ease-in-out infinite;
}

.hud-upgrade-toggle.is-hidden {
  --upgrade-tab-y: calc(100% + 2px);
  display: inline-flex;
  opacity: 0.92;
  pointer-events: none;
  transition:
    translate 620ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 620ms;
  visibility: hidden;
}

.hud-center.is-upgrade-open .hud-upgrade-toggle {
  right: auto;
  left: 50%;
  width: min(var(--command-pod-tab-width), calc(100vw - 32px));
}

.hud-upgrade-toggle .lucide-icon {
  width: 16px;
  height: 16px;
  color: currentColor;
  filter:
    drop-shadow(0 1px 0 rgba(2, 6, 23, 0.96))
    drop-shadow(1px 0 0 rgba(2, 6, 23, 0.74))
    drop-shadow(-1px 0 0 rgba(2, 6, 23, 0.74));
}

.hud-upgrade-toggle .lucide-icon,
.hud-upgrade-toggle .lucide-icon *,
.hud-upgrade-toggle span {
  pointer-events: none;
}

.hud-upgrade-toggle:hover,
.hud-upgrade-toggle:focus-visible {
  --upgrade-tab-border-color: #fef08a;
  --upgrade-tab-angle-border-color: #fef9c3;
  background:
    linear-gradient(90deg, rgba(254, 240, 138, 0), rgba(254, 240, 138, 0.5) 22%, rgba(254, 249, 195, 0.92) 50%, rgba(254, 240, 138, 0.5) 78%, rgba(254, 240, 138, 0)) 12px 0 / calc(100% - 24px) 1px no-repeat,
    linear-gradient(135deg, rgba(254, 240, 138, 0) calc(50% - 1.2px), rgba(254, 240, 138, 0.58) 50%, rgba(254, 240, 138, 0) calc(50% + 1.2px)) left top / 12px 12px no-repeat,
    linear-gradient(45deg, rgba(254, 240, 138, 0) calc(50% - 1.2px), rgba(254, 240, 138, 0.58) 50%, rgba(254, 240, 138, 0) calc(50% + 1.2px)) right top / 12px 12px no-repeat,
    linear-gradient(180deg, rgba(254, 240, 138, 0.34), rgba(250, 204, 21, 0.1) 46%, rgba(250, 204, 21, 0.03) 70%, rgba(250, 204, 21, 0)) left 12px / 1px calc(100% - 12px) no-repeat,
    linear-gradient(180deg, rgba(254, 240, 138, 0.34), rgba(250, 204, 21, 0.1) 46%, rgba(250, 204, 21, 0.03) 70%, rgba(250, 204, 21, 0)) right 12px / 1px calc(100% - 12px) no-repeat,
    radial-gradient(ellipse at top, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.12) 38%, rgba(250, 204, 21, 0) 78%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.84) 34%, rgba(2, 6, 23, 0.9)),
    rgba(2, 6, 23, 0.74);
  color: #fffde3;
  opacity: 1;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
  text-shadow:
    0 1px 0 rgba(2, 6, 23, 0.98),
    1px 0 0 rgba(2, 6, 23, 0.82),
    -1px 0 0 rgba(2, 6, 23, 0.82),
    0 -1px 0 rgba(2, 6, 23, 0.68),
    0 1px 0 rgba(0, 0, 0, 0.78);
}

.hud-upgrade-toggle:hover::after,
.hud-upgrade-toggle:focus-visible::after {
  opacity: 1;
  animation: tab-shimmer 760ms ease-out;
}

.hud-upgrade-toggle.is-active {
  --upgrade-tab-border-color: rgba(250, 204, 21, 0.62);
  --upgrade-tab-angle-border-color: rgba(250, 204, 21, 0.92);
  background:
    linear-gradient(90deg, rgba(250, 204, 21, 0), rgba(250, 204, 21, 0.34) 22%, rgba(254, 240, 138, 0.78) 50%, rgba(250, 204, 21, 0.34) 78%, rgba(250, 204, 21, 0)) 12px 0 / calc(100% - 24px) 1px no-repeat,
    linear-gradient(135deg, rgba(250, 204, 21, 0) calc(50% - 1.2px), rgba(250, 204, 21, 0.48) 50%, rgba(250, 204, 21, 0) calc(50% + 1.2px)) left top / 12px 12px no-repeat,
    linear-gradient(45deg, rgba(250, 204, 21, 0) calc(50% - 1.2px), rgba(250, 204, 21, 0.48) 50%, rgba(250, 204, 21, 0) calc(50% + 1.2px)) right top / 12px 12px no-repeat,
    linear-gradient(180deg, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.08) 46%, rgba(250, 204, 21, 0.02) 70%, rgba(250, 204, 21, 0)) left 12px / 1px calc(100% - 12px) no-repeat,
    linear-gradient(180deg, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.08) 46%, rgba(250, 204, 21, 0.02) 70%, rgba(250, 204, 21, 0)) right 12px / 1px calc(100% - 12px) no-repeat,
    radial-gradient(ellipse at top, rgba(120, 89, 18, 0.56), rgba(120, 89, 18, 0.34) 38%, rgba(120, 89, 18, 0) 78%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.84) 38%, rgba(2, 6, 23, 0.92)),
    rgba(2, 6, 23, 0.88);
  color: #fff7ad;
  opacity: 0.92;
  text-shadow:
    0 1px 0 rgba(2, 6, 23, 0.96),
    1px 0 0 rgba(2, 6, 23, 0.78),
    -1px 0 0 rgba(2, 6, 23, 0.78),
    0 -1px 0 rgba(2, 6, 23, 0.64),
    0 1px 0 rgba(0, 0, 0, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: none;
}

.hud-upgrade-toggle.is-active:hover,
.hud-upgrade-toggle.is-active:focus-visible {
  --upgrade-tab-border-color: #fef08a;
  --upgrade-tab-angle-border-color: #fef9c3;
  color: #fffde3;
  opacity: 1;
  background:
    linear-gradient(90deg, rgba(254, 240, 138, 0), rgba(254, 240, 138, 0.5) 22%, rgba(254, 249, 195, 0.92) 50%, rgba(254, 240, 138, 0.5) 78%, rgba(254, 240, 138, 0)) 12px 0 / calc(100% - 24px) 1px no-repeat,
    linear-gradient(135deg, rgba(254, 240, 138, 0) calc(50% - 1.2px), rgba(254, 240, 138, 0.58) 50%, rgba(254, 240, 138, 0) calc(50% + 1.2px)) left top / 12px 12px no-repeat,
    linear-gradient(45deg, rgba(254, 240, 138, 0) calc(50% - 1.2px), rgba(254, 240, 138, 0.58) 50%, rgba(254, 240, 138, 0) calc(50% + 1.2px)) right top / 12px 12px no-repeat,
    linear-gradient(180deg, rgba(254, 240, 138, 0.34), rgba(250, 204, 21, 0.1) 46%, rgba(250, 204, 21, 0.03) 70%, rgba(250, 204, 21, 0)) left 12px / 1px calc(100% - 12px) no-repeat,
    linear-gradient(180deg, rgba(254, 240, 138, 0.34), rgba(250, 204, 21, 0.1) 46%, rgba(250, 204, 21, 0.03) 70%, rgba(250, 204, 21, 0)) right 12px / 1px calc(100% - 12px) no-repeat,
    radial-gradient(ellipse at top, rgba(250, 204, 21, 0.24), rgba(250, 204, 21, 0.12) 38%, rgba(250, 204, 21, 0) 78%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.84) 34%, rgba(2, 6, 23, 0.9)),
    rgba(2, 6, 23, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
  text-shadow:
    0 1px 0 rgba(2, 6, 23, 0.98),
    1px 0 0 rgba(2, 6, 23, 0.82),
    -1px 0 0 rgba(2, 6, 23, 0.82),
    0 -1px 0 rgba(2, 6, 23, 0.68),
    0 1px 0 rgba(0, 0, 0, 0.78);
}

@keyframes tab-shimmer {
  from {
    left: -45%;
  }

  to {
    left: 120%;
  }
}

@keyframes tab-idle-sheen {
  0%,
  58% {
    left: -45%;
    opacity: 0;
  }

  70% {
    opacity: 0.72;
  }

  100% {
    left: 120%;
    opacity: 0;
  }
}

@keyframes upgrade-tab-attention {
  0%,
  100% {
    border-color: rgba(250, 204, 21, 0.62);
    box-shadow:
      inset 0 0 0 1px rgba(250, 204, 21, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.16);
    color: #fff7ad;
    text-shadow:
      0 1px 0 rgba(2, 6, 23, 0.96),
      1px 0 0 rgba(2, 6, 23, 0.78),
      -1px 0 0 rgba(2, 6, 23, 0.78),
      0 -1px 0 rgba(2, 6, 23, 0.64),
      0 1px 0 rgba(0, 0, 0, 0.72);
  }

  45% {
    border-color: rgba(254, 240, 138, 0.94);
    box-shadow:
      inset 0 0 0 1px rgba(250, 204, 21, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);
    color: #fffde3;
    text-shadow:
      0 1px 0 rgba(2, 6, 23, 0.98),
      1px 0 0 rgba(2, 6, 23, 0.84),
      -1px 0 0 rgba(2, 6, 23, 0.84),
      0 -1px 0 rgba(2, 6, 23, 0.68),
      0 1px 0 rgba(0, 0, 0, 0.82);
  }
}

.hud-personal {
  display: grid;
  grid-template-columns: auto auto;
  justify-self: center;
  align-items: center;
  gap: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.ship-status {
  width: 112px;
  height: 104px;
  overflow: visible;
  transform: translateX(-6px) scale(1.3);
  transform-origin: center;
}

.ship-status-shield-ghost {
  fill: rgba(2, 6, 23, 0);
  stroke: rgba(56, 189, 248, 0.025);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 20;
}

.ship-status-shield {
  fill: rgba(2, 6, 23, 0);
  stroke: rgba(95, 143, 168, 0.16);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: var(--shield-width);
  filter:
    drop-shadow(0 0 var(--shield-glow-blur) rgb(14 165 233 / var(--shield-glow-alpha)))
    drop-shadow(0 0 1px rgb(125 211 252 / 0.2));
}

.ship-status-shield-border {
  fill: none;
  stroke: rgba(56, 189, 248, 0.9);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: var(--shield-border-width);
}

.ship-status-hull path {
  fill: rgba(2, 6, 23, 0.74);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  filter: drop-shadow(0 0 3px currentColor);
}

.ship-status-hull path:not(:first-child) {
  fill: none;
  opacity: 0.78;
  stroke-width: 2.1;
}

.hud-status-rail {
  display: grid;
  grid-template-columns: auto;
  align-items: center;
  justify-items: center;
  gap: 5px;
  pointer-events: auto;
}

.hud-resources-readout {
  color: #fde68a;
  font-family: "Bahnschrift", "Segoe UI Variable Text", "Segoe UI", "Aptos", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(2, 6, 23, 0.82);
}

.hud-vitals {
  display: grid;
  grid-template-rows: repeat(3, 17px);
  min-width: 70px;
  padding: 0;
}

.hud-vital {
  position: relative;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.hud-vital::after {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: calc(100% - 2px);
  width: max-content;
  max-width: 120px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #b9cbd5;
  content: "- " attr(data-tooltip);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  text-shadow: 0 1px 0 rgba(2, 6, 23, 0.86);
  text-transform: none;
  transform: translateY(-50%);
}

.hud-vital:hover::after,
.hud-vital.is-tooltip-hover::after {
  opacity: 1;
}

.hud-vital:hover b,
.hud-vital.is-tooltip-hover b {
  filter: drop-shadow(0 0 6px rgba(186, 230, 253, 0.18));
  transform: scale(1.08);
}

.hud-vital.is-tooltip-hover b {
  transition: none;
}

.hud-vital b {
  display: inline-block;
  font-size: 14px;
  transform-origin: center;
  transition:
    filter 120ms ease,
    transform 120ms ease;
}

.hud-vital b span {
  color: rgba(226, 232, 240, 0.76);
  font-size: 11px;
}

.hud-vital.shield b {
  color: var(--blue);
}

.hud-vital.hull b {
  color: var(--green);
}

.hud-vital.energy b {
  color: var(--purple);
}

.hud-vital.shield::after {
  color: var(--blue);
}

.hud-vital.hull::after {
  color: var(--green);
}

.hud-vital.energy::after {
  color: var(--purple);
}

.hud-passives {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 28px;
  gap: 7px;
  justify-content: center;
}

.passive-placeholder[hidden] {
  display: none;
}

.passive-level {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fef3c7;
  overflow: visible;
}

.passive-level::after {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: calc(100% + 12px);
  display: inline-flex;
  width: max-content;
  max-width: 120px;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(125, 211, 252, 0.62);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  color: #b9cbd5;
  content: attr(data-tooltip);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: none;
  transform: translateY(-50%);
}

.passive-level::before {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: inset 0 0 10px rgba(125, 211, 252, 0.08);
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  content: "";
  pointer-events: none;
}

.passive-level:hover::before,
.passive-level.is-tooltip-hover::before {
  background: rgba(8, 20, 34, 0.98);
  box-shadow:
    inset 0 0 10px rgba(125, 211, 252, 0.13),
    0 0 12px rgba(14, 165, 233, 0.18);
}

.passive-level:hover::after,
.passive-level.is-tooltip-hover::after {
  opacity: 1;
}

.passive-level:hover i,
.passive-level:hover b,
.passive-level.is-tooltip-hover i,
.passive-level.is-tooltip-hover b {
  filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.22));
}

.passive-level i {
  position: relative;
  z-index: 1;
  color: #fff7ad;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.passive-level b {
  position: absolute;
  z-index: 2;
  right: -6px;
  bottom: -6px;
  width: 18px;
  min-width: 18px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: rgba(2, 6, 23, 0.96);
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  color: #fde68a;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
}

.hud-selection {
  display: none;
  min-height: 82px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: rgba(2, 6, 23, 0.74);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}

.hud-casting {
  --casting-corner: 12px;
  display: grid;
  position: absolute;
  bottom: calc(14px + var(--command-pod-height, 118px));
  left: 50%;
  z-index: 8;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  width: min(var(--command-pod-width, 360px), calc(100vw - 32px));
  min-height: 44px;
  align-items: center;
  column-gap: 9px;
  overflow: hidden;
  padding: 8px 9px 8px 13px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0), rgba(14, 165, 233, 0.26) 24%, rgba(186, 230, 253, 0.58) 50%, rgba(14, 165, 233, 0.26) 76%, rgba(14, 165, 233, 0)) var(--casting-corner) 0 / calc(100% - calc(var(--casting-corner) * 2)) 1px no-repeat,
    linear-gradient(135deg, rgba(14, 165, 233, 0) calc(50% - 1px), rgba(125, 211, 252, 0.34) 50%, rgba(14, 165, 233, 0) calc(50% + 1px)) left top / var(--casting-corner) var(--casting-corner) no-repeat,
    linear-gradient(45deg, rgba(14, 165, 233, 0) calc(50% - 1px), rgba(125, 211, 252, 0.34) 50%, rgba(14, 165, 233, 0) calc(50% + 1px)) right top / var(--casting-corner) var(--casting-corner) no-repeat,
    linear-gradient(45deg, rgba(14, 165, 233, 0) calc(50% - 1px), rgba(95, 143, 168, 0.22) 50%, rgba(14, 165, 233, 0) calc(50% + 1px)) left bottom / var(--casting-corner) var(--casting-corner) no-repeat,
    linear-gradient(135deg, rgba(14, 165, 233, 0) calc(50% - 1px), rgba(95, 143, 168, 0.22) 50%, rgba(14, 165, 233, 0) calc(50% + 1px)) right bottom / var(--casting-corner) var(--casting-corner) no-repeat,
    radial-gradient(ellipse at top, rgba(95, 143, 168, 0.16), rgba(95, 143, 168, 0.06) 48%, rgba(95, 143, 168, 0) 80%),
    linear-gradient(90deg, rgba(9, 17, 32, 0.82), rgba(15, 23, 42, 0.76) 34%, rgba(2, 6, 23, 0.86)),
    rgba(2, 6, 23, 0.72);
  clip-path: polygon(var(--casting-corner) 0, calc(100% - var(--casting-corner)) 0, 100% var(--casting-corner), 100% calc(100% - var(--casting-corner)), calc(100% - var(--casting-corner)) 100%, var(--casting-corner) 100%, 0 calc(100% - var(--casting-corner)), 0 var(--casting-corner));
  box-shadow:
    inset 0 1px 0 rgba(186, 230, 253, 0.12),
    inset 0 -1px 0 rgba(95, 143, 168, 0.1),
    0 10px 22px rgba(2, 6, 23, 0.3),
    0 0 14px rgba(14, 165, 233, 0.12);
  pointer-events: auto;
  transform: translateX(-50%);
}

.hud-casting.has-upgrade-tab {
  bottom: calc(56px + var(--command-pod-height, 118px));
}

.hud-casting-title {
  position: relative;
  z-index: 1;
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(2, 6, 23, 0.96);
}

.hud-casting-time {
  position: relative;
  z-index: 1;
  min-width: 34px;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.hud-casting-track {
  position: relative;
  z-index: 1;
  height: 12px;
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(125, 211, 252, 0.16),
    inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hud-casting-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.62), rgba(125, 211, 252, 0.92));
  box-shadow: 0 0 12px rgba(125, 211, 252, 0.68);
}

.hud-casting-cancel {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 62px;
  height: 26px;
  place-items: center;
  --casting-cancel-border: rgba(248, 113, 113, 0.38);
  --casting-cancel-chamfer-border: rgba(248, 113, 113, 0.5);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, var(--casting-cancel-border), var(--casting-cancel-border)) 4px top / calc(100% - 8px) 1px no-repeat,
    linear-gradient(90deg, var(--casting-cancel-border), var(--casting-cancel-border)) 4px bottom / calc(100% - 8px) 1px no-repeat,
    linear-gradient(180deg, var(--casting-cancel-border), var(--casting-cancel-border)) left 4px / 1px calc(100% - 8px) no-repeat,
    linear-gradient(180deg, var(--casting-cancel-border), var(--casting-cancel-border)) right 4px / 1px calc(100% - 8px) no-repeat,
    linear-gradient(135deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) left top / 5px 5px no-repeat,
    linear-gradient(45deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) right top / 5px 5px no-repeat,
    linear-gradient(45deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) left bottom / 5px 5px no-repeat,
    linear-gradient(135deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) right bottom / 5px 5px no-repeat,
    rgba(127, 29, 29, 0.16);
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  color: #fecaca;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1;
  padding: 2px 10px 0;
  text-transform: uppercase;
}

.hud-casting-cancel:hover,
.hud-casting-cancel:focus-visible {
  --casting-cancel-border: rgba(248, 113, 113, 0.78);
  --casting-cancel-chamfer-border: rgba(254, 202, 202, 0.86);
  background:
    linear-gradient(90deg, var(--casting-cancel-border), var(--casting-cancel-border)) 4px top / calc(100% - 8px) 1px no-repeat,
    linear-gradient(90deg, var(--casting-cancel-border), var(--casting-cancel-border)) 4px bottom / calc(100% - 8px) 1px no-repeat,
    linear-gradient(180deg, var(--casting-cancel-border), var(--casting-cancel-border)) left 4px / 1px calc(100% - 8px) no-repeat,
    linear-gradient(180deg, var(--casting-cancel-border), var(--casting-cancel-border)) right 4px / 1px calc(100% - 8px) no-repeat,
    linear-gradient(135deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) left top / 5px 5px no-repeat,
    linear-gradient(45deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) right top / 5px 5px no-repeat,
    linear-gradient(45deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) left bottom / 5px 5px no-repeat,
    linear-gradient(135deg, transparent calc(50% - 1px), var(--casting-cancel-chamfer-border) 50%, transparent calc(50% + 1px)) right bottom / 5px 5px no-repeat,
    rgba(127, 29, 29, 0.28);
  color: #fee2e2;
  outline: none;
}

.hud-casting-cancel span {
  pointer-events: none;
}

.hud-empty {
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
}

.hud-upgrades {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.72fr);
  width: min(620px, calc(100vw - 40px));
  margin-top: 9px;
  padding: 0 10px;
  gap: 6px;
  align-items: stretch;
  pointer-events: auto;
}

.upgrade-buy-mode {
  display: inline-flex;
  grid-column: 1 / -1;
  justify-self: center;
  min-height: 30px;
  overflow: hidden;
  --buy-mode-border-color: rgba(250, 204, 21, 0.48);
  border: 0;
  background:
    linear-gradient(90deg, rgba(250, 204, 21, 0), rgba(250, 204, 21, 0.3) 22%, rgba(254, 240, 138, 0.62) 50%, rgba(250, 204, 21, 0.3) 78%, rgba(250, 204, 21, 0)) 12px 0 / calc(100% - 24px) 1px no-repeat,
    linear-gradient(135deg, transparent calc(50% - 1px), var(--buy-mode-border-color) 50%, transparent calc(50% + 1px)) left top / 12px 12px no-repeat,
    linear-gradient(45deg, transparent calc(50% - 1px), var(--buy-mode-border-color) 50%, transparent calc(50% + 1px)) right top / 12px 12px no-repeat,
    radial-gradient(ellipse at top, rgba(120, 89, 18, 0.44), rgba(120, 89, 18, 0.24) 44%, transparent 78%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.9)),
    rgba(2, 6, 23, 0.88);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%, 0 12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.upgrade-buy-mode button {
  min-width: 86px;
  border: 0;
  background: transparent;
  color: rgba(254, 243, 199, 0.72);
  cursor: pointer;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 0 13px;
  text-shadow: 0 1px 0 rgba(2, 6, 23, 0.95);
  text-transform: uppercase;
  transition:
    background 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease,
    filter 120ms ease;
}

.upgrade-buy-mode button + button {
  border-left: 1px solid rgba(250, 204, 21, 0.22);
}

.upgrade-buy-mode button.is-active {
  background:
    radial-gradient(ellipse at top, rgba(250, 204, 21, 0.28), rgba(120, 89, 18, 0.12) 58%, transparent),
    rgba(120, 89, 18, 0.42);
  color: #fff7ad;
}

.upgrade-buy-mode button:hover,
.upgrade-buy-mode button:focus-visible {
  background:
    radial-gradient(ellipse at top, rgba(254, 240, 138, 0.24), rgba(250, 204, 21, 0.1) 62%, transparent),
    rgba(120, 89, 18, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(250, 204, 21, 0.16);
  color: #fffde3;
  filter: brightness(1.08);
  outline: none;
}

.upgrade-buy-mode button.is-active:hover,
.upgrade-buy-mode button.is-active:focus-visible {
  background:
    radial-gradient(ellipse at top, rgba(254, 240, 138, 0.34), rgba(250, 204, 21, 0.16) 62%, transparent),
    rgba(120, 89, 18, 0.54);
}

.upgrade-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 7px;
  --angled-border-color: rgba(148, 163, 184, 0.46);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.68), rgba(2, 6, 23, 0.72)),
    rgba(2, 6, 23, 0.78);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  pointer-events: auto;
}

.upgrade-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
  margin-bottom: 8px;
  padding: 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.upgrade-panel-title strong {
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-panel-title span {
  color: #fde68a;
  flex: 0 0 auto;
}

.upgrade-panel-title .upgrade-shop-hint {
  min-width: 0;
  overflow: hidden;
  color: var(--red);
  font-size: 9px;
  font-weight: 900;
  text-align: right;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  align-content: start;
}

.ship-ability-grid {
  grid-template-columns: 1fr;
}

.upgrade-button {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px 18px auto;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  --angled-border-color: rgba(148, 163, 184, 0);
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(51, 65, 85, 0.88), rgba(30, 41, 59, 0.78)),
    rgba(30, 41, 59, 0.92);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  color: var(--ink);
  cursor: pointer;
  padding: 4px 6px;
  text-align: left;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease,
    transform 120ms ease;
  pointer-events: auto;
}

.upgrade-button:hover,
.upgrade-button.is-hovered,
.upgrade-button:focus-visible {
  --angled-border-color: #fde68a;
  outline: none;
  background:
    radial-gradient(ellipse at top, rgba(250, 204, 21, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(250, 204, 21, 0.2), rgba(15, 23, 42, 0.92)),
    rgba(15, 23, 42, 0.9);
  box-shadow: none;
  transform: translateY(-1px);
}

.upgrade-tooltip {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  max-width: 220px;
  width: max-content;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(125, 211, 252, 0.62);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.96);
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateY(-100%);
  white-space: pre-line;
}

.upgrade-tooltip.is-visible {
  opacity: 1;
}

.upgrade-button:active,
.upgrade-button.is-pressed {
  background:
    linear-gradient(180deg, rgba(41, 53, 75, 0.9), rgba(23, 33, 52, 0.86)),
    rgba(23, 33, 52, 0.94);
  box-shadow:
    inset 0 2px 5px rgba(2, 6, 23, 0.42);
  filter: brightness(0.92);
  transform: translateY(1px) scale(0.99);
}

.upgrade-button strong,
.upgrade-button-stage,
.upgrade-button em,
.upgrade-button-state,
.upgrade-button b {
  position: relative;
  z-index: 1;
}

.upgrade-button.is-pending {
  --angled-border-color: #bbf7d0;
  background:
    linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.86)),
    rgba(15, 23, 42, 0.9);
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.22),
    0 0 22px rgba(34, 197, 94, 0.22);
  animation: upgrade-pending 620ms ease-in-out infinite alternate;
}

.upgrade-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.upgrade-button.is-unaffordable {
  opacity: 0.74;
}

.upgrade-button.is-installed {
  --angled-border-color: rgba(100, 116, 139, 0);
  background:
    linear-gradient(180deg, rgba(51, 65, 85, 0.62), rgba(30, 41, 59, 0.58)),
    rgba(30, 41, 59, 0.72);
  color: rgba(203, 213, 225, 0.72);
  cursor: default;
  opacity: 0.66;
}

.upgrade-button.is-installed:hover,
.upgrade-button.is-installed.is-hovered,
.upgrade-button.is-installed:focus-visible {
  --angled-border-color: rgba(100, 116, 139, 0);
  background:
    linear-gradient(180deg, rgba(51, 65, 85, 0.62), rgba(30, 41, 59, 0.58)),
    rgba(30, 41, 59, 0.72);
  box-shadow: none;
  transform: none;
}

.upgrade-button.is-installed strong {
  grid-column: 1 / -1;
  color: rgba(203, 213, 225, 0.72);
  text-align: center;
  text-transform: uppercase;
}

.upgrade-button.is-placeholder {
  --angled-border-color: rgba(100, 116, 139, 0);
  background:
    linear-gradient(180deg, rgba(51, 65, 85, 0.5), rgba(30, 41, 59, 0.46)),
    rgba(30, 41, 59, 0.58);
  cursor: default;
  opacity: 0.52;
}

.upgrade-button.is-placeholder:hover,
.upgrade-button.is-placeholder.is-hovered,
.upgrade-button.is-placeholder:focus-visible {
  --angled-border-color: rgba(71, 85, 105, 0);
  background:
    linear-gradient(180deg, rgba(51, 65, 85, 0.5), rgba(30, 41, 59, 0.46)),
    rgba(30, 41, 59, 0.58);
  box-shadow: none;
  transform: none;
}

.upgrade-button.is-placeholder strong {
  grid-column: 1 / -1;
  align-self: center;
  color: rgba(203, 213, 225, 0.76);
}

.upgrade-button.is-unaffordable b {
  color: #fca5a5;
}

@keyframes upgrade-pending {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.24);
  }
}

.upgrade-button strong,
.upgrade-button-stage,
.upgrade-button em,
.upgrade-button-state,
.upgrade-button b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-button strong {
  color: #e5edf7;
  font-size: 11px;
  line-height: 1;
}

.upgrade-button em {
  color: #4ade80;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.upgrade-button-stage {
  color: #c084fc;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
}

.ability-upgrade-button {
  grid-template-columns: minmax(0, 1fr) 18px 18px 46px 38px;
}

.upgrade-button-state {
  color: rgba(203, 213, 225, 0.86);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.ability-upgrade-button:not(.is-installed):not(.is-placeholder) .upgrade-button-state {
  color: #c084fc;
}

.ability-upgrade-button.is-installed strong {
  grid-column: auto;
  color: rgba(203, 213, 225, 0.82);
  text-align: left;
  text-transform: none;
}

.ability-upgrade-button.is-installed {
  grid-template-columns: minmax(0, 1fr) 0 0 68px 0;
}

.ability-upgrade-button.is-installed .upgrade-button-state {
  font-size: 9px;
}

.ability-upgrade-button.is-placeholder strong {
  grid-column: auto;
}

.upgrade-button b {
  color: #fde68a;
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  text-align: right;
}

.upgrade-shop-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding: 8px 3px 0;
}

.upgrade-shop-total {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.upgrade-shop-summary span {
  color: #fde68a;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.upgrade-shop-summary span.is-shortfall {
  color: #f87171;
}

.upgrade-shop-summary button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(106, 82, 154, 0.98), rgba(72, 54, 120, 0.98) 48%, rgba(35, 29, 72, 0.98)),
    rgba(42, 34, 78, 0.94);
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px), 0 7px);
  color: #f3e8ff;
  cursor: pointer;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(2, 6, 23, 0.95);
  text-transform: uppercase;
  transition:
    background 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease,
    transform 120ms ease;
}

.upgrade-shop-summary button::after {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -45%;
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: rotate(18deg);
}

.upgrade-shop-summary button:not(:disabled):hover,
.upgrade-shop-summary button:not(:disabled):focus-visible {
  background:
    linear-gradient(180deg, rgba(134, 103, 188, 0.98), rgba(89, 66, 139, 0.98) 48%, rgba(43, 34, 82, 0.98)),
    rgba(55, 43, 97, 0.94);
  color: #faf5ff;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 2px rgba(192, 132, 252, 0.18),
    0 0 22px rgba(168, 85, 247, 0.34);
  filter: brightness(1.12);
}

.upgrade-shop-summary button:not(:disabled):active {
  background:
    linear-gradient(180deg, rgba(72, 54, 120, 0.98), rgba(48, 38, 88, 0.98) 48%, rgba(24, 21, 55, 0.98)),
    rgba(31, 26, 63, 0.96);
  box-shadow:
    inset 0 2px 6px rgba(2, 6, 23, 0.68),
    0 0 0 1px rgba(192, 132, 252, 0.12);
  filter: brightness(0.92);
  transform: translateY(1px) scale(0.99);
}

.upgrade-shop-summary button:not(:disabled):hover::after,
.upgrade-shop-summary button:not(:disabled):focus-visible::after {
  opacity: 1;
  animation: tab-shimmer 760ms ease-out;
}

.upgrade-shop-summary button:disabled {
  background:
    linear-gradient(180deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.64)),
    rgba(51, 65, 85, 0.62);
  color: rgba(203, 213, 225, 0.46);
  cursor: not-allowed;
}

.ship-ability-placeholder {
  min-height: 42px;
  padding: 10px;
  --angled-border-color: rgba(148, 163, 184, 0.5);
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, 0.58);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.hud-unit-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hud-unit-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-unit-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hud-stat {
  display: grid;
  grid-template-columns: 58px minmax(72px, 1fr) 78px;
  gap: 8px;
  align-items: center;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.hud-stat-track {
  height: 8px;
  border: 0;
  background: #111827;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px);
}

.hud-stat-track i {
  display: block;
  height: 100%;
}

.hud-stat.health .hud-stat-track {
  background: #7f1d1d;
}

.hud-stat.health .hud-stat-track i {
  background: var(--green);
}

.hud-stat.shields .hud-stat-track {
  background: #1e3a8a;
}

.hud-stat.shields .hud-stat-track i {
  background: var(--blue);
}

.hud-stat.energy .hud-stat-track {
  background: #581c87;
}

.hud-stat.energy .hud-stat-track i {
  background: var(--purple);
}

.hud-stat b {
  color: #e2e8f0;
  font-size: 11px;
  text-align: right;
}

.hud-minimap-actions {
  display: flex;
  gap: 10px;
  min-height: 32px;
  align-items: center;
  justify-content: flex-start;
  transform: translateY(-2px);
}

.minimap-action-button {
  position: relative;
  display: inline-grid;
  width: 38px;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #facc15;
  cursor: pointer;
  padding: 0;
}

.minimap-action-button .lucide-icon {
  width: 29px;
  height: 29px;
  color: #fff7ad;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.42));
  transition:
    color 140ms ease,
    filter 140ms ease,
    transform 140ms ease;
}

.minimap-action-button .lucide-icon,
.minimap-action-button .lucide-icon * {
  pointer-events: none;
}

.ping-radar-icon {
  display: block;
  width: 29px;
  height: 29px;
  overflow: visible;
  color: #fff7ad;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.42));
  transition:
    filter 140ms ease,
    transform 140ms ease;
}

.ping-radar-icon * {
  pointer-events: none;
}

.distress-triangle-icon {
  display: block;
  width: 29px;
  height: 29px;
  overflow: visible;
  color: #b64a5a;
  filter: drop-shadow(0 0 6px rgba(182, 74, 90, 0.42));
  transition:
    filter 140ms ease,
    transform 140ms ease;
}

.distress-triangle-icon * {
  pointer-events: none;
}

.distress-triangle-outer,
.distress-triangle-inner {
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.45;
  vector-effect: non-scaling-stroke;
}

.distress-triangle-inner {
  opacity: 0.82;
}

.ping-ring,
.ping-tick {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.ping-ring-outer {
  stroke-width: 1.35;
  opacity: 0.76;
}

.ping-ring-inner {
  stroke-width: 1.45;
  opacity: 0.96;
}

.ping-tick {
  stroke-width: 1.35;
  opacity: 0.9;
}

.ping-dot {
  fill: currentColor;
}

.minimap-action-button::after {
  position: absolute;
  z-index: 2;
  top: calc(100% + 6px);
  left: 50%;
  display: inline-flex;
  width: max-content;
  max-width: 130px;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(125, 211, 252, 0.62);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.96);
  color: #e0f2fe;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
}

.minimap-action-button:hover::after {
  opacity: 1;
}

.minimap-action-button:hover,
.minimap-action-button:focus-visible {
  color: #fffde3;
  outline: none;
  box-shadow: none;
}

.minimap-action-button:hover .lucide-icon,
.minimap-action-button:focus-visible .lucide-icon,
.minimap-action-button:hover .ping-radar-icon,
.minimap-action-button:focus-visible .ping-radar-icon,
.minimap-action-button:hover .distress-triangle-icon,
.minimap-action-button:focus-visible .distress-triangle-icon {
  filter:
    drop-shadow(0 0 8px rgba(250, 204, 21, 0.78))
    drop-shadow(0 0 16px rgba(234, 179, 8, 0.42));
  transform: translateY(-1px) scale(1.08);
}

.minimap-action-button.is-distress {
  color: #b64a5a;
}

.minimap-action-button.is-distress .lucide-icon {
  color: #b64a5a;
  stroke-width: 1.45;
}

.minimap-action-button.is-distress .distress-triangle-icon {
  color: #b64a5a;
}

.minimap-action-button.is-distress:hover .lucide-icon,
.minimap-action-button.is-distress:focus-visible .lucide-icon,
.minimap-action-button.is-distress:hover .distress-triangle-icon,
.minimap-action-button.is-distress:focus-visible .distress-triangle-icon {
  filter:
    drop-shadow(0 0 8px rgba(182, 74, 90, 0.78))
    drop-shadow(0 0 16px rgba(136, 41, 55, 0.38));
}

.dev-hurt-self-button .lucide-icon {
  color: #f9a8d4;
  filter: drop-shadow(0 0 7px rgba(244, 114, 182, 0.58));
}

.dev-hurt-self-button:hover .lucide-icon,
.dev-hurt-self-button:focus-visible .lucide-icon {
  filter:
    drop-shadow(0 0 8px rgba(244, 114, 182, 0.82))
    drop-shadow(0 0 16px rgba(219, 39, 119, 0.42));
}

.dev-tuning-toggle {
  position: static;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e0f2fe;
  cursor: none;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.chat-icon-button,
.dev-tuning-toggle.chat-icon-button,
.chat-tool-button.chat-icon-button,
.chat-info-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  place-items: center;
  border-radius: 0;
  clip-path: none;
  padding: 0;
}

.chat-icon-button .lucide-icon {
  width: 22px;
  height: 22px;
  color: currentColor;
  filter: drop-shadow(0 0 6px rgba(125, 211, 252, 0.22));
  transition:
    color 140ms ease,
    filter 140ms ease,
    transform 140ms ease;
}

.chat-icon-button .lucide-icon,
.chat-icon-button .lucide-icon * {
  pointer-events: none;
}

.dev-tuning-toggle:hover,
.dev-tuning-toggle:focus-visible {
  color: #ffffff;
  outline: none;
  box-shadow: none;
}

.chat-tool-button {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e0f2fe;
  cursor: none;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.chat-tool-button:hover,
.chat-tool-button:focus-visible,
.chat-tool-button.is-active {
  color: #ffffff;
  outline: none;
  box-shadow: none;
}

.chat-tool-button:hover .lucide-icon,
.chat-tool-button:focus-visible .lucide-icon,
.chat-tool-button.is-active .lucide-icon,
.dev-tuning-toggle:hover .lucide-icon,
.dev-tuning-toggle:focus-visible .lucide-icon {
  filter:
    drop-shadow(0 0 8px rgba(125, 211, 252, 0.78))
    drop-shadow(0 0 16px rgba(14, 165, 233, 0.42));
  transform: translateY(-1px) scale(1.08);
}

.chat-tool-button.is-active {
  color: #fde68a;
}

.interface-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 18;
  display: block;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}

.interface-menu-panel {
  display: grid;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 36px);
  gap: 16px;
  border: 1px solid rgba(125, 211, 252, 0.68);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48);
  overflow: auto;
  padding: 16px;
}

.interface-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e0f2fe;
  font-size: 16px;
}

.interface-menu-body {
  display: grid;
  gap: 12px;
}

.interface-menu label {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.interface-menu input {
  position: relative;
  width: 46px;
  height: 22px;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 999px;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.94));
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.interface-menu input::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.92);
  box-shadow: 0 0 8px rgba(15, 23, 42, 0.64);
  content: "";
  transition:
    background 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.interface-menu input::after {
  position: absolute;
  top: 50%;
  right: 7px;
  color: rgba(203, 213, 225, 0.8);
  content: "OFF";
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.interface-menu input:checked {
  border-color: rgba(56, 189, 248, 0.86);
  background:
    linear-gradient(180deg, rgba(14, 116, 144, 0.72), rgba(15, 23, 42, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(125, 211, 252, 0.12),
    0 0 12px rgba(14, 165, 233, 0.18);
}

.interface-menu input:checked::before {
  background: #7dd3fc;
  box-shadow:
    0 0 8px rgba(125, 211, 252, 0.68),
    0 0 16px rgba(14, 165, 233, 0.34);
  transform: translateX(24px);
}

.interface-menu input:checked::after {
  right: auto;
  left: 7px;
  color: #e0f2fe;
  content: "ON";
}

.interface-menu input:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(125, 211, 252, 0.2),
    0 0 14px rgba(14, 165, 233, 0.2);
}

.interface-menu-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.secondary-button,
.primary-small-button,
.danger-button {
  min-height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.68);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 11px;
}

.primary-small-button {
  border-color: rgba(56, 189, 248, 0.74);
  background: rgba(14, 116, 144, 0.88);
}

.danger-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(239, 68, 68, 0.66);
  background:
    linear-gradient(180deg, rgba(127, 29, 29, 0.36), rgba(15, 23, 42, 0.92));
  color: #fff1f2;
  text-shadow:
    0 0 8px rgba(239, 68, 68, 0.58),
    0 1px 0 rgba(0, 0, 0, 0.76);
  box-shadow:
    inset 0 0 0 1px rgba(248, 113, 113, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.danger-button::after {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -55%;
  width: 28px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: rotate(18deg);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.primary-small-button:hover,
.primary-small-button:focus-visible {
  border-color: #dff8ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.16);
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: var(--red);
  color: #ffffff;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(248, 113, 113, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 2px rgba(248, 113, 113, 0.12);
}

.danger-button:hover::after,
.danger-button:focus-visible::after {
  opacity: 1;
  animation: tab-shimmer 760ms ease-out;
}

.hud-abilities {
  position: absolute;
  bottom: 14px;
  right: calc(50% + var(--command-pod-half-width, 160px) + 18px);
  display: flex;
  gap: 0;
  align-items: flex-end;
  pointer-events: auto;
}

.ability-slot {
  position: relative;
  z-index: 0;
  display: grid;
  width: 63px;
  height: 63px;
  align-items: center;
  justify-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: default;
  padding: 6px;
  filter: drop-shadow(0 0 9px rgba(14, 165, 233, 0.14));
  transition: filter 160ms ease;
}

.ability-slot::before {
  position: absolute;
  inset: 3.5px;
  z-index: 1;
  background: rgba(51, 65, 85, 0.82);
  backdrop-filter: blur(14px) saturate(1.45) brightness(1.12);
  clip-path: polygon(50% 0, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%);
  content: "";
  pointer-events: none;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition:
    background 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ability-slot::after {
  position: absolute;
  inset: 2.5px;
  z-index: 0;
  background:
    conic-gradient(from var(--ability-border-angle, 0deg) at 50% 50%,
      rgba(14, 165, 233, 0.18) 0deg,
      rgba(14, 165, 233, 0.08) 46deg,
      rgba(14, 165, 233, 0.32) 96deg,
      rgba(125, 211, 252, 0.96) 118deg,
      rgba(186, 230, 253, 0.72) 136deg,
      rgba(14, 165, 233, 0.18) 164deg,
      rgba(14, 165, 233, 0.06) 238deg,
      rgba(14, 165, 233, 0.46) 302deg,
      rgba(125, 211, 252, 0.86) 326deg,
      rgba(14, 165, 233, 0.18) 360deg);
  clip-path: polygon(50% 0, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%);
  content: "";
  filter:
    drop-shadow(0 0 4px rgba(14, 165, 233, 0.56))
    drop-shadow(0 0 9px rgba(125, 211, 252, 0.3));
  opacity: 0;
  pointer-events: none;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ability-slot:not(.is-placeholder):not(:disabled) {
  cursor: pointer;
}

.ability-hex-border {
  position: absolute;
  inset: 3.5px;
  z-index: 2;
  color: rgba(2, 6, 23, 0.9);
  overflow: visible;
  pointer-events: none;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ability-hex-border polygon {
  fill: none;
  stroke: currentColor;
  stroke-linejoin: miter;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.ability-slot strong {
  position: relative;
  z-index: 3;
  color: var(--green);
  font-size: 17px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.46);
}

.ability-slot img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.ability-icon {
  position: relative;
  z-index: 3;
  width: 31px;
  height: 31px;
  color: #b9cbd5;
  overflow: visible;
  pointer-events: none;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition:
    color 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ability-icon-warp path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.35;
  filter: none;
}

.ability-slot .ability-icon-pdd-image {
  left: 0px;
  top: 0px;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  object-fit: contain;
  justify-self: center;
  align-self: center;
  filter:
    drop-shadow(0 2px 3px rgba(2, 6, 23, 0.72))
    drop-shadow(0 6px 8px rgba(2, 6, 23, 0.42));
}

.ability-drone-counter {
  position: absolute;
  left: 50%;
  bottom: -4px;
  z-index: 6;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #bae6fd;
  pointer-events: none;
  transform: translateX(-50%);
  filter:
    drop-shadow(0 2px 3px rgba(2, 6, 23, 0.72))
    drop-shadow(0 0 6px rgba(14, 165, 233, 0.24));
}

.ability-drone-counter svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(125, 211, 252, 0.78);
  overflow: visible;
}

.ability-drone-counter polygon {
  fill: rgba(15, 23, 42, 0.92);
  stroke: currentColor;
  stroke-linejoin: miter;
  stroke-width: 1.65;
  vector-effect: non-scaling-stroke;
}

.ability-drone-counter strong {
  position: relative;
  z-index: 1;
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.9);
}

.ability-slot:not(:disabled):hover .ability-icon,
.ability-slot:not(:disabled):focus-visible .ability-icon,
.ability-slot.is-active .ability-icon {
  color: #e0f2fe;
}

.ability-slot:not(:disabled):hover,
.ability-slot:not(:disabled):focus-visible,
.ability-slot.is-active {
  z-index: 2;
}

.ability-slot:not(:disabled):hover::before,
.ability-slot:not(:disabled):hover::after,
.ability-slot:not(:disabled):hover .ability-hex-border,
.ability-slot:not(:disabled):focus-visible::before,
.ability-slot:not(:disabled):focus-visible::after,
.ability-slot:not(:disabled):focus-visible .ability-hex-border,
.ability-slot.is-active::before,
.ability-slot.is-active::after,
.ability-slot.is-active .ability-hex-border {
  transform: scale(1.18);
}

.hud-abilities:has(.ability-slot:not(:disabled):hover) .ability-slot:not(:hover)::before,
.hud-abilities:has(.ability-slot:not(:disabled):hover) .ability-slot:not(:hover)::after,
.hud-abilities:has(.ability-slot:not(:disabled):hover) .ability-slot:not(:hover) .ability-hex-border,
.hud-abilities:has(.ability-slot:not(:disabled):focus-visible) .ability-slot:not(:focus-visible)::before,
.hud-abilities:has(.ability-slot:not(:disabled):focus-visible) .ability-slot:not(:focus-visible)::after,
.hud-abilities:has(.ability-slot:not(:disabled):focus-visible) .ability-slot:not(:focus-visible) .ability-hex-border {
  transform: scale(0.88);
}

.hud-abilities:has(.ability-slot.is-active) .ability-slot:not(.is-active)::before,
.hud-abilities:has(.ability-slot.is-active) .ability-slot:not(.is-active)::after,
.hud-abilities:has(.ability-slot.is-active) .ability-slot:not(.is-active) .ability-hex-border {
  transform: scale(0.88);
}

.ability-slot:not(.is-placeholder):not(:disabled):hover .ability-icon,
.ability-slot:not(.is-placeholder):not(:disabled):focus-visible .ability-icon,
.ability-slot.is-active .ability-icon {
  transform: scale(1.24);
}

.hud-abilities:has(.ability-slot.is-active) .ability-slot:not(.is-active) .ability-icon {
  color: #b9cbd5;
  transform: scale(1);
}

.ability-slot:not(:disabled):hover .ability-icon-warp path,
.ability-slot:not(:disabled):focus-visible .ability-icon-warp path,
.ability-slot.is-active .ability-icon-warp path {
  filter:
    drop-shadow(0 0 7px rgba(224, 242, 254, 0.72))
    drop-shadow(0 0 16px rgba(14, 165, 233, 0.34));
}

.ability-slot:not(:disabled):hover .ability-icon-pdd-image,
.ability-slot:not(:disabled):focus-visible .ability-icon-pdd-image,
.ability-slot.is-active .ability-icon-pdd-image {
  filter:
    drop-shadow(0 2px 4px rgba(2, 6, 23, 0.78))
    drop-shadow(0 7px 10px rgba(2, 6, 23, 0.46));
}

.hud-abilities:has(.ability-slot.is-active) .ability-slot:not(.is-active) .ability-icon-warp path {
  filter: none;
}

.hud-abilities:has(.ability-slot.is-active) .ability-slot:not(.is-active) .ability-icon-pdd-image {
  filter:
    drop-shadow(0 2px 4px rgba(2, 6, 23, 0.62))
    drop-shadow(0 5px 7px rgba(2, 6, 23, 0.36));
}

.ability-slot span:not(.sr-only):not(.ability-cooldown-mask):not(.ability-drone-counter) {
  position: relative;
  z-index: 3;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ability-slot em {
  position: absolute;
  z-index: 5;
  inset: auto 4px 4px auto;
  padding: 1px 4px;
  border-radius: 0;
  background: rgba(2, 6, 23, 0.86);
  color: #fef3c7;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.ability-cooldown-mask {
  position: absolute;
  inset: 5px;
  z-index: 4;
  background:
    conic-gradient(from 0deg,
      transparent 0 var(--ability-cooldown-progress, 0%),
      rgba(2, 6, 23, 0.74) var(--ability-cooldown-progress, 0%) 100%);
  clip-path: polygon(50% 0, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%);
  content: "";
  pointer-events: none;
  transform-origin: 50% 50%;
}

.ability-slot.is-active {
  filter:
    drop-shadow(0 0 8px rgba(125, 211, 252, 0.36))
    drop-shadow(0 0 18px rgba(14, 165, 233, 0.24));
}

.ability-slot.is-active::before {
  inset: 5px;
  background: rgba(51, 65, 85, 0.86);
}

.ability-slot.is-active::after {
  opacity: 1;
  animation: ability-active-border-sweep 2100ms linear infinite;
}

.ability-slot.is-cooling {
  opacity: 0.72;
}

.ability-slot.is-placeholder {
  opacity: 0.76;
}

.ability-slot.is-drone-blocked {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.35) drop-shadow(0 0 4px rgba(2, 6, 23, 0.3));
}

.ability-slot.is-drone-blocked::before {
  background: rgba(51, 65, 85, 0.46);
}

.ability-slot.is-drone-blocked .ability-icon-pdd-image {
  filter:
    grayscale(0.52)
    brightness(0.62)
    drop-shadow(0 2px 4px rgba(2, 6, 23, 0.58));
}

.ability-slot.is-drone-blocked .ability-drone-counter {
  color: rgba(148, 163, 184, 0.86);
  filter: drop-shadow(0 2px 3px rgba(2, 6, 23, 0.58));
}

.ability-slot.is-drone-blocked .ability-drone-counter polygon {
  fill: rgba(15, 23, 42, 0.84);
  stroke: rgba(100, 116, 139, 0.76);
}

.ability-slot.is-drone-blocked .ability-drone-counter strong {
  color: rgba(203, 213, 225, 0.86);
}

.ability-slot.is-placeholder::before {
  background: rgba(51, 65, 85, 0.58);
}

.ability-slot:disabled {
  opacity: 0.42;
}

.ability-slot.is-cooling:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.ability-slot.is-cooling:disabled .ability-icon {
  color: #7892a3;
  transform: scale(1);
}

.ability-slot.is-cooling:disabled .ability-icon-warp path {
  filter:
    drop-shadow(0 0 3px rgba(120, 146, 163, 0.32))
    drop-shadow(0 0 8px rgba(2, 6, 23, 0.28));
}

.ability-slot.is-cooling:disabled .ability-icon-pdd-image {
  filter:
    grayscale(0.36)
    brightness(0.74)
    drop-shadow(0 2px 4px rgba(2, 6, 23, 0.62))
    drop-shadow(0 5px 7px rgba(2, 6, 23, 0.34));
}

@property --ability-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes ability-active-border-sweep {
  to {
    --ability-border-angle: 360deg;
  }
}

.movement-command-panel {
  position: absolute;
  right: min(390px, calc(100vw - 424px));
  bottom: 14px;
  z-index: 3;
  display: grid;
  width: 154px;
  gap: 7px;
  padding: 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}

.movement-command-panel::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  --move-frame-border-color: rgba(14, 165, 233, 0.54);
  --move-frame-angle-border-color: rgba(14, 165, 233, 0.9);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(2, 6, 23, 0.74)),
    rgba(2, 6, 23, 0.62);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  box-shadow: 0 -8px 18px rgba(14, 165, 233, 0.12);
  content: "";
  pointer-events: none;
}

.movement-command-panel.is-collapsed {
  pointer-events: none;
  transform: translateY(calc(100% + 16px));
}

.movement-command-panel.is-collapsed .movement-command-toggle {
  pointer-events: auto;
}

.movement-command-toggle {
  position: absolute;
  z-index: 2;
  right: -1px;
  bottom: calc(100% + 1px);
  display: inline-flex;
  width: 78px;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  --move-tab-border-color: rgba(14, 165, 233, 0.56);
  --move-tab-angle-border-color: rgba(14, 165, 233, 0.9);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.78)),
    rgba(2, 6, 23, 0.68);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
  color: #e0f2fe;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.74;
  padding: 3px 10px;
  pointer-events: auto;
  text-transform: uppercase;
}

.movement-command-toggle .lucide-icon {
  width: 14px;
  height: 14px;
}

.movement-command-toggle .lucide-icon,
.movement-command-toggle .lucide-icon *,
.movement-command-toggle span {
  pointer-events: none;
}

.movement-command-toggle:hover,
.movement-command-toggle:focus-visible {
  --move-tab-border-color: #7dd3fc;
  --move-tab-angle-border-color: #bae6fd;
  color: #f8fafc;
  opacity: 1;
  outline: none;
}

.movement-command-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 64px);
  gap: 8px;
  transition:
    opacity 180ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}

.movement-command-panel.is-collapsed .movement-command-grid {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 120ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 520ms;
  visibility: hidden;
}

.movement-command-button {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-items: center;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(125, 211, 252, 0.16), transparent 58%),
    rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  cursor: pointer;
  padding: 8px;
  transition:
    box-shadow 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.movement-command-button .lucide-icon {
  width: 31px;
  height: 31px;
  pointer-events: none;
  stroke-width: 2.5;
}

.movement-command-button kbd {
  position: absolute;
  right: 4px;
  bottom: 3px;
  border: 0;
  background: transparent;
  color: #fde68a;
  font: 700 10px/1 var(--ui-font);
  pointer-events: none;
}

.movement-command-button:hover,
.movement-command-button:focus-visible,
.movement-command-button.is-active {
  color: #ffffff;
  outline: none;
  box-shadow: 0 0 18px rgba(14, 165, 233, 0.2);
  transform: translateY(-1px);
}

.movement-command-button.is-active {
  background:
    radial-gradient(circle at 50% 36%, rgba(250, 204, 21, 0.24), transparent 62%),
    linear-gradient(180deg, rgba(120, 89, 18, 0.46), rgba(15, 23, 42, 0.92));
  color: #fff7ad;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.26);
}

.movement-command-button.is-active .lucide-icon {
  filter:
    drop-shadow(0 0 8px rgba(250, 204, 21, 0.72))
    drop-shadow(0 0 14px rgba(250, 204, 21, 0.3));
}

.chat-panel {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  min-width: 0;
  height: 176px;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: auto;
  transform: translateY(0);
  transition:
    border-color 180ms ease,
    height 680ms cubic-bezier(0.22, 0.74, 0.22, 1),
    box-shadow 180ms ease,
    transform 680ms cubic-bezier(0.22, 0.74, 0.22, 1);
}

.chat-panel.is-tall {
  height: 352px;
}

.chat-panel.is-collapsed {
  transform: translateY(calc(100% + 16px));
}

.chat-panel::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0) 0%, rgba(56, 189, 248, 0.035) 58%, rgba(125, 211, 252, 0.075) 100%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.68), rgba(30, 41, 59, 0.62)),
    rgba(2, 6, 23, 0.28);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 -8px 20px rgba(14, 165, 233, 0.08);
  content: "";
  pointer-events: none;
  backdrop-filter: blur(8px) saturate(1.25);
}

.chat-panel::after {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  width: 58%;
  height: 58%;
  background:
    linear-gradient(180deg, transparent, rgba(14, 165, 233, 0.26)) right bottom / 1.6px 78% no-repeat,
    linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.28)) right bottom / 86% 1.6px no-repeat;
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 calc(100% - 12px), calc(100% - 12px) 0);
  content: "";
  filter:
    drop-shadow(0 0 8px rgba(14, 165, 233, 0.34))
    drop-shadow(0 0 13px rgba(125, 211, 252, 0.18));
  opacity: 0.76;
  pointer-events: none;
}

.chat-panel.is-collapsed::before {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 -6px 14px rgba(14, 165, 233, 0.07);
}

.chat-panel.is-collapsed::after {
  opacity: 0.55;
}

.chat-panel * {
  cursor: auto;
}

.chat-toggle {
  position: absolute;
  z-index: 2;
  right: -1px;
  bottom: calc(100% + 1px);
  display: inline-flex;
  width: 142px;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0), rgba(56, 189, 248, 0.04) 62%, rgba(125, 211, 252, 0.075)),
    linear-gradient(90deg, rgba(15, 23, 42, 0.68), rgba(30, 41, 59, 0.62)),
    rgba(2, 6, 23, 0.28);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%, 0 12px);
  color: #e0f2fe;
  cursor: pointer;
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1;
  opacity: 0.68;
  padding: 3px 12px;
  pointer-events: auto;
  text-shadow: none;
  text-transform: uppercase;
  backdrop-filter: blur(8px) saturate(1.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 -4px 12px rgba(14, 165, 233, 0.08);
  transition:
    opacity 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.chat-toggle::before {
  position: absolute;
  inset: 0 0 auto auto;
  width: 46%;
  height: 100%;
  background:
    linear-gradient(180deg, transparent, rgba(14, 165, 233, 0.24)) right bottom / 1.4px 82% no-repeat,
    linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.22)) right bottom / 88% 1.4px no-repeat;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  content: "";
  filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.28));
  pointer-events: none;
}

.chat-toggle::after {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -45%;
  width: 34px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: rotate(18deg);
}

.chat-toggle .lucide-icon {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.chat-toggle .lucide-icon,
.chat-toggle .lucide-icon *,
.chat-toggle span {
  pointer-events: none;
}

.chat-toggle .lucide-icon,
.chat-toggle span {
  transform: none;
}

.chat-toggle .lucide-icon {
  transform: translateY(0.25px);
}

.chat-toggle span {
  transform: translateY(1.1px);
}

.chat-toggle:hover,
.chat-toggle:focus-visible {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0), rgba(56, 189, 248, 0.065) 58%, rgba(125, 211, 252, 0.12)),
    linear-gradient(90deg, rgba(15, 23, 42, 0.7), rgba(30, 41, 59, 0.66)),
    rgba(2, 6, 23, 0.32);
  color: #f8fafc;
  opacity: 1;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 -4px 14px rgba(14, 165, 233, 0.12);
  text-shadow:
    0 0 8px rgba(56, 189, 248, 0.56),
    0 1px 0 rgba(0, 0, 0, 0.72);
}

.chat-toggle:hover::after,
.chat-toggle:focus-visible::after {
  opacity: 1;
  animation: tab-shimmer 760ms ease-out;
}

.chat-size-toggle {
  position: absolute;
  z-index: 3;
  top: 1px;
  left: 1px;
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #8bb8ca;
  cursor: pointer;
  filter: none;
  pointer-events: auto;
  transform: rotate(135deg);
  transition:
    color 140ms ease,
    filter 140ms ease;
}

.chat-size-toggle::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 2px;
  display: inline-flex;
  min-width: max-content;
  padding: 5px 8px;
  border: 1px solid rgba(125, 211, 252, 0.62);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.95);
  color: #e0f2fe;
  content: attr(data-tooltip);
  font: 700 11px/1 var(--ui-font);
  opacity: 0;
  pointer-events: none;
  transform: rotate(-135deg) translateY(4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.chat-size-toggle:hover,
.chat-size-toggle:focus-visible {
  color: #bae6fd;
  filter: drop-shadow(0 0 8px rgba(125, 211, 252, 0.28));
  outline: none;
}

.chat-size-toggle:hover::after {
  opacity: 1;
  transform: rotate(-135deg) translateY(0);
}

.chat-size-chevron {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  filter:
    drop-shadow(0 0 4px rgba(14, 165, 233, 0.5))
    drop-shadow(0 0 8px rgba(14, 165, 233, 0.18));
  transform: translate(1px, -1px) rotate(225deg);
  transform-origin: 33.333% 33.333%;
  transition:
    filter 140ms ease,
    transform 160ms ease;
}

.chat-size-toggle:hover .chat-size-chevron,
.chat-size-toggle:focus-visible .chat-size-chevron {
  filter:
    drop-shadow(0 0 8px rgba(186, 230, 253, 0.9))
    drop-shadow(0 0 16px rgba(14, 165, 233, 0.56));
  transform: translate(1px, -1px) scale(1.16) rotate(225deg);
}

.chat-size-toggle.is-expanded .chat-size-chevron {
  transform: translate(1px, -1px) rotate(45deg);
}

.chat-size-toggle.is-expanded:hover .chat-size-chevron,
.chat-size-toggle.is-expanded:focus-visible .chat-size-chevron {
  transform: translate(1px, -1px) scale(1.16) rotate(45deg);
}

.chat-panel.is-collapsed .chat-size-toggle {
  opacity: 0;
  pointer-events: none;
}

.chat-panel.is-collapsed .chat-toggle {
  opacity: 0.74;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 -4px 12px rgba(14, 165, 233, 0.08);
}

.chat-panel.is-collapsed .chat-toggle:hover,
.chat-panel.is-collapsed .chat-toggle:focus-visible {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 -4px 14px rgba(14, 165, 233, 0.12);
}

.chat-info {
  position: relative;
  z-index: 2;
  top: auto;
  right: auto;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px 4px;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0), rgba(56, 189, 248, 0.025) 64%, rgba(125, 211, 252, 0.045));
  box-shadow: 0 12px 18px rgba(2, 6, 23, 0.3);
  transition:
    opacity 180ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}

.chat-info-button {
  border: 0;
  background: transparent;
  color: #dff8ff;
  cursor: help;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 6px rgba(125, 211, 252, 0.22);
  transition:
    color 140ms ease,
    text-shadow 140ms ease,
    transform 140ms ease;
}

.chat-info-button:hover,
.chat-info-button:focus-visible {
  color: #ffffff;
  outline: none;
  text-shadow:
    0 0 8px rgba(125, 211, 252, 0.72),
    0 0 16px rgba(14, 165, 233, 0.34);
  transform: translateY(-1px);
}

.chat-stats {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: none;
  min-width: 190px;
  padding: 10px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0), rgba(56, 189, 248, 0.04) 62%, rgba(125, 211, 252, 0.08)),
    linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.9)),
    rgba(2, 6, 23, 0.78);
  box-shadow: 0 0 18px rgba(14, 165, 233, 0.1);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

.chat-info-button:hover ~ .chat-stats,
.chat-info-button:focus-visible ~ .chat-stats {
  display: block;
}

.chat-stats p {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chat-stats strong {
  color: #dff8ff;
  font-weight: 700;
  text-align: right;
}

.chat-messages {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  padding: 9px 10px 8px 18px;
  overflow-y: auto;
  color: #dff8ff;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  scrollbar-color: rgba(95, 143, 168, 0.46) rgba(15, 23, 42, 0.28);
  scrollbar-width: thin;
  transition:
    opacity 180ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}

.chat-message {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}

.chat-message-body {
  min-width: 0;
}

.chat-message strong,
.game-chat-message strong {
  font-weight: 800;
}

.chat-message strong {
  margin-right: 11px;
}

.game-chat-message strong {
  font-size: 0.86em;
  margin-right: 11px;
  opacity: 1;
}

.chat-scope-tag {
  flex: 0 0 auto;
  color: rgba(185, 203, 213, 0.68);
  font-weight: 700;
}

.chat-form {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: end;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: 6px 8px;
  border: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0), rgba(56, 189, 248, 0.025) 58%, rgba(125, 211, 252, 0.04)),
    rgba(2, 6, 23, 0.24);
  box-shadow: 0 -4px 6px rgba(2, 6, 23, 0.36);
  transition:
    opacity 180ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}

.chat-scope-switch {
  display: inline-grid;
  overflow: hidden;
  grid-template-columns: repeat(2, 1fr);
  min-width: 82px;
  height: 28px;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.58)),
    rgba(2, 6, 23, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 -1px 0 rgba(148, 163, 184, 0.12);
}

.chat-scope-option {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(185, 203, 213, 0.7);
  cursor: pointer;
  font: 800 10px/1 var(--ui-font);
  letter-spacing: 0;
  padding: 3px 8px 0;
  text-transform: uppercase;
  transition:
    background 140ms ease,
    color 140ms ease,
    text-shadow 140ms ease;
}

.chat-scope-option.is-active {
  background: rgba(51, 65, 85, 0.58);
  color: #b9cbd5;
  text-shadow: none;
}

.chat-scope-option:hover,
.chat-scope-option:focus-visible {
  color: #f8fafc;
  outline: none;
}

.chat-input {
  width: 100%;
  min-width: 0;
  max-height: 76px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.74), rgba(30, 41, 59, 0.62)),
    rgba(2, 6, 23, 0.36);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
  line-height: 18px;
  overflow-y: hidden;
  padding: 5px 9px;
  resize: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    inset 0 -1px 0 rgba(148, 163, 184, 0.12);
}

.chat-input::-webkit-scrollbar {
  width: 6px;
}

.chat-input::-webkit-scrollbar-track {
  background: rgba(2, 6, 23, 0.3);
}

.chat-input::-webkit-scrollbar-thumb {
  background: rgba(95, 143, 168, 0.42);
}

.chat-input::placeholder {
  color: #7f95ad;
}

.chat-input:focus {
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(185, 203, 213, 0.26),
    0 0 0 2px rgba(148, 163, 184, 0.1);
}

.chat-send {
  position: relative;
  display: grid;
  min-width: 62px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 0;
  background:
    radial-gradient(ellipse at top, rgba(120, 89, 18, 0.3), rgba(120, 89, 18, 0.16) 42%, rgba(120, 89, 18, 0) 78%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.52), rgba(15, 23, 42, 0.62) 38%, rgba(2, 6, 23, 0.72)),
    rgba(2, 6, 23, 0.46);
  color: #fff7ad;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  padding: 2px 0 0;
  text-shadow:
    0 0 5px rgba(250, 204, 21, 0.42),
    0 1px 0 rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(250, 204, 21, 0.1);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.chat-send::before {
  position: absolute;
  inset: 1px 2px auto;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 62%, rgba(255, 255, 255, 0));
  content: "";
  pointer-events: none;
}

.chat-send::after {
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -45%;
  width: 34px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: rotate(18deg);
}

.chat-send:hover,
.chat-send:focus-visible {
  outline: none;
  color: #fffde3;
  border-color: rgba(254, 240, 138, 0.58);
  background:
    radial-gradient(ellipse at top, rgba(250, 204, 21, 0.16), rgba(250, 204, 21, 0.08) 42%, rgba(250, 204, 21, 0) 78%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.56), rgba(15, 23, 42, 0.66) 34%, rgba(2, 6, 23, 0.76)),
    rgba(2, 6, 23, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(250, 204, 21, 0.16);
  text-shadow:
    0 0 8px rgba(250, 204, 21, 0.58),
    0 1px 0 rgba(0, 0, 0, 0.72);
}

.chat-send:hover::after,
.chat-send:focus-visible::after {
  opacity: 1;
  animation: tab-shimmer 1.2s ease-out infinite;
}

.chat-panel.is-collapsed .chat-info,
.chat-panel.is-collapsed .chat-messages,
.chat-panel.is-collapsed .chat-form {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 120ms ease,
    transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 520ms;
  visibility: hidden;
}

.dev-tuning-modal {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.62);
  pointer-events: auto;
}

.dev-tuning-modal,
.dev-tuning-modal * {
  cursor: none !important;
}

.dev-tuning-panel {
  display: grid;
  width: min(1240px, calc(100vw - 32px));
  max-height: min(740px, calc(100vh - 32px));
  gap: 12px;
  overflow: auto;
  border: 1px solid rgba(125, 211, 252, 0.58);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
  padding: 16px;
}

.dev-tuning-header,
.dev-tuning-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dev-tuning-header strong {
  color: #e0f2fe;
  font-size: 16px;
}

.dev-tuning-toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 4px;
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.68);
}

.dev-ship-selector {
  display: grid;
  grid-template-columns: auto 30px minmax(150px, 1fr) 30px;
  align-items: center;
  gap: 6px;
  min-width: 270px;
  color: #bae6fd;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dev-ship-selector button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.92);
  color: #f8fafc;
  cursor: none;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.dev-ship-selector button:hover,
.dev-ship-selector button:focus-visible {
  border-color: rgba(125, 211, 252, 0.82);
  background: rgba(14, 165, 233, 0.18);
  outline: none;
}

.dev-ship-selector b {
  display: grid;
  align-items: center;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.72);
  color: #f8fafc;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-tuning-file-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dev-tuning-file-status {
  grid-column: 1 / -1;
  min-height: 0;
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.dev-profile-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #bae6fd;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dev-profile-name b {
  display: block;
  max-width: 190px;
  min-width: 0;
  color: #f8fafc;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-tuning-close,
.dev-tuning-submit,
.dev-tuning-cancel,
.dev-tuning-propagate,
.dev-tuning-override,
.dev-tuning-import,
.dev-tuning-export {
  border: 1px solid rgba(148, 163, 184, 0.68);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  cursor: none;
  font-weight: 800;
  min-height: 32px;
  padding: 5px 10px;
}

.dev-tuning-propagate,
.dev-tuning-override,
.dev-tuning-submit {
  position: relative;
}

.dev-tuning-propagate::after,
.dev-tuning-override::after,
.dev-tuning-submit::after {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(100% + 8px);
  display: inline-flex;
  width: min(220px, calc(100vw - 48px));
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid rgba(125, 211, 252, 0.68);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  color: #e2e8f0;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: none;
  transform: translateX(-50%);
  transition: opacity 0ms linear;
}

.dev-tuning-propagate::after {
  left: 0;
  transform: none;
}

.dev-tuning-submit::after {
  right: 0;
  left: auto;
  transform: none;
}

.dev-tuning-propagate:hover::after,
.dev-tuning-propagate:focus-visible::after,
.dev-tuning-override:hover::after,
.dev-tuning-override:focus-visible::after,
.dev-tuning-submit:hover::after,
.dev-tuning-submit:focus-visible::after {
  opacity: 1;
}

.dev-tuning-export {
  min-height: 30px;
  border-color: rgba(125, 211, 252, 0.58);
  color: #e0f2fe;
}

.dev-tuning-import {
  min-height: 30px;
  border-color: rgba(167, 139, 250, 0.58);
  color: #ede9fe;
}

.dev-tuning-submit {
  border-color: rgba(34, 197, 94, 0.72);
  background: rgba(22, 101, 52, 0.86);
}

.dev-tuning-propagate {
  border-color: rgba(250, 204, 21, 0.68);
  color: #fef3c7;
}

.dev-tuning-override {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.dev-tuning-close:hover,
.dev-tuning-close:focus-visible,
.dev-tuning-cancel:hover,
.dev-tuning-cancel:focus-visible,
.dev-tuning-propagate:hover,
.dev-tuning-propagate:focus-visible,
.dev-tuning-override:hover,
.dev-tuning-override:focus-visible {
  border-color: #e0f2fe;
  outline: none;
  background: rgba(30, 41, 59, 0.96);
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.16);
}

.dev-tuning-submit:hover,
.dev-tuning-submit:focus-visible {
  border-color: #bbf7d0;
  outline: none;
  background: rgba(21, 128, 61, 0.96);
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.2),
    0 0 18px rgba(34, 197, 94, 0.18);
}

.dev-tuning-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.dev-tuning-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  padding: 12px;
}

.dev-tuning-group legend {
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
  padding: 0 5px;
  text-transform: uppercase;
}

.dev-weapon-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.7);
}

.dev-weapon-toggle button {
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  cursor: none;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dev-weapon-toggle button.is-active {
  border-color: rgba(125, 211, 252, 0.72);
  background: rgba(14, 165, 233, 0.22);
  color: #e0f2fe;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.12);
}

.dev-tuning-subtitle {
  color: #bae6fd;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dev-tuning-expander {
  display: grid;
  gap: 10px;
}

.dev-tuning-expander summary {
  cursor: pointer;
  color: #e0f2fe;
  font-size: 12px;
  font-weight: 900;
  list-style-position: inside;
}

.dev-tuning-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 88px);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dev-tuning-field.is-overridden {
  color: #fde68a;
}

.dev-tuning-field > span {
  position: relative;
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.dev-help {
  position: relative;
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(125, 211, 252, 0.62);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  color: #e0f2fe;
  cursor: none;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.dev-help::after {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(100% + 7px);
  display: inline-flex;
  width: 190px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid rgba(125, 211, 252, 0.68);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  color: #e2e8f0;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 0ms linear;
}

.dev-help:hover::after,
.dev-help:focus-visible::after {
  opacity: 1;
}

.dev-tuning-field input {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  padding: 5px 18px 5px 7px;
}

.dev-tuning-field.is-overridden input {
  border-color: rgba(250, 204, 21, 0.82);
  background: rgba(51, 39, 9, 0.82);
  color: #fff7ad;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.12);
}

.dev-tuning-field input::-webkit-outer-spin-button,
.dev-tuning-field input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.dev-tuning-field input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.dev-tuning-number {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.dev-tuning-number.has-revert {
  grid-template-columns: minmax(0, 1fr) 26px;
}

.dev-tuning-number input {
  border-radius: 0;
}

.dev-stepper {
  display: grid;
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 30px;
  min-width: 0;
  pointer-events: auto;
}

.dev-tuning-number.has-revert .dev-stepper {
  right: 27px;
}

.dev-stepper button {
  display: grid;
  min-width: 0;
  height: 16px;
  place-items: center;
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  color: #cbd5e1;
  cursor: none;
  font-size: 8px;
  line-height: 1;
  padding: 0;
}

.dev-stepper button:first-child {
  border-radius: 0;
}

.dev-stepper button:last-child {
  border-top: 0;
  border-radius: 0;
}

.dev-tuning-number.has-revert .dev-stepper button:first-child,
.dev-tuning-number.has-revert .dev-stepper button:last-child {
  border-radius: 0;
}

.dev-stepper button:hover,
.dev-stepper button:focus-visible {
  outline: none;
  background: transparent;
  color: #e0f2fe;
}

.dev-revert-button {
  display: grid;
  min-width: 0;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(250, 204, 21, 0.72);
  border-left: 0;
  border-radius: 0;
  background: rgba(58, 46, 13, 0.96);
  color: #fde68a;
  cursor: none;
  padding: 0;
}

.dev-revert-button .lucide-icon {
  width: 14px;
  height: 14px;
  pointer-events: none;
  stroke-width: 2.4;
}

.dev-revert-button:hover,
.dev-revert-button:focus-visible {
  outline: none;
  background: rgba(87, 68, 17, 0.98);
  color: #fff7ad;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.16);
}

.dev-tuning-field input:focus {
  border-color: #7dd3fc;
  outline: none;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.18);
}

.is-hidden {
  display: none;
}

@media (max-width: 860px) {
  .app-shell {
    align-items: flex-start;
    overflow-y: auto;
  }

  body {
    overflow: auto;
  }

  .ship-select-layout {
    grid-template-columns: 1fr;
  }

  .ship-grid {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
  }

  .game-hud {
    min-height: 0;
  }

  .chat-panel {
    right: 12px;
    bottom: 12px;
    width: min(330px, calc(100vw - 24px));
    height: 150px;
  }

  .chat-panel.is-tall {
    height: min(300px, calc(100vh - 96px));
  }

  .movement-command-panel {
    right: min(354px, calc(100vw - 190px));
    bottom: 12px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 14px;
  }

  .panel {
    padding: 18px;
  }

  .ship-grid {
    grid-template-columns: repeat(3, minmax(54px, 1fr));
  }

  .game-hud {
    min-height: 0;
  }

  .hud-minimap-space {
    display: none;
  }

  .score-display {
    top: 10px;
    left: 10px;
  }

  .hud-minimap-frame {
    top: 10px;
    left: 10px;
  }

  .minimap-collapse-toggle {
    top: calc(60px + var(--minimap-map-offset, clamp(150px, 14vw, 220px)));
    left: calc(10px + clamp(150px, 14vw, 220px) - 23px);
  }

  .hud-minimap-dock {
    top: calc(48px + var(--minimap-map-offset, clamp(150px, 14vw, 220px)));
    left: 10px;
  }

  .hud-center {
    bottom: 10px;
    min-width: 158px;
    padding-inline: 10px;
  }

  .hud-abilities {
    right: auto;
    bottom: 114px;
    left: 12px;
  }

  .ability-slot {
    width: 49px;
    height: 49px;
  }

  .dev-tuning-toggle {
    bottom: 10px;
    left: auto;
    right: 12px;
  }

  .dev-tuning-fields {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    right: 12px;
    bottom: 166px;
    width: calc(100vw - 24px);
    height: 148px;
  }

  .chat-panel.is-tall {
    height: min(296px, calc(100vh - 210px));
  }

  .movement-command-panel {
    right: 12px;
    bottom: 324px;
  }

  .hud-upgrades {
    grid-template-columns: 1fr;
  }

  .upgrade-grid {
    grid-template-columns: 1fr;
  }

  .hud-abilities {
    grid-template-columns: repeat(3, minmax(48px, 1fr));
  }

  .dev-tuning-fields {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .dev-tuning-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .dev-ship-selector,
  .dev-tuning-file-actions,
  .dev-tuning-export {
    width: 100%;
  }

  .dev-tuning-file-actions {
    justify-self: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dev-tuning-file-status {
    text-align: left;
  }

  .dev-profile-name {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .dev-tuning-fields {
    grid-template-columns: 1fr;
  }
}
