/* ==========================================================================
   Moddedrealms — main stylesheet
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/chakra-petch-500.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/chakra-petch-600.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/chakra-petch-700.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0c0b;
  --bg-2: #0e1210;
  --surface: #131815;
  --surface-2: #1a201c;
  --surface-3: #212923;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eef3ee;
  --text-2: #c9d3cb;
  --muted: #9aa69d;
  --dim: #6c776f;

  --green: #66d95b;
  --green-hi: #82e877;
  --green-ink: #06210a;
  --yellow: #ffd84d;
  --red: #ff5a4e;
  --red-hi: #ff776c;
  --discord: #5865f2;
  --discord-hi: #6c78ff;
  --youtube: #ff3b30;
  --modrinth: #1bd96a;

  --ww1: #d2ad6e;
  --ww2: #a3b464;
  --modern: #63aee0;
  --more: #b48dff;

  --radius: 14px;
  --radius-sm: 10px;
  --container: 1200px;
  --header-h: 72px;

  --font-head: "Chakra Petch", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 75%);
}

[hidden] {
  display: none !important;
}

img,
svg,
video,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

::selection {
  background: var(--green);
  color: var(--green-ink);
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

@media (min-width: 640px) {
  .container {
    width: min(100% - 48px, var(--container));
  }
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: var(--green-ink);
  font-weight: 700;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.pixel {
  shape-rendering: crispEdges;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: 600 0.95rem/1 var(--font-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.btn-primary {
  background: var(--green);
  color: var(--green-ink);
  box-shadow:
    0 10px 28px -12px rgba(102, 217, 91, 0.75),
    inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: var(--green-hi);
}

.btn-discord {
  background: var(--discord);
  color: #fff;
  box-shadow:
    0 10px 28px -12px rgba(88, 101, 242, 0.8),
    inset 0 -3px 0 rgba(0, 0, 0, 0.22);
}

.btn-discord:hover {
  background: var(--discord-hi);
}

.btn-danger {
  background: var(--red);
  color: #2b0603;
  box-shadow:
    0 10px 28px -12px rgba(255, 90, 78, 0.75),
    inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.btn-danger:hover {
  background: var(--red-hi);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn.is-busy {
  pointer-events: none;
}

.btn.is-busy::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font: 600 0.95rem var(--font-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.link-arrow .icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.link-arrow:hover .icon {
  transform: translateX(4px);
}

/* ---------- Header / navigation ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.3s,
    border-color 0.3s,
    backdrop-filter 0.3s;
}

.site-header.is-scrolled,
.site-header.menu-open {
  background: rgba(10, 12, 11, 0.86);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 700 1.2rem/1 var(--font-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 12px rgba(102, 217, 91, 0.35));
  transition: transform 0.4s ease;
}

.brand:hover img {
  transform: rotate(-12deg) scale(1.06);
}

.brand-name span {
  color: var(--green);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a:not(.btn) {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition:
    color 0.2s,
    background-color 0.2s;
}

.nav-links a:not(.btn):hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-links .btn {
  margin-left: 10px;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.nav-toggle span:not(.sr-only) {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition:
    transform 0.25s,
    opacity 0.2s;
}

.nav-toggle span:nth-child(1) {
  top: 14px;
}
.nav-toggle span:nth-child(2) {
  top: 20px;
}
.nav-toggle span:nth-child(3) {
  top: 26px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-block;
  }

  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 20px;
    background: rgba(10, 12, 11, 0.97);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.2s,
      transform 0.2s,
      visibility 0.2s;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-links a:not(.btn) {
    padding: 14px 12px;
    font-size: 1.05rem;
  }

  .nav-links .btn {
    margin: 8px 0 0;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(100svh, 940px);
  padding-top: calc(var(--header-h) + 40px);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.06);
  animation: hero-zoom 18s ease-out both;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 12, 11, 0.97) 0%, rgba(10, 12, 11, 0.88) 38%, rgba(10, 12, 11, 0.5) 72%, rgba(10, 12, 11, 0.7) 100%),
    linear-gradient(180deg, rgba(10, 12, 11, 0.5) 0%, rgba(10, 12, 11, 0) 28%, rgba(10, 12, 11, 0.4) 70%, var(--bg) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: 48px;
  padding-bottom: 72px;
  flex: 1;
}

.hero-copy > * {
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-copy > *:nth-child(2) {
  animation-delay: 0.08s;
}
.hero-copy > *:nth-child(3) {
  animation-delay: 0.16s;
}
.hero-copy > *:nth-child(4) {
  animation-delay: 0.24s;
}
.hero-copy > *:nth-child(5) {
  animation-delay: 0.32s;
}
.hero-copy > *:nth-child(6) {
  animation-delay: 0.4s;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text-2);
  font: 500 0.82rem/1.2 var(--font-mono);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--dim);
}

.status-pill[data-state="online"] .dot {
  background: var(--green);
  animation: pulse 2s infinite;
}

.status-pill[data-state="offline"] .dot {
  background: var(--red);
}

.status-pill strong {
  color: var(--text);
  font-weight: 700;
}

.hero h1 {
  margin: 24px 0 22px;
  font-size: clamp(2.5rem, 6vw, 4.7rem);
  line-height: 0.96;
  text-transform: uppercase;
}

.hero h1 .kicker {
  display: block;
  margin-bottom: 0.7em;
  color: var(--yellow);
  font-size: max(0.28em, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.34em;
}

.accent {
  color: var(--green);
  text-shadow: 0 0 42px rgba(102, 217, 91, 0.35);
}

.lead {
  max-width: 60ch;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.35vw, 1.18rem);
}

.ip-box {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 540px;
  margin: 30px 0 16px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ip-label {
  padding-left: 12px;
  color: var(--dim);
  font: 600 0.7rem var(--font-head);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ip-box code {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  color: var(--text);
  font: 700 clamp(0.95rem, 2.3vw, 1.12rem) var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-tags li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-tags .icon {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(100%, 440px);
  aspect-ratio: 1;
  animation: rise 1s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 217, 91, 0.38), transparent 66%);
  filter: blur(30px);
}

.hero-art img {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 7%;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.65));
  animation: float 7s ease-in-out infinite;
}

.hero-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--green);
  opacity: 0.55;
  animation: spin 60s linear infinite;
}

.hero-ring--inner {
  inset: 3%;
  width: 94%;
  height: 94%;
  opacity: 0.3;
  animation-direction: reverse;
  animation-duration: 90s;
}

.ticker {
  position: relative;
  overflow: hidden;
  padding: 16px 0;
  border-block: 1px solid var(--line);
  background: rgba(10, 12, 11, 0.75);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
}

.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 36px;
  padding-right: 36px;
  color: var(--muted);
  font: 600 0.95rem/1 var(--font-head);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker-track span::after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--green);
  transform: rotate(45deg);
}

.ticker-track span:nth-child(3n + 2)::after {
  background: var(--yellow);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-bottom: 56px;
  }

  .hero-art {
    order: -1;
    justify-self: start;
    width: 150px;
  }

  .hero-art img {
    padding: 9%;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgba(10, 12, 11, 0.82) 0%, rgba(10, 12, 11, 0.9) 45%, var(--bg) 100%);
  }
}

@media (max-width: 520px) {
  .ip-box {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .ip-label {
    padding: 8px 0 0;
    text-align: center;
  }

  .ip-box code {
    padding: 6px 4px 10px;
    text-align: center;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: clamp(80px, 10vw, 136px) 0;
}

.section--tight {
  padding: clamp(56px, 7vw, 96px) 0;
}

.section--alt {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(102, 217, 91, 0.06), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 740px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}

.section-head--split > div {
  max-width: 680px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--green);
  font: 600 0.78rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.section-head--center .eyebrow::after {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.section h2 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  text-transform: uppercase;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.3vw, 1.12rem);
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.card h3 {
  margin-bottom: 10px;
  font-size: 1.32rem;
  text-transform: uppercase;
}

.card p {
  color: var(--muted);
}

.hud::before,
.hud::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--hud, var(--green));
  opacity: 0.6;
  pointer-events: none;
  transition:
    width 0.3s,
    height 0.3s,
    opacity 0.3s;
}

.hud::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: var(--radius);
}

.hud::after {
  right: -1px;
  bottom: -1px;
  border-top: 0;
  border-left: 0;
  border-bottom-right-radius: var(--radius);
}

.hud:hover::before,
.hud:hover::after {
  width: 40px;
  height: 40px;
  opacity: 1;
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border: 1px solid rgba(102, 217, 91, 0.25);
  border-radius: 12px;
  background: rgba(102, 217, 91, 0.1);
  color: var(--green);
}

.icon-tile .icon {
  width: 26px;
  height: 26px;
}

.pillars {
  margin-top: clamp(64px, 8vw, 104px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.pillars .card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 217, 91, 0.3);
}

@media (max-width: 1040px) {
  .pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .pillars {
    grid-template-columns: 1fr;
  }
}

/* ---------- Battles / eras ---------- */
.battles-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.battles-intro .section-head {
  margin-bottom: 0;
}

