/* Cyberclash /play – Spielwelt, HUD, Login und Hangar.
   Farben und Schriften wie v2.html (titan #0a0d14, hull #0f172a, neon #00f0ff, crimson #ef4444). */

:root {
  color-scheme: dark;
  --neon: #00f0ff;
  --crimson: #ef4444;
  --amber: #f59e0b;
  --panel: rgba(15, 23, 42, 0.78);
  --line: rgba(30, 41, 59, 0.95);
  --display: 'Rajdhani', 'Inter', sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05070d;
}

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0.05em 0.45em;
  margin: 0 0.1em;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.08);
  color: var(--neon);
  font: 600 0.78em/1.5 'Inter', sans-serif;
  text-align: center;
}

/* ---------------------------------------------------------------- Spielfläche */

#game {
  position: fixed;
  inset: 0;
  background: #05070d;
}

#game canvas {
  display: block;
  outline: none;
  cursor: none;
}

#game::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(5, 7, 13, 0.7) 100%),
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.1) 2px 3px);
}

/* ---------------------------------------------------------------- Overlays und Login */

.play-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(1200px 560px at 8% -10%, rgba(0, 240, 255, 0.12), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(239, 68, 68, 0.1), transparent 48%),
    linear-gradient(180deg, #0a0d14 0%, #0f172a 48%, #0a0d14 100%);
}

.play-overlay[hidden] {
  display: none;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.login-card {
  width: 100%;
  max-width: 28rem;
  padding: 1.75rem;
  border-radius: 0.75rem;
  box-shadow: 0 0 42px rgba(0, 240, 255, 0.12);
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}

.login-btn-twitch {
  width: 100%;
  border: 1px solid #9146ff;
  background: rgba(145, 70, 255, 0.18);
  color: #e9ddff;
}

.login-btn-twitch:hover {
  background: rgba(145, 70, 255, 0.32);
  box-shadow: 0 0 18px rgba(145, 70, 255, 0.45);
}

.login-btn-guest {
  border: 1px solid rgba(0, 240, 255, 0.7);
  background: transparent;
  color: var(--neon);
}

.login-btn-guest:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
}

.login-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #334155;
  border-radius: 0.375rem;
  background: rgba(2, 6, 23, 0.7);
  padding: 0.6rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.9rem;
}

.login-input:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.25);
}

/* ---------------------------------------------------------------- HUD */

.hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

.hud[hidden] {
  display: none;
}

.hud-card {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.08);
}

.hud-card-title {
  margin: 0 0 0.4rem;
  font: 700 0.7rem/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon);
}

.hud-player {
  top: 0.9rem;
  left: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: min(19rem, calc(100vw - 22rem));
  padding: 0.65rem;
}

.hud-avatar {
  flex: none;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 1.5rem/1 var(--display);
  color: var(--neon);
}

.hud-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-avatar img[hidden] {
  display: none;
}

.hud-player-body {
  flex: 1;
  min-width: 0;
}

.hud-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 1.05rem/1.1 var(--display);
  letter-spacing: 0.04em;
  color: #f8fafc;
}

.hud-class {
  margin: 0;
  flex: none;
  font: 700 0.72rem/1.1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon);
}

.hud-bar {
  position: relative;
  height: 1.05rem;
  margin-top: 0.3rem;
  border: 1px solid rgba(100, 116, 139, 0.55);
  border-radius: 3px;
  background: rgba(2, 6, 23, 0.8);
  overflow: hidden;
}

.hud-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, #0891b2, var(--neon));
  transition: width 0.12s linear;
}

.hud-bar-hp .hud-bar-fill {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.65);
}

.hud-bar-xp {
  margin-top: 0.25rem;
}

.hud-bar-xp .hud-bar-fill {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.55);
  transition: none;
  overflow: hidden;
}

