body {
  background-color: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.navbar {
  background-color: #1a1a2e;
  border-bottom: 2px solid #e94560;
}

.navbar-brand {
  color: #e94560 !important;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nav-link {
  color: #a0a0b0 !important;
  font-weight: 500;
  padding: 0.5rem 1.25rem !important;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(233, 69, 96, 0.15);
}

.nav-link.active {
  color: #ffffff !important;
  background-color: #e94560;
}

/* Listing grid */
.listing-header {
  border-bottom: 2px solid #e94560;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.listing-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.card-item {
  background-color: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, transform 0.15s;
  cursor: pointer;
}

.card-item:hover {
  border-color: #e94560;
  transform: translateY(-2px);
}

.card-item .item-name {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.card-item .item-meta {
  font-size: 0.8rem;
  color: #7070a0;
}

.empty-state {
  text-align: center;
  color: #4a4a6a;
  padding: 4rem 0;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6060a0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.2rem;
}

.filter-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #2a2a4a;
  background-color: #1a1a2e;
  color: #7070a0;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.filter-btn:hover {
  border-color: #5050a0;
  color: #c0c0e0;
}

.filter-btn.active {
  border-color: transparent;
  color: #ffffff;
}

/* rank filter active states — use filter-rank-* to avoid collision with badge classes */
.filter-btn.filter-rank-b.active { background-color: #4a6fa5; color: #ffffff; }
.filter-btn.filter-rank-a.active { background-color: #8b6abf; color: #ffffff; }
.filter-btn.filter-rank-s.active { background: linear-gradient(135deg, #c9960c, #f0b429); color: #1a1200; }

/* version / occupation buttons use accent colour when active */
.filter-btn.filter-occ.active,
.filter-btn.filter-ver.active {
  background-color: #e94560;
  color: #ffffff;
}

/* Pilot cards */
.pilot-card {
  background-color: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
  cursor: pointer;
}

.pilot-card:hover {
  border-color: #e94560;
  transform: translateY(-3px);
}

.pilot-avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #111122;
  overflow: hidden;
}

.pilot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.rank-badge,
.version-badge {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.rank-badge {
  top: 6px;
  right: 6px;
  text-transform: uppercase;
}

.version-badge {
  top: 6px;
  left: 6px;
  background-color: rgba(0, 0, 0, 0.55);
  color: #c0c0d0;
}

.rank-b {
  background-color: #4a6fa5;
  color: #ffffff;
}

.rank-a {
  background-color: #8b6abf;
  color: #ffffff;
}

.rank-s {
  background: linear-gradient(135deg, #c9960c, #f0b429);
  color: #1a1200;
}

.pilot-info {
  padding: 0.6rem 0.75rem 0.75rem;
}

.pilot-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pilot-realname {
  font-size: 0.72rem;
  color: #7070a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.4rem;
}

.pilot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tag {
  font-size: 0.62rem;
  background-color: #2a2a4a;
  color: #a0a0c0;
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ── Pilot detail page ────────────────────────────────────────────── */
.btn-back {
  position: fixed;
  top: 4rem;
  left: 1rem;
  display: inline-block;
  color: #7070a0;
  font-size: 0.8rem;
  text-decoration: none;
  background: rgba(15, 15, 15, 0.85);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  z-index: 100;
  transition: color 0.15s;
}
.btn-back:hover { color: #e94560; }

.detail-layout {
  display: flex;
  flex-direction: row-reverse;
  gap: 2rem;
  align-items: flex-start;
}

.detail-portrait-col {
  flex: 0 0 auto;
}

.detail-portrait {
  position: relative;
  height: 500px;
  border-radius: 10px;
  overflow: hidden;
  background-color: #111122;
  border: 1px solid #2a2a4a;
}

.detail-portrait img {
  height: 100%;
  width: auto;
  display: block;
}

.detail-info-col {
  flex: 1;
  min-width: 0;
}

.detail-name {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.occupation-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.detail-realname {
  font-size: 0.9rem;
  color: #7070a0;
  margin-bottom: 0.75rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 1.5rem;
}

.detail-tags .tag {
  font-size: 0.75rem;
  padding: 3px 8px;
}

.detail-talents {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.talent-card {
  background-color: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.talent-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.talent-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: #111122;
  object-fit: contain;
  flex-shrink: 0;
}

.talent-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #e94560;
  margin-bottom: 1px;
}

.talent-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.talent-desc {
  font-size: 1rem;
  color: #b0b0c8;
  line-height: 1.55;
}

/* ── Mech stats ───────────────────────────────────────────────────── */
.mech-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.mech-stat {
  background-color: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.mech-stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6060a0;
  margin-bottom: 2px;
}

.mech-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.mech-stat-fire   .mech-stat-label { color: #c05060; }
.mech-stat-fire   .mech-stat-value { color: #ff6070; }
.mech-stat-hp     .mech-stat-label { color: #3a7a4a; }
.mech-stat-hp     .mech-stat-value { color: #60c870; }
.mech-stat-weight .mech-stat-label { color: #2a5a8a; }
.mech-stat-weight .mech-stat-value { color: #60a8ff; }
.mech-stat-over   .mech-stat-value { color: #e94560; }

.module-level {
  font-size: 0.65rem;
  font-weight: 600;
  color: #e0b030;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ── Skills ───────────────────────────────────────────────────────── */
.skill-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.skill-card {
  background-color: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.skill-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.skill-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: #111122;
  object-fit: contain;
  flex-shrink: 0;
}

.skill-header-info {
  flex: 1;
  min-width: 0;
}

.skill-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

.skill-type-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
}

.skill-type-attack  { background-color: #7a2030; color: #ff8090; }
.skill-type-code    { background-color: #1a4a7a; color: #70b8ff; }
.skill-type-passive { background-color: #2a3a2a; color: #70c870; }
.skill-type-innate  { background-color: #3a2a5a; color: #c088ff; }

.skill-list-innate .skill-card {
  border-color: #3a2a5a;
}

.skill-stats {
  display: flex;
  gap: 0.5rem;
}

.skill-stat {
  font-size: 0.72rem;
  color: #c0c0d8;
  display: flex;
  align-items: center;
  gap: 3px;
}

.skill-stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #6060a0;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .skill-list { grid-template-columns: 1fr; }
}

/* ── Neural Drive ─────────────────────────────────────────────────── */
.nd-section {
  margin-top: 2.5rem;
}

.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 2px solid #e94560;
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
}

.nd-parts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.nd-part {
  background-color: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.nd-part-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.nd-part-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.nd-part-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  flex: 1;
}

.nd-slots-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.nd-slots-label {
  font-size: 0.6rem;
  color: #6060a0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.nd-slots {
  display: flex;
  gap: 5px;
}

.nd-slot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
}

.slot-attack   { background-color: #e94560; }
.slot-dodge    { background-color: #e0b030; }
.slot-critical { background-color: #4a9fd4; }

.nd-effects {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nd-effect {
  border-top: 1px solid #2a2a4a;
  padding-top: 0.75rem;
}

.nd-effect-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.nd-effect-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e0e0e0;
}

.nd-effect-req {
  font-size: 0.75rem;
  color: #6060a0;
  margin-top: 1px;
}

@media (max-width: 600px) {
  .detail-layout {
    flex-direction: column;
  }
  .detail-portrait-col {
    width: 100%;
  }
  .detail-portrait {
    height: 300px;
  }
  .detail-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }
  .nd-parts {
    grid-template-columns: 1fr;
  }
}

/* ── Keyword glossary ─────────────────────────────────────────────────────── */
.kw {
  color: #b39ddb;
  cursor: help;
  border-bottom: 1px dashed rgba(179, 157, 219, 0.5);
  white-space: nowrap;
}
.kw-skill {
  color: #b39ddb;
  border-bottom-color: rgba(179, 157, 219, 0.5);
}
.kw-unknown {
  opacity: 0.75;
}

#kw-tooltip {
  position: absolute;
  z-index: 2000;
  max-width: 280px;
  background: #1a1a2e;
  border: 1px solid #3a3a6e;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
#kw-tooltip.visible {
  opacity: 1;
}
.kw-tip-name {
  font-weight: 600;
  color: #b39ddb;
  margin-bottom: 0.25rem;
}
.kw-tip-stats {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 0.3rem;
}
.kw-tip-sep {
  margin: 0 0.35rem;
  color: #555;
}
.kw-tip-effect {
  color: #b0b0c8;
}

/* Global version badge in navbar */
.global-version-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #a0a0b0;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* CN translation warning */
.cn-warning {
  background-color: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.5);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
}

/* Home page */
.home-page {
  max-width: 720px;
  margin: 0 auto;
}
.home-hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.home-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #e94560;
  letter-spacing: 0.05em;
}
.home-subtitle {
  color: #a0a0b0;
  font-size: 1rem;
  margin-top: 0.5rem;
}
.home-nav-cards {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}
.home-card {
  flex: 1;
  max-width: 260px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 1.5rem;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.home-card:hover {
  border-color: #e94560;
  background: #20203a;
}
.home-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e94560;
  margin-bottom: 0.4rem;
}
.home-card-desc {
  font-size: 0.85rem;
  color: #a0a0b0;
}
.home-disclaimer {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 1.5rem 2rem;
  color: #a0a0b0;
  font-size: 0.85rem;
  line-height: 1.7;
}
.home-disclaimer p {
  margin-bottom: 0.6rem;
}
.home-disclaimer p:last-child {
  margin-bottom: 0;
}
.home-disclaimer-title {
  font-size: 1rem;
  font-weight: 600;
  color: #c0c0d0;
  margin-bottom: 0.75rem;
}

/* Q&A section */
.home-qa {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.25rem;
}
.qa-item {
  margin-bottom: 1rem;
}
.qa-item:last-child {
  margin-bottom: 0;
}
.qa-q {
  font-weight: 600;
  color: #e94560;
  margin-bottom: 0.25rem;
}
.qa-q::before {
  content: 'Q: ';
}
.qa-a {
  color: #a0a0b0;
  font-size: 0.88rem;
  line-height: 1.65;
  padding-left: 1rem;
}
.qa-a::before {
  content: 'A: ';
  color: #c0c0d0;
  font-weight: 500;
}
