/* ==========================================================================
   Midnight Desi — interface styles
   One accent (rose), warm-black neutrals, pill controls, 12–20px media radii.
   ========================================================================== */

@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0a0c;
  --ink-1: #111013;
  --ink-2: #17151a;
  --ink-3: #211d23;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4eff1;
  --muted: #a49aa1;
  --faint: #776d74;
  --accent: #e25b73;
  --accent-ink: #1c0a0e;
  --accent-dim: rgba(226, 91, 115, 0.14);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --top: 56px;
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 460px at 50% -8%, rgba(226, 91, 115, 0.075), transparent 62%),
    var(--ink);
  color: var(--text);
  font-family: "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  padding-bottom: calc(28px + var(--safe));
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; -webkit-user-drag: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s, opacity 0.18s;
}
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary { background: var(--text); color: var(--ink); }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn-small { height: 36px; padding: 0 14px; font-size: 13px; }
.btn .icon { width: 15px; height: 15px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small .icon { width: 17px; height: 17px; }

.text-link {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s;
}
.text-link:hover { color: var(--text); }

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--top);
  padding: 0 8px 0 16px;
  background: rgba(11, 10, 12, 0.86);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  transition: border-color 0.25s;
}
body.is-scrolled .topbar { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-word { display: inline-flex; align-items: baseline; gap: 4px; }
.brand-word em { font-style: normal; font-weight: 300; color: var(--muted); }
.brand .dot { transform: translateY(-7px); }

.top-actions { display: flex; align-items: center; gap: 2px; }

.admin-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(226, 91, 115, 0.4);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* search */
.search-panel {
  position: fixed;
  top: var(--top);
  left: 0;
  right: 0;
  z-index: 39;
  padding: 10px 16px 14px;
  background: rgba(11, 10, 12, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s var(--ease), opacity 0.2s, visibility 0.25s;
}
.search-panel.open { transform: none; opacity: 1; visibility: visible; }

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 4px 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--ink-2);
  max-width: 720px;
  margin: 0 auto;
}
.search-field .icon { width: 18px; height: 18px; color: var(--faint); }
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 16px;
  outline: 0;
}
.search-field input::placeholder { color: var(--faint); }
.search-field input::-webkit-search-cancel-button { display: none; }

/* tabs */
.tabs {
  position: sticky;
  top: var(--top);
  z-index: 38;
  display: flex;
  gap: 22px;
  height: 45px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(11, 10, 12, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: none;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: color 0.18s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); font-weight: 600; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.tab-dot {
  position: absolute;
  top: 12px;
  right: -7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------------- page */

.page { max-width: 1280px; margin: 0 auto; }

/* ------------------------------------------------------------------- hero */

.hero {
  position: relative;
  margin: 10px 16px 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 66dvh;
  background: var(--ink-2);
  isolation: isolate;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}
.hero-slide.is-active img { animation: drift 13s ease-out forwards; }
@keyframes drift {
  from { transform: scale(1.02); }
  to { transform: scale(1.11); }
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 10, 12, 0.18) 0%, rgba(11, 10, 12, 0) 34%, rgba(11, 10, 12, 0.58) 66%, rgba(11, 10, 12, 0.94) 100%),
    linear-gradient(90deg, rgba(11, 10, 12, 0.55) 0%, rgba(11, 10, 12, 0) 62%);
}
.hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 18px;
  max-width: 620px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-title {
  margin: 10px 0 0;
  font-size: clamp(23px, 6.2vw, 40px);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}