.hud-bar-hp .hud-bar-text,
.hud-bar-xp .hud-bar-text {
  font-size: 0.64rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hud-bar-text {
  position: relative;
  display: block;
  text-align: center;
  font: 700 0.7rem/1.05rem 'Inter', sans-serif;
  color: #fff;
  text-shadow: 0 0 4px #000;
}

.hud-status {
  margin: 0.35rem 0 0;
  font: 700 0.72rem/1.3 'Rajdhani', 'Inter', sans-serif;
  letter-spacing: 0.08em;
  color: #67e8f9;
  white-space: pre-line;
}

.hud-status.is-alert {
  color: #fbbf24;
}

.hud-player-row {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.hud-ability {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.25rem 0.45rem;
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.06);
  overflow: hidden;
}

.hud-ability.is-ready {
  border-color: var(--neon);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

.hud-ability-cd {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(2, 6, 23, 0.75);
}

.hud-ability-key,
.hud-ability-name {
  position: relative;
  font: 700 0.68rem/1 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud-ability-key {
  color: var(--neon);
}

.hud-ability-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e2e8f0;
}

.hud-gear {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.07);
}

.hud-gear-label {
  font: 700 0.6rem/1 var(--display);
  letter-spacing: 0.2em;
  color: var(--amber);
}

.hud-gear-value {
  font: 700 1rem/1 var(--display);
  color: #fde68a;
}

.hud-links {
  margin: 0.35rem 0 0;
  text-align: right;
}

.hud-link {
  pointer-events: auto;
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.68rem;
  color: #64748b;
  text-decoration: underline;
  cursor: pointer;
}

.hud-link:hover {
  color: var(--neon);
}

.hud-top {
  position: absolute;
  top: 0.9rem;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(-50%);
}

.hud-zone {
  margin: 0;
  padding: 0.25rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font: 700 0.78rem/1.2 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #cbd5e1;
}

.hud-zone.is-safe {
  border-color: rgba(0, 240, 255, 0.55);
  color: var(--neon);
}

.hud-boss {
  width: min(30rem, calc(100vw - 40rem));
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.hud-boss[hidden],
.hud-prompt[hidden],
.hud-boss-armor[hidden],
.reveal[hidden],
.death[hidden] {
  display: none;
}

.hud-boss-name {
  margin: 0;
  font: 700 1.1rem/1.1 var(--display);
  letter-spacing: 0.3em;
  color: var(--crimson);
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.hud-bar-boss {
  height: 1.2rem;
  border-color: rgba(239, 68, 68, 0.6);
}

.hud-bar-boss .hud-bar-fill {
  background: linear-gradient(90deg, #991b1b, var(--crimson));
}

.hud-boss-armor {
  margin: 0.25rem 0 0;
  font: 700 0.7rem/1 var(--display);
  letter-spacing: 0.25em;
  color: var(--amber);
}

.hud-right {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(17rem, calc(100vw - 22rem));
  pointer-events: none;
}

.hud-quests {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
}

/* Taktik-Radar / Mini-Map */
.hud-radar {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: 0.5rem 0.6rem 0.55rem;
  background: rgba(10, 13, 20, 0.62);
  border-color: rgba(0, 240, 255, 0.35);
}

.hud-minimap {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 0.3rem;
  background: rgba(2, 6, 23, 0.55);
  image-rendering: pixelated;
}

.hud-radar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.65rem;
  margin: 0.4rem 0 0;
  font-size: 0.62rem;
  line-height: 1;
  color: #64748b;
}

.hud-radar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.radar-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.radar-dot-me {
  background: #fff;
}

.radar-dot-base {
  border-radius: 1px;
  background: rgba(0, 240, 255, 0.45);
  border: 1px solid #00f0ff;
}

.radar-dot-boss {
  border-radius: 1px;
  background: #ef4444;
  transform: rotate(45deg) scale(0.85);
}

.radar-dot-loot {
  background: #fbbf24;
}

.hud-quest-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hud-quest {
  padding: 0.35rem 0;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  font-size: 0.78rem;
  color: #cbd5e1;
}

.hud-quest:first-child {
  border-top: 0;
}

.hud-quest-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
}

.hud-quest-head > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-quest-count {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--neon);
}

.hud-quest-bar {
  height: 4px;
  margin-top: 0.3rem;
  border-radius: 2px;
  background: rgba(2, 6, 23, 0.9);
  overflow: hidden;
}

.hud-quest-bar > div {
  height: 100%;
  background: var(--neon);
}

.hud-quest.is-done .hud-quest-count,
.hud-quest.is-done .hud-quest-hint {
  color: var(--amber);
}

.hud-quest.is-done .hud-quest-bar > div {
  background: var(--amber);
}

.hud-quest-hint {
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  color: #64748b;
}

.hud-prompt {
  position: absolute;
  left: 50%;
  bottom: 5.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 0.5rem;
  background: rgba(10, 13, 20, 0.85);
  font: 600 0.9rem/1.2 'Inter', sans-serif;
  color: #f1f5f9;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.25);
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: pointer;
}

.hud-prompt:hover {
  border-color: var(--neon);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.45);
}