.battles-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font: 600 0.8rem/1 var(--font-head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge .icon {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.eras {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.era {
  --hud: var(--era);
  display: flex;
  flex-direction: column;
  min-height: 380px;
  overflow: hidden;
  padding: 26px;
  isolation: isolate;
}

.era::before,
.era::after {
  z-index: 2;
}

.era:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--era) 45%, transparent);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--era) 45%, transparent);
}

.era--ww1 {
  --era: var(--ww1);
}
.era--ww2 {
  --era: var(--ww2);
}
.era--modern {
  --era: var(--modern);
}
.era--more {
  --era: var(--more);
}

.era-pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  transition: opacity 0.3s;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}

.era:hover .era-pattern {
  opacity: 0.9;
}

.era--ww1 .era-pattern {
  background:
    repeating-linear-gradient(135deg, rgba(210, 173, 110, 0.12) 0 2px, transparent 2px 14px),
    radial-gradient(circle at 80% 0%, rgba(210, 173, 110, 0.28), transparent 60%);
}

.era--ww2 .era-pattern {
  background:
    radial-gradient(rgba(163, 180, 100, 0.25) 1.5px, transparent 1.6px) 0 0 / 14px 14px,
    radial-gradient(circle at 80% 0%, rgba(163, 180, 100, 0.28), transparent 60%);
}