.hero-meta {
  margin: 8px 0 0;
  color: #cdc3c8;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.hero-actions .btn { height: 40px; }

.hero-bars {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  gap: 4px;
}
.hero-bar {
  width: 16px;
  height: 2px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}
.hero-bar.is-active { width: 26px; background: var(--text); }

/* ------------------------------------------------------------------ rails */

.rail { margin-top: 28px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 10px;
}
.section-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.section-count {
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rail-track {
  display: flex;
  gap: 10px;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail-track::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------- cards */

.card {
  flex: none;
  width: 63vw;
  max-width: 252px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
  scroll-snap-align: start;
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}
.grid .card { width: auto; max-width: none; }

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink-2);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease), opacity 0.3s;
}
.card:hover .thumb img { transform: scale(1.035); }
.card:active .thumb img { opacity: 0.85; }

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 38%, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.badge {
  position: absolute;
  z-index: 2;
  top: 7px;
  left: 7px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.rank {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 7px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.66);
  color: #f0e7ea;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}
.thumb-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(11, 10, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.22s, transform 0.22s var(--ease);
}
.thumb-play .icon { width: 16px; height: 16px; margin-left: 2px; }
.card:hover .thumb-play { opacity: 1; transform: none; }

.card-body { display: block; padding: 9px 1px 0; }
.card-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------- grid */

.library { margin-top: 32px; }
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px 12px;
  padding: 2px 16px;
}
.grid .thumb { border-radius: var(--r-md); }

#sentinel { height: 2px; }

.empty { padding: 64px 24px 72px; text-align: center; }
.empty-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.empty-copy { margin: 6px auto 0; max-width: 34ch; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------------------ player */

.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: calc(40px + var(--safe));
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0.4s;
}
.player.open { transform: none; visibility: visible; }
.player-scroll { min-height: 100%; }

.stage {
  position: sticky;
  top: 0;
  z-index: 12;
  background: #000;
}
.video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 64dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}
.video-shell.vertical {
  width: min(100%, calc(min(62dvh, 620px) * 9 / 16));
  height: min(62dvh, 620px);
  aspect-ratio: 9 / 16;
  max-height: none;
}
.video-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}
.video-shell.faux-full {
  position: fixed;
  inset: 0;
  z-index: 140;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  aspect-ratio: auto;
}
.video-shell.faux-full.rotated {
  top: 0;
  left: 100%;
  width: 100dvh;
  height: 100dvw;
  transform: rotate(90deg);
  transform-origin: 0 0;
}

.stage-ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 26%, transparent 58%, rgba(0, 0, 0, 0.82));
  transition: opacity 0.25s;
}
.video-shell.idle .stage-ui { opacity: 0; }
.video-shell.idle .stage-ui button { pointer-events: none; }
.video-shell.vertical .stage-ui { padding: 8px 10px 10px; }

.stage-top { display: flex; align-items: center; gap: 10px; }
.stage-tag {
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.stage-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.18s, transform 0.18s;
}
.stage-btn:hover { background: rgba(0, 0, 0, 0.6); }
.stage-btn:active { transform: scale(0.94); }
.stage-btn.small { width: 32px; height: 32px; background: transparent; }
.stage-btn.small .icon { width: 18px; height: 18px; }
.stage-btn .icon { width: 20px; height: 20px; }

.stage-middle {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  pointer-events: none;
}
.stage-middle button { pointer-events: auto; }

.stage-play {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #14100f;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s var(--ease), background 0.18s;
}
.stage-play:hover { transform: scale(1.04); }
.stage-play:active { transform: scale(0.96); }
.stage-play .icon { width: 24px; height: 24px; margin-left: 2px; }
.stage-play.playing .icon { margin-left: 0; }

.stage-skip {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.stage-skip span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stage-skip .skip-icon { width: 22px; height: 22px; opacity: 0.55; }
.stage-skip .skip-icon.flip { transform: scaleX(-1); }

.stage-bottom { position: relative; }
.seek { position: relative; height: 22px; display: flex; align-items: center; }
.seek-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}
.seek-buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.34);
}
.seek-played {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
}
.seek-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(226, 91, 115, 0.18);
  pointer-events: none;
  transition: transform 0.12s;
}
.seek input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seek input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; }