#hud-dock {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  display: flex;
  gap: 0.5rem;
  pointer-events: auto;
}

.hud-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  border: 1px solid rgba(0, 240, 255, 0.7);
  border-radius: 0.375rem;
  background: rgba(10, 13, 20, 0.85);
  padding: 0.6rem 1rem;
  font: 700 0.85rem/1 var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--neon);
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s;
}

.hud-dock-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
}

.hud-controls {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  margin: 0;
  max-width: min(60vw, calc(100vw - 22rem));
  font-size: 0.7rem;
  line-height: 1.45;
  color: #64748b;
}

/* ---------------------------------------------------------------- Beute und Meldungen */

.toasts {
  position: absolute;
  left: 50%;
  bottom: 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  transform: translateX(-50%);
}

.toast {
  max-width: 28rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--tc, var(--neon));
  border-radius: 0.4rem;
  background: rgba(10, 13, 20, 0.92);
  font-size: 0.82rem;
  font-weight: 500;
  color: #e2e8f0;
  animation: toast-in 0.2s ease-out;
}

.toast.is-error {
  --tc: var(--crimson);
}

.toast.is-good {
  --tc: #22c55e;
}

.toast.is-level {
  --tc: #22d3ee;
  border-color: rgba(34, 211, 238, 0.75);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
  font: 700 0.95rem/1.2 var(--display, inherit);
  letter-spacing: 0.08em;
  color: #ecfeff;
}

.toast.is-leaving {
  opacity: 0;
  transition: opacity 0.35s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal {
  position: absolute;
  top: 28%;
  left: 50%;
  min-width: 18rem;
  max-width: 24rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--rc, var(--neon));
  border-radius: 0.75rem;
  background: rgba(10, 13, 20, 0.94);
  text-align: center;
  box-shadow: 0 0 36px var(--rc, var(--neon));
  transform: translateX(-50%);
  animation: reveal-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.reveal-rarity {
  margin: 0;
  font: 700 0.75rem/1 var(--display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rc);
}

.reveal-name {
  margin: 0.4rem 0 0.2rem;
  font: 700 1.4rem/1.15 var(--display);
  color: #fff;
}

.reveal-meta {
  margin: 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

.reveal-bonus {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #86efac;
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.7);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

.death {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(60, 0, 0, 0.45);
  text-align: center;
}

/* ---------------------------------------------------------------- Hangar */

#hangar-root[hidden],
#help-root[hidden] {
  display: none;
}

.help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 61;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 7, 13, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.help-panel {
  display: flex;
  flex-direction: column;
  width: min(42rem, 100%);
  max-height: min(44rem, calc(100vh - 2rem));
  border-radius: 0.75rem;
  outline: none;
  box-shadow: 0 0 52px rgba(0, 240, 255, 0.18);
}

.help-body {
  min-height: 0;
  overflow-y: auto;
  padding: 0.9rem 1.25rem 1.1rem;
}

.help-block + .help-block {
  margin-top: 0.95rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.help-section {
  margin: 0 0 0.5rem;
  font: 700 0.72rem/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon);
}

.help-keys {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.9;
  color: #cbd5e1;
}

.help-sep {
  margin: 0 0.15rem;
  color: #475569;
}

.help-lead {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #94a3b8;
}

.help-lead b {
  color: #e2e8f0;
}

.help-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.help-card {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgba(5, 7, 13, 0.45);
}

.help-card-boss {
  border-color: rgba(245, 158, 11, 0.4);
}

.help-card h3 {
  margin: 0 0 0.25rem;
  font: 700 0.95rem/1.1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f8fafc;
}

.help-card p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #94a3b8;
}

.help-card em {
  color: #fde68a;
  font-style: normal;
}

.help-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.help-items li {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.22rem 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #94a3b8;
}

.help-items b {
  font: 700 0.78rem/1.35 var(--display);
  letter-spacing: 0.03em;
  color: #e2e8f0;
}

.help-rarity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.help-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  vertical-align: 0.05em;
}

