:root {
  --bg: #050706;
  --surface: rgba(13, 18, 16, 0.84);
  --surface-strong: #0c1210;
  --line: rgba(183, 255, 0, 0.18);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #eef7f0;
  --muted: #91a39b;
  --accent: #b7ff00;
  --accent-2: #1cf6c4;
  --danger: #ff5d73;
  --ok: #81ffb2;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  --radius: 28px;
  --radius-sm: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; }
img, video { max-width: 100%; height: auto; }
h1, h2, h3, p, a, span, strong { overflow-wrap: anywhere; }
.hero-section__content, .page-title, .toolbar-card, .content-card, .form-card, .game-card, .post-card, .team-card, .mod-card, .bento-card { min-width: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(183, 255, 0, 0.12), transparent 34%),
    radial-gradient(circle at 86% 14%, rgba(28, 246, 196, 0.12), transparent 26%),
    linear-gradient(180deg, #06110d 0%, var(--bg) 52%, #030403 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation: none !important;
  transition: none !important;
}

body.compact-mode { --radius: 20px; --radius-sm: 14px; }
body.compact-mode .site-shell { width: min(1080px, calc(100% - 28px)); }
body.compact-mode .hero-section, body.compact-mode .page-title { padding-block: 46px; }

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.auth-screen { display: grid; place-items: center; padding: 32px; }
.auth-layout {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  align-items: stretch;
}
.auth-layout--reverse { grid-template-columns: 0.92fr 1.08fr; }
.auth-copy, .auth-card, .content-card, .form-card, .toolbar-card, .bento-card, .game-card, .post-card, .team-card, .mod-card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(145deg, rgba(16, 24, 20, 0.86), rgba(7, 10, 9, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.auth-copy {
  min-height: 650px;
  border-radius: var(--radius);
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}
.auth-copy::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -100px;
  top: -100px;
  background: radial-gradient(circle, rgba(183,255,0,.26), transparent 66%);
  filter: blur(6px);
}
.auth-copy h1, .hero-section h1, .page-title h1 {
  margin: 0;
  letter-spacing: -0.055em;
  line-height: 0.96;
}
.auth-copy h1 { max-width: 620px; font-size: clamp(48px, 7vw, 86px); }
.lead { color: #b7c7be; font-size: 18px; line-height: 1.7; max-width: 650px; }
.auth-note {
  margin-top: 30px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--muted);
  max-width: 560px;
}
.auth-note span { width: 10px; height: 10px; margin-top: 8px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 22px var(--accent); flex: 0 0 auto; }

.auth-card {
  border-color: var(--line);
  border-radius: var(--radius);
  padding: 34px;
  align-self: center;
}
.auth-card__head h2 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.03em; }
.auth-card__head p { margin: 0 0 28px; color: var(--muted); line-height: 1.5; }
.auth-switch {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}
.auth-switch a { color: var(--accent); font-weight: 800; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: -0.02em; }
.brand--large { position: absolute; top: 34px; left: 38px; z-index: 1; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071009;
  font-weight: 1000;
  box-shadow: 0 0 34px rgba(183,255,0,.25);
}
.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  font-weight: 900;
}

.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; color: var(--muted); }
.field span { font-size: 14px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid rgba(183, 255, 0, 0.25);
  outline: none;
  border-radius: 16px;
  color: var(--text);
  background: rgba(2, 6, 5, 0.72);
  padding: 15px 16px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.field textarea { resize: vertical; min-height: 132px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(183,255,0,.09); }
.field--search input { min-width: min(520px, 100%); }
.check-field { display: flex; align-items: center; gap: 12px; color: #c2cec8; }
.check-field input { width: 18px; height: 18px; accent-color: var(--accent); }

.primary-button, .secondary-button, .menu-button, .account-line button {
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  transition: transform .18s ease, filter .18s ease, border-color .18s ease;
}
.primary-button { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04110c; }
.secondary-button, .menu-button, .account-line button { color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--line-soft); }
.primary-button:hover, .secondary-button:hover, .menu-button:hover, .account-line button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.message-box {
  margin: 0 0 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  padding: 12px 14px;
  color: #d9e5de;
}
.message-box[data-type="error"] { border-color: rgba(255, 93, 115, .35); color: #ffb2bf; }
.message-box[data-type="success"] { border-color: rgba(129, 255, 178, .35); color: #bfffd5; }

.site-shell { width: min(1220px, calc(100% - 38px)); margin: 0 auto; padding: 20px 0 42px; }
.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  border: 1px solid var(--line-soft);
  background: rgba(5, 8, 7, 0.72);
  backdrop-filter: blur(18px);
  border-radius: 24px;
  min-height: 72px;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.32);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: #bfcac4;
  padding: 12px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 750;
}
.nav a:hover, .nav a.is-active { color: #071009; background: var(--accent); }
.account-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.account-line span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-button { display: none; margin-left: auto; }

.hero-section {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: end;
  padding: 92px 0 56px;
}
.hero-section h1 { font-size: clamp(54px, 8vw, 110px); max-width: 920px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(183,255,0,.13), rgba(28,246,196,.07) 42%, rgba(12,18,16,.92));
  padding: 28px;
  box-shadow: var(--shadow);
}
.hero-panel strong { display: block; font-size: 70px; line-height: .9; letter-spacing: -0.08em; }
.hero-panel span, .panel-label { color: var(--muted); }
.panel-label { margin: 0 0 18px; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }

.page-title { padding: 72px 0 34px; }
.page-title h1 { font-size: clamp(42px, 6vw, 82px); max-width: 880px; }
.page-title p:not(.eyebrow) { color: var(--muted); line-height: 1.7; max-width: 780px; }
.page-title--split { display: flex; align-items: end; justify-content: space-between; gap: 24px; }

.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 48px; }
.stats-row article, .mini-stat {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.045);
  padding: 22px;
}
.stats-row strong, .mini-stat strong { display: block; font-size: 42px; letter-spacing: -.05em; }
.stats-row span, .mini-stat span { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 42px 0 18px; }
.section-head h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }
.section-head--tight { margin-top: 0; }

