:root {
  --acid: #39ff14;
  --acid-dim: #2aa810;
  --bg: #0a0a0a;
  --panel: #121412;
  --line: #1e2e1e;
  --text: #d4d8d4;
  --muted: #6a756a;
  --font: 'Barlow Condensed', 'Segoe UI', sans-serif;
  --mono: 'Share Tech Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 1.05rem;
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px
  );
  z-index: 9999;
}

.top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: #0d100d;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand > div { min-width: 0; }
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--acid-dim);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.25);
}
.brand .mark { color: var(--acid); font-size: 1.4rem; }
.brand strong { display: block; letter-spacing: 0.08em; color: #e8ffe8; }
.brand .sub { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }

.nav { display: flex; gap: 1rem; flex: 1; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; letter-spacing: 0.04em; }
.nav-link:hover, .nav-link.active { color: var(--acid); }
.nav-link.dim { opacity: 0.6; }

.user-box { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.user-box img { border-radius: 4px; border: 1px solid var(--line); }
.hidden { display: none !important; }

.btn {
  background: #1a2a1a;
  border: 1px solid var(--acid-dim);
  color: var(--acid);
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #243024; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

.forum-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 1.5rem) 2rem;
  width: 100%;
}

.forum-hero { margin-bottom: 2rem; }
.forum-banner {
  margin-bottom: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #0d100d;
}
.forum-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: cover;
  object-position: left center;
}
.kicker { font-family: var(--mono); font-size: 0.7rem; color: var(--acid-dim); margin-bottom: 0.5rem; }
.forum-hero h1 { font-size: 2rem; color: #e8ffe8; margin-bottom: 0.5rem; }
.lead { color: var(--muted); max-width: 560px; }

.forum-gate {
  background: var(--panel);
  border: 1px dashed var(--line);
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}

.forum-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; }
@media (max-width: 640px) { .forum-layout { grid-template-columns: 1fr; } }

.forum-cats button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
}
.forum-cats button.active, .forum-cats button:hover {
  border-color: var(--acid-dim);
  color: var(--acid);
  background: #141a14;
}

.forum-main {
  background: var(--panel);
  border: 1px solid var(--line);
  min-height: 320px;
}