.help-dot-common { color: #94a3b8; }
.help-dot-rare { color: #00f0ff; }
.help-dot-epic { color: #d946ef; }
.help-dot-legendary { color: #f59e0b; }

.help-rarity-arrow {
  color: #475569;
}

.help-rarity-note {
  color: #64748b;
}

.hangar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 7, 13, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hangar-panel {
  display: flex;
  flex-direction: column;
  width: min(78rem, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  border-radius: 0.75rem;
  outline: none;
  box-shadow: 0 0 52px rgba(0, 240, 255, 0.18);
}

.hangar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.hangar-eyebrow {
  margin: 0;
  font: 700 0.65rem/1 var(--display);
  letter-spacing: 0.3em;
  color: var(--neon);
}

.hangar-title {
  margin: 0.15rem 0 0;
  font: 700 1.6rem/1 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8fafc;
}

.hangar-head-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hangar-gear {
  margin: 0;
  font: 700 0.8rem/1 var(--display);
  letter-spacing: 0.2em;
  color: var(--amber);
}

.hangar-gear b {
  font-size: 1.5rem;
  color: #fde68a;
}

.hangar-close {
  border: 1px solid #475569;
  border-radius: 0.3rem;
  background: transparent;
  padding: 0.35rem 0.7rem;
  font: 600 0.75rem/1 'Inter', sans-serif;
  color: #cbd5e1;
  cursor: pointer;
}

.hangar-close:hover {
  border-color: var(--neon);
  color: var(--neon);
}

.hangar-body {
  display: grid;
  grid-template-columns: minmax(380px, 420px) minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

.hangar-left,
.hangar-right {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.hangar-left {
  border-right: 1px solid var(--line);
  padding-bottom: 24px;
}

.hangar-section {
  margin: 1rem 0 0.5rem;
  font: 700 0.72rem/1 var(--display);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #94a3b8;
}

.hangar-left > .hangar-section:first-of-type {
  margin-top: 0.9rem;
}

.hangar-preview-card {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.2rem 0.9rem;
  align-items: center;
}

.hangar-preview {
  grid-row: span 2;
  width: 7.5rem;
  height: 7.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: radial-gradient(circle at 50% 55%, rgba(0, 240, 255, 0.14), rgba(2, 6, 23, 0.8) 70%);
}

.hangar-preview svg {
  width: 100%;
  height: 100%;
}

.hangar-preview-name {
  margin: 0;
  font: 700 1.5rem/1 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hangar-preview-role {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.hangar-level {
  margin: 0.45rem 0 0;
  font: 700 0.78rem/1 var(--display);
  letter-spacing: 0.18em;
  color: #67e8f9;
}

.hangar-xp {
  position: relative;
  margin-top: 0.35rem;
  height: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.85);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.28);
}

.hangar-xp-fill {
  position: relative;
  height: 100%;
  width: 0;
  overflow: hidden;
  background: linear-gradient(90deg, #0891b2, #22d3ee 62%, #f0fdff);
  box-shadow: 0 0 12px #22d3ee;
}

.hangar-xp-fill::after,
.hud-bar-xp .hud-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.42) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: xp-sheen 2.4s ease-in-out infinite;
}

.is-levelup-flash {
  animation: xp-levelup-flash 0.42s ease-out;
}

@keyframes xp-sheen {
  0%,
  55% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes xp-levelup-flash {
  0% {
    transform: scale(1);
    text-shadow: none;
  }
  40% {
    transform: scale(1.08);
    color: #fde68a;
    text-shadow: 0 0 10px #fde68a, 0 0 16px #22d3ee;
  }
  100% {
    transform: scale(1);
    text-shadow: none;
  }
}

.hangar-xp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 0.62rem/1 var(--display);
  letter-spacing: 0.06em;
  color: #f8fafc;
  text-shadow: 0 1px 2px #020617;
}

.hangar-level-bonus {
  margin: 0.28rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #86efac;
}

.hangar-mechs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.hangar-mech {
  border: 1px solid #334155;
  border-radius: 0.3rem;
  background: rgba(2, 6, 23, 0.6);
  padding: 0.4rem 0.2rem;
  font: 700 0.72rem/1 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.hangar-mech:hover {
  border-color: var(--mc);
  color: var(--mc);
}

.hangar-mech.is-active {
  border-color: var(--mc);
  color: var(--mc);
  box-shadow: 0 0 12px color-mix(in srgb, var(--mc) 45%, transparent);
  background: color-mix(in srgb, var(--mc) 12%, transparent);
}

.hangar-slots,
.hangar-ability-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hangar-ability-slots {
  margin-bottom: 0.35rem;
}

.hangar-filter {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
}

.hangar-filter-btn {
  border: 1px solid #334155;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
}

.hangar-filter-btn.is-active {
  border-color: #00f0ff;
  color: #00f0ff;
  background: color-mix(in srgb, #00f0ff 12%, transparent);
}

.hangar-slot.is-locked {
  color: #64748b;
  cursor: default;
}

.hangar-slot {
  --rc: #475569;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.45);
  text-align: left;
  color: #e2e8f0;
  font: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

button.hangar-slot:hover {
  border-color: color-mix(in srgb, var(--rc) 70%, #334155);
  box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 35%, transparent);
}

.hangar-slot.is-empty {
  cursor: default;
  color: #94a3b8;
}

.hangar-slot-icon {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--rc, #334155);
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--rc, #334155) 18%, rgba(2, 6, 23, 0.92));
  box-shadow: 0 0 14px color-mix(in srgb, var(--rc, transparent) 42%, transparent);
  overflow: hidden;
}

.hangar-slot.is-empty .hangar-slot-icon,
.hangar-slot.is-locked .hangar-slot-icon {
  border-style: dashed;
  border-color: #334155;
  background: rgba(2, 6, 23, 0.55);
  box-shadow: none;
}

.hangar-slot-icon .hangar-icon {
  width: 32px;
  height: 32px;
}

.hangar-slot-plus {
  font: 500 1.7rem/1 var(--display);
  color: #475569;
}

.hangar-slot-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hangar-slot-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hangar-slot,
.hangar-item,
.hangar-item-main {
  touch-action: none;
}

.hangar-ghost,
.hangar-item-main.hangar-ghost,
button.hangar-ghost {
  position: fixed;
  z-index: 100;
  margin: 0;
  width: 5.6rem;
  min-height: 5.6rem;
  height: auto;
  pointer-events: none;
  opacity: 0.94;
  transform: translate(-50%, -55%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

.hangar-item-main.hangar-ghost.is-module {
  border: 2px solid var(--rc, #475569);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc, #475569) 22%, transparent), rgba(2, 6, 23, 0.92) 75%);
}

.hangar-item-main.hangar-ghost.is-skill {
  border: 2px solid #f59e0b;
  border-radius: 0;
  clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
  background: radial-gradient(circle at 50% 40%, rgba(251, 191, 36, 0.34), rgba(2, 6, 23, 0.92) 76%);
  box-shadow: none;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.55));
}

body.hangar-dragging,
body.hangar-dragging * {
  cursor: grabbing !important;
}

.hangar-slot.is-dragging,
.hangar-item-main.is-dragging {
  opacity: 0.35;
}

.hangar-slot.is-drop {
  border-style: solid;
  border-color: var(--neon);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.55);
}

button.hangar-slot.hangar-ghost {
  width: 64px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  gap: 0;
  justify-content: center;
}

button.hangar-slot.hangar-ghost .hangar-slot-copy {
  display: none;
}

.hangar-right.is-drop {
  border-radius: 0.6rem;
  box-shadow: inset 0 0 0 2px rgba(0, 240, 255, 0.7);
}

.hangar-slot-no {
  flex: none;
  font: 700 0.68rem/1 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.hangar-slot-badge {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 0.62rem/1.1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rc, #64748b);
}

.hangar-slot-name,
.hangar-slot-bonus,
.hangar-slot-hint {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hangar-slot-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  color: #f8fafc;
}

.hangar-slot-name.is-muted {
  font-weight: 500;
  color: #64748b;
}

.hangar-slot-bonus {
  font-size: 0.72rem;
  font-weight: 600;
  color: #67e8f9;
}

.hangar-slot-hint {
  font-size: 0.72rem;
  color: #64748b;
}

.hangar-slot.is-ability .hangar-slot-icon {
  border-radius: 0;
  border-color: #f59e0b;
  clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
  background: radial-gradient(circle at 50% 42%, rgba(251, 191, 36, 0.38), rgba(2, 6, 23, 0.92) 72%);
  box-shadow: none;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.hangar-slot.is-ability.is-empty .hangar-slot-icon,
.hangar-slot.is-ability.is-locked .hangar-slot-icon {
  border-color: #b45309;
  background: radial-gradient(circle at 50% 42%, rgba(251, 191, 36, 0.16), rgba(2, 6, 23, 0.72) 72%);
  filter: none;
}

.hangar-slot.is-ability .hangar-slot-hint {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hangar-icon {
  display: inline-flex;
  width: 2.1rem;
  height: 2.1rem;
  color: var(--rc, #94a3b8);
}

.hangar-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px currentColor);
}

.hangar-stats {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.hangar-stats th,
.hangar-stats td {
  padding: 0.28rem 0.25rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hangar-stats th[scope='row'],
.hangar-stats thead th:first-child {
  text-align: left;
  font-weight: 500;
  color: #94a3b8;
}

.hangar-stats thead th {
  font: 700 0.62rem/1 var(--display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #64748b;
}

.hangar-stat-base {
  color: #64748b;
}

.hangar-stat-now {
  font-weight: 700;
  color: #e2e8f0;
}

.hangar-stat-now.is-up {
  color: #4ade80;
}

.hangar-stat-now.is-down {
  color: #f87171;
}

.hangar-storage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.hangar-storage-head .hangar-section {
  margin-top: 0.1rem;
}

.hangar-count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #64748b;
}

.hangar-empty {
  margin: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

.hangar-empty[hidden] {
  display: none;
}

.hangar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
  gap: 0.5rem;
}

.hangar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid var(--rc);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 22%, transparent), rgba(2, 6, 23, 0.85) 75%);
  transition: box-shadow 0.15s, transform 0.1s, filter 0.15s;
}

.hangar-item.is-skill {
  border-radius: 0;
  border-color: #f59e0b;
  clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
  background: radial-gradient(circle at 50% 40%, rgba(251, 191, 36, 0.34), rgba(120, 53, 15, 0.22) 46%, rgba(2, 6, 23, 0.92) 76%);
  box-shadow: none;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.55));
}

.hangar-item.is-skill .hangar-icon {
  color: #fbbf24;
}

.hangar-item-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: 100%;
  min-height: 4.4rem;
  flex: 1;
  padding: 0.85rem 0.45rem 0.7rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.hangar-item:has(.hangar-item-main:hover),
.hangar-item:has(.hangar-item-main:focus-visible) {
  box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 65%, transparent);
  transform: translateY(-1px);
}

.hangar-item.is-skill:has(.hangar-item-main:hover),
.hangar-item.is-skill:has(.hangar-item-main:focus-visible) {
  box-shadow: none;
  filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.85));
}

.hangar-item-main:focus-visible {
  outline: none;
}

.hangar-item.is-equipped {
  opacity: 0.55;
  border-style: dashed;
}

.hangar-item.is-staged {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.85);
  opacity: 0.72;
}

.hangar-item .hangar-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.hangar-item-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
  margin: 0 0 0.35rem;
  text-align: center;
  font: 600 0.58rem/1.05 Inter, sans-serif;
  color: #e2e8f0;
}

.hangar-item:has(.hangar-item-unsecured) .hangar-item-name {
  margin-bottom: 0.7rem;
}

.hangar-item-score {
  position: absolute;
  right: 0.3rem;
  bottom: 0.2rem;
  font: 700 0.62rem/1 var(--display);
  letter-spacing: 0.06em;
  color: var(--rc);
}

.hangar-kind {
  position: absolute;
  left: 0.22rem;
  top: 0.18rem;
  padding: 0.08rem 0.22rem;
  border-radius: 3px;
  font: 700 0.5rem/1 var(--display);
  letter-spacing: 0.08em;
}

.hangar-kind.is-mod {
  border: 1px solid rgba(103, 232, 249, 0.5);
  background: rgba(15, 23, 42, 0.92);
  color: #67e8f9;
}

.hangar-kind.is-skill {
  border: 1px solid rgba(251, 191, 36, 0.75);
  background: rgba(120, 53, 15, 0.92);
  color: #fde68a;
}

.hangar-item.is-skill .hangar-kind {
  left: 16%;
  top: 14%;
}

.hangar-item.is-skill .hangar-item-class {
  right: 14%;
  top: 14%;
}

.hangar-item.is-skill .hangar-item-unsecured {
  left: 16%;
  bottom: 14%;
}

.hangar-item-badge {
  position: absolute;
  left: 0.25rem;
  top: 0.2rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  background: var(--rc);
  font: 700 0.55rem/1 var(--display);
  letter-spacing: 0.12em;
  color: #05070d;
}

.hangar-item-badge.hangar-item-class {
  left: auto;
  right: 0.22rem;
  background: var(--mc, var(--rc));
}

.hangar-item-badge.hangar-item-unsecured {
  top: auto;
  bottom: 0.16rem;
  left: 0.22rem;
  max-width: calc(100% - 1.4rem);
  overflow: hidden;
  text-overflow: ellipsis;
  background: #f59e0b;
}

.hangar-item-badge.hangar-item-staged {
  top: auto;
  bottom: 0.16rem;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hangar-item.is-skill .hangar-item-staged {
  bottom: 14%;
}

.hangar-sell-row {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  margin: 0.15rem 0 0.75rem;
}

.hangar-sell-bin {
  flex: 1;
  min-height: 4.6rem;
  min-width: 0;
  padding: 0.45rem 0.55rem 0.55rem;
  border: 2px dashed rgba(251, 191, 36, 0.55);
  border-radius: 0.55rem;
  background: rgba(2, 6, 23, 0.55);
}

.hangar-sell-bin.is-drop {
  border-style: solid;
  border-color: #fbbf24;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
}

.hangar-sell-label {
  margin: 0;
  font: 700 0.68rem/1 var(--display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fbbf24;
}

.hangar-sell-hint {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.hangar-sell-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.hangar-sell-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 2px solid var(--rc);
  border-radius: 0.4rem;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 28%, transparent), rgba(2, 6, 23, 0.9) 75%);
  color: var(--rc);
  cursor: pointer;
}

.hangar-sell-chip.is-skill {
  border-radius: 0;
  border-color: #f59e0b;
  clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
  background: radial-gradient(circle at 50% 40%, rgba(251, 191, 36, 0.34), rgba(120, 53, 15, 0.22) 46%, rgba(2, 6, 23, 0.92) 76%);
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.55));
}

.hangar-sell-chip.is-skill .hangar-sell-x {
  top: 14%;
  right: 16%;
}

.hangar-sell-chip.is-skill .hangar-icon {
  color: #fbbf24;
}

.hangar-sell-chip.is-pop {
  animation: hangar-sell-pop 0.18s ease-out;
}

.hangar-sell-x {
  position: absolute;
  top: 0;
  right: 0;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #1c1405;
  font: 700 0.68rem/0.85rem Inter, sans-serif;
  text-align: center;
  pointer-events: none;
}

@keyframes hangar-sell-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.hangar-sell-chip .hangar-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.hangar-sell-go {
  flex: none;
  width: 12.4rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(251, 191, 36, 0.75);
  border-radius: 0.5rem;
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  cursor: pointer;
  font: 700 0.78rem/1.25 var(--display);
  letter-spacing: 0.02em;
}

.hangar-sell-go:hover:not(:disabled),
.hangar-sell-go:focus-visible:not(:disabled) {
  background: rgba(251, 191, 36, 0.28);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.35);
  outline: none;
}

