: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; }
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;
}

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); }

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; }

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

#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; }

.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 { 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; }

#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; }

/* image 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;
}
