:root {
  --bg: #0a0d10;
  --bg-2: #14181f;
  --bg-3: #1f242e;
  --neon: #39ff14;
  --neon-dim: rgba(57, 255, 20, 0.5);
  --text: #e8e9ed;
  --text-dim: #9ca0aa;
  --accent: #6c9bff;
  --accent-2: #4d7be6;
  --danger: #e85a5a;
  --border: #2a2f3b;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

/* ── Entry gate ────────────────────────────────────────────────────────────── */

#gate {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}
#gate-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 2rem;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow);
}
#gate-card h1 {
  margin: 0 0 0.4rem;
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon-dim);
  font-size: 1.8rem;
  letter-spacing: 0.03em;
}
.gate-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 0 1.4rem;
}
#gate-form {
  display: flex; flex-direction: column; gap: 0.7rem;
}
#gate-pwd {
  text-align: center;
  letter-spacing: 0.15em;
  font-size: 1.1rem;
}
.full-width { width: 100%; }

/* ── Header ────────────────────────────────────────────────────────────────── */

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
header h1 {
  margin: 0;
  color: var(--neon);
  text-shadow: 0 0 10px var(--neon-dim);
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}
.home-link {
  color: var(--text-dim); text-decoration: none; font-size: 0.9rem;
  flex: 1; text-align: center;
}
.home-link:hover { color: var(--text); }
#admin-btn {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.4rem 0.7rem; border-radius: 6px; cursor: pointer;
  font-size: 1rem;
}
#admin-btn:hover { color: var(--neon); border-color: var(--neon); }

/* ── Layout ────────────────────────────────────────────────────────────────── */

main { max-width: 760px; margin: 0 auto; padding: 1.25rem; }

form, button, input, textarea, select { font-family: inherit; }

button {
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: 6px; cursor: pointer;
  font-size: 0.9rem;
}
button:hover { background: #2c3142; }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.primary:hover { background: var(--accent-2); }
button.danger  { background: var(--danger); border-color: var(--danger); color: white; }

input, textarea, select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem; border-radius: 6px;
  font-size: 0.95rem; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }

label { display: block; margin: 0.6rem 0 0.2rem; color: var(--text-dim); font-size: 0.85rem; }
label > input { margin-top: 0.25rem; }

.hint { color: var(--text-dim); font-size: 0.82rem; margin: 0 0 0.5rem; }

.row { display: flex; gap: 0.6rem; align-items: center; }
.row > * { flex: 1; }
.row > button { flex: 0 0 auto; }

/* ── Post form ─────────────────────────────────────────────────────────────── */

#post-form {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.controls { justify-content: space-between; }
.file-pick {
  display: inline-block; cursor: pointer;
  color: var(--text-dim); font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border: 1px dashed var(--border); border-radius: 6px;
  flex: 1;
}
.file-pick:hover { color: var(--text); border-color: var(--text-dim); }
.file-pick input { display: none; }
#image-label.has-file { color: var(--neon); border-color: var(--neon); border-style: solid; }

.ntfy-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.ntfy-hint code {
  font-family: monospace;
  color: var(--neon);
  word-break: break-all;
}
#copy-topic {
  padding: 0.1rem 0.35rem;
  font-size: 0.75rem;
  margin-left: 0.3rem;
  vertical-align: middle;
  border-radius: 4px;
  cursor: pointer;
}

.msg { margin: 0; font-size: 0.85rem; }
.msg.error   { color: var(--danger); }
.msg.success { color: #6cc78a; }
.muted { color: var(--text-dim); font-size: 0.9rem; text-align: center; padding: 2rem 0; }

/* ── Feed ──────────────────────────────────────────────────────────────────── */

#feed { display: flex; flex-direction: column; gap: 0.6rem; }
.post {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.post-head {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin-bottom: 0.4rem; flex-wrap: wrap;
}
.post-name { font-weight: 700; color: var(--neon); }
.post-date { color: var(--text-dim); font-size: 0.75rem; }
.post-ip   { color: var(--text-dim); font-size: 0.75rem; font-family: monospace; margin-left: auto; }
.post-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.4; }
.post-image {
  display: block; margin-top: 0.6rem;
  max-width: 100%; max-height: 420px;
  border-radius: 6px; border: 1px solid var(--border);
  cursor: zoom-in;
}
.post-actions { margin-top: 0.5rem; display: flex; gap: 0.4rem; justify-content: flex-end; }
.post-actions button { font-size: 0.75rem; padding: 0.2rem 0.5rem; }

/* ── Modals ────────────────────────────────────────────────────────────────── */

#modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 10; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--bg-2); padding: 1.5rem; border-radius: 12px;
  min-width: 380px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow); z-index: 11;
}
.modal h2 { margin: 0 0 0.5rem; color: var(--neon); }
.modal h3 { margin: 1rem 0 0.5rem; font-size: 0.95rem; color: var(--text-dim); }
.modal section { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.modal section:last-of-type { border-bottom: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

#ban-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
#ban-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0.6rem;
  background: var(--bg-3); border-radius: 6px;
  font-family: monospace; font-size: 0.85rem;
}
#ban-list .ban-meta { color: var(--text-dim); font-size: 0.75rem; }

/* ── Lightbox ──────────────────────────────────────────────────────────────── */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 20; cursor: zoom-out;
}
.lightbox img { max-width: 95vw; max-height: 95vh; border-radius: 4px; }

/* ── Voice rooms ───────────────────────────────────────────────────────────── */

.voice-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 1rem 0.6rem;
  margin-bottom: 1.25rem;
}
.voice-section[open] { padding-bottom: 1rem; }
.voice-section summary {
  cursor: pointer;
  padding: 0.5rem 0;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  list-style: none;
}
.voice-section summary::-webkit-details-marker { display: none; }
.voice-section summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.4rem;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}
.voice-section[open] summary::before { transform: rotate(90deg); }
.voice-sum-status { color: var(--text-dim); font-weight: 400; font-size: 0.85rem; }
.voice-idle {
  display: flex; align-items: center; gap: 0.8rem;
  margin-top: 0.5rem; flex-wrap: wrap;
}
.voice-hint { margin: 0; flex: 1; min-width: 200px; }
.voice-active {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; margin-top: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-3);
  border-radius: 6px;
}
.voice-status { margin: 0; font-size: 0.9rem; color: var(--neon); }
#voice-remote { display: none; } /* audio-only, no visible element */