.hangar-sell-go:disabled {
  opacity: 0.4;
  cursor: default;
}

.hangar-busy .hangar-panel {
  cursor: progress;
}

.hangar-tip {
  position: fixed;
  z-index: 80;
  max-width: 17rem;
  pointer-events: none;
}

.hangar-tip[hidden] {
  display: none;
}

.hangar-tip-inner {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rc);
  border-radius: 0.5rem;
  background: rgba(5, 7, 13, 0.97);
  box-shadow: 0 0 22px color-mix(in srgb, var(--rc) 40%, transparent);
}

.hangar-tip-kind {
  margin: 0 0 0.2rem;
  font: 700 0.62rem/1.2 var(--display);
  letter-spacing: 0.12em;
}

.hangar-tip-kind.is-mod {
  color: #67e8f9;
}

.hangar-tip-kind.is-skill {
  color: #fbbf24;
}

.hangar-tip-name {
  margin: 0;
  font: 700 1.05rem/1.15 var(--display);
  letter-spacing: 0.03em;
  color: var(--rc);
}

.hangar-tip-meta {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  color: #94a3b8;
}

.hangar-tip-bonus {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #86efac;
}

.hangar-tip-sell {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fde68a;
}

.hangar-tip-sig {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--amber);
}

.hangar-tip-hint {
  margin: 0.5rem 0 0;
  font-size: 0.66rem;
  color: #64748b;
}