.era--modern .era-pattern {
  background:
    linear-gradient(rgba(99, 174, 224, 0.14) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, rgba(99, 174, 224, 0.14) 1px, transparent 1px) 0 0 / 16px 16px,
    radial-gradient(circle at 80% 0%, rgba(99, 174, 224, 0.3), transparent 60%);
}

.era--more .era-pattern {
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(180, 141, 255, 0.14), transparent 25%, rgba(180, 141, 255, 0.14) 50%, transparent 75%, rgba(180, 141, 255, 0.14)) 0 0 / 28px 28px,
    radial-gradient(circle at 80% 0%, rgba(180, 141, 255, 0.3), transparent 60%);
}

.era-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.era-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid color-mix(in srgb, var(--era) 40%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--era) 14%, rgba(0, 0, 0, 0.4));
  color: var(--era);
}

.era-icon svg {
  width: 30px;
  height: 30px;
}

.era-years {
  color: var(--era);
  font: 600 0.78rem/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.era-big {
  margin: 48px 0 12px;
  color: transparent;
  font: 700 clamp(3.6rem, 6vw, 4.6rem)/0.9 var(--font-head);
  letter-spacing: -0.02em;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--era) 70%, transparent);
  transition: color 0.3s;
}

.era-big--long {
  font-size: clamp(2.6rem, 4.2vw, 3.3rem);
  line-height: 1.25;
}

.era-big--long,
.era-big {
  min-height: 66px;
}

.era:hover .era-big {
  color: color-mix(in srgb, var(--era) 22%, transparent);
}

.era h3 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1.3rem;
}

.era p {
  margin: 0;
  font-size: 0.97rem;
}

@media (max-width: 1100px) {
  .eras {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .era {
    min-height: 340px;
  }
}

@media (max-width: 860px) {
  .battles-intro {
    grid-template-columns: 1fr;
  }

  .battles-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 580px) {
  .eras {
    grid-template-columns: 1fr;
  }

  .era {
    min-height: 0;
  }
}

/* ---------- Featured video / spotlight ---------- */
.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(48px, 6vw, 80px);
  padding: clamp(16px, 2vw, 20px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, var(--surface), var(--bg-2));
}

.spotlight-copy {
  padding: 8px clamp(4px, 2vw, 24px) 8px 0;
}

.spotlight-copy h3 {
  margin-bottom: 14px;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  text-transform: uppercase;
}

.spotlight-copy p:not(.eyebrow) {
  color: var(--muted);
}

.spotlight-copy .btn {
  margin-top: 10px;
}

@media (max-width: 860px) {
  .spotlight {
    grid-template-columns: 1fr;
  }

  .spotlight-copy {
    padding: 4px 8px 12px;
  }
}

/* ---------- Video facades ---------- */
.video {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #000;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-facade {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  text-align: left;
}

.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition:
    transform 0.5s ease,
    opacity 0.3s;
}

.video-facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.85));
}

