:root {
  --bg: #141917;
  --surface: #1b221f;
  --surface-2: #222b27;
  --border: #313d37;
  --border-strong: #46574f;
  --text: #ece6d8;
  --text-muted: #9aa59a;
  --text-dim: #738079;
  --brass: #c2a26b;
  --brass-bright: #e8c08a;
  --brass-dark: #6e5a36;
  --olive: #718b45;
  --amber: #ba8e3d;
  --danger: #c45c52;
  --radius: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brass-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

/* ----------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(20, 25, 23, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(70, 87, 79, 0.35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-crest {
  height: 34px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.brand:hover {
  text-decoration: none;
  color: var(--brass-bright);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
}

.topbar-nav a {
  color: var(--text-muted);
}

.topbar-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.pill-brass {
  border-color: rgba(194, 162, 107, 0.45);
  color: var(--brass-bright);
  background: rgba(194, 162, 107, 0.1);
}

.pill-green {
  border-color: rgba(113, 139, 69, 0.55);
  color: #b4d47c;
  background: rgba(113, 139, 69, 0.16);
}

.pill-amber {
  border-color: rgba(186, 142, 61, 0.5);
  color: var(--brass-bright);
  background: rgba(186, 142, 61, 0.14);
}

.pill-red {
  border-color: rgba(196, 92, 82, 0.5);
  color: #f0a199;
  background: rgba(196, 92, 82, 0.14);
}

/* ----------------------------------------------------------- hero */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  padding: 88px 28px 64px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
  filter: brightness(0.76) contrast(1.03);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 25, 23, 0.72) 0%, rgba(20, 25, 23, 0.28) 52%, rgba(20, 25, 23, 0.12) 100%),
    linear-gradient(180deg, rgba(20, 25, 23, 0.18) 0%, rgba(20, 25, 23, 0.42) 55%, rgba(20, 25, 23, 0.96) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.hero-crest-wrap {
  margin: 18px 0 18px;
}

.hero-crest {
  width: clamp(240px, 34vw, 390px);
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.62));
}

.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;
}

.hero-lead {
  margin: 0 0 26px;
  max-width: 580px;
  font-size: 16.5px;
  line-height: 1.6;
  color: #d5dcd5;
}

/* ----------------------------------------------------------- waitlist form */
.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 780px;
}

.input,
select.input,
textarea.input {
  background: rgba(20, 25, 23, 0.88);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus {
  border-color: var(--brass);
}

.waitlist-form input[type="email"] {
  flex: 1 1 240px;
}

.waitlist-form select {
  flex: 0 0 132px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--brass);
  color: #141917;
}

.btn-primary:hover {
  background: var(--brass-bright);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--brass);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: rgba(196, 92, 82, 0.14);
  border-color: rgba(196, 92, 82, 0.45);
  color: #f0a199;
}

.btn-danger:hover {
  background: rgba(196, 92, 82, 0.25);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 6px;
}

.form-msg {
  margin-top: 12px;
  font-size: 14px;
  min-height: 22px;
  color: var(--brass-bright);
}

.form-msg.error {
  color: #f0a199;
}

/* ----------------------------------------------------------- sections */
.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px 28px;
}

.container-narrow {
  max-width: 720px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 22px;
}

.section-head .section-title {
  margin: 0;
}

.section-meta {
  font-size: 13px;
  color: var(--text-dim);
}

.section-title {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
}

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

.gallery-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.shot-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.16s ease;
}

.shot-card:hover {
  border-color: var(--brass);
}

.shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: #0d1110;
  cursor: zoom-in;
  overflow: hidden;
}

.shot-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.shot-btn:hover img {
  transform: scale(1.02);
}

.shot-card figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.factions-alpha {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.faction-panel {
  display: grid;
  grid-template-columns: 164px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faction-portrait-btn {
  height: 100%;
  background: #161c1a;
  border-right: 1px solid var(--border);
}

.faction-portrait-btn img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}

.faction-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

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

.faction-head img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.faction-base {
  font-size: 12.5px;
  color: var(--brass);
}

.faction-perks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.faction-perks li {
  position: relative;
  padding-left: 14px;
  line-height: 1.4;
}

.faction-perks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--brass);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(10, 14, 13, 0.94);
  backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  margin: 0;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-stage img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.lightbox-stage figcaption {
  font-size: 13.5px;
  color: var(--text-muted);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: rgba(20, 25, 23, 0.88);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  border-color: var(--brass);
  color: var(--brass-bright);
}

.lightbox-close {
  top: 20px;
  right: 22px;
  width: 40px;
  height: 40px;
  font-size: 24px;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.faction-name {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.faction-ship {
  font-size: 12.5px;
  color: var(--brass);
}

.faction-trait {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.faction-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}

.faction-stats strong {
  color: var(--text);
  font-weight: 500;
}

/* ----------------------------------------------------------- invite portal */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card + .card {
  margin-top: 16px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.download-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
}

.download-card:hover {
  border-color: var(--brass);
  text-decoration: none;
}

.alpha-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.alpha-code {
  text-align: right;
}

.alpha-download {
  margin-top: 20px;
}

.download-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.download-primary:hover {
  border-color: var(--brass);
  background: #27322d;
  text-decoration: none;
}

.download-os {
  font-weight: 600;
  font-size: 15px;
}

.download-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #0f1311;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--brass-bright);
  overflow-x: auto;
}

.code-block code {
  white-space: nowrap;
}

.steam-box {
  margin-top: 16px;
  padding: 16px;
  background: rgba(194, 162, 107, 0.08);
  border: 1px solid rgba(194, 162, 107, 0.45);
  border-radius: var(--radius);
}

.controls-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--text-muted);
}

.controls-list strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-right: 6px;
}

/* ----------------------------------------------------------- admin UI */
.admin-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

.kpi-val {
  font-size: 24px;
  font-weight: 600;
  margin-top: 2px;
  color: var(--text);
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-links {
  display: flex;
  gap: 4px;
}

.tab-links a {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.tab-links a.active {
  color: var(--text);
  border-bottom-color: var(--brass);
  font-weight: 500;
}

.banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.banner-ok {
  background: rgba(113, 139, 69, 0.16);
  border: 1px solid rgba(113, 139, 69, 0.45);
  color: #d6e8b5;
}

.banner-err {
  background: rgba(196, 92, 82, 0.16);
  border: 1px solid rgba(196, 92, 82, 0.45);
  color: #f4bbb5;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pills a {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
}

.filter-pills a.active,
.filter-pills a:hover {
  color: var(--text);
  border-color: var(--brass);
  text-decoration: none;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
  border-bottom: none;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions form {
  display: inline;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: var(--font-mono);
}

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

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

.field label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-dim);
}

.footer a {
  color: var(--text-dim);
}

.footer a:hover {
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .gallery-grid,
  .gallery-grid-2,
  .factions-alpha {
    grid-template-columns: 1fr;
  }
  .faction-panel {
    grid-template-columns: 128px 1fr;
  }
  .lightbox-nav {
    display: none;
  }
  .topbar {
    padding: 12px 16px;
  }
  .hero {
    padding: 64px 16px 44px;
  }
  .container {
    padding: 44px 16px;
  }
}