@media (max-width: 860px) {
  .hangar-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .hangar-left {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .hangar-right {
    overflow: visible;
  }
  .hud-right {
    top: auto;
    bottom: 4.5rem;
    width: 14rem;
  }
  .hud-radar {
    display: none;
  }
  .hud-controls {
    display: none;
  }
  .help-cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .reveal,
  .hangar-xp-fill::after,
  .hud-bar-xp .hud-bar-fill::after,
  .is-levelup-flash,
  .hangar-sell-chip.is-pop {
    animation: none;
  }
}

/* ---------------------------------------------------------------- Koop-Squad */

.hud-left {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: min(19rem, calc(100vw - 22rem));
  max-height: calc(100vh - 1.8rem);
  pointer-events: none;
}

.hud-left .hud-player {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  box-sizing: border-box;
}

.hud-squad {
  pointer-events: none;
}

.squad-panel {
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
}

.squad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.squad-title {
  margin: 0;
  font: 700 0.7rem/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--neon);
}

.squad-count {
  font: 700 0.72rem/1 var(--display);
  letter-spacing: 0.12em;
  color: #94a3b8;
}

.squad-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.squad-code {
  font: 700 1.25rem/1 var(--display);
  letter-spacing: 0.32em;
  color: #f8fafc;
  user-select: all;
}

