/* ============================================================
   Incel Research Forum — dark theme
   ============================================================ */
:root {
  --bg:        #0d1017;
  --bg-2:      #121722;
  --panel:     #171d2a;
  --panel-2:   #1c2433;
  --border:    #263042;
  --border-2:  #33415a;
  --text:      #e7ecf3;
  --muted:     #8a94a7;
  --muted-2:   #626d82;
  --accent:    #7ee081;   /* green — votes / active */
  --accent-2:  #56b8ff;   /* blue — links / play */
  --danger:    #ff6b6b;
  --up:        #7ee081;
  --down:      #ff6b6b;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 10px 30px rgba(0,0,0,.35);
  --maxw:      880px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(86,184,255,.08), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(126,224,129,.06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,16,23,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.brand .logo {
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid; place-items: center;
  color: #06210b; font-weight: 900; font-size: 20px;
  box-shadow: 0 6px 18px rgba(126,224,129,.25);
}
.brand-text { min-width: 0; }
.brand-title {
  font-weight: 800; font-size: 15px; letter-spacing: .2px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 62vw;
}
.brand-sub { font-size: 11.5px; color: var(--muted-2); }
.header-spacer { flex: 1; }
.nav { display: flex; gap: 6px; }
.nav a {
  padding: 8px 13px; border-radius: 9px; color: var(--muted);
  font-weight: 600; font-size: 13.5px;
}
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--panel-2); color: var(--text); }

/* ---------- Hero / title band ---------- */
.hero {
  max-width: var(--maxw);
  margin: 26px auto 8px;
  padding: 0 18px;
}
.hero h1 {
  font-size: clamp(20px, 3.2vw, 30px);
  line-height: 1.25;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.hero p { color: var(--muted); margin: 0; max-width: 68ch; font-size: 14.5px; }
.hero .tag {
  display: inline-block; margin-bottom: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); background: rgba(126,224,129,.1);
  border: 1px solid rgba(126,224,129,.25);
  padding: 5px 11px; border-radius: 999px;
}

/* ---------- Toolbar ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px 80px; }
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 22px 0 16px;
}
.search {
  flex: 1; min-width: 200px; position: relative;
}
.search input {
  width: 100%; padding: 11px 14px 11px 38px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 11px; color: var(--text); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--border-2); box-shadow: 0 0 0 3px rgba(86,184,255,.12); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.sort {
  display: flex; background: var(--panel); border: 1px solid var(--border);
  border-radius: 11px; padding: 3px; gap: 2px;
}
.sort button {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 13px; border-radius: 8px; font-weight: 600; font-size: 13px;
}
.sort button.active { background: var(--panel-2); color: var(--text); }

.btn {
  border: 0; border-radius: 11px; font-weight: 700; font-size: 14px;
  padding: 11px 18px; color: #06210b;
  background: linear-gradient(135deg, var(--accent), #62c98a);
  transition: transform .08s, filter .15s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.secondary {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
}
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Post card ---------- */
.feed { display: flex; flex-direction: column; gap: 14px; }
.card {
  display: flex; gap: 0;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, transform .1s, box-shadow .2s;
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }

.vote {
  flex: none; width: 58px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 0; background: rgba(0,0,0,.15);
  border-right: 1px solid var(--border);
}
.vote button {
  border: 0; background: transparent; color: var(--muted-2);
  width: 34px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  transition: background .12s, color .12s, transform .08s;
}
.vote button:hover { background: var(--panel-2); color: var(--text); }
.vote button.up.on { color: var(--up); background: rgba(126,224,129,.12); }
.vote button.down.on { color: var(--down); background: rgba(255,107,107,.12); }
.vote button:active { transform: scale(.9); }
.vote .score { font-weight: 800; font-size: 14px; color: var(--text); }
.vote .score.pos { color: var(--up); }
.vote .score.neg { color: var(--down); }