.video-facade:hover img {
  transform: scale(1.04);
  opacity: 1;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(10, 12, 11, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  transform: translate(-50%, -50%);
  transition:
    transform 0.25s,
    background-color 0.25s,
    border-color 0.25s;
}

.play-btn svg {
  width: 26px;
  height: 26px;
  margin-left: 4px;
}

.video-facade:hover .play-btn {
  background: var(--youtube);
  border-color: var(--youtube);
  transform: translate(-50%, -50%) scale(1.08);
}

.video-meta {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  padding: 16px 18px;
  color: #fff;
  font: 600 1.02rem/1.25 var(--font-head);
  letter-spacing: 0.02em;
}

.video-meta small {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.7);
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.videos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.videos .video .play-btn {
  width: 56px;
  height: 56px;
}

.videos .video .play-btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 900px) {
  .videos {
    grid-template-columns: 1fr;
    max-width: 640px;
  }
}

/* ---------- Teamwork split ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
}

.split--reverse .split-media {
  order: 2;
}

.framed {
  position: relative;
  border-radius: var(--radius);
}

.framed img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.framed::before {
  content: "";
  position: absolute;
  inset: -14px 14px 14px -14px;
  z-index: -1;
  border: 1px solid rgba(102, 217, 91, 0.35);
  border-radius: var(--radius);
}

.framed-tag {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(10, 12, 11, 0.8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--text-2);
  font: 600 0.72rem/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.checklist {
  display: grid;
  gap: 14px;
  margin: 28px 0 32px;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  color: var(--text-2);
}

.checklist .tick {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(102, 217, 91, 0.12);
  color: var(--green);
}

.checklist .tick .icon {
  width: 16px;
  height: 16px;
}

.checklist strong {
  display: block;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }

  .split--reverse .split-media {
    order: 0;
  }

  .framed::before {
    inset: -10px 10px 10px -10px;
  }
}

/* ---------- Vehicles ---------- */
.vehicles-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

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

.shot {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.shot--main {
  grid-column: span 4;
  aspect-ratio: 16 / 8.4;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.shot:hover img {
  transform: scale(1.05);
}

.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.7));
  opacity: 0;
  transition: opacity 0.3s;
}

.shot--main::after,
.shot:hover::after {
  opacity: 1;
}

.shot-cap {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  color: #fff;
  font: 600 0.95rem/1.2 var(--font-head);
  letter-spacing: 0.04em;
  text-align: left;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.shot--main .shot-cap,
.shot:hover .shot-cap {
  opacity: 1;
  transform: none;
}

.shot-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(10, 12, 11, 0.7);
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}

.shot-zoom .icon {
  width: 18px;
  height: 18px;
}

.shot:hover .shot-zoom,
.shot:focus-visible .shot-zoom {
  opacity: 1;
}

.vehicles-side {
  display: grid;
  gap: 16px;
}

.telemetry {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    #0c100e;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.tele-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line-2);
  color: var(--dim);
  letter-spacing: 0.12em;
}

.tele-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--yellow);
}

.tele-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.4s steps(2, start) infinite;
}

.tele-speed {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--text);
}

.tele-speed b {
  font-size: 2.6rem;
  line-height: 1;
  font-weight: 700;
}

.tele-speed span {
  color: var(--muted);
}

.tele-speed em {
  margin-left: auto;
  color: var(--yellow);
  font-style: normal;
  font-weight: 700;
}

.tele-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
}

.tele-row span:last-child {
  color: var(--text-2);
  text-align: right;
}

.bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 50%);
  background: var(--c, #48b8ff);
  transform-origin: left;
  transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .telemetry:not(.is-visible) .bar i {
  transform: scaleX(0);
}

.bar--fuel {
  --w: 68%;
}
.bar--water {
  --w: 80%;
}
.bar--oil {
  --w: 55%;
  --c: var(--yellow);
}
.bar--temp {
  --w: 62%;
  --c: #ff9a3c;
}
.bar--batt {
  --w: 100%;
  --c: var(--green);
}

.spec-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.spec-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 10px;
  transition: background-color 0.2s;
}

.spec-list li:hover {
  background: rgba(255, 255, 255, 0.03);
}

.spec-list .icon-tile {
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 10px;
}

.spec-list .icon-tile .icon {
  width: 20px;
  height: 20px;
}