.squad-role {
  padding: 0.12rem 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  font: 700 0.62rem/1.2 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.squad-role.is-host {
  border-color: rgba(245, 158, 11, 0.7);
  color: var(--amber);
}

.squad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.squad-join {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.squad-input {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(100, 116, 139, 0.55);
  border-radius: 4px;
  background: rgba(2, 6, 23, 0.8);
  font: 700 0.85rem/1.2 var(--display);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #f8fafc;
}

.squad-input::placeholder {
  letter-spacing: 0.2em;
  color: #475569;
}

.squad-input:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.25);
}

.squad-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(100, 116, 139, 0.55);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.9);
  font: 700 0.72rem/1.2 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e2e8f0;
  cursor: pointer;
  pointer-events: auto;
}

.squad-btn:hover:not(:disabled) {
  border-color: var(--neon);
  color: var(--neon);
}

.squad-btn:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

.squad-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.squad-btn-primary {
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon);
}

.squad-btn-danger:hover:not(:disabled) {
  border-color: var(--crimson);
  color: var(--crimson);
}

.squad-note {
  margin: 0.4rem 0 0;
  font-size: 0.68rem;
  color: #64748b;
}

.squad-panel.is-compact {
  padding: 0.45rem 0.55rem;
}

.squad-panel.is-compact .squad-code {
  font-size: 1.05rem;
}

