* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

#app-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: 100%;
  background: #050508;
}

#game-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(5, 5, 8, 0.94) 0%, rgba(5, 5, 8, 0) 100%);
}

.nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.88);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.nav-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.18s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab:hover {
  color: #ffffff;
}

.nav-tab.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.mode-summary-bar {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: 0.5px;
}

.mode-pill {
  display: flex;
  gap: 12px;
  background: rgba(15, 23, 42, 0.6);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-pill strong {
  color: #facc15;
}

.mode-pill.hidden {
  display: none !important;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 30;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.overlay.hidden {
  display: none !important;
}

.overlay-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 1px;
  margin: 0 0 4px 0;
}

.big-score {
  font-size: 48px;
  font-weight: 900;
  color: #facc15;
  margin: 0;
  line-height: 1.1;
}

.medal-badge {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 4px 0 8px 0;
  padding: 4px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.medal-badge:empty {
  display: none;
}

.medal-badge.gold {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid #facc15;
  color: #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.25);
}

.medal-badge.silver {
  background: rgba(226, 232, 240, 0.15);
  border: 1px solid #cbd5e1;
  color: #e2e8f0;
  box-shadow: 0 0 12px rgba(203, 213, 225, 0.2);
}

.medal-badge.bronze {
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid #d97706;
  color: #fbbf24;
}

.mult-badge {
  font-size: 16px;
  font-weight: 800;
  color: #94a3b8;
  margin: 6px 0 24px 0;
}

.mult-badge span {
  color: #fff;
}

.upgrades-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 460px;
  margin-bottom: 20px;
}

.upgrade-card {
  background: #111;
  border: 2px solid #333;
  padding: 16px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.1s, background 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.upgrade-card:hover {
  border-color: #777;
  background: #1a1a1a;
  transform: translateY(-3px) scale(1.03);
}

.upgrade-card:active {
  transform: scale(0.96);
}

.upgrade-card.selected {
  border-color: #facc15;
  background: #262107;
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 8px 24px rgba(250, 204, 21, 0.22);
}

.upgrade-name {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
}

.upgrade-desc {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.upgrade-card.risk .upgrade-desc {
  color: #fb7185;
}

.decision-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 460px;
}

.action-btn {
  padding: 16px 12px;
  background: #111;
  border: 2px solid #fff;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.action-btn:hover:not(:disabled) {
  filter: brightness(1.2);
  transform: translateY(-2px) scale(1.02);
}

.action-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
}

.action-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.btn-bank {
  background: #14532d;
  border-color: #22c55e;
  color: #4ade80;
}

.btn-continue {
  background: #4c0519;
  border-color: #f43f5e;
  color: #fff;
}

.btn-primary {
  width: 100%;
  max-width: 260px;
  margin-top: 20px;
  background: #fff;
  color: #000;
}

.breakdown-box {
  width: 100%;
  max-width: 360px;
  background: #111;
  border: 2px solid #333;
  padding: 14px 18px;
  margin: 4px 0 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-box.hidden {
  display: none !important;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
}

.breakdown-label {
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.breakdown-val {
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.breakdown-val.highlight {
  color: #4ade80;
}

.breakdown-row.breakdown-total {
  border-top: 1px solid #333;
  padding-top: 8px;
  margin-top: 2px;
  font-size: 16px;
  color: #fff;
}

.breakdown-row.breakdown-total .breakdown-val {
  color: #facc15;
  font-size: 18px;
  font-weight: 900;
}

/* ========================================== */
/* HANGAR SCREEN & FLEET UPGRADES (PHASE 3)   */
/* ========================================== */

#hangar-view {
  background: rgba(5, 7, 15, 0.96);
  backdrop-filter: blur(14px);
  padding: 56px 14px 20px 14px;
  overflow-y: auto;
  align-items: center;
  justify-content: flex-start;
}

.hangar-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hangar-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.hangar-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
}

.hangar-subtitle {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.hangar-wallet-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  color: #facc15;
}

.wallet-currency {
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
}

.hangar-ships-carousel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hangar-ship-card {
  position: relative;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.hangar-ship-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.hangar-ship-card.selected {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.hangar-ship-card.locked {
  opacity: 0.72;
}

.ship-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.ship-card-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ship-card-name {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.ship-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  letter-spacing: 0.4px;
}

.ship-badge.active {
  background: #0284c7;
  color: #ffffff;
}

.ship-badge.unlocked {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.ship-badge.locked {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.ship-card-tagline {
  font-size: 9px;
  color: #94a3b8;
  line-height: 1.2;
}

.hangar-ship-profile {
  background: #0b0f19;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ship-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.profile-ship-name {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.profile-ship-tagline {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.ship-specialty-desc {
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #38bdf8;
}

.btn-unlock {
  background: #e11d48;
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-unlock:hover:not(:disabled) {
  background: #f43f5e;
}

.btn-unlock.disabled {
  background: #475569;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-equip {
  background: #0284c7;
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-equip:hover {
  background: #0ea5e9;
}

.btn-equipped {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: default;
}

.ship-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat-cell {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-name {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

.stat-val {
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
}

.stat-val.highlight {
  color: #facc15;
}

.hangar-upgrades-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.upgrades-section-header {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.upgrades-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hangar-upgrade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  gap: 10px;
}

.upgrade-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.upgrade-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upgrade-label {
  font-size: 12px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.4px;
}

.upgrade-pips {
  display: flex;
  gap: 4px;
}

.lvl-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
  border: 1px solid #475569;
}

.lvl-pip.filled {
  background: #facc15;
  border-color: #fef08a;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.5);
}

.upgrade-desc {
  font-size: 10px;
  color: #94a3b8;
}

.upgrade-current-val {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
}

.upgrade-btn {
  background: #3b82f6;
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 900;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.upgrade-btn:hover:not(:disabled) {
  background: #60a5fa;
}

.upgrade-btn.disabled,
.upgrade-btn:disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.7;
}

.upgrade-btn.max {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  cursor: default;
}

.hangar-bottom-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

/* ==========================================
   PHASE 4 EXPANDED PROGRESSION STYLES
   ========================================== */

/* Companion Drones Section in Hangar */
.hangar-drones-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.drones-loadout-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.drone-slot-pill {
  flex: 1;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drone-slot-pill.active {
  border-color: #22d3ee;
  background: rgba(6, 182, 212, 0.15);
  color: #e0f2fe;
}

.drones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.drone-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.18s ease;
}

.drone-card.equipped {
  border-color: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}

.drone-card.locked {
  opacity: 0.75;
}

.drone-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.drone-name {
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.drone-role-tag {
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.drone-role-tag.offensive {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

.drone-role-tag.defensive {
  background: rgba(34, 211, 238, 0.2);
  color: #22d3ee;
}

.drone-role-tag.utility {
  background: rgba(250, 204, 21, 0.2);
  color: #facc15;
}

.drone-tagline {
  font-size: 9px;
  color: #94a3b8;
}

.drone-desc {
  font-size: 9px;
  color: #cbd5e1;
  line-height: 1.3;
  flex: 1;
}

.drone-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.drone-lvl-label {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
}

.drone-pips {
  display: flex;
  gap: 2px;
}

.drone-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.equip-slot-btns {
  display: flex;
  gap: 4px;
}

.equip-slot-btns button {
  flex: 1;
  padding: 4px 6px;
  font-size: 9px;
  font-weight: 800;
}

.btn-unlock-drone {
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 5px 6px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-unequip-drone {
  background: #334155;
  color: #e2e8f0;
  font-size: 9px;
  font-weight: 800;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
}

.btn-equip-drone {
  background: #0284c7;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Campaign Screen */
.campaign-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  overflow-y: auto;
  padding: 8px 12px;
}

.campaign-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.campaign-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}

.campaign-subtitle {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.campaign-progress-badge {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 8px;
  border-radius: 999px;
}

.campaign-sectors-row {
  display: flex;
  gap: 6px;
}

.campaign-sector-tab {
  flex: 1;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: all 0.15s ease;
}

.campaign-sector-tab:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.campaign-sector-tab.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.sector-code {
  font-size: 9px;
  font-weight: 900;
  color: #38bdf8;
}

.sector-name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.campaign-mission-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.15s ease;
}

.campaign-mission-card:hover:not(.locked) {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.campaign-mission-card.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.campaign-mission-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.campaign-mission-card.boss-card {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.08);
}

.mission-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mission-code {
  font-size: 11px;
  font-weight: 900;
  color: #e2e8f0;
}

.mission-status-pill {
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
}

.mission-status-pill.cleared {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.mission-status-pill.available {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.mission-status-pill.locked {
  color: #64748b;
  background: rgba(100, 116, 139, 0.15);
}

.mission-card-title {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mission-card-stars {
  font-size: 12px;
  color: #64748b;
}

.mission-card-stars .filled {
  color: #facc15;
}

.mission-card-reward {
  font-size: 10px;
  font-weight: 800;
  color: #facc15;
}

.campaign-briefing-panel {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.briefing-code {
  font-size: 9px;
  font-weight: 900;
  color: #38bdf8;
}

.briefing-title {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
}

.briefing-desc {
  margin: 0;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
}

.briefing-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px;
  border-radius: 6px;
}

.briefing-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.briefing-stat .stat-label {
  font-size: 8px;
  font-weight: 800;
  color: #94a3b8;
}

.briefing-stat .stat-value {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

.btn-launch-mission {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

/* Profile View */
.profile-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
  padding: 8px 12px;
}

.profile-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.profile-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
}

.profile-subtitle {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.profile-wallet-badge {
  font-size: 12px;
  font-weight: 800;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 4px 8px;
  border-radius: 999px;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.profile-stat-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pstat-val {
  font-size: 16px;
  font-weight: 900;
  color: #facc15;
}

.pstat-label {
  font-size: 8px;
  font-weight: 800;
  color: #94a3b8;
  margin-top: 2px;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.achievement-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.achievement-card.unlocked {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.08);
}

.achievement-card.claimed {
  border-color: rgba(74, 222, 128, 0.3);
  opacity: 0.85;
}

.ach-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ach-title {
  font-size: 12px;
  font-weight: 900;
  color: #fff;
}

.ach-reward {
  font-size: 10px;
  font-weight: 800;
  color: #facc15;
}

.ach-desc {
  margin: 2px 0 0;
  font-size: 10px;
  color: #cbd5e1;
}

.ach-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 4px;
}

.ach-badge.claimed {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.ach-badge.locked {
  color: #64748b;
  background: rgba(100, 116, 139, 0.15);
}

.btn-claim {
  background: #f59e0b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  animation: pulse 1.8s infinite;
}

/* ==========================================
   LEADERBOARDS & RANKINGS UI (GDD 3.3, 4.6, 8.1, 10)
   ========================================== */

.leaderboard-inner {
  max-width: 660px;
  width: 96%;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(10, 15, 29, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(2, 132, 199, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.leaderboard-title {
  font-size: 18px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 0.5px;
  margin: 0;
}

.leaderboard-subtitle {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.leaderboard-percentile-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: #cbd5e1;
}

.leaderboard-percentile-badge strong {
  color: #38bdf8;
}

.leaderboard-category-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.lb-category-tab {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.lb-category-tab:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

.lb-category-tab.active {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.leaderboard-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.lb-stat-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.lb-card-label {
  font-size: 8px;
  font-weight: 800;
  color: #94a3b8;
}

.lb-card-val {
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-card-val.highlight {
  color: #facc15;
}

.leaderboard-table-container {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.leaderboard-table th {
  background: rgba(30, 41, 59, 0.95);
  color: #94a3b8;
  font-weight: 900;
  font-size: 9px;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-row.player-row {
  background: rgba(250, 204, 21, 0.12);
  border-left: 3px solid #facc15;
}

.rank-badge {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 10px;
}

.rank-gold {
  background: #facc15;
  color: #0f172a;
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.4);
}

.rank-silver {
  background: #cbd5e1;
  color: #0f172a;
}

.rank-bronze {
  background: #d97706;
  color: #fff;
}

.rank-other {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.rank-badge.hall {
  background: #a855f7;
  color: #fff;
}

.pilot-handle {
  font-weight: 800;
  color: #fff;
}

.you-badge {
  font-size: 9px;
  font-weight: 900;
  color: #facc15;
  margin-left: 4px;
}

.lb-col-value {
  font-weight: 900;
  color: #fff;
}

.lb-col-value.highlight {
  color: #facc15;
}

.lb-col-detail {
  color: #94a3b8;
  font-size: 10px;
}

.verified-tag {
  font-size: 9px;
  font-weight: 800;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  white-space: nowrap;
}

.season-badge {
  font-size: 9px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: 4px;
}

.leaderboard-footer {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

/* ==========================================
   CHALLENGES VIEW & CUSTOMIZATION STYLES (PHASE 5)
   ========================================== */

.challenges-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 580px;
  padding: 12px;
  color: #fff;
  overflow-y: auto;
  max-height: 90vh;
}

.challenges-header-banner {
  text-align: center;
}

.challenges-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 1px;
}

.challenges-subtitle {
  margin: 4px 0 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.challenge-code-input-bar {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.challenge-input-field {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
}

.challenge-select-field {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.challenge-input-msg {
  font-size: 11px;
  color: #f43f5e;
  font-weight: 700;
  text-align: center;
}

.challenges-section-heading {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.5px;
}

.challenges-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challenge-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.18s ease;
}

.challenge-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.challenge-card.completed {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(6, 78, 59, 0.18);
}

.challenge-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.challenge-title-box {
  display: flex;
  flex-direction: column;
}

.challenge-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.challenge-card-creator {
  font-size: 10px;
  color: #38bdf8;
  font-weight: 700;
}

.challenge-status-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.challenge-status-badge.bounty {
  background: rgba(250, 204, 21, 0.16);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.challenge-status-badge.cleared {
  background: rgba(74, 222, 128, 0.16);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.challenge-card-code {
  font-size: 11px;
  color: #94a3b8;
}

.challenge-card-code code {
  color: #facc15;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
}

.challenge-card-desc {
  margin: 0;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.35;
}

.challenge-mods-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.challenge-mod-pill {
  font-size: 9px;
  font-weight: 800;
  color: #e0f2fe;
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.challenge-mult-pill {
  font-size: 9px;
  font-weight: 900;
  color: #facc15;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.challenge-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.challenge-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-deploy-challenge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.18s ease;
}

.challenge-creator-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.creator-desc {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
}

.creator-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.creator-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.creator-field label, .creator-modifiers-group label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.modifiers-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.mod-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
}

.mod-name {
  font-weight: 700;
}

.mod-sub {
  font-size: 9px;
  color: #94a3b8;
}

.creator-actions-row {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.creator-result-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  font-size: 11px;
  color: #cbd5e1;
}

.result-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.result-code-display code {
  font-size: 13px;
  font-weight: 900;
  color: #facc15;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 4px;
}

.btn-small {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.challenges-bottom-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* ==========================================
   HANGAR COSMETICS & CUSTOMIZATION BAY
   ========================================== */

.hangar-cosmetics-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cosmetics-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cosmetics-subhead {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.cosmetics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.cosmetic-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.cosmetic-card.equipped {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.cosmetic-swatch {
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cosmetic-name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

.cosmetic-desc {
  font-size: 9px;
  color: #94a3b8;
  line-height: 1.25;
  min-height: 22px;
}

.cosmetic-action {
  margin-top: auto;
}

.cosmetic-btn {
  width: 100%;
  padding: 5px;
  border-radius: 4px;
  border: none;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  background: #3b82f6;
  color: #fff;
  transition: opacity 0.18s ease;
}

.cosmetic-btn.equipped {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  cursor: default;
}

.cosmetic-btn.btn-unlock-skin, .cosmetic-btn.btn-unlock-trail {
  background: #ea580c;
  color: #fff;
}

.cosmetic-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
