:root {
  color-scheme: dark;
  --bg: #080b0a;
  --panel: #111613;
  --panel-2: #171e1a;
  --line: #2a352f;
  --text: #f3f7f4;
  --muted: #a8b5ad;
  --green: #7dff75;
  --green-2: #37cf58;
  --danger: #ff7d7d;
  --warning: #ffd36a;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(55, 207, 88, .13), transparent 34rem),
    linear-gradient(180deg, #0b100d 0, var(--bg) 32rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem max(1rem, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(125, 255, 117, .18);
  background: rgba(8, 11, 10, .9);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--green-2);
  border-radius: 50%;
  background: #0f1811;
  color: var(--green);
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.main-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.main-nav a {
  padding: .55rem .75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
}
.main-nav a:hover, .main-nav a.active { background: var(--panel-2); color: var(--text); }

.shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2.2rem 0 4rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, rgba(125, 255, 117, .1), rgba(17, 22, 19, .9) 45%);
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 .5rem; color: var(--green); font-size: .78rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .6rem; font-size: clamp(2rem, 6vw, 4.6rem); line-height: .95; letter-spacing: -.055em; }
h2 { letter-spacing: -.025em; }
.hero p { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(82px, 1fr)); gap: .65rem; }
.stat { min-width: 92px; padding: 1rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(8, 11, 10, .65); text-align: center; }
.stat strong, .stat span { display: block; }
.stat strong { color: var(--green); font-size: 1.5rem; }
.stat span { margin-top: .25rem; color: var(--muted); font-size: .72rem; text-transform: uppercase; }

.toolbar, .breadcrumb, .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.breadcrumb { justify-content: flex-start; color: var(--muted); font-size: .9rem; }
.breadcrumb a { color: var(--green); text-decoration: none; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem 1rem;
  border: 1px solid var(--green-2);
  border-radius: 10px;
  background: var(--green-2);
  color: #061008;
  text-decoration: none;
  font-weight: 900;
}
.button:hover { filter: brightness(1.08); }
.button.secondary { border-color: var(--line); background: var(--panel-2); color: var(--text); }
.button.danger { border-color: rgba(255,125,125,.45); background: rgba(255,125,125,.12); color: #ffd5d5; }
.button.small { min-height: 34px; padding: .45rem .7rem; font-size: .78rem; }
.button[disabled] { cursor: not-allowed; opacity: .55; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.2rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17, 22, 19, .92); box-shadow: var(--shadow); overflow: hidden; }
.panel-header { padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.018); }
.panel-header h2, .panel-header p { margin-bottom: 0; }
.panel-header p { margin-top: .35rem; color: var(--muted); }

.category-list, .thread-list, .post-list { list-style: none; margin: 0; padding: 0; }
.category-row, .thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.category-row:last-child, .thread-row:last-child { border-bottom: 0; }
.category-row:hover, .thread-row:hover { background: rgba(125, 255, 117, .04); }
.category-row h3, .thread-row h3 { margin-bottom: .25rem; font-size: 1rem; }
.category-row p, .thread-row p { margin-bottom: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.category-counts { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .78rem; text-align: right; }
.category-counts strong { display: block; color: var(--text); font-size: 1rem; }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .35rem; }
.badge { padding: .17rem .45rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .67rem; font-weight: 900; text-transform: uppercase; }
.badge.pin { border-color: rgba(125,255,117,.35); color: var(--green); }
.badge.lock { border-color: rgba(255,211,106,.35); color: var(--warning); }

.sidebar-card { padding: 1.15rem; border-bottom: 1px solid var(--line); }
.sidebar-card:last-child { border-bottom: 0; }
.sidebar-card p { color: var(--muted); line-height: 1.55; }
.sidebar-card .button { width: 100%; }

.post { display: grid; grid-template-columns: 190px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-author { padding: 1.2rem; border-right: 1px solid var(--line); background: rgba(255,255,255,.015); }
.avatar { display: grid; width: 48px; height: 48px; margin-bottom: .7rem; place-items: center; border-radius: 50%; background: #203126; color: var(--green); font-weight: 900; }
.post-author strong, .post-author span { display: block; }
.post-author span { margin-top: .2rem; color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.post-content { min-width: 0; padding: 1.2rem; }
.post-meta { margin-bottom: 1rem; color: var(--muted); font-size: .78rem; }
.post-body { min-height: 72px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.post-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.deleted { color: var(--muted); font-style: italic; }

.form-panel { padding: 1.2rem; }
.form-grid { display: grid; gap: 1rem; }
label { display: grid; gap: .4rem; color: var(--muted); font-size: .84rem; font-weight: 800; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b100d;
  color: var(--text);
  padding: .75rem .85rem;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(55, 207, 88, .13); }
textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
.form-message { min-height: 1.4rem; margin: .25rem 0 0; color: var(--muted); }
.form-message.error { color: var(--danger); }
.search-form { display: flex; gap: .55rem; width: min(100%, 470px); }
.search-form input { min-width: 0; }

.empty, .notice, .loading-card, .error-card { padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-align: center; color: var(--muted); }
.notice { text-align: left; }
.notice strong { color: var(--text); }
.error-card { color: #ffd5d5; border-color: rgba(255,125,125,.35); }
.spinner { width: 28px; height: 28px; margin: 0 auto 1rem; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 1.2rem; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 1.6rem 0 2.4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--green); }

@media (max-width: 860px) {
  .site-header { position: static; align-items: flex-start; flex-direction: column; }
  .main-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .hero, .grid { grid-template-columns: 1fr; }
  .stats { width: 100%; }
  .post { grid-template-columns: 1fr; }
  .post-author { display: flex; align-items: center; gap: .7rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .avatar { flex: 0 0 auto; margin: 0; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 1rem, 1180px); padding-top: 1rem; }
  .hero { padding: 1.3rem; }
  .toolbar, .section-heading { align-items: stretch; flex-direction: column; }
  .search-form { width: 100%; }
  .category-row, .thread-row { grid-template-columns: 1fr; }
  .category-counts { justify-content: flex-start; text-align: left; }
  .site-footer { flex-direction: column; }
}

