/* ============================================================
   r6mdb — public frontend styles
   R6-dossier aesthetic: deep gunmetal, signal-amber accent,
   condensed tactical display type over clean neutral body.
   ============================================================ */

:root {
  --void: #0d0f12;
  --steel: #16191f;
  --fog: #21262e;
  --line: #2b3138;
  --ice: #e8ecf1;
  --ice-dim: #929aa6;
  --amber: #d4a02a;
  --amber-dim: #9a7620;

  /* rarity scale (functional second palette) */
  --r-common: #5ba85c;
  --r-rare: #4e8fd0;
  --r-epic: #a563d4;
  --r-legendary: #d4a02a;
  --r-base: #6b7280;

  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ice);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

a { color: inherit; text-decoration: none; }

/* condensed tactical display face */
.display {
  font-family: "Oswald", "Saira Condensed", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: uppercase;
}

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 14px 24px;
  background: rgba(13,15,18,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-family: "Oswald", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; font-size: 18px;
}
.topbar .brand .accent { color: var(--amber); }
.topbar .spacer { flex: 1; }
.topbar nav a {
  font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ice-dim); margin-left: 20px;
}
.topbar nav a:hover { color: var(--amber); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

/* ---- search ---- */
.searchbar { position: relative; }
.searchbar input {
  width: 100%; background: var(--steel); border: 1px solid var(--line);
  color: var(--ice); font-size: 15px; padding: 12px 16px; border-radius: 3px;
  font-family: var(--mono);
}
.searchbar input:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-dim);
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 15;
  background: var(--steel); border: 1px solid var(--line); border-radius: 3px;
  max-height: 420px; overflow-y: auto; display: none;
}
.search-results.show { display: block; }
.search-results a {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.search-results a:hover { background: var(--fog); }
.search-results .thumb {
  width: 34px; height: 34px; object-fit: contain; flex-shrink: 0;
  background: var(--void); border-radius: 2px;
}
.search-results .r-name { font-size: 14px; }
.search-results .r-meta {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--ice-dim);
}

/* ---- item dossier ---- */
.dossier { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .dossier { grid-template-columns: 1fr; gap: 24px; } }

/* HUD-framed image — the signature element */
.frame {
  position: relative; background: var(--steel);
  border: 1px solid var(--line); aspect-ratio: 1;
  display: grid; place-items: center; padding: 32px;
}
.frame::before, .frame::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2px solid var(--amber);
}
.frame::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.frame::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }
.frame img { max-width: 100%; max-height: 100%; object-fit: contain; }

.data .eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
  color: var(--amber); text-transform: uppercase; margin-bottom: 8px;
}
.data h1 {
  font-family: "Oswald", sans-serif; font-weight: 600;
  text-transform: uppercase; font-size: 38px; line-height: 1.05;
  margin: 0 0 20px;
}
.spec { border-top: 1px solid var(--line); }
.spec .row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.spec .row .k {
  font-family: var(--mono); font-size: 12px; letter-spacing: .05em;
  color: var(--ice-dim); text-transform: uppercase;
}
.spec .row .v a:hover { color: var(--amber); }

.bug-flag {
  margin-top: 20px; padding: 12px 14px; font-size: 13px;
  border: 1px solid var(--amber-dim); border-left: 3px solid var(--amber);
  background: rgba(212,160,42,.08); color: #e8cd8a;
}

/* ---- rarity pill ---- */
.pill {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px;
  border-radius: 2px; border: 1px solid currentColor;
}
.pill.common { color: var(--r-common); }
.pill.rare { color: var(--r-rare); }
.pill.epic { color: var(--r-epic); }
.pill.legendary { color: var(--r-legendary); }
.pill.base { color: var(--r-base); }

/* ---- acquisition log (sources) ---- */
.section-h {
  font-family: "Oswald", sans-serif; text-transform: uppercase;
  letter-spacing: .06em; font-size: 15px; color: var(--ice-dim);
  margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.log { display: flex; flex-direction: column; gap: 1px; }
.log .entry {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  align-items: center; padding: 12px 16px; background: var(--steel);
}
.log .entry:hover { background: var(--fog); }
.log .entry .name { font-size: 14px; }
.log .entry .season {
  font-family: var(--mono); font-size: 11px; color: var(--ice-dim);
  text-transform: uppercase; letter-spacing: .04em;
}
.log .entry .type-tag {
  display: inline-block; margin-left: 10px; font-family: var(--mono);
  font-size: 11px; color: var(--ice-dim); text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- components / parts list ---- */
.parts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 1px; }
.part-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--steel); width: 100%; text-align: left;
  border: none; color: inherit; font: inherit;
}
button.part-row {
  cursor: pointer; -webkit-appearance: none; appearance: none;
  border-radius: 0; box-shadow: none;
}
button.part-row:hover { background: var(--fog); }
button.part-row:hover .part-img { outline: 1px solid var(--amber); }
.part-row .part-img {
  width: 44px; height: 44px; flex-shrink: 0; object-fit: contain;
  background: var(--void); border-radius: 2px; padding: 4px;
}
.part-row .part-meta {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.part-row .part-role {
  font-family: "Oswald", sans-serif; font-size: 13px; letter-spacing: .02em;
  color: var(--ice); text-transform: uppercase;
}
.part-row .part-slot {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  color: var(--amber); text-transform: uppercase;
}
.part-row .part-id {
  font-family: var(--mono); font-size: 11px; color: var(--ice-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- item grid (set / operator pages, index) ---- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.card {
  background: var(--steel); border: 1px solid var(--line);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--amber); transform: translateY(-2px); }
.card .thumb {
  aspect-ratio: 1; display: grid; place-items: center; padding: 20px;
  background: var(--void);
}
.card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card .body { padding: 12px 14px; }
.card .body .nm {
  font-family: "Oswald", sans-serif; text-transform: uppercase;
  font-size: 15px; line-height: 1.15; margin-bottom: 4px;
}
.card .body .mt {
  font-family: var(--mono); font-size: 11px; color: var(--ice-dim);
}

/* ---- hub headers ---- */
.hub-head { margin-bottom: 32px; }
.hub-head .eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
  color: var(--amber); text-transform: uppercase;
}
.hub-head h1 {
  font-family: "Oswald", sans-serif; text-transform: uppercase;
  font-size: 44px; margin: 6px 0 0; font-weight: 600;
}
.hub-head .count { color: var(--ice-dim); font-size: 14px; margin-top: 8px; }

.crumbs {
  font-family: var(--mono); font-size: 12px; color: var(--ice-dim);
  margin-bottom: 20px; letter-spacing: .04em;
}
.crumbs a:hover { color: var(--amber); }
.crumbs .sep { margin: 0 8px; opacity: .5; }

footer {
  border-top: 1px solid var(--line); margin-top: 64px;
  padding: 32px 24px; text-align: center; color: var(--ice-dim);
  font-size: 13px;
}
footer .note { font-family: var(--mono); font-size: 11px; margin-top: 8px; opacity: .7; }

/* ---- lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: none;
  background: rgba(6,7,9,.92); place-items: center; padding: 40px;
  cursor: zoom-out;
}
.lightbox.show { display: grid; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lightbox img {
  max-width: min(80vw, 640px); max-height: 76vh; object-fit: contain;
  background: var(--steel); border: 1px solid var(--line); padding: 24px;
}
.lightbox figcaption {
  font-family: var(--mono); font-size: 12px; color: var(--ice-dim);
  letter-spacing: .05em;
}
