/* ============================================================================
   NOVA STRIKE: APEX VANGUARD — UNIVERSAL RESPONSIVE COCKPIT STYLESHEET
   Supports 9:16 / 4:5 Mobile Portrait AND 16:9 Widescreen Desktop Cockpit
   ============================================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --cyan: #00f0ff;
  --blue: #3b82f6;
  --gold: #ffd700;
  --red: #ff2a5f;
  --violet: #c084fc;
  --emerald: #34d399;
  --bg-deep: #030612;
  --panel-bg: rgba(9, 14, 32, 0.84);
  --panel-border: rgba(0, 240, 255, 0.28);
  --text-dim: rgba(203, 213, 225, 0.72);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: #f8fafc;
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
}

#app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  background: radial-gradient(circle at 50% 30%, #0b1533 0%, #030612 85%);
  overflow: hidden;
}

/* Desktop / Widescreen Tactical Cockpit Mode */
@media (min-width: 820px) and (min-aspect-ratio: 6/5) {
  #app-shell {
    grid-template-columns: minmax(220px, 265px) 1fr minmax(220px, 265px);
    gap: 0;
  }
  .cockpit-wing {
    display: flex !important;
  }
  #desktop-arena-strip {
    display: flex !important;
  }
  #mobile-hud-top,
  #mobile-hud-bottom {
    display: none !important;
  }
}

.cockpit-wing {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  gap: 12px;
  background: linear-gradient(180deg, rgba(6, 11, 26, 0.96), rgba(4, 7, 18, 0.98));
  border-right: 1px solid rgba(0, 240, 255, 0.22);
  z-index: 15;
  overflow-y: auto;
}

#cockpit-right {
  border-right: none;
  border-left: 1px solid rgba(0, 240, 255, 0.22);
}

.wing-card {
  background: rgba(13, 21, 46, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 12px;
  padding: 11px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.wing-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.telemetry-value-lg {
  font-family: 'Orbitron', monospace;
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
}

.meter-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 9px;
}
.meter-row:last-child {
  margin-bottom: 0;
}
.meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-dim);
}
.meter-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  width: 0%;
  transition: width 0.12s ease;
}
.fill-shield {
  background: linear-gradient(90deg, #00f0ff, #3b82f6);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.65);
}
.fill-overdrive {
  background: linear-gradient(90deg, #f59e0b, #ffd700);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}
.fill-dash {
  background: linear-gradient(90deg, #a855f7, #00f0ff);
}
.fill-combo {
  background: linear-gradient(90deg, #ff2a5f, #ffd700);
}

.augment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.aug-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #e0f2fe;
}
.aug-empty {
  font-size: 0.74rem;
  color: rgba(148, 163, 184, 0.65);
}

.radar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(4, 8, 20, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  padding: 6px;
}
#radarCanvas {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 480 / 760;
  display: block;
}

.cockpit-controls-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(15, 23, 48, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.32);
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s, background 0.15s;
}
.icon-btn:hover {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.16);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Center Combat Arena */
#arena-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #030612;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Mobile / Portrait Overlay HUD */
#mobile-hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: max(8px, var(--yg-safe-top, 8px)) max(10px, var(--yg-safe-right, 10px)) 6px max(10px, var(--yg-safe-left, 10px));
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  z-index: 20;
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(7, 12, 28, 0.82);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 9px;
  padding: 4px 7px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 0;
}

.mob-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: clamp(54px, 16vw, 78px);
}

.mob-score-val {
  font-family: 'Orbitron', monospace;
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
}
.combo-pill {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.64rem;
  font-weight: 900;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.14);
  border: 1px solid rgba(255, 215, 0, 0.65);
  border-radius: 5px;
  padding: 1px 5px;
}

.hud-actions-row {
  display: flex;
  gap: 4px;
  pointer-events: auto;
  flex-shrink: 0;
}
.hud-actions-row .icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
}
.hud-actions-row .icon-btn svg {
  width: 14px;
  height: 14px;
}

#mobile-hud-bottom {
  position: absolute;
  bottom: max(12px, var(--yg-safe-bottom, 12px));
  left: 12px;
  right: 12px;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 20;
}

.weapon-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 12, 28, 0.84);
  border: 1px solid rgba(0, 240, 255, 0.32);
  padding: 6px 11px;
  border-radius: 18px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--cyan);
}

.mobile-ability-cluster {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: auto;
}

.btn-ability-circle {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.35), rgba(8, 15, 36, 0.92));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.38);
  transition: transform 0.1s, opacity 0.15s;
}
.btn-ability-circle.nova {
  width: 62px;
  height: 62px;
  border-color: var(--gold);
  background: radial-gradient(circle at 35% 30%, #ffd700, #ea580c 72%, #7f1d1d);
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.6);
}
.btn-ability-circle.disabled {
  opacity: 0.42;
  filter: grayscale(0.7);
}
.btn-ability-circle:active {
  transform: scale(0.9);
}

/* Desktop Center Top Strip + Ability Actions */
#desktop-arena-strip {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  display: none;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 18;
}
.sector-chip {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--cyan);
  background: rgba(7, 12, 28, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
}