.card-body { flex: 1; min-width: 0; padding: 16px 18px; }
.card-top {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted-2); margin-bottom: 8px; flex-wrap: wrap;
}
.avatar {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: linear-gradient(135deg, #3a4a66, #223047);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #cdd7e8;
}
.card-top .author { color: var(--muted); font-weight: 600; }
.dot { color: var(--border-2); }

.card h2, .card .post-title {
  margin: 0 0 6px; font-size: 17px; font-weight: 700; line-height: 1.3;
}
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent-2); text-decoration: none; }
.card .desc { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

.card-foot {
  display: flex; align-items: center; gap: 16px; margin-top: 12px;
  font-size: 13px; color: var(--muted-2);
}
.card-foot a, .card-foot .meta {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-weight: 600;
}
.card-foot a:hover { color: var(--text); text-decoration: none; }

/* ---------- Audio player ---------- */
.player {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 14px;
}
.player .play {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), #3f8ff0);
  border: 0; color: #04121f; display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(86,184,255,.3);
  transition: transform .08s, filter .15s;
}
.player .play:hover { filter: brightness(1.08); }
.player .play:active { transform: scale(.94); }
.player-main { flex: 1; min-width: 0; }
.player-title {
  font-size: 12px; color: var(--muted); margin-bottom: 7px;
  display: flex; justify-content: space-between; gap: 10px;
}
.player-title .badge {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-2); background: rgba(86,184,255,.12);
  padding: 2px 7px; border-radius: 6px;
}
.bar {
  height: 7px; background: var(--panel-2); border-radius: 999px;
  position: relative; cursor: pointer; overflow: hidden;
}
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; }
.player-time {
  display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2);
  margin-top: 6px; font-variant-numeric: tabular-nums;
}

/* ---------- Empty / loading ---------- */
.state {
  text-align: center; padding: 70px 20px; color: var(--muted);
  border: 1px dashed var(--border-2); border-radius: var(--radius);
  background: var(--bg-2);
}
.state .big { font-size: 40px; margin-bottom: 12px; }
.state h3 { margin: 0 0 6px; color: var(--text); }
.spinner {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 14px;
  border: 3px solid var(--border); border-top-color: var(--accent-2);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.35);
  color: #ffc9c9; border-radius: 12px; padding: 14px 16px; margin: 16px 0;
  font-size: 13.5px;
}
.banner code { background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 5px; }

/* ---------- Modal / form ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6,9,14,.7); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 560px;
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .x {
  border: 0; background: transparent; color: var(--muted); font-size: 22px;
  width: 34px; height: 34px; border-radius: 8px; line-height: 1;
}
.modal-head .x:hover { background: var(--panel-2); color: var(--text); }
.modal-body { padding: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  font-size: 14px; font-family: inherit; resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--border-2); box-shadow: 0 0 0 3px rgba(86,184,255,.1);
}
.field .hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.filedrop {
  border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 22px;
  text-align: center; color: var(--muted); cursor: pointer; transition: all .15s;
  background: var(--bg-2);
}
.filedrop:hover, .filedrop.drag { border-color: var(--accent-2); background: rgba(86,184,255,.06); color: var(--text); }
.filedrop.has-file { border-color: var(--accent); color: var(--text); border-style: solid; }
.filedrop .fd-icon { font-size: 26px; margin-bottom: 8px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--border);
}
.progress-wrap { margin-top: 12px; display: none; }
.progress-wrap.show { display: block; }
.progress { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress .p { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .2s; }

/* ---------- Comments (post page) ---------- */
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; margin: 20px 0 6px; }
.back:hover { color: var(--text); text-decoration: none; }
.comments-head { margin: 30px 0 16px; font-size: 18px; font-weight: 700; }
.comment {
  display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border);
}
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-top { font-size: 12px; color: var(--muted-2); margin-bottom: 5px; }
.comment .c-top .author { color: var(--muted); font-weight: 600; }
.comment .c-text { font-size: 14px; color: var(--text); white-space: pre-wrap; word-wrap: break-word; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text);
  padding: 12px 18px; border-radius: 11px; box-shadow: var(--shadow); font-size: 13.5px;
  animation: pop .18s ease; max-width: 90vw;
}
.toast.err { border-color: rgba(255,107,107,.5); }
.toast.ok { border-color: rgba(126,224,129,.5); }

footer.site-foot {
  max-width: var(--maxw); margin: 0 auto; padding: 30px 18px 50px;
  color: var(--muted-2); font-size: 12.5px; text-align: center; border-top: 1px solid var(--border);
}

@media (max-width: 560px) {
  .vote { width: 46px; }
  .brand-title { max-width: 50vw; }
  .nav { display: none; }
  .card-body { padding: 14px; }
}
