:root {
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --dim: #8b949e;
  --green: #3fb950;
  --red: #f85149;
  --blue: #58a6ff;
  --amber: #d29922;
  --purple: #bc8cff;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 760px;
  padding: 0 1rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.5;
}

h1 { font-size: 1.25rem; }
h1 .prompt { color: var(--green); }
.dim { color: var(--dim); font-weight: normal; }

a { color: var(--blue); }

input, textarea, select, button {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
}
input:focus, textarea:focus, select:focus { outline: 1px solid var(--blue); }

button { cursor: pointer; background: var(--panel); }
button:hover { border-color: var(--dim); }
button.ghost { background: none; border: none; color: var(--dim); padding: 0 0.25rem; }
button.ghost:hover { color: var(--text); text-decoration: underline; }
button.danger:hover { color: var(--red); }

/* topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.who { display: flex; align-items: center; gap: 0.5rem; color: var(--dim); }
.views { display: flex; gap: 0.15rem; margin-right: 0.75rem; }
.view-link {
	display: inline-block;
  background: none;
  border: none;
  color: var(--dim);
  font-size: 0.85rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}
.view-link:hover { color: var(--text); }
.view-link.active { color: var(--green); background: var(--panel); }
.admin-badge {
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0 0.45rem;
  margin-left: 0.3rem;
}
.banned-badge {
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0 0.45rem;
  margin-left: 0.3rem;
}

/* user moderation */
.admin-heading h2 { margin-bottom: 0.2rem; font-size: 1.05rem; }
.admin-heading p { margin-top: 0; color: var(--dim); font-size: 0.85rem; }
.user-table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; background: var(--panel); }
.user-table th,
.user-table td { padding: 0.65rem; border-bottom: 1px solid var(--border); text-align: left; }
.user-table th { color: var(--dim); font-size: 0.78rem; font-weight: normal; }
.user-table td { font-size: 0.85rem; }
.user-table td:last-child { text-align: right; }
.user-table td:last-child form { display: inline; }
.user-row.banned { opacity: 0.65; }

/* auth */
.auth { max-width: 360px; margin: 10vh auto 0; }
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1rem;
}
.auth-form h2 { margin: 0; font-size: 1.05rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.25rem; color: var(--dim); }
.auth-form .alt { color: var(--dim); font-size: 0.85rem; margin: 0; }
.error { color: var(--red); margin: 0; font-size: 0.9rem; }

/* new idea */
.new-idea {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}
.new-idea summary { cursor: pointer; color: var(--green); }
.new-idea form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.new-idea .row { display: flex; gap: 0.5rem; }
.new-idea .row input { flex: 1; }

/* controls */
.controls { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.controls input[type="search"] { flex: 1; }

/* idea cards */
.idea-card {
  display: flex;
  gap: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
}
.vote-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}
.vote-btn {
  border: none;
  background: none;
  color: var(--dim);
  padding: 0 0.4rem;
  font-size: 0.9rem;
}
.vote-btn:hover:not(.own) { color: var(--text); }
.vote-btn.own { opacity: 0.3; cursor: not-allowed; }
.vote-btn.active { color: var(--green); }
.vote-btn.active:last-of-type { color: var(--red); }
.score { font-weight: bold; color: var(--green); }
.score.neg { color: var(--red); }

.idea-body { flex: 1; min-width: 0; }
.idea-card.editing { border-color: var(--blue); }
.edit-form { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.edit-form .row { display: flex; gap: 0.5rem; }
.idea-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.idea-head h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.desc { margin: 0.35rem 0; color: var(--dim); white-space: pre-wrap; overflow-wrap: anywhere; }

.idea-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.tags { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tag {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--blue);
  font-size: 0.78rem;
  padding: 0.05rem 0.55rem;
}
.tag:hover { border-color: var(--blue); }
.meta { color: var(--dim); font-size: 0.78rem; white-space: nowrap; }

/* status badge/select */
.status {
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 0.1rem 0.5rem;
  background: var(--bg);
  text-align: center;
  text-align-last: center; /* centers the selected option inside the <select> */
}
.status-idea { color: var(--dim); border-color: var(--dim); }
.status-pre-production { color: var(--amber); border-color: var(--amber); }
.status-recording { color: var(--purple); border-color: var(--purple); }
.status-posted { color: var(--green); border-color: var(--green); }

.empty { color: var(--dim); text-align: center; padding: 2rem 0; }

/* posted videos (landing + /videos) */
.login-link { color: var(--green); border: 1px solid var(--border); }
.login-link:hover { border-color: var(--green); color: var(--green); }
.videos-heading { font-size: 1.05rem; margin: 0 0 0.75rem; }
.video-count { color: var(--dim); font-size: 0.85rem; margin: 0 0 1rem; }
.video-card {
  display: flex;
  gap: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
}
.video-thumb { flex: 0 0 200px; align-self: flex-start; }
.video-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.video-body { flex: 1; min-width: 0; }
.video-body h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.video-body h3 a { color: var(--text); text-decoration: none; }
.video-body h3 a:hover { color: var(--blue); }
.video-date { color: var(--dim); font-size: 0.78rem; margin: 0.15rem 0 0.35rem; }
.video-desc {
  margin: 0 0 0.35rem;
  color: var(--dim);
  font-size: 0.85rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-watch { margin: 0; font-size: 0.85rem; }
@media (max-width: 560px) {
  .video-card { flex-direction: column; }
  .video-thumb { flex: none; }
}

/* toasts */
#toasts {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: 90vw;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: toast 4s ease forwards;
}
.toast-error { border-color: var(--red); color: var(--red); }
.toast-success { border-color: var(--green); color: var(--green); }
@keyframes toast {
  0%   { opacity: 0; translate: 0 0.5rem; }
  8%   { opacity: 1; translate: 0 0; }
  85%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
