:root {
  --bg: #0a0d11;
  --bg-soft: #11161d;
  --panel: rgba(18, 21, 27, 0.92);
  --panel-soft: rgba(25, 31, 39, 0.92);
  --line: rgba(214, 184, 120, 0.14);
  --line-strong: rgba(214, 184, 120, 0.28);
  --gold: #d6b878;
  --gold-bright: #f1d89c;
  --ink: #f6f0df;
  --muted: #a9acaa;
  --green: #7dbf87;
  --amber: #d8a24c;
  --orange: #d57a3a;
  --red: #bb544c;
  --blue: #6f8fb5;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(214, 184, 120, 0.09), transparent 24%),
    radial-gradient(circle at left 20%, rgba(125, 191, 135, 0.06), transparent 18%),
    linear-gradient(180deg, #0f1318 0%, #090b0e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 82%);
}

code {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px 18px 72px;
}

.site-width {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 18px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid rgba(214, 184, 120, 0.12);
  background:
    linear-gradient(180deg, rgba(10, 13, 17, 0.96), rgba(10, 13, 17, 0.9)),
    rgba(10, 13, 17, 0.94);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(214, 184, 120, 0.2), rgba(214, 184, 120, 0.06)),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(214, 184, 120, 0.2);
  color: var(--gold-bright);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.site-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-brand-copy strong {
  font-size: 16px;
  line-height: 1;
}

.site-brand-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a,
.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: 0.2s ease;
}

.site-nav a:hover,
.site-cta:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: rgba(214, 184, 120, 0.22);
  background: rgba(214, 184, 120, 0.12);
}

.site-cta {
  flex: 0 0 auto;
  color: var(--gold-bright);
}

.site-subbar {
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.02);
}

.site-subbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
}

.site-breadcrumb {
  width: 100%;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-list a,
.breadcrumb-list span {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb-list a:hover {
  color: var(--ink);
}

.breadcrumb-list [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.breadcrumb-separator {
  color: rgba(255,255,255,0.32);
}

.site-subbar-inner strong {
  color: var(--ink);
}

.site-footer {
  border-top: 1px solid rgba(214, 184, 120, 0.1);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 26%),
    rgba(9, 11, 14, 0.94);
}

.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 28px;
}

.site-footer-panel {
  padding: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.site-footer-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

.site-footer-panel h2 {
  margin: 0;
  font-size: 24px;
}

.site-footer-panel p {
  color: var(--muted);
  line-height: 1.8;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

.site-footer-note {
  margin: 14px 0 0;
  color: var(--gold-bright);
  font-size: 13px;
}

.site-footer-note + .site-footer-note {
  margin-top: 8px;
}

.site-float {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 70;
  display: grid;
  gap: 10px;
}

.site-float-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(214, 184, 120, 0.26);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(24, 29, 36, 0.98), rgba(14, 18, 24, 0.98));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  color: var(--gold-bright);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.site-float-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(214, 184, 120, 0.16);
  background:
    linear-gradient(180deg, rgba(18, 21, 27, 0.94), rgba(12, 15, 19, 0.96));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

.site-float-item:hover {
  border-color: rgba(214, 184, 120, 0.28);
  color: var(--gold-bright);
}

.site-float-button {
  cursor: pointer;
}

.panel-shell {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(214, 184, 120, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 60%),
    var(--panel);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--gold);
}

.hero h1,
.section-head h1,
.section-head h2 {
  margin: 0;
  line-height: 1.04;
}

.hero h1 {
  font-size: clamp(34px, 4vw, 58px);
}

.section-head h1 {
  font-size: clamp(28px, 3vw, 42px);
}

.page-title {
  font-family: var(--display-face);
  letter-spacing: -0.03em;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.hero-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-flag,
.mini-badge,
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-flag {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--gold-bright);
  background: rgba(214, 184, 120, 0.12);
  border: 1px solid rgba(214, 184, 120, 0.14);
}

.hero-meta {
  display: grid;
  gap: 12px;
}

.meta-card {
  min-height: 96px;
  padding: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}

.meta-card.accent {
  background: linear-gradient(135deg, rgba(214, 184, 120, 0.14), rgba(214, 184, 120, 0.03));
}

.meta-label,
.summary-label,
.section-note,
.compare-subtitle {
  color: var(--muted);
}

.meta-label,
.summary-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.meta-card strong {
  font-size: 22px;
  line-height: 1.25;
}

.compare-strip,
.toolbar,
.compare-panel,
.table-wrap {
  margin-top: 18px;
  padding: 18px;
}

.compare-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(90deg, rgba(214, 184, 120, 0.12), transparent 35%),
    var(--panel-soft);
}