.squad-mates {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  pointer-events: none;
}

.squad-mates[hidden] {
  display: none;
}

.squad-mate {
  --mc: var(--neon);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--mc);
  border-radius: 0.5rem;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.squad-mate.is-offline {
  opacity: 0.5;
}

.squad-mate.is-dead .squad-mate-name {
  text-decoration: line-through;
}

.squad-mate-avatar {
  flex: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--mc);
  border-radius: 0.35rem;
  overflow: hidden;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 1rem/1 var(--display);
  color: var(--mc);
}

.squad-mate-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.squad-mate-body {
  flex: 1;
  min-width: 0;
}

.squad-mate-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}

.squad-mate-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 0.9rem/1.1 var(--display);
  letter-spacing: 0.04em;
  color: #f8fafc;
}

.squad-mate.is-host .squad-mate-name::after {
  content: ' ★';
  color: var(--amber);
}

.squad-mate-meta {
  flex: none;
  font: 700 0.62rem/1.1 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.squad-mate-bar {
  position: relative;
  height: 0.8rem;
  margin-top: 0.25rem;
  border: 1px solid rgba(100, 116, 139, 0.55);
  border-radius: 3px;
  background: rgba(2, 6, 23, 0.8);
  overflow: hidden;
}

.squad-mate-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: linear-gradient(90deg, #15803d, #22c55e);
  transition: width 0.15s linear;
}

.squad-mate.is-dead .squad-mate-fill {
  background: #7f1d1d;
}

.squad-mate-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 0.6rem/1 var(--display);
  letter-spacing: 0.12em;
  color: #f8fafc;
  text-shadow: 0 0 3px #000;
}

.hangar-squad {
  margin-top: 0.4rem;
}

.hangar-squad .squad-panel {
  padding: 0.7rem 0.85rem;
}

@media (max-width: 860px) {
  .hud-left {
    width: min(16rem, calc(100vw - 1.8rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .squad-mate-fill {
    transition: none;
  }
}
