/* ===== GTA Forum — dark theme ===== */
:root {
  --bg: #0b0f14;
  --surface: #121a22;
  --surface-2: #18222c;
  --border: #24313d;
  --text: #dce5e9;
  --muted: #8aa0ab;
  --accent: #5fd636;
  --accent-dark: #46a824;
  --accent-glow: rgba(95, 214, 54, 0.18);
  --gold: #e6b34d;
  --red: #e05252;
  --blue: #6aa9ff;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

::selection { background: var(--accent-glow); }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.logo-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  color: #08120a;
  font-weight: 800;
  font-size: 20px;
  border-radius: 8px;
  box-shadow: 0 0 18px var(--accent-glow);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}
.logo-text .logo-accent { color: var(--accent); }

.site-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }

.site-nav a {
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a.active { color: var(--accent); background: var(--accent-glow); }

.header-actions { display: flex; gap: 8px; margin-left: auto; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.btn:hover { background: #1f2c38; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #08120a;
}
.btn-primary:hover { background: linear-gradient(145deg, #6ee146, var(--accent-dark)); }

.btn-outline { background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* ===== Hero ===== */
.hero {
  position: relative;
  margin-top: 28px;
  padding: 44px 40px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    radial-gradient(600px 220px at 85% -10%, var(--accent-glow), transparent 70%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.014) 0 12px, transparent 12px 24px),
    var(--surface);
  overflow: hidden;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.hero h1 span { color: var(--accent); }

.hero p { color: var(--muted); margin: 10px 0 24px; max-width: 560px; }
.hero p b { color: var(--text); }

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

.stat {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}
.stat b { font-size: 22px; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }

/* ===== Sections ===== */
.section { margin-top: 40px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section h2 {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section h2::before {
  content: "";
  width: 5px;
  height: 22px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== Category grid ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.cat-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform 0.15s, border-color 0.15s;
}
.cat-card:hover { transform: translateY(-2px); border-color: #33455a; }

.cat-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cat-body { min-width: 0; flex: 1; }

.cat-body h3 { font-size: 16px; }
.cat-body h3 a { color: var(--text); }
.cat-body h3 a:hover { color: var(--accent); }
.cat-body p { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }

.cat-meta { font-size: 12px; color: var(--muted); }
.cat-meta b { color: var(--text); }

.cat-latest {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-latest a { color: var(--text); }
.cat-latest a:hover { color: var(--accent); }

/* ===== Threads ===== */
.tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 4px; }

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-glow); color: var(--accent); }

.thread-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.thread-tools input {
  flex: 1;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.15s;
}
.thread-tools input:focus { border-color: var(--accent); }
.thread-tools input::placeholder { color: #5b707c; }

.result-count { color: var(--muted); font-size: 13px; }

.thread-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color 0.15s, background 0.15s;
}
.trow:hover { border-color: var(--accent); background: var(--surface-2); }

.trow-title { font-weight: 700; display: block; }
.trow:hover .trow-title { color: var(--accent); }

.trow-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.trow-sub .author { color: var(--text); font-weight: 600; }

.trow-stats { display: flex; gap: 22px; text-align: right; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.trow-stats b { display: block; color: var(--text); font-size: 15px; }
.trow-time { padding-top: 3px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-roleplay   { background: rgba(255, 122, 92, 0.14);  color: #ff7a5c; }
.badge-gta-online { background: rgba(95, 214, 54, 0.14);   color: var(--accent); }
.badge-weapons    { background: rgba(230, 179, 77, 0.14);  color: var(--gold); }
.badge-missions   { background: rgba(106, 169, 255, 0.14); color: var(--blue); }
.badge-tech       { background: rgba(197, 140, 255, 0.14); color: #c58cff; }
.badge-offtopic   { background: rgba(92, 214, 208, 0.14);  color: #5cd6d0; }

.role { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.role-admin { background: rgba(224, 82, 82, 0.16); color: var(--red); }
.role-mod   { background: rgba(106, 169, 255, 0.16); color: var(--blue); }
.role-user  { background: rgba(138, 160, 171, 0.14); color: var(--muted); }

/* ===== Avatars ===== */
.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  color: #0a0f13;
  flex-shrink: 0;
  user-select: none;
}

/* ===== Thread page ===== */
.breadcrumbs { margin-top: 24px; color: var(--muted); font-size: 13px; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 8px; opacity: 0.5; }

.thread-header {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.thread-header h1 { font-size: 24px; line-height: 1.3; }
.thread-header .th-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}
.thread-header .th-meta .author { color: var(--text); font-weight: 700; }

.post {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 12px;
}
.post.op { border-left: 3px solid var(--accent); }

.post-avatar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.post-avatar .avatar { width: 48px; height: 48px; font-size: 16px; }

.post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-head .author { font-weight: 700; }
.post-head .time { color: var(--muted); font-size: 12.5px; }

.post-text { margin-top: 10px; white-space: pre-line; color: #c4d2d9; }

.replies-title {
  margin: 28px 0 4px;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

/* ===== Reply form ===== */
.reply-form {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.reply-form h3 { margin-bottom: 14px; font-size: 16px; text-transform: uppercase; letter-spacing: 0.6px; }

.reply-form input,
.reply-form textarea,
.auth-form input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.15s;
  resize: vertical;
}
.reply-form input:focus,
.reply-form textarea:focus,
.auth-form input:focus { border-color: var(--accent); }
.reply-form input::placeholder,
.reply-form textarea::placeholder,
.auth-form input::placeholder { color: #5b707c; }

.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.reply-actions .hint { color: var(--muted); font-size: 12.5px; }

/* ===== Auth page ===== */
.auth-wrap {
  margin: 48px auto 24px;
  width: min(420px, 100%);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tabs .tab { padding: 9px; }

.auth-card .btn-primary { width: 100%; justify-content: center; padding: 11px; }
.auth-note { margin-top: 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ===== Related ===== */
.related-list { display: flex; flex-direction: column; gap: 8px; }
.related-list .trow { padding: 11px 16px; }

/* ===== Footer ===== */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 26px 0;
  color: var(--muted);
  font-size: 13px;
}
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer b { color: var(--text); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  max-width: min(480px, 90vw);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .header-inner { gap: 10px; }
  .site-nav { order: 3; width: 100%; }
  .header-actions { margin-left: auto; }

  .hero { padding: 28px 22px; }

  .trow { grid-template-columns: 1fr; gap: 10px; }
  .trow-stats { justify-content: flex-start; text-align: left; }
  .trow-stats b { display: inline; margin-right: 4px; }

  .post { grid-template-columns: 48px 1fr; padding: 14px; }
  .post-avatar .avatar { width: 40px; height: 40px; font-size: 13px; }
}