.spec-list strong {
  display: block;
  margin-bottom: 2px;
  font: 600 1.02rem/1.3 var(--font-head);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.spec-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.vehicles-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.btn-modrinth {
  background: var(--modrinth);
  color: #04210f;
  box-shadow:
    0 10px 28px -12px rgba(27, 217, 106, 0.7),
    inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.btn-modrinth:hover {
  background: #3ff083;
}

@media (max-width: 1040px) {
  .vehicles-layout {
    grid-template-columns: 1fr;
  }

  .vehicles-side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shot--main {
    grid-column: span 2;
    aspect-ratio: 16 / 10;
  }

  .vehicles-side {
    grid-template-columns: 1fr;
  }
}

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(100vw - 24px, 1400px);
  max-width: none;
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(4, 6, 5, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox[open] {
  animation: fade-in 0.25s ease both;
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}

.lightbox figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px 0;
  color: var(--text-2);
  font: 600 1rem var(--font-head);
  letter-spacing: 0.03em;
}

.lightbox-count {
  color: var(--dim);
  font: 500 0.85rem var(--font-mono);
}

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(10, 12, 11, 0.8);
  color: #fff;
  transition: background-color 0.2s;
}

.lb-btn:hover {
  background: var(--surface-3);
}

.lb-close {
  top: -14px;
  right: -14px;
  z-index: 2;
}

.lb-prev,
.lb-next {
  top: calc(50% - 40px);
}

.lb-prev {
  left: 12px;
}

.lb-next {
  right: 12px;
}

@media (max-width: 640px) {
  .lb-close {
    top: 8px;
    right: 8px;
  }
}

/* ---------- How to join ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  padding: 30px 28px;
}

.step-num {
  display: block;
  margin-bottom: 20px;
  color: transparent;
  font: 700 3.4rem/1 var(--font-head);
  -webkit-text-stroke: 1.5px rgba(102, 217, 91, 0.7);
}

.step h3 {
  margin-bottom: 10px;
}

.step code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: 600 0.9em var(--font-mono);
}

.step .btn {
  margin-top: 18px;
}

.kbd-path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--text-2);
  font: 600 0.85rem var(--font-mono);
}

.kbd-path span {
  padding: 3px 8px;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--surface-2);
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ---------- Community ---------- */
.socials {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
}

.social {
  --brand: var(--green);
  --hud: var(--brand);
  display: flex;
  flex-direction: column;
  min-height: 300px;
  overflow: hidden;
  padding: 30px;
  isolation: isolate;
}

.social:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--brand) 50%, transparent);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--brand) 55%, transparent);
}

.social::before,
.social::after {
  z-index: 2;
}

.social-glow {
  position: absolute;
  top: -40%;
  right: -30%;
  z-index: -1;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 32%, transparent), transparent 70%);
  transition: transform 0.5s;
}

.social:hover .social-glow {
  transform: scale(1.2);
}

.social--discord {
  --brand: var(--discord);
}
.social--youtube {
  --brand: var(--youtube);
}
.social--modrinth {
  --brand: var(--modrinth);
}

.social-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--brand) 80%, transparent);
}

.social .link-arrow {
  margin-top: auto;
  padding-top: 6px;
}

.social--modrinth .social-icon {
  color: #04210f;
}

.social-icon svg {
  width: 32px;
  height: 32px;
}

.social h3 {
  margin: 32px 0 8px;
  font-size: 1.6rem;
}

.social-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 4px 0 18px;
  color: var(--text-2);
  font: 500 0.85rem var(--font-mono);
}

.social-meta:empty {
  display: none;
}

.social-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.social-meta .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.social-meta .dot--muted {
  background: var(--dim);
}

.social .link-arrow {
  color: color-mix(in srgb, var(--brand) 70%, #fff);
}

@media (max-width: 960px) {
  .socials {
    grid-template-columns: 1fr 1fr;
  }

  .social--discord {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .socials {
    grid-template-columns: 1fr;
  }

  .social--discord {
    grid-column: auto;
  }

  .social {
    min-height: 0;
  }
}

/* ---------- Support CTA band ---------- */
.cta-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cta-card {
  --hud: var(--green);
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 26px;
}

.cta-card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 217, 91, 0.3);
}

.cta-card--report {
  --hud: var(--red);
}

.cta-card--report:hover {
  border-color: rgba(255, 90, 78, 0.35);
}

.cta-card--report .icon-tile {
  border-color: rgba(255, 90, 78, 0.3);
  background: rgba(255, 90, 78, 0.12);
  color: var(--red);
}

.cta-card .icon-tile {
  margin: 0;
}

.cta-card h3 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.cta-card p {
  margin: 0;
  font-size: 0.95rem;
}

.cta-card .arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  transition:
    transform 0.25s,
    background-color 0.25s;
}

.cta-card:hover .arrow {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 820px) {
  .cta-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .cta-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .cta-card .arrow {
    display: none;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  padding: 72px 0 28px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), #070908);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.footer-brand p {
  max-width: 34ch;
  margin: 18px 0 20px;
  color: var(--muted);
}

.footer-ip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: 600 0.88rem var(--font-mono);
  text-align: left;
  transition:
    border-color 0.2s,
    background-color 0.2s;
}