/* Boss HUD */
#boss-hud {
  position: absolute;
  top: 52px;
  left: 14px;
  right: 14px;
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(24, 6, 16, 0.88);
  border: 1px solid rgba(255, 42, 95, 0.65);
  box-shadow: 0 0 24px rgba(255, 42, 95, 0.32);
  pointer-events: none;
  z-index: 22;
}
.boss-head {
  display: flex;
  justify-content: space-between;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--red);
  letter-spacing: 1px;
}
.boss-bar {
  height: 9px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 42, 95, 0.45);
}
.boss-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2a5f, #ffd700);
  transition: width 0.08s linear;
}

/* Sector Banner Toast */
#sector-banner {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(5, 10, 24, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 36px rgba(0, 240, 255, 0.25);
  z-index: 24;
  transition: opacity 0.28s ease, transform 0.28s ease;
  width: min(90%, 360px);
}
#sector-banner.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.sector-banner-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--cyan);
}
.sector-banner-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 2px;
}

/* ============================================================================
   CLEAN MINIMALIST LIVE HANGAR & SUB-MODALS
   ============================================================================ */

.hangar-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(14px, var(--yg-safe-top, 14px)) 16px max(16px, var(--yg-safe-bottom, 16px));
  background: linear-gradient(
    180deg,
    rgba(3, 6, 18, 0.72) 0%,
    rgba(3, 6, 18, 0.08) 28%,
    rgba(3, 6, 18, 0.08) 54%,
    rgba(3, 6, 18, 0.9) 82%,
    rgba(3, 6, 18, 0.96) 100%
  );
  pointer-events: auto;
}

.hangar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.brand-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.05;
  background: linear-gradient(90deg, #ffffff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2.4px;
  color: rgba(148, 163, 184, 0.85);
  margin-top: 2px;
}

.wallet-strip {
  display: flex;
  align-items: center;
  gap: 6px;
}
.shard-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(8, 16, 36, 0.75);
  border: 1px solid rgba(34, 211, 238, 0.45);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  color: #67e8f9;
  backdrop-filter: blur(8px);
}
.hangar-header .icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
}

/* Open Center Carousel Flanking the Live Ship on Canvas */
.hangar-stage-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 10px;
  pointer-events: none;
}

.carousel-arrows {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: auto;
  margin-top: auto;
  pointer-events: none;
}
.arrow-nav-btn {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(8, 15, 34, 0.58);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.12s, background 0.15s;
}
.arrow-nav-btn:hover {
  background: rgba(0, 240, 255, 0.18);
}
.arrow-nav-btn:active {
  transform: scale(0.9);
}

.ship-hero-info {
  text-align: center;
  max-width: 320px;
  pointer-events: auto;
}
.ship-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 7px;
}
.ship-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: all 0.2s;
}
.ship-dot.active {
  width: 18px;
  border-radius: 4px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.hero-ship-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: #fff;
}
.hero-ship-role {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan);
  margin-top: 1px;
}
.hero-ship-perk {
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.78);
  margin-top: 4px;
  line-height: 1.3;
}

.hangar-bottom-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.pill-controls-row {
  display: flex;
  gap: 6px;
}
.segmented-group {
  flex: 1;
  display: flex;
  gap: 4px;
  background: rgba(8, 14, 32, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 3px;
}
.seg-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.seg-btn.active {
  background: rgba(0, 240, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.45);
}

.btn-launch {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, #00f0ff, #3b82f6);
  color: #030612;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 1.6px;
  cursor: pointer;
  box-shadow: 0 6px 26px rgba(0, 240, 255, 0.42);
  transition: transform 0.12s, filter 0.15s;
}
.btn-launch:hover {
  filter: brightness(1.08);
}
.btn-launch:active {
  transform: scale(0.98);
}

.dock-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(3, 6, 18, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
}

.sheet-card {
  width: 100%;
  max-width: 410px;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(9, 15, 36, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.34);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
  overflow-y: auto;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

/* Workshop & Liveries Grid */
.workshop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.upgrade-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(13, 21, 46, 0.84);
  border: 1px solid rgba(0, 240, 255, 0.22);
}
.upgrade-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  justify-content: space-between;
}
.upgrade-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.pips-row {
  display: flex;
  gap: 4px;
}
.pip {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}
.pip.filled {
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.65);
}
.btn-buy {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-buy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.livery-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.livery-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(13, 21, 46, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
}
.livery-card.active {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.15);
}
.swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  flex-shrink: 0;
}

/* Compact Pause & Debrief Cards */
.compact-card {
  width: 100%;
  max-width: 370px;
  background: rgba(8, 14, 34, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
}
.debrief-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.debrief-stat {
  background: rgba(15, 24, 50, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  padding: 8px;
}
.debrief-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
}
.debrief-stat-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
.rank-badge {
  display: inline-block;
  margin: 6px 0;
  padding: 4px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--gold);
  background: rgba(255, 215, 0, 0.14);
  color: var(--gold);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}
.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-sec {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 24, 52, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #e2e8f0;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-sec:hover {
  border-color: var(--cyan);
}