.stage-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.9);
}
.time { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.time.dim { color: rgba(255, 255, 255, 0.42); }
.grow { flex: 1; }
.stage-text {
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.stage-text:hover { background: rgba(255, 255, 255, 0.1); }

.tap-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.tap-flash.show { opacity: 1; }

.stage-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.spinner {
  display: block;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: rgba(11, 10, 12, 0.9);
}
.stage-error p { margin: 0; max-width: 30ch; color: var(--muted); font-size: 13px; }

/* player info */
.player-info {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 16px 0;
}
.player-title {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.player-meta {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.player-actions { display: flex; gap: 8px; margin-top: 14px; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.action-btn .icon { width: 18px; height: 18px; }
.action-btn:hover { background: rgba(255, 255, 255, 0.06); }
.action-btn.is-on { border-color: rgba(226, 91, 115, 0.5); background: var(--accent-dim); color: var(--accent); }

.channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.channel-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(226, 91, 115, 0.35);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.channel-row strong { display: block; font-size: 13.5px; font-weight: 600; }
.channel-row small { display: block; margin-top: 1px; color: var(--faint); font-size: 11.5px; }

/* comments */
.comments { max-width: 900px; margin: 22px auto 0; }
.comments .section-head { padding: 0 16px; }
.comment-form {
  display: flex;
  gap: 8px;
  padding: 0 16px;
}
.comment-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-2);
  color: var(--text);
  font-size: 16px;
  outline: 0;
  transition: border-color 0.18s;
}
.comment-form input:focus { border-color: rgba(226, 91, 115, 0.55); }
.comment-form input::placeholder { color: var(--faint); }
.form-note {
  margin: 8px 0 0;
  padding: 0 16px;
  min-height: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.panel .form-note, .screen .form-note { padding: 0; }
.form-note.error { color: #ff8fa0; }

.comment-list { padding: 6px 16px 0; }
.comment {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.comment:last-child { border-bottom: 0; }
.comment-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.comment-body { min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 7px; }
.comment-name { font-size: 12.5px; font-weight: 600; }
.comment-time { color: var(--faint); font-size: 11px; }
.comment-text {
  margin: 2px 0 0;
  color: #d8cfd3;
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}
.comment-empty { padding: 18px 0 24px; color: var(--faint); font-size: 13px; }

/* related */
.related { margin-top: 28px; }
.related .rail-track { padding-bottom: 12px; }

/* ------------------------------------------------------------------ admin */

.admin {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--ink);
  overflow-y: auto;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0.4s;
}
.admin.open { transform: none; visibility: visible; }

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--top);
  padding: 0 8px 0 6px;
  background: rgba(11, 10, 12, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.admin-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.admin-badge {
  margin-left: auto;
  margin-right: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(226, 91, 115, 0.35);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px calc(60px + var(--safe));
}
.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--ink-1);
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.015em; }
.card-head p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.card-head p span { color: var(--text); font-variant-numeric: tabular-nums; }

.form-grid { display: block; margin-top: 14px; }
.field { display: block; margin-bottom: 13px; }
.field-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: #ddd3d7; }
.field-help { display: block; margin-top: 5px; color: var(--faint); font-size: 11.5px; }

.field input:not([type="file"]),
.field select,
.field textarea,
.admin-body > .panel > input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--ink-2);
  color: var(--text);
  font-size: 16px;
  outline: 0;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.field textarea { height: auto; min-height: 96px; padding: 11px 12px; line-height: 1.5; resize: vertical; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(226, 91, 115, 0.55); box-shadow: 0 0 0 3px var(--accent-dim); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }

.drop {
  position: relative;
  display: grid;
  place-items: center;
  height: 148px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--ink-2);
  color: var(--muted);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.drop:hover { border-color: rgba(255, 255, 255, 0.3); background: var(--ink-3); }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; padding: 12px; }
.drop-inner .icon { width: 22px; height: 22px; color: var(--faint); }
.drop-inner strong { font-size: 12.5px; font-weight: 600; color: #ddd3d7; }
.drop-inner small { font-size: 11.5px; color: var(--faint); }
.drop-compact { height: 72px; }
.drop-compact .drop-inner { flex-direction: row; gap: 9px; }

.crop {
  position: relative;
  height: 168px;
  margin-top: 10px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  touch-action: none;
  cursor: ns-resize;
}
.crop img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.crop-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px;
  background: rgba(0, 0, 0, 0.62);
  color: #cfc5c9;
  font-size: 10.5px;
  text-align: center;
  pointer-events: none;
}

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.admin-list { margin-top: 12px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.admin-row:first-child { border-top: 0; }
.admin-row img { width: 72px; height: 42px; object-fit: cover; border-radius: 8px; flex: none; background: var(--ink-3); }
.admin-row .row-text { flex: 1; min-width: 0; }
.admin-row .row-title {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-row .row-sub { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.admin-row .row-actions { display: flex; gap: 2px; flex: none; }
.row-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.row-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.row-btn.danger:hover { background: rgba(226, 91, 115, 0.12); color: var(--accent); }
.row-btn .icon { width: 17px; height: 17px; }
.list-empty { padding: 14px 0; color: var(--faint); font-size: 12.5px; }

.progress { height: 4px; margin-top: 12px; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.progress > div { width: 0; height: 100%; background: var(--accent); transition: width 0.3s; }

/* ----------------------------------------------------------------- screens */

.screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 26px;
  background:
    radial-gradient(700px 400px at 50% 0%, rgba(226, 91, 115, 0.14), transparent 62%),
    var(--ink);
  overflow-y: auto;
}
.screen-inner { width: 100%; max-width: 380px; }
.screen-title {
  margin: 12px 0 0;
  font-size: clamp(28px, 8vw, 34px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.screen-copy { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.screen .btn { width: 100%; margin-top: 10px; }
.screen .btn:first-of-type { margin-top: 22px; }
.screen-fine { margin: 16px 0 0; color: var(--faint); font-size: 11.5px; line-height: 1.5; }

.steps { list-style: none; margin: 20px 0 6px; padding: 0; border-top: 1px solid var(--line); }
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: #ddd3d7;
  font-size: 13.5px;
}
.steps span { color: var(--accent); font-size: 10.5px; font-weight: 650; letter-spacing: 0.1em; }

/* --------------------------------------------------------------------- ads */

.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 10, 12, 0.96);
  backdrop-filter: blur(10px);
}
.ad-card {
  width: 100%;
  max-width: 320px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--ink-1);
  text-align: center;
}
.ad-label {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ad-spinner { display: block; margin: 18px auto 12px; }
.ad-copy { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ad-skip {
  min-width: 128px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}
.ad-skip:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); }
.ad-skip:disabled { opacity: 0.5; cursor: default; }

.ad-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(50px + var(--safe));
  padding-bottom: var(--safe);
  background: rgba(11, 10, 12, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.ad-frame { width: 320px; height: 50px; overflow: hidden; }
.ad-frame iframe { width: 320px; height: 50px; border: 0; display: block; }
.ad-close {
  position: absolute;
  right: 6px;
  top: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
}
.ad-close:hover { color: var(--text); }
.ad-close .icon { width: 14px; height: 14px; }

body.has-ad { padding-bottom: calc(92px + var(--safe)); }
.no-scroll .ad-banner { display: none; }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe));
  z-index: 300;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(28, 25, 30, 0.96);
  color: var(--text);
  font-size: 12.5px;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s var(--ease), opacity 0.25s;
  backdrop-filter: blur(10px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* -------------------------------------------------------------- responsive */

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card { width: 40vw; }
  .grid .card { width: auto; }
  .hero { aspect-ratio: 16 / 10; }
}

@media (min-width: 760px) {
  .hero { margin: 14px 20px 0; aspect-ratio: 16 / 8.4; }
  .hero-copy { padding: 26px; }
  .hero-actions .btn { height: 44px; }
  .section-head, .rail-track, .grid { padding-left: 20px; padding-right: 20px; }
  .rail-track { gap: 14px; }
  .card { width: 236px; }
  .grid { gap: 24px 16px; }
  .player-info, .comments { padding-left: 20px; padding-right: 20px; }
  .comment-form { padding: 0 20px; }
  .form-note { padding: 0 20px; }
  .comment-list { padding: 6px 20px 0; }
}

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .hero { aspect-ratio: 16 / 7.2; max-height: 480px; }
  .hero-title { font-size: clamp(30px, 3.6vw, 42px); }
  .player-title { font-size: 22px; }
  .video-shell { border-radius: 0; }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .hero { margin: 18px 20px 0; }
  .card { width: 250px; }
}

@media (hover: none) {
  .thumb-play { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-slide.is-active img { animation: none; transform: scale(1.02); }
  .player, .admin { transition: none; }
}