.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bento-card { border-radius: var(--radius); padding: 26px; min-height: 220px; position: relative; overflow: hidden; transition: transform .2s, border-color .2s; }
.bento-card:hover { transform: translateY(-4px); border-color: var(--line); }
.bento-card--wide { grid-column: span 2; }
.bento-card span { color: var(--accent); font-weight: 900; }
.bento-card h3, .game-card h3, .post-card h3, .team-card h3, .mod-card h3 { margin: 16px 0 10px; font-size: 24px; letter-spacing: -.03em; }
.bento-card p, .game-card p, .post-card p, .team-card p, .mod-card p { color: var(--muted); line-height: 1.6; }

.toolbar-card { border-radius: var(--radius); padding: 22px; display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cards-grid--compact { grid-template-columns: 1fr; }
.game-card, .post-card, .mod-card, .team-card { border-radius: var(--radius); padding: 24px; min-height: 220px; }
.game-card__meta, .post-card__meta, .mod-card__meta { color: var(--accent); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 900; }
.card-link { margin-top: 16px; display: inline-flex; color: var(--accent); font-weight: 900; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.team-card { min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; }
.team-card .role { color: var(--accent); font-weight: 900; }

.split-layout { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 24px; align-items: start; }
.form-card { border-radius: var(--radius); padding: 26px; }
.form-card h2 { margin: 0 0 8px; font-size: 32px; letter-spacing: -.04em; }
.form-card p { color: var(--muted); line-height: 1.6; }
.form-card--wide { max-width: 720px; display: grid; gap: 16px; }
.content-card { border-radius: var(--radius); padding: 30px; max-width: 880px; }
.content-card h2 { margin-top: 0; font-size: 34px; letter-spacing: -.04em; }
.content-card p { color: var(--muted); line-height: 1.75; }

.empty-box, .error-box { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; background: rgba(255,255,255,.04); color: var(--muted); }
.error-box { color: #ffb2bf; border-color: rgba(255,93,115,.3); }
.site-footer {
  margin-top: 58px;
  border-top: 1px solid var(--line-soft);
  padding-top: 22px;
  color: #9ca9a2;
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .auth-layout, .auth-layout--reverse, .hero-section, .split-layout { grid-template-columns: 1fr; }
  .auth-copy { min-height: 460px; }
  .topbar { flex-wrap: wrap; }
  .menu-button { display: inline-flex; }
  .nav { display: none; width: 100%; order: 5; flex-direction: column; align-items: stretch; }
  .nav.is-open { display: flex; }
  .nav a { width: 100%; }
  .account-line { margin-left: auto; }
  .stats-row, .cards-grid, .team-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .auth-screen { padding: 16px; }
  .auth-copy, .auth-card { padding: 24px; }
  .brand--large { position: static; margin-bottom: 70px; }
  .auth-copy h1, .hero-section h1, .page-title h1 { font-size: 44px; }
  .site-shell { width: min(100% - 22px, 1220px); }
  .topbar { top: 8px; border-radius: 18px; }
  .hero-section { padding-top: 54px; }
  .page-title--split, .toolbar-card { flex-direction: column; align-items: stretch; }
  .stats-row, .cards-grid, .team-grid, .bento-grid { grid-template-columns: 1fr; }
  .bento-card--wide { grid-column: auto; }
}


/* ===== Mobile and layout fix v4 ===== */
.topbar { position: sticky; isolation: isolate; }
.brand span:last-child { white-space: nowrap; }
.nav a { white-space: nowrap; }
.hero-section__content { max-width: 100%; }
.hero-section .lead { max-width: 720px; }

@media (max-width: 1180px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .brand { min-width: 0; }
  .brand span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-button {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
  }

  .nav {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: rgba(6, 10, 8, 0.94);
    box-shadow: 0 18px 42px rgba(0,0,0,.34);
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .nav.is-open { display: flex; }
  .nav a {
    width: 100%;
    padding: 14px 16px;
    text-align: left;
  }

  .account-line {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
  }

  .account-line span { max-width: calc(100vw - 145px); }

  .hero-section,
  .split-layout,
  .auth-layout,
  .auth-layout--reverse {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    align-items: start;
    padding: 70px 0 44px;
  }

  .hero-panel { max-width: 520px; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  body {
    background:
      radial-gradient(circle at 16% 0%, rgba(183, 255, 0, 0.10), transparent 34%),
      radial-gradient(circle at 84% 10%, rgba(28, 246, 196, 0.10), transparent 30%),
      linear-gradient(180deg, #06110d 0%, var(--bg) 58%, #030403 100%);
  }

  body::before { background-size: 42px 42px; opacity: .65; }

  .site-shell {
    width: min(100% - 20px, 1220px);
    padding: 10px 0 30px;
  }

  .topbar {
    top: 8px;
    min-height: 0;
    padding: 10px;
    border-radius: 18px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand span:last-child { font-size: 15px; }

  .hero-section {
    padding: 42px 0 28px;
    gap: 18px;
  }

  .hero-section h1,
  .page-title h1,
  .auth-copy h1 {
    font-size: clamp(34px, 12vw, 48px);
    line-height: 1.02;
    letter-spacing: -0.045em;
  }

  .lead,
  .page-title p:not(.eyebrow),
  .content-card p,
  .form-card p {
    font-size: 15px;
    line-height: 1.65;
  }

  .hero-actions,
  .auth-switch {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .secondary-button,
  .menu-button,
  .account-line button {
    width: 100%;
  }

  .hero-panel,
  .stats-row article,
  .mini-stat,
  .bento-card,
  .game-card,
  .post-card,
  .mod-card,
  .team-card,
  .form-card,
  .content-card,
  .toolbar-card,
  .auth-card,
  .auth-copy {
    border-radius: 20px;
  }

  .hero-panel { padding: 22px; }
  .hero-panel strong { font-size: clamp(48px, 18vw, 70px); }

  .stats-row,
  .cards-grid,
  .team-grid,
  .bento-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .bento-card--wide { grid-column: auto; }

  .section-head,
  .page-title--split,
  .toolbar-card {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head { margin: 30px 0 14px; }
  .page-title { padding: 44px 0 24px; }

  .toolbar-card { padding: 18px; }
  .field--search input { min-width: 0; }

  .form-card,
  .content-card,
  .bento-card,
  .game-card,
  .post-card,
  .team-card,
  .mod-card {
    padding: 20px;
    min-height: auto;
  }

  .auth-screen {
    min-height: 100svh;
    padding: 12px;
    display: block;
  }

  .auth-layout,
  .auth-layout--reverse {
    width: 100%;
    gap: 14px;
  }

  .auth-copy {
    min-height: auto;
    padding: 24px;
  }

  .brand--large {
    position: static;
    margin-bottom: 42px;
  }

  .auth-note { margin-top: 20px; }
  .auth-card { padding: 22px; }
  .auth-card__head h2 { font-size: 28px; }

  .site-footer {
    margin-top: 36px;
    padding-top: 18px;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .site-shell { width: min(100% - 14px, 1220px); }
  .topbar { border-radius: 16px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; font-size: 13px; }
  .brand span:last-child { font-size: 14px; }
  .hero-section h1,
  .page-title h1,
  .auth-copy h1 { font-size: 34px; }
  .stats-row strong, .mini-stat strong { font-size: 34px; }
  .bento-card h3, .game-card h3, .post-card h3, .team-card h3, .mod-card h3 { font-size: 21px; }
  .field input, .field textarea { padding: 14px; border-radius: 14px; }
  .account-line { align-items: stretch; flex-direction: column; }
  .account-line span { max-width: 100%; }
}


/* ===== Mod review + user count patch v4 ===== */
.admin-panel {
  margin-top: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 22px;
}

.mod-card__links,
.mod-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.mod-card__actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.danger-button {
  color: #ffb2bf;
  border-color: rgba(255, 93, 115, 0.32);
}

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

@media (max-width: 780px) {
  .stats-row { grid-template-columns: 1fr; }
}
