:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #222;
  --border: #2e2e2e;
  --accent: #c8a84b;
  --accent2: #7eb8a4;
  --text: #e0e0e0;
  --muted: #888;
  --danger: #c0392b;
  --radius: 8px;
  --font: 'Georgia', serif;
  --mono: 'Courier New', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.7;
}

/* ── Header ── */
header {
  background: #111;
  border-bottom: 2px solid var(--accent);
  padding: 1.2rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}
.tagline {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  flex: 1;
}
.user-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--accent2);
  white-space: nowrap;
}
.user-bar button {
  background: none;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--mono);
}
.user-bar button:hover { background: var(--accent2); color: #000; }

/* ── Main ── */
main {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ── Topic Card ── */
.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  position: relative;
}
.topic-card.pinned {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(200,168,75,0.15);
}
.topic-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.topic-author {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(200,168,75,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.topic-date {
  font-size: 0.75rem;
  color: var(--muted);
}
.pinned-badge {
  font-size: 0.7rem;
  background: var(--accent);
  color: #000;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: bold;
}
.topic-title {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  line-height: 1.3;
}
.topic-preview {
  color: var(--text);
  font-size: 0.97rem;
}
.topic-full {
  display: none;
  color: var(--text);
  font-size: 0.97rem;
  margin-top: 0.5rem;
}
.topic-full.open { display: block; }

/* section headers inside content */
.topic-full h3, .topic-preview h3 {
  color: var(--accent2);
  font-size: 1rem;
  margin: 1.2rem 0 0.4rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.topic-full ul, .topic-preview ul {
  padding-left: 1.4rem;
  margin: 0.4rem 0;
}
.topic-full li, .topic-preview li {
  margin-bottom: 0.3rem;
}

.read-more-btn {
  background: none;
  border: none;
  color: var(--accent2);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--mono);
  padding: 0.4rem 0;
  margin-top: 0.6rem;
  display: inline-block;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.read-more-btn:hover { color: var(--accent); }

/* ── Comments ── */
.comments-section {
  margin-top: 1.4rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.comments-section h4 {
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
}
.comment {
  background: var(--surface2);
  border-left: 3px solid var(--border);
  padding: 0.7rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
}
.comment-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.comment-form {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.comment-form textarea {
  flex: 1;
  min-width: 200px;
  min-height: 60px;
  resize: vertical;
}
.comment-form button {
  align-self: flex-end;
  white-space: nowrap;
}

/* ── New Topic Section ── */
.new-topic-section {
  background: var(--surface);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.new-topic-section h2 {
  font-size: 1.1rem;
  color: var(--accent);
  font-family: var(--mono);
}

/* ── Inputs ── */
input[type="text"], textarea {
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  width: 100%;
  transition: border-color 0.2s;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #000;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 0.55rem 1.2rem;
  transition: opacity 0.2s;
}
button:hover { opacity: 0.85; }

/* ── Disclaimer ── */
.disclaimer {
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: left;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.6;
}
.disclaimer p { margin-bottom: 0.6rem; }
.disclaimer p:last-child { margin-bottom: 0; }
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-label input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Privacy link ── */
.privacy-link {
  color: var(--muted);
  font-size: 0.75rem;
  font-family: var(--mono);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.privacy-link:hover { color: var(--danger); }

/* ── Data items (privacy page) ── */
.data-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  transition: opacity 0.3s;
}
.data-item.data-hidden { opacity: 0.35; }
.data-item-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.data-type-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  background: rgba(200,168,75,0.1);
  color: var(--accent);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}
.hidden-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  background: var(--danger);
  color: #fff;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
}
.data-item-text {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}
.toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
}
.toggle-btn:hover { border-color: var(--accent2); color: var(--accent2); background: none; opacity: 1; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}
.modal h2 { color: var(--accent); }
.modal p { color: var(--muted); font-size: 0.9rem; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 1.2rem;
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.footer-main {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.footer-legal {
  font-size: 0.72rem;
  color: #555;
  line-height: 1.7;
}
.footer-legal strong {
  color: var(--muted);
}
.footer-legal a {
  color: var(--accent2);
  text-underline-offset: 3px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .topic-title { font-size: 1.1rem; }
}