.topic-row {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.topic-row:hover { background: #141814; }
.topic-row h4 { color: #e0ffe0; font-size: 0.95rem; }
.topic-row .meta { font-size: 0.75rem; color: var(--muted); font-family: var(--mono); }

.forum-form, .thread-box {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem;
  margin-top: 1rem;
}
.forum-form input, .forum-form textarea, .forum-form select,
.thread-box textarea {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: var(--font);
}
.forum-form h3 { color: var(--acid); margin-bottom: 0.75rem; font-size: 1rem; }

.reply {
  border-left: 2px solid var(--acid-dim);
  padding: 0.5rem 0 0.5rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.reply .who { font-family: var(--mono); font-size: 0.75rem; color: var(--acid); }

.empty { padding: 2rem; text-align: center; color: var(--muted); }

.foot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  background: #0a0c0a;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}
.foot .acid { color: var(--acid); }

.forum-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.forum-tab {
  flex: 1;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
}
.forum-tab.active {
  border-color: var(--acid);
  color: var(--acid);
  background: #141a14;
}

.forum-panel.hidden { display: none; }
.panel-hint {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.btn-big {
  padding: 0.65rem 1.4rem;
  font-size: 1.05rem;
}

.shout-compose, .quick-compose {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem;
  margin-bottom: 1rem;
}
.shout-compose textarea, .quick-compose textarea,
.thread-box textarea, .forum-form textarea, .forum-form input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.75rem;
  font-family: var(--font);
  font-size: 1.05rem;
  border-radius: 4px;
  resize: vertical;
}
.shout-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
.shout-count { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

.shout-list {
  background: var(--panel);
  border: 1px solid var(--line);
  max-height: 520px;
  overflow-y: auto;
  padding: 0.5rem;
}
.shout-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.shout-item:last-child { border-bottom: none; }
.shout-av {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
}
.shout-av-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a2a1a;
  color: var(--acid);
  font-weight: 700;
  font-size: 1.1rem;
}
.shout-head {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.shout-head strong { color: var(--acid); }
.shout-head span { color: var(--muted); font-family: var(--mono); font-size: 0.75rem; margin-left: 0.4rem; }
.shout-body p { font-size: 1.05rem; color: #e4ebe4; word-break: break-word; }

.shout-feedback {
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.shout-feedback.ok { background: #142014; border: 1px solid var(--acid-dim); color: var(--acid); }
.shout-feedback.err { background: #201414; border: 1px solid #a33; color: #f88; }

.quick-compose {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.quick-compose textarea { flex: 1; min-width: 200px; }

.forum-form label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.thread-content { font-size: 1.05rem; margin: 0.75rem 0; }
.btn-back {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  padding: 0;
}
.btn-back:hover { color: var(--acid); }

.streamers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.streamer-card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.streamer-card:hover { border-color: var(--acid-dim); }
.streamer-card.live { border-color: #c33; box-shadow: 0 0 12px rgba(255, 50, 50, 0.15); }
.streamer-card-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.streamer-card-head img {
  width: 48px; height: 48px; border-radius: 4px; border: 1px solid var(--line); object-fit: cover;
}
.streamer-card-head .av-fallback {
  width: 48px; height: 48px; border-radius: 4px; background: #1a2a1a;
  display: flex; align-items: center; justify-content: center; color: var(--acid); font-size: 1.2rem;
}
.streamer-card h4 { color: #e8ffe8; letter-spacing: 0.04em; }
.streamer-card .platform { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.streamer-card .bio-snippet { font-size: 0.9rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.35; }
.streamer-card .next-session { font-size: 0.8rem; color: var(--acid-dim); margin-top: 0.5rem; }

.streamer-detail {
  margin-top: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.25rem;
}
.streamer-detail .banner {
  width: 100%; max-height: 140px; object-fit: cover; border-radius: 4px; margin-bottom: 1rem;
}
.streamer-detail-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.streamer-detail-head img { width: 72px; height: 72px; border-radius: 4px; border: 1px solid var(--line); }
.streamer-detail h3 { color: #e8ffe8; font-size: 1.4rem; }
.streamer-detail .channel-link { color: var(--acid); font-size: 0.9rem; }
.streamer-sessions { margin-top: 1.25rem; }
.streamer-sessions h4 { color: var(--acid); margin-bottom: 0.75rem; letter-spacing: 0.06em; }
.session-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.session-item strong { color: #e8ffe8; }
.session-item .when { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .top {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand auth"
      "nav nav";
    gap: 0.65rem 0.75rem;
    padding: 0.85rem clamp(1rem, 4vw, 1.5rem);
  }

  .brand { grid-area: brand; }

  .brand strong {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav {
    grid-area: nav;
    flex: none;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    padding-bottom: 0.15rem;
  }

  .nav-link { flex-shrink: 0; white-space: nowrap; }

  #user-box,
  #btn-login {
    grid-area: auth;
    justify-self: end;
  }

  #user-name {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .forum-tabs {
    flex-direction: column;
    gap: 0.35rem;
  }

  .forum-tab {
    flex: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    padding: 0.7rem 0.85rem;
  }

  .forum-hero h1 { font-size: 1.55rem; }

  .lead {
    font-size: 0.95rem;
    max-width: none;
  }

  .forum-banner img { max-height: 140px; }

  .streamers-grid,
  .forum-layout {
    grid-template-columns: 1fr;
  }

  .forum-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .forum-cats button {
    width: auto;
    flex: 1 1 calc(50% - 0.35rem);
    margin-bottom: 0;
    min-width: 8rem;
  }

  .shout-item {
    flex-wrap: wrap;
  }

  .shout-body {
    flex: 1 1 100%;
    min-width: 0;
  }

  .shout-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .shout-actions .btn-big {
    width: 100%;
    text-align: center;
  }

  .quick-compose {
    flex-direction: column;
    align-items: stretch;
  }

  .quick-compose textarea {
    min-width: 0;
    width: 100%;
  }

  .quick-compose .btn {
    width: 100%;
    text-align: center;
  }

  .streamer-detail-head {
    flex-direction: column;
  }

  .streamer-detail .banner {
    max-height: 120px;
  }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }

  .forum-gate { padding: 1.75rem 1rem; }

  .shout-list { max-height: 420px; }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.45rem 1rem;
    padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }

  .forum-cats button {
    flex: 1 1 100%;
  }
}