.compare-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.compare-subtitle,
.section-note {
  margin: 0;
  line-height: 1.7;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  background: #0d1116;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}

.summary {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  min-height: 112px;
  padding: 18px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.summary-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.25;
}

.summary-card.solo {
  grid-column: 1 / -1;
}

.summary-wide strong {
  font-size: 20px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.compare-card {
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.compare-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.compare-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compare-title-wrap h3 {
  margin: 0;
  font-size: 18px;
}

.compare-title-wrap p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.compare-icon,
.ammo-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  padding: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  flex: 0 0 auto;
}

.compare-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.compare-stats div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.05);
}

.compare-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.compare-stats strong {
  font-size: 17px;
}

.compare-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  line-height: 1.7;
}

.empty-state,
.placeholder {
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
}

.table-head {
  margin-bottom: 12px;
}

.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1250px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f141b;
  color: var(--gold-bright);
  font-size: 12px;
  letter-spacing: 0.06em;
}

tbody tr:hover {
  background: rgba(255,255,255,0.025);
}

.ammo-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.ammo-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ammo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ammo-text strong {
  font-size: 15px;
}

.ammo-text span,
.note-cell {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ammo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-badge {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
}

.mini-badge.gold,
.badge,
.hero-flag,
.ghost-btn.active,
.table-btn.active {
  background: rgba(214, 184, 120, 0.15);
  color: var(--gold-bright);
  border-color: rgba(214, 184, 120, 0.25);
}

.tier-badge {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.tier-0 {
  background: rgba(111, 143, 181, 0.16);
  color: #b4cae3;
  border-color: rgba(111, 143, 181, 0.22);
}

.tier-1 {
  background: rgba(95, 137, 171, 0.18);
  color: #bfd5ea;
  border-color: rgba(95, 137, 171, 0.24);
}

.tier-2 {
  background: rgba(125, 191, 135, 0.15);
  color: #afddb5;
  border-color: rgba(125, 191, 135, 0.22);
}

.tier-3 {
  background: rgba(216, 162, 76, 0.17);
  color: #f0c16d;
  border-color: rgba(216, 162, 76, 0.22);
}

.tier-4 {
  background: rgba(213, 122, 58, 0.17);
  color: #f5ad74;
  border-color: rgba(213, 122, 58, 0.24);
}

.tier-5 {
  background: rgba(187, 84, 76, 0.18);
  color: #ef9d98;
  border-color: rgba(187, 84, 76, 0.24);
}

.tier-6 {
  background: rgba(214, 184, 120, 0.2);
  color: #ffe6b7;
  border-color: rgba(214, 184, 120, 0.3);
}

.tier-unknown {
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  border-color: rgba(255,255,255,0.08);
}

.table-btn,
.ghost-btn {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--ink);
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}

.table-btn:hover,
.ghost-btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.table-btn {
  min-width: 92px;
}

.ghost-btn.small {
  padding: 7px 10px;
  font-size: 12px;
}

.admin-page {
  max-width: 1520px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
  gap: 20px;
}

.panel {
  background: rgba(18, 24, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 18px;
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.danger {
  color: #ff908c;
}

.success {
  color: #92d39f;
}

.warning {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(244, 196, 106, 0.14);
  border: 1px solid rgba(244, 196, 106, 0.2);
  color: #ffd98d;
}

.item-list {
  max-height: 72vh;
  overflow: auto;
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.item-button {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b1018;
  color: #ebf1f7;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.item-button.active {
  border-color: rgba(244, 196, 106, 0.4);
  box-shadow: inset 0 0 0 1px rgba(244, 196, 106, 0.3);
}

.item-button small {
  display: block;
  margin-top: 4px;
  color: #8fa2b7;
}

.admin-actions,
.form-actions,
.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-page button {
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  background: #f4c46a;
  color: #0a0f16;
  font-weight: 700;
}

.admin-page button.secondary {
  background: #263446;
  color: #ebf1f7;
}

.admin-page button.danger {
  background: #cf5d57;
  color: #fff;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid label,
.admin-form > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #9fb0c2;
  font-size: 13px;
}

.field-grid.full {
  grid-template-columns: 1fr;
}

.source-box {
  border-radius: 16px;
  background: #0b1018;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  color: #9fb0c2;
  line-height: 1.7;
}

.source-box strong {
  color: #ebf1f7;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-line input {
  width: auto;
}

@media (max-width: 1180px) {
  .site-footer-grid,
  .hero,
  .toolbar,
  .summary,
  .admin-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: start;
    padding: 14px 0;
  }

  .section-head,
  .compare-strip {
    flex-direction: column;
    align-items: start;
  }

  .site-nav {
    justify-content: start;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 18px 12px 56px;
  }

  .site-width {
    padding: 0 12px;
  }

  .site-header-inner {
    min-height: auto;
    padding: 12px 0;
  }

  .site-subbar-inner {
    min-height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
  }

  .site-float {
    right: 12px;
    bottom: 12px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .site-float.is-mobile-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .site-float-toggle {
    display: inline-flex;
  }

  .site-float-item {
    display: none;
    min-width: 64px;
    min-height: 38px;
    font-size: 12px;
  }

  .site-float.is-open .site-float-item {
    display: inline-flex;
  }

  .site-float.is-open .site-float-toggle {
    background: rgba(214, 184, 120, 0.18);
    color: var(--ink);
  }

  .hero,
  .compare-strip,
  .toolbar,
  .compare-panel,
  .table-wrap {
    padding: 16px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .meta-card strong,
  .summary-card strong {
    font-size: 20px;
  }
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 12px;
}

.detail-panel {
  margin-top: 18px;
  padding: 18px;
}

.legend-card {
  display: grid;
}

.legend-table {
  display: grid;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.legend-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(160px, 0.55fr) minmax(0, 1.65fr);
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.legend-row:first-child {
  border-top: none;
}

.legend-row > div {
  padding: 14px 16px;
  min-width: 0;
}

.legend-head {
  background: rgba(0,0,0,0.26);
}

.legend-head > div {
  color: var(--gold-bright);
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.legend-effect {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-effect strong,
.legend-average,
.legend-description {
  line-height: 1.7;
}

.legend-average,
.legend-description {
  color: var(--muted);
}

.detail-card {
  display: grid;
  gap: 16px;
}

.detail-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-head h3 {
  margin: 0;
  font-size: 24px;
}

.detail-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.detail-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  flex: 0 0 auto;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.detail-metrics,
.detail-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.detail-metrics div,
.detail-facts div,
.ammo-card-stats div {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.detail-metrics span,
.detail-facts span,
.ammo-card-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.detail-metrics strong,
.detail-facts strong,
.ammo-card-stats strong {
  font-size: 16px;
}

.detail-note {
  padding: 16px;
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  line-height: 1.8;
}

.detail-note p {
  margin: 0;
}

.armor-cell {
  min-width: 260px;
}

.armor-chart {
  display: inline-grid;
  gap: 6px;
}

.armor-chart-grid,
.armor-chart-levels {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.armor-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
}

.armor-score-0 {
  background: #d94d48;
  border-color: rgba(217, 77, 72, 0.42);
}

.armor-score-1 {
  background: #e38235;
  border-color: rgba(227, 130, 53, 0.42);
}

.armor-score-2 {
  background: #f3bd35;
  border-color: rgba(243, 189, 53, 0.42);
  color: #1d1606;
}

.armor-score-3 {
  background: #9ccc3b;
  border-color: rgba(156, 204, 59, 0.42);
  color: #102007;
}

.armor-score-4 {
  background: #49c96b;
  border-color: rgba(73, 201, 107, 0.42);
  color: #071b0d;
}

.armor-score-5 {
  background: #16b28c;
  border-color: rgba(22, 178, 140, 0.42);
}

.armor-score-6 {
  background: #1f8fff;
  border-color: rgba(31, 143, 255, 0.42);
}

.armor-chart-levels span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.armor-chart.compact {
  display: grid;
  width: 100%;
}

.armor-chart.compact .armor-box {
  min-width: 0;
  min-height: 26px;
  padding: 3px 0;
}

.armor-card-block {
  display: grid;
  gap: 10px;
}

.armor-card-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 12px;
}

.action-stack {
  display: grid;
  gap: 8px;
}

.active-row {
  background: rgba(214, 184, 120, 0.06);
}

.desktop-table {
  display: block;
}

.mobile-list {
  display: none;
}

.detail-actions,
.wiki-card-actions,
.detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-link-btn,
.table-link-btn,
.detail-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.icon-button,
.wiki-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.zoomable-image,
.wiki-icon {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.icon-button:hover .zoomable-image,
.wiki-icon-button:hover .wiki-icon {
  transform: translateY(-1px) scale(1.03);
  border-color: rgba(214, 184, 120, 0.26);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.detail-toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.detail-page-shell {
  max-width: 1380px;
}

.detail-page-hero {
  margin-top: 0;
}

.wiki-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(290px, 0.72fr) minmax(0, 1.38fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.wiki-sidebar,
.wiki-main {
  min-width: 0;
}

.wiki-card,
.wiki-section {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.wiki-card {
  padding: 18px;
  position: sticky;
  top: 20px;
}

.wiki-card-media {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.wiki-icon,
.wiki-icon-placeholder {
  width: min(220px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 24px;
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(214, 184, 120, 0.08), transparent 56%),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.wiki-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 22px;
  letter-spacing: 0.12em;
}

.wiki-card h2,
.wiki-card-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}

.wiki-card-title {
  font-weight: 700;
  line-height: 1.1;
}

.wiki-card-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.wiki-card-actions {
  margin-top: 16px;
}

.wiki-quickfacts {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.wiki-quickfacts div,
.wiki-data-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.05);
}

.wiki-quickfacts span,
.wiki-data-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.wiki-quickfacts strong,
.wiki-data-item strong {
  font-size: 15px;
  line-height: 1.55;
}

.wiki-main {
  display: grid;
  gap: 18px;
}

.wiki-section {
  padding: 18px;
}

.wiki-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wiki-copy {
  display: grid;
  gap: 14px;
}

.wiki-copy p,
.wiki-source {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.wiki-notes {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}

.wiki-notes li + li {
  margin-top: 8px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.related-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.related-card-kicker {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.related-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.related-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.related-card h3 a:hover {
  color: var(--gold-bright);
}

.related-card-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.related-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-card-stats span {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--ink-soft);
  font-size: 12px;
}

.related-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(214, 184, 120, 0.12);
  border: 1px solid rgba(214, 184, 120, 0.18);
  color: var(--gold-bright);
  text-decoration: none;
}

.related-card-link:hover {
  background: rgba(214, 184, 120, 0.18);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.78);
  backdrop-filter: blur(6px);
}

.lightbox-panel {
  position: relative;
  width: min(720px, 100%);
  padding: 24px;
  background: rgba(16, 21, 28, 0.96);
  border: 1px solid rgba(214, 184, 120, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

.lightbox-caption {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.lightbox-image {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 22px;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(214, 184, 120, 0.08), transparent 60%),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .wiki-layout,
  .wiki-data-grid,
  .detail-metrics,
  .detail-facts,
  .legend-row {
    grid-template-columns: 1fr;
  }

  .wiki-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .desktop-table {
    display: none;
  }

  .mobile-list {
    display: grid;
    gap: 12px;
  }

  .detail-toolbar {
    align-items: stretch;
  }

  .detail-page-shell {
    padding-top: 18px;
  }

  .armor-cell {
    min-width: 220px;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox-panel {
    padding: 18px;
  }
}

.ammo-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.ammo-card.active {
  border-color: rgba(214, 184, 120, 0.26);
  background: rgba(214, 184, 120, 0.06);
}

.ammo-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.ammo-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ammo-card-title h3 {
  margin: 0;
  font-size: 18px;
}

.ammo-card-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ammo-card-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ammo-card-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.ammo-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.load-more-wrap {
  display: grid;
  place-items: center;
  gap: 10px;
  padding-top: 18px;
}

.load-more-text {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.load-more-sentinel {
  width: 100%;
  height: 1px;
}

@media (max-width: 1180px) {
  .detail-metrics,
  .detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .desktop-table {
    display: none;
  }

  .mobile-list {
    display: grid;
    gap: 14px;
  }

  .detail-hero {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .result-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-head {
    align-items: start;
  }

  .detail-metrics,
  .detail-facts,
  .ammo-card-stats {
    grid-template-columns: 1fr;
  }

  .ammo-card-actions,
  .detail-tags {
    flex-direction: column;
    align-items: stretch;
  }

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