:root {
  --bg: #140b10;
  --panel: #21161c;
  --panel-2: #2b2026;
  --text: #fff7f2;
  --muted: #bdaeb6;
  --red: #ff2d55;
  --gold: #ffb000;
  --aqua: #00d1c1;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 45, 85, 0.2), transparent 30%),
    linear-gradient(135deg, #140b10 0%, #211016 48%, #071b1b 100%);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 64px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(20, 11, 16, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand, .nav-actions, .admin-toolbar, .login-callout, .video-heading, .video-actions { display: flex; align-items: center; gap: 12px; }
.brand { text-decoration: none; font-weight: 900; letter-spacing: 0; }
.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(255, 176, 0, 0.22);
}
.nav-actions form { margin: 0; }
.hero-band, .page-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 38px 0 28px;
  border-bottom: 1px solid var(--line);
}
.hero-band h1, .page-heading h1, .auth-panel h1, .empty-state h1 { margin: 0; font-size: clamp(2.1rem, 4vw, 4.6rem); line-height: 0.98; max-width: 820px; }
.hero-band p, .page-heading p { max-width: 660px; color: var(--muted); font-size: 1.08rem; }
.eyebrow { color: var(--aqua); text-transform: uppercase; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; margin: 0 0 10px; }
.pill-btn, .primary-btn, .icon-label-btn, .icon-btn, .text-btn {
  border: 0;
  color: var(--text);
  background: var(--red);
  min-height: 40px;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
}
.primary-btn { width: fit-content; padding: 0 20px; box-shadow: 0 16px 40px rgba(255, 45, 85, 0.25); }
.ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); }
.icon-btn { width: 40px; padding: 0; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); }
.icon-btn img, .icon-label-btn img { filter: invert(1); }
.icon-label-btn { background: var(--panel-2); border: 1px solid var(--line); }
.danger { color: #ffd7df; border-color: rgba(255, 45, 85, 0.45); background: rgba(255, 45, 85, 0.12); }
.danger-btn { background: var(--red); }
.compact { min-height: 34px; font-size: 0.9rem; }
.text-btn { min-height: 30px; background: transparent; color: var(--aqua); padding: 0; }
.login-callout {
  margin: 24px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 8px;
  flex-wrap: wrap;
}
input, select, textarea {
  width: 100%;
  color: var(--text);
  background: #120e12;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}
textarea { resize: vertical; }
.video-grid { display: grid; gap: 26px; }
.video-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.08fr);
  background: rgba(33, 22, 28, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: clip;
  box-shadow: var(--shadow);
}
.video-shell { aspect-ratio: 16 / 9; background: #050505; position: sticky; top: 77px; align-self: start; }
.video-shell iframe { width: 100%; height: 100%; border: 0; }
.video-content { padding: 22px; display: grid; gap: 18px; }
.video-heading { justify-content: space-between; align-items: start; }
.video-heading h2 { margin: 8px 0 2px; font-size: 1.35rem; line-height: 1.16; }
.video-actions { align-items: start; }
.video-actions form { margin: 0; }
.like-btn.active {
  background: var(--aqua);
  border-color: transparent;
  color: #081312;
}
.like-btn.active img { filter: none; }
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}
.stat-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stat-row img { width: 16px; height: 16px; filter: invert(1); opacity: 0.76; }
.vote-counts { color: #d9f8f4; }
.muted { color: var(--muted); }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; text-transform: uppercase; font-size: 0.7rem; font-weight: 900; background: rgba(255, 255, 255, 0.11); }
.badge.best { background: rgba(0, 209, 193, 0.18); color: #8cfff5; }
.badge.worst { background: rgba(255, 176, 0, 0.18); color: #ffd57c; }
.metadata { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: rgba(255, 255, 255, 0.05); }
.metadata summary { font-weight: 800; }
dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; color: var(--muted); }
dt { color: var(--text); text-transform: capitalize; }
dd { margin: 0; overflow-wrap: anywhere; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.note-column h3, .comments h3 { margin: 0 0 10px; font-size: 1rem; }
.note-item, .comment, .idea-row, .idea-form, .idea-side-panel {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.note-item p, .comment p { margin: 6px 0 0; color: var(--muted); }
.reply { border-left: 3px solid var(--aqua); padding-left: 10px; }
.comment-form { display: grid; gap: 10px; margin-bottom: 14px; }
.modal {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal.wide { width: min(980px, calc(100vw - 28px)); }
.modal::backdrop { background: rgba(0, 0, 0, 0.74); backdrop-filter: blur(6px); }
.modal-body { display: grid; gap: 14px; padding: 24px; position: relative; }
.modal-body label, .stack label { display: grid; gap: 7px; color: var(--muted); }
.modal-actions { display: flex; justify-content: end; gap: 10px; flex-wrap: wrap; }
.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.segmented-control label { display: block; color: var(--text); }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}
.segmented-control img { filter: invert(1); opacity: 0.82; }
.segmented-control input:checked + span {
  color: var(--text);
  background: var(--red);
  box-shadow: 0 12px 28px rgba(255, 45, 85, 0.2);
}
.source-panel[hidden] { display: none; }
.close { position: absolute; top: 14px; right: 14px; }
.metadata-full {
  max-height: 68vh;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: #0c090b;
  border: 1px solid var(--line);
  color: #d7fff8;
  white-space: pre-wrap;
}
.auth-shell, .empty-state { min-height: 70vh; display: grid; place-items: center; }
.compact-empty { min-height: 42vh; text-align: center; align-content: center; gap: 12px; }
.auth-panel {
  width: min(480px, 100%);
  background: rgba(33, 22, 28, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.stack { display: grid; gap: 14px; margin-top: 20px; }
.check-row { display: flex !important; align-items: center; gap: 10px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--red); }
.alert { padding: 10px 12px; border-radius: 8px; background: rgba(255, 176, 0, 0.12); color: #ffe0a3; }
.notice { padding: 10px 12px; border-radius: 8px; background: rgba(0, 209, 193, 0.12); color: #b7fff8; }
.form-section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.form-section h3 { margin: 0; font-size: 1rem; }
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #0d0b0d;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.cookie-banner p { margin: 4px 0 0; color: var(--muted); }
.cookie-banner form { display: flex; gap: 8px; }
.idea-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto auto;
  gap: 12px;
  align-items: end;
  padding: 18px 0 0;
}
.idea-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}
.idea-list { display: grid; gap: 12px; padding-top: 22px; }
.idea-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.idea-row:hover {
  border-color: rgba(0, 209, 193, 0.5);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}
.idea-row h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  line-height: 1.2;
}
.idea-row p {
  margin: 0 0 8px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.idea-keywords {
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.idea-thumb, .thumbnail-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #0c090b;
  border: 1px solid var(--line);
}
.idea-thumb { aspect-ratio: 16 / 9; }
.idea-thumb img, .thumbnail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.idea-thumb img + span, .thumbnail-preview img + span { display: none; }
.idea-thumb img, .thumbnail-preview img { display: block; }
.idea-thumb span img, .thumbnail-preview span img, .row-arrow img { filter: invert(1); opacity: 0.76; }
.row-arrow { display: grid; place-items: center; }
.idea-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  padding-top: 22px;
}
.idea-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-bottom: 0;
}
.idea-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}
.idea-form textarea { min-height: 120px; }
.idea-form textarea[name="script"] { min-height: 300px; }
.form-actions {
  display: flex;
  justify-content: flex-start;
}
.idea-side-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  margin-bottom: 0;
  position: sticky;
  top: 82px;
}
.thumbnail-preview {
  aspect-ratio: 16 / 9;
  min-height: 160px;
}
.thumbnail-preview > span img {
  width: 42px;
  height: 42px;
}
.path-value {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
}
.danger {
  width: 100%;
  background: rgba(255, 45, 85, 0.14);
  border-color: rgba(255, 45, 85, 0.45);
}

@media (max-width: 820px) {
  main { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .hero-band, .page-heading, .video-card, .idea-detail-layout { grid-template-columns: 1fr; }
  .admin-toolbar { justify-content: stretch; flex-wrap: wrap; }
  .video-shell { position: static; }
  .notes-grid, dl { grid-template-columns: 1fr; }
  .cookie-banner { display: grid; }
  .topbar { gap: 10px; }
  .nav-actions { gap: 8px; }
  .brand span { display: none; }
  .idea-filters { grid-template-columns: 1fr; }
  .idea-row { grid-template-columns: 96px minmax(0, 1fr); }
  .row-arrow { display: none; }
  .idea-side-panel { position: static; }
}
