:root {
  --bg: #0b0c10;
  --bg-elev: #14161c;
  --bg-soft: #1c2029;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f1ea;
  --muted: #a7a49c;
  --accent: #e8ff47;
  --accent-ink: #14160a;
  --danger: #ff6b6b;
  --ok: #7dffb3;
  --warn: #ffd166;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "Instrument Sans", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(232, 255, 71, 0.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(125, 255, 179, 0.06), transparent 45%),
    var(--bg);
  color: var(--text);
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 6vw;
  backdrop-filter: blur(16px);
  background: rgba(11, 12, 16, 0.72);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.search { flex: 1 1 280px; max-width: 520px; }
.search input {
  width: 100%;
  border: 2px solid var(--accent);
  background: #10131a;
  color: var(--text);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-size: 1rem;
  box-shadow: 0 0 0 4px rgba(232, 255, 71, 0.14);
}
.search input::placeholder { color: #d7d3c8; }
.search input:focus {
  outline: none;
  background: #161a22;
  box-shadow: 0 0 0 4px rgba(232, 255, 71, 0.32);
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.brand-logo {
  height: 116px;
  width: auto;
  display: block;
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a.is-active { color: var(--accent); }
.nav-check {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border: 0;
}
.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 3;
}
.nav-toggle-close { display: none; }

.page { width: min(1180px, 92vw); margin: 0 auto; padding: 48px 0 80px; }
.footer {
  border-top: 1px solid var(--line);
  padding: 24px 6vw 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.manual h2, .manual h1 { scroll-margin-top: 110px; }
.manual h2 { margin: 2rem 0 0.5rem; font-size: 1.35rem; }
.manual p, .manual li { color: var(--muted); line-height: 1.55; }
.manual strong, .manual h2 { color: var(--text); }
.manual-toc {
  margin: 1.5rem 0 2rem;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
}
.manual-toc h2 { margin: 0 0 8px; font-size: 1rem; }
.manual-toc ol { margin: 0; padding-left: 1.2rem; }
.manual-toc a { color: var(--accent); }

.hero { max-width: 760px; margin-bottom: 36px; }
.home-upload { margin: 18px 0 14px; }
.home-split { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent);
  margin: 0 0 12px;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; margin: 0 0 16px; }
h2 { margin: 0; }
.lede { color: var(--muted); font-size: 1.08rem; line-height: 1.55; max-width: 62ch; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(135deg, #1a1d26, #101217);
}
.badge, .duration {
  position: absolute;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
}
.badge { top: 10px; left: 10px; text-transform: capitalize; }
.badge-ready { color: var(--ok); }
.badge-processing { color: var(--warn); }
.badge-error { color: var(--danger); }
.duration { right: 10px; bottom: 10px; }
.card-body { padding: 14px 14px 16px; }
.card-body h3 { margin: 0 0 6px; font-size: 1rem; }
.meta { color: var(--muted); font-size: 0.88rem; margin: 0; }

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.narrow { max-width: 680px; }
.upload-form { display: grid; gap: 16px; margin-top: 28px; }
.dropzone {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  min-height: 180px;
  padding: 28px;
  border: 1.5px dashed rgba(232, 255, 71, 0.35);
  border-radius: var(--radius);
  background: rgba(232, 255, 71, 0.04);
  cursor: pointer;
}
.dropzone input { display: none; }
.dropzone.is-active { background: rgba(232, 255, 71, 0.1); }
.dropzone span { color: var(--muted); font-size: 0.9rem; }
.field { display: grid; gap: 8px; font-size: 0.92rem; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
.progress {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}
.form-hint { min-height: 1.3em; color: var(--muted); }

.watch { display: grid; gap: 22px; }
.player-shell {
  background: #000;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.player-shell { position: relative; }
.player-shell.wm-live .player-mark {
  position: absolute;
  right: 12px;
  bottom: 42px;
  width: min(16%, 104px);
  aspect-ratio: 1;
  background: url("/static/watermark.png") center / contain no-repeat;
  pointer-events: none;
  z-index: 4;
}
.player { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 32px;
  gap: 8px;
  background: linear-gradient(180deg, #151820, #0c0d11);
}
.player-placeholder.is-error { color: var(--danger); }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.watch-meta h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.desc { line-height: 1.6; color: #ddd8ce; max-width: 70ch; }
.alert {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffc9c9;
  padding: 12px 14px;
  border-radius: 12px;
}
.inline-form { display: inline; margin: 0; }
.quality-bar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  background: #0e1014;
  border-top: 1px solid var(--line);
}
.quality-bar select, .field select {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}
.edit-form {
  margin-top: 24px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.player-placeholder .progress { width: min(320px, 80%); margin-top: 8px; }
.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr);
  gap: 28px;
  align-items: start;
}
.watch-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.comments { margin-top: 28px; }
.comments h2, .related h2 { font-size: 1.1rem; margin-bottom: 12px; }
.comment-form { display: grid; gap: 10px; margin-bottom: 16px; }
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
}
.comment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.comment-list p { margin: 6px 0 0; }
.linkish {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.related-list { display: grid; gap: 14px; }
.notes { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.note {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  display: grid;
  gap: 4px;
}
.note.is-new { border-color: rgba(232, 255, 71, 0.35); }
.bell { position: relative; }
.dot {
  display: inline-grid;
  place-items: center;
  min-width: 1.3em;
  height: 1.3em;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 960px) {
  .watch-layout { grid-template-columns: 1fr; }
}

@media (min-width: 901px) {
  .topbar { flex-wrap: nowrap; }
  .nav {
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px 14px;
    min-width: 0;
  }
  .nav-mobile { display: none; }
  .nav .btn { padding: 8px 14px; }
}

@media (max-width: 900px) {
  .search { order: 3; flex: 1 0 100%; max-width: none; }
  .brand-logo { height: 92px; }
  .topbar { padding: 14px 18px; }
  .page { width: min(100% - 32px, 1180px); padding-top: 28px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    flex: 1 0 100%;
    width: 100%;
    gap: 0;
    order: 4;
    padding-top: 8px;
  }
  .nav-check:checked ~ .nav { display: flex; }
  .nav-check:checked ~ .nav-toggle .nav-toggle-open { display: none; }
  .nav-check:checked ~ .nav-toggle .nav-toggle-close { display: inline; }
  .nav a, .nav .btn, .nav .inline-form button {
    display: flex;
    width: 100%;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    justify-content: flex-start;
  }
  .nav .btn-primary, .nav .btn-ghost { border-radius: 999px; margin-top: 8px; justify-content: center; }
  .nav .inline-form { display: block; }
}

.teaser { max-width: 40rem; padding: 2rem 0 4rem; }
.teaser h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0.4rem 0 1rem; }
.teaser .lede { color: var(--muted); font-size: 1.05rem; }
.teaser .actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.5rem 0; }
.teaser-points { color: var(--muted); padding-left: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; color: var(--accent); margin: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }


.rich p { margin: 0 0 0.75em; }
.rich a { color: var(--accent); text-decoration: underline; }
.rich ul, .rich ol { margin: 0 0 0.75em; padding-left: 1.2em; }
.rich h2, .rich h3, .rich h4 { margin: 1em 0 0.4em; }


.html-preview-wrap { margin-top: 0.6rem; }
.html-preview {
  min-height: 4.5rem;
  padding: 0.8rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}


.stars { display: flex; align-items: center; gap: 0.15rem; }
.stars .star {
  background: none; border: 0; color: #5c5a54; font-size: 1.35rem; cursor: pointer; line-height: 1; padding: 0 1px;
}
.stars .star.is-on { color: var(--accent); }


.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-item { margin: 0; background: var(--bg-elev); border-radius: 12px; overflow: hidden; }
.photo-item img { width: 100%; height: 160px; object-fit: cover; }
.sortbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.sortbar a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.sortbar a.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
  position: relative;
  z-index: 5;
}
.admin-nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.admin-nav a.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
@media (max-width: 900px) {
  .admin-nav { flex-direction: column; }
  .admin-nav a { width: 100%; justify-content: flex-start; border-radius: 12px; }
}
.photo-item figcaption { padding: 6px 8px 8px; }


.models { margin: 0.35rem 0 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}
.tox-tinymce { border-radius: 12px !important; border-color: var(--line) !important; }


.report { margin: 1.2rem 0; }
.report summary { cursor: pointer; color: var(--muted); }

.btn-report {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  font-weight: 700;
}
.btn-report:hover { filter: brightness(1.08); }
.report-box {
  margin: 1.4rem 0 2rem;
  padding: 1.1rem 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.report-box h2 { margin: 0; font-size: 1.15rem; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 0.4rem; }
.report-box .lede { margin: 0 0 1rem; }
.report-ok {
  margin: 0.8rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: rgba(125, 255, 179, 0.12);
  color: var(--ok);
}
.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}
.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
}


table.stats { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; }
table.stats th, table.stats td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
table.stats th { color: var(--muted); font-weight: 600; }