.footer-ip:hover {
  border-color: rgba(102, 217, 91, 0.5);
  background: rgba(102, 217, 91, 0.06);
}

.footer-ip .icon {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.footer-ip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer h4 {
  margin-bottom: 18px;
  color: var(--dim);
  font: 600 0.78rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-2);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--green);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid rgba(102, 217, 91, 0.45);
  border-radius: 12px;
  background: rgba(16, 22, 18, 0.96);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
  color: var(--text);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .icon {
  width: 18px;
  height: 18px;
  color: var(--green);
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  isolation: isolate;
  padding: calc(var(--header-h) + 72px) 0 56px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0.35;
  filter: blur(2px) saturate(0.9);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--bg) 10%, rgba(10, 12, 11, 0.75) 60%, rgba(10, 12, 11, 0.6)),
    linear-gradient(180deg, transparent 40%, var(--bg));
}

.page-hero h1 {
  margin-bottom: 16px;
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  text-transform: uppercase;
}

.page-hero p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--text-2);
  font-size: 1.1rem;
}

/* ---------- Support page ---------- */
.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
  max-width: 520px;
  margin-bottom: 20px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 600 0.95rem/1 var(--font-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    color 0.2s,
    background-color 0.2s,
    border-color 0.2s;
}

.tab:hover {
  color: var(--text);
}

@media (max-width: 420px) {
  .tab {
    padding: 0 8px;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .tab .icon {
    display: none;
  }
}

.tab[aria-selected="true"] {
  border-color: rgba(102, 217, 91, 0.35);
  background: rgba(102, 217, 91, 0.12);
  color: var(--text);
}

.tab[aria-selected="true"] .icon {
  color: var(--green);
}

.tab--report[aria-selected="true"] {
  border-color: rgba(255, 90, 78, 0.4);
  background: rgba(255, 90, 78, 0.12);
}

.tab--report[aria-selected="true"] .icon {
  color: var(--red);
}

.panel {
  padding: clamp(22px, 3.5vw, 36px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}

.panel[hidden] {
  display: none;
}

.panel-head {
  margin-bottom: 26px;
}

.panel-head h2 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 3vw, 2rem);
  text-transform: uppercase;
}

.panel-head p {
  color: var(--muted);
}

.form {
  display: grid;
  gap: 22px;
}

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

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > label,
.field > legend {
  padding: 0;
  color: var(--text);
  font: 600 0.92rem/1.3 var(--font-body);
}

.field > legend {
  margin-bottom: 10px;
}

.req {
  color: var(--red);
}

.opt {
  margin-left: 6px;
  color: var(--dim);
  font-size: 0.8rem;
  font-weight: 500;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #0b0f0d;
  color: var(--text);
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background-color 0.2s;
}

.input::placeholder {
  color: #5d6860;
}

.input:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(102, 217, 91, 0.2);
  background: #0d1210;
}

.input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 90, 78, 0.16);
}

textarea.input {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

select.input {
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa69d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}

input[type="datetime-local"].input {
  color-scheme: dark;
}

.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--dim);
  font-size: 0.82rem;
}

.counter {
  margin-left: auto;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.counter.is-over {
  color: var(--red);
}

.field-error {
  color: var(--red-hi);
  font-size: 0.85rem;
  font-weight: 500;
}

.field-error:empty {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    color 0.2s;
}

.chip span:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}

.chip input:checked + span {
  border-color: var(--green);
  background: rgba(102, 217, 91, 0.14);
  color: var(--text);
}

.chips--danger .chip input:checked + span {
  border-color: var(--red);
  background: rgba(255, 90, 78, 0.14);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.chips[aria-invalid="true"] .chip span {
  border-color: rgba(255, 90, 78, 0.6);
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stars label {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #3a443d;
  cursor: pointer;
  transition:
    color 0.15s,
    transform 0.15s;
}

.stars label svg {
  width: 30px;
  height: 30px;
}

.stars:has(input:checked) label {
  color: var(--yellow);
}

.stars input:checked + label ~ label {
  color: #3a443d;
}

.stars:hover label {
  color: var(--yellow);
}

.stars label:hover ~ label {
  color: #3a443d;
}

.stars label:hover {
  transform: scale(1.12);
}

.stars input:focus-visible + label {
  outline: 2px solid var(--green);
  outline-offset: 0;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.rating-text {
  color: var(--muted);
  font: 500 0.88rem var(--font-mono);
}

.check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: var(--text-2);
  font-size: 0.95rem;
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding-top: 6px;
}

.form-note {
  margin: 0;
  color: var(--dim);
  font-size: 0.85rem;
}

.form-status {
  padding: 14px 16px;
  border: 1px solid rgba(255, 90, 78, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(255, 90, 78, 0.08);
  color: #ffd2ce;
  font-size: 0.95rem;
}

.form-status a {
  color: #fff;
  text-decoration: underline;
}

.form-success {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 20px;
  text-align: center;
}

.form-success:focus {
  outline: none;
}

.form-success[hidden] {
  display: none;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: rgba(102, 217, 91, 0.14);
  color: var(--green);
  box-shadow: 0 0 0 10px rgba(102, 217, 91, 0.06);
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.success-icon .icon {
  width: 34px;
  height: 34px;
}

.form-success h3 {
  font-size: 1.6rem;
  text-transform: uppercase;
}

.form-success p {
  max-width: 46ch;
  color: var(--muted);
}

.ref-code {
  padding: 6px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  color: var(--text);
  font: 700 1rem var(--font-mono);
  letter-spacing: 0.08em;
}

.support-aside {
  display: grid;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.aside-card {
  padding: 24px;
}

.aside-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.aside-card h3 .icon {
  color: var(--green);
}

.aside-card p {
  font-size: 0.95rem;
}

.aside-card .btn {
  margin-top: 16px;
}

.aside-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 0.93rem;
}

.aside-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
}

.aside-list .icon {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  color: var(--green);
}

.aside-card--discord {
  --hud: var(--discord);
  background:
    radial-gradient(circle at 100% 0%, rgba(88, 101, 242, 0.25), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
}

.aside-card--discord h3 .icon {
  color: var(--discord-hi);
}

@media (max-width: 1000px) {
  .support-layout {
    grid-template-columns: 1fr;
  }

  .support-aside {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* ---------- 404 ---------- */
.notfound {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 40px) 0 60px;
  text-align: center;
}

.notfound-code {
  color: transparent;
  font: 700 clamp(6rem, 22vw, 12rem)/0.9 var(--font-head);
  -webkit-text-stroke: 2px rgba(102, 217, 91, 0.7);
}

.notfound h1 {
  margin: 16px 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-transform: uppercase;
}

.notfound p {
  max-width: 44ch;
  margin-inline: auto;
  color: var(--muted);
}

.notfound .hero-actions {
  justify-content: center;
  margin-top: 28px;
}

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-d1 {
  transition-delay: 0.08s !important;
}
.reveal-d2 {
  transition-delay: 0.16s !important;
}
.reveal-d3 {
  transition-delay: 0.24s !important;
}

/* ---------- Animations ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-zoom {
  from {
    transform: scale(1.14);
  }
  to {
    transform: scale(1.04);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 217, 91, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(102, 217, 91, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 217, 91, 0);
  }
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Accounts: sign in, account page, staff dashboard
   ========================================================================== */

.page-hero--compact {
  padding-bottom: 40px;
}

.app-section {
  padding: 40px 0 96px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
  max-width: 1040px;
}

.auth-card {
  padding: clamp(22px, 3.5vw, 36px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}

.auth-card .tabs {
  max-width: none;
}

.auth-card h2 {
  margin-bottom: 6px;
  font-size: 1.6rem;
  text-transform: uppercase;
}

.auth-card .lead-sm {
  margin-bottom: 22px;
  color: var(--muted);
}

.text-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-link:hover {
  color: var(--green-hi);
}

.form-ok {
  padding: 14px 16px;
  border: 1px solid rgba(102, 217, 91, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(102, 217, 91, 0.08);
  color: #d9f7d4;
  font-size: 0.95rem;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.app-main,
.app-side {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.app-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}

.app-card > h2,
.app-card-head h2 {
  font-size: 1.25rem;
  text-transform: uppercase;
}

.app-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
}

.app-card > h2 {
  margin-bottom: 14px;
}

.app-card p.muted,
.muted {
  color: var(--muted);
}

.app-card .form {
  gap: 16px;
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  font: 600 0.75rem/1 var(--font-mono);
  vertical-align: middle;
}

/* Profile */
.profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.avatar {
  width: 72px;
  height: 72px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface-3);
  image-rendering: pixelated;
}

.profile-name {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}

/* Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font: 600 0.72rem/1.2 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--green,
.tag--resolved,
.tag--done {
  border-color: rgba(102, 217, 91, 0.45);
  background: rgba(102, 217, 91, 0.12);
  color: #a6f09d;
}

.tag--yellow,
.tag--investigating,
.tag--planned {
  border-color: rgba(255, 216, 77, 0.45);
  background: rgba(255, 216, 77, 0.1);
  color: #ffe68a;
}

.tag--red,
.tag--open,
.tag--new {
  border-color: rgba(255, 90, 78, 0.5);
  background: rgba(255, 90, 78, 0.12);
  color: #ffb3ad;
}

.tag--blue,
.tag--reviewed {
  border-color: rgba(99, 174, 224, 0.5);
  background: rgba(99, 174, 224, 0.12);
  color: #b4dbf5;
}

.tag--grey,
.tag--dismissed,
.tag--declined {
  color: var(--muted);
}

.tag--staff {
  border-color: rgba(180, 141, 255, 0.5);
  background: rgba(180, 141, 255, 0.14);
  color: #d8c6ff;
}

/* Link code */
.link-steps {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--text-2);
}

.link-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed rgba(102, 217, 91, 0.5);
  border-radius: 12px;
  background: rgba(102, 217, 91, 0.06);
}

.link-code code {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font: 700 clamp(1.3rem, 3.4vw, 1.8rem) / 1.2 var(--font-mono);
  letter-spacing: 0.08em;
}

.link-timer {
  width: 100%;
  color: var(--muted);
  font: 500 0.82rem var(--font-mono);
}

.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  margin: 0;
  font-size: 0.95rem;
}

.kv dt {
  color: var(--dim);
  font: 600 0.75rem/1.9 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-2);
}

/* Activity lists */
.items {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.item-id {
  color: var(--dim);
  font: 600 0.78rem var(--font-mono);
}

.item-date {
  margin-left: auto;
  color: var(--dim);
  font-size: 0.82rem;
}

.item-title {
  margin: 0 0 4px;
  color: var(--text);
  font: 600 1.02rem/1.35 var(--font-body);
}

.item-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.item-text {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 0.93rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.staff-reply {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0;
  background: rgba(102, 217, 91, 0.07);
  color: var(--text-2);
  font-size: 0.93rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.staff-reply strong {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font: 600 0.72rem var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 216, 77, 0.4);
  border-radius: 12px;
  background: rgba(255, 216, 77, 0.07);
  color: #fff1bf;
  font-size: 0.95rem;
}

.notice--ok {
  border-color: rgba(102, 217, 91, 0.45);
  background: rgba(102, 217, 91, 0.08);
  color: #d9f7d4;
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  cursor: pointer;
}

.switch input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.loading {
  padding: 60px 0;
  color: var(--muted);
  text-align: center;
}

/* Staff dashboard */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}

.stat b {
  display: block;
  color: var(--text);
  font: 700 2.1rem/1.1 var(--font-head);
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.stat--alert b {
  color: var(--red-hi);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar .tabs {
  width: auto;
  max-width: none;
  margin: 0 auto 0 0;
  grid-template-columns: repeat(3, auto);
}

.toolbar .input {
  width: auto;
  min-height: 44px;
}

.toolbar input.input {
  min-width: 220px;
}

.rows {
  display: grid;
  gap: 8px;
}

.row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1.4fr) minmax(0, 1fr) 150px 108px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.92rem;
  text-align: left;
  transition:
    border-color 0.2s,
    background-color 0.2s;
}

button.row:hover {
  border-color: rgba(102, 217, 91, 0.35);
  background: var(--surface-2);
}

.row-main {
  min-width: 0;
}

.row-main strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main small,
.row small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .item-id {
  white-space: nowrap;
}

.row .tag {
  justify-self: start;
}

.verified {
  color: var(--green);
  font-weight: 700;
}

@media (max-width: 1000px) {
  .auth-layout,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .row > :nth-child(3),
  .row > :nth-child(4) {
    display: none;
  }

  .row .item-id {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .toolbar input.input,
  .toolbar select.input {
    flex: 1 1 100%;
  }

  .profile-actions {
    margin-left: 0;
  }
}

/* Modal */
.modal {
  width: min(100vw - 24px, 760px);
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: calc(var(--radius) + 4px);
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(4, 6, 5, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: fade-in 0.2s ease both;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
  text-transform: uppercase;
}

.modal-head .lb-btn {
  position: static;
  width: 40px;
  height: 40px;
  margin-left: auto;
}

.modal-body {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.modal-stack {
  display: grid;
  gap: 20px;
}

.modal-body h3 {
  margin-bottom: 8px;
  color: var(--dim);
  font: 600 0.75rem var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.evidence {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence a {
  color: var(--green);
  overflow-wrap: anywhere;
  text-decoration: underline;
}

.quote {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.app-card code,
.aside-list code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font: 600 0.9em var(--font-mono);
}

.app-card .switch {
  margin-top: 18px;
}

.kv + p {
  margin: 14px 0 12px;
}
