/* ---------------------------------------------------------------------------
   Tube UI design system.

   Metrics taken from the reference layout with CDP (tools/design-capture.mjs):
   a 1440px desktop renders 5 columns of 275px cards with an 8px gap, and a
   390px phone renders 2 columns of 183px cards, also 8px apart. Cards are a
   16:9 thumbnail with 4px top corners over a compact text panel; the header is
   a dark bar with a two-tone wordmark, a nav, and a pill search field.

   The stylesheet itself is written from scratch against those measurements —
   no third-party CSS, fonts, logos or images are used.
--------------------------------------------------------------------------- */

:root {
  --bg: #000;
  --panel: #18181b;
  --panel-2: #1f1f23;
  --panel-3: #27272a;
  --border: #27272a;
  --border-soft: #1e1e21;
  --text: #e4e4e7;          /* reference body colour (zinc-200) */
  --text-dim: #d4d4d8;      /* nav links and meta (zinc-300) */
  --text-strong: #fafafa;   /* wordmark, active chip, hover */
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --accent: #f5c518;
  --green: #0c9a41;
  --radius: 4px;
  --radius-lg: 8px;
  --gap: 8px;
  --pad: 8px;
  --header-h: 56px;
  --wrap: 1536px;   /* the reference caps its content container here */
}

/* The reference switches from phone to desktop chrome at exactly 1024px:
   below it a hamburger + a stacked search row, above it an inline nav. */
@media (min-width: 1024px) {
  :root { --pad: 12px; }
}

* { box-sizing: border-box; }

/* `hidden` must win over any display rule: the mobile drawer sets display:grid,
   which would otherwise beat the UA's [hidden] rule and leave the drawer open on
   every phone. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font: 400 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

/* Form controls do not inherit typography by default: without this the search
   field renders in the UA font (Arial) while the rest of the page does not. */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.main { padding-bottom: 32px; }

/* --------------------------------------------------------------- header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

/* The bar owns all padding (vertical rhythm + gutters); the row inside it is a
   bare flex line, which is how the reference is structured and measured. */
.site-header__bar { padding-top: 15px; padding-bottom: 15px; }
@media (max-width: 1023px) {
  .site-header__bar { padding-top: 12px; padding-bottom: 12px; }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f4f4f5;
  line-height: 1;
  white-space: nowrap;
}
.brand__a { color: var(--accent); }
.brand__b { color: #f4f4f5; }
.brand:hover { opacity: 0.9; }

.nav {
  display: none;              /* mobile uses the drawer instead */
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 0;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.nav__link:hover { background: var(--panel-3); color: var(--text-strong); }

.caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}

.nav__group { position: relative; }

.nav__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  display: none;
}
.nav__group[data-open="true"] .nav__menu,
.nav__group:hover .nav__menu { display: block; }
.nav__menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-dim);
}
.nav__menu a:hover { background: var(--panel-3); color: #fff; }

.search {
  display: none;              /* shown from tablet up */
  position: relative;
  flex: 1 1 auto;
  max-width: 404px;
  margin-left: auto;
  height: 38px;
  /* The rounded shell lives on the wrapper, as on the reference layout: the
     input itself is a square, transparent field inside it. */
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}
.search:focus-within { border-color: #52525c; }

.search__input {
  width: 100%;
  height: 36px;
  display: block;
  padding: 8px 40px 8px 12px;
  color: #f4f4f5;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 20px;
  outline: none;
  appearance: none;
}
.search__input::placeholder { color: var(--muted-2); }
.search__input::-webkit-search-cancel-button { display: none; }

.search__go {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #f4f4f5;
  background: none;
  border: 0;
  cursor: pointer;
}
.search__go:hover { color: #fff; background: var(--panel-2); }

.header-icons { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.iconbtn:hover { background: var(--panel-3); color: #fff; }

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
  position: relative;
}
.menu-toggle__bars::before { position: absolute; top: -6px; }
.menu-toggle__bars::after { position: absolute; top: 6px; }

.mobile-nav {
  display: grid;
  gap: 2px;
  padding: 6px var(--pad) 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.mobile-nav a {
  padding: 12px 10px;
  border-radius: 6px;
  font-size: 15px;
  color: var(--text-dim);
}
.mobile-nav a:hover { background: var(--panel-3); }

@media (min-width: 1024px) {
  .menu-toggle, .mobile-nav { display: none !important; }
  .nav { display: flex; }
  .search { display: block; }
  .header-icons { margin-left: 0; }
}

/* Phones keep search, stacked under the brand row: that is how the reference
   behaves at 390px (36px row + 8px gap + 38px search row = 82px header). */
@media (max-width: 1023px) {
  .site-header__inner {
    flex-wrap: wrap;
    height: auto;
    row-gap: 8px;
  }
  .site-header__inner .search {
    display: block;
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }
  .site-header__inner .search__input,
  .search__input { padding-left: 8px; }
}

/* ------------------------------------------------------------- sections --- */

.section { margin-top: 20px; }
.section--tight { margin-top: 14px; }

.section__head {
  position: relative;
  margin-bottom: 10px;
}

/* The heading is a full-width block (as measured); the "more" link sits at the
   right of the same line without shrinking it. */
.section__more {
  position: absolute;
  right: 0;
  bottom: 4px;
}

.section__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  color: var(--text);
}

.section__count { color: var(--muted); font-weight: 400; font-size: 0.8em; }
.section__more { color: var(--muted); font-size: 13px; }
.section__more:hover { color: var(--text-strong); }

.pagehead { padding-top: 16px; }
.pagehead__title {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  height: 28px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
}
.filters__left { display: block; margin-bottom: -8px; }

.letter {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------------ pills --- */

/* Chips are inline-level children of a block row, not flex items: as flex items
   CSS blockifies them to `display: flex`, which is measurable and differs from
   the reference. Spacing therefore comes from margins, not `gap`. */
.pills, .tagcloud {
  display: block;
  margin-bottom: -8px;      /* absorb the last row's trailing margin */
}

.pill {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 8px 0;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13.5px;
  white-space: nowrap;
}
.pill:hover { border-color: #3f3f46; background: var(--panel-2); color: #fff; }
.pill--active { border-color: #52525c; background: var(--panel-3); color: var(--text-strong); }

/* Listing filters: 8px corners, filled, padding 8px — measured on the
   reference filter row, which differs from its own rounded category pills. */
.pill--filter {
  height: auto;
  padding: 8px;
  border-radius: 8px;
  border-color: #52525c;
  background: var(--panel-3);
  color: #f4f4f5;
  font-size: 12px;
  line-height: 16px;
}
.pill--small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.pill__count { color: var(--muted-2); font-size: 11.5px; }

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

.grid {
  display: grid;
  gap: var(--gap);
  padding: 4px 0 24px;
}
@media (max-width: 1023px) {
  /* The reference drops the grid's bottom padding below its desktop breakpoint. */
  .grid { padding-bottom: 0; }
}

/* Column counts measured off the reference across 13 viewport widths:
   2 (<430), 3 (>=430), 4 (>=640), 5 (>=820), 4 again at >=1024, 5 at >=1280,
   6 at >=1536. The 5 -> 4 step at 1024 is the reference's own large-screen
   breakpoint (bigger cards), not a mistake; it was verified twice. */
.grid--videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (min-width: 430px)  { .grid--videos, .grid--categories { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px)  { .grid--videos, .grid--categories { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 820px)  { .grid--videos, .grid--categories { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid--videos, .grid--categories { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid--videos, .grid--categories { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1536px) { .grid--videos, .grid--categories { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* -------------------------------------------------------------- vid card --- */

.card { min-width: 0; position: relative; }

.card__link { display: block; }

.card__media {
  position: relative;
  color: #f4f4f5;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
}

.card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.card__thumb--empty { background: linear-gradient(135deg, #1b1b1f, #0c0c0e); }
.card__link:hover .card__thumb { transform: scale(1.03); opacity: 0.92; }

.card__badges {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  color: #f4f4f5;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}
.badge--quality { background: rgba(12, 154, 65, 0.92); }
.badge--time { font-weight: 400; }
.badge--source {
  position: absolute;
  left: 6px;
  top: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.66);
  text-transform: uppercase;
}

.card__body { padding: 0 4px 2px; }

/* Single truncated line: the reference card is title-on-one-line, then meta. */
.card__title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 20px;
  color: #f4f4f5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  font-size: 10px;
  line-height: 12px;
  color: var(--text-dim);
}
.card__uploader {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__row { display: inline-flex; gap: 8px; white-space: nowrap; }
.card__views { color: var(--text-dim); }

@media (min-width: 1024px) {
  .card__title { font-size: 14px; }
}

/* Home-page card variant: the reference uses a compact card there — bold,
   single-line ellipsised title and no uploader/views row. */
.card--compact .card__title {
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.card--compact .card__body { padding-bottom: 0; }

/* ------------------------------------------------------------- cat card --- */

.catcard { display: block; min-width: 0; }

.catcard__media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
  /* The gradient is the backdrop while the cover loads, and the tile's whole
     look when a category has no clip with a thumbnail. */
  background:
    radial-gradient(120% 120% at 20% 10%, #2a2a30 0%, #141417 55%, #0a0a0c 100%);
  overflow: hidden;
  transition: filter 0.2s ease;
}
.catcard:hover .catcard__media { filter: brightness(1.25); }

/* The cover fills the tile; the count and a dark scrim keep it readable. */
.catcard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.catcard__img--empty { background: transparent; }

.catcard__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
  pointer-events: none;
}

/* Same swap feedback as the video grid. */
.catcard--rotated .catcard__img { animation: thumb-swap 0.32s ease; }

.catcard__name {
  display: block;
  padding: 6px 2px 2px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Count sits inside the artwork, bottom-left, as on the reference layout. */
.catcard__count {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* -------------------------------------------------------------- cat list --- */

.catlist {
  display: grid;
  gap: 4px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px)  { .catlist { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .catlist { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.catlist__item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  font-size: 13.5px;
  color: var(--text-dim);
}
.catlist__item span { color: var(--muted-2); font-size: 12px; }
.catlist__item:hover { background: var(--panel-2); border-color: var(--border); color: #fff; }

/* ----------------------------------------------------------------- watch --- */

/* Video page, measured off the reference at 1440:
   title (25/32, badges inline) then a wrapping chip row, then the player,
   then a 56px action row the same width as the player, then the related grid.
   The player chrome is ours: an 80px center play control, a title chip at the
   top, a full-width progress line, and a 40px bar (play, volume, time | fullscreen). */

.watch { padding-top: 8px; }

.watch__title {
  margin: 0 2px 12px;
  font-size: 25px;
  line-height: 32px;
  font-weight: 700;
  color: #fff;
}
@media (max-width: 639px) {
  .watch__title { font-size: 20px; line-height: 28px; }
}

.watch__mark {
  display: inline-block;
  margin: 5px 0 0 4px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
  vertical-align: top;
  white-space: nowrap;
}
.watch__mark--time { background: #888; color: #000; }
.watch__mark--hd { background: #404040; color: #fff; }

.watch__tags { margin: 0 2px 6px; }
.watch__chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  margin: 0 5px 5px 0;
  padding: 0 8px;
  border-radius: 3px;
  background: #3a3a3a;
  color: #fff;
  font-size: 13px;
  line-height: 26px;
  white-space: nowrap;
}
.watch__chip:hover { background: #4a4a4a; color: #fff; }
.watch__chip--uploader {
  background: #161616;
  border: 1px solid #4a4a4a;
  font-weight: 700;
}
.watch__chip--uploader:hover { background: #222; }

.watch__stage { min-width: 0; }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.player:fullscreen,
.player:-webkit-full-screen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  background: #000;
}
.player__video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  /* Fill the stage with the poster so the bars around a still are not black. */
  object-fit: cover;
}

.player__pending {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.player__pending strong { color: var(--text-dim); font-size: 15px; }
.player__pending a { color: var(--accent); }

.player__error {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  padding: 10px 12px;
  background: rgba(60, 12, 12, 0.92);
  color: #fecaca;
  font-size: 12.5px;
}

/* Custom chrome. The center control is 80px. The bar is the bottom 40px.
   The progress line sits on the top edge of that bar. */
.player__bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 80px;
  height: 80px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  transform: translate(-50%, -50%);
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}
.player__bigplay:hover { color: #fff; transform: translate(-50%, -50%) scale(1.04); }

.player__chrome {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.15s linear;
  user-select: none;
}
.player--playing:not(.player--active) .player__chrome {
  opacity: 0;
  pointer-events: none;
}
.player__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}
.player__title {
  position: absolute;
  top: 10px;
  left: 15px;
  max-width: min(70%, 640px);
  margin: 0;
  padding: 5px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  height: 14px;
  pointer-events: auto;
  cursor: pointer;
}
.player__progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.45);
}
.player__progress-played {
  height: 100%;
  width: 0;
  background: #de2600;
}
.player__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}
.player__cluster { display: flex; align-items: center; height: 40px; }
.player__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 8px 11px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}
.player__btn:hover { color: #fff; }
.player__volume {
  width: 60px;
  height: 24px;
  margin: 0 5px;
  accent-color: #fff;
  cursor: pointer;
}
.player__time {
  margin-left: 12px;
  padding: 0 11px;
  color: #fff;
  font-size: 12px;
  line-height: 24px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .player__volume { width: 40px; }
  .player__time { margin-left: 4px; padding: 0 6px; }
}

/* Preview gate. It sits on the player only. [hidden] wins over display:flex. */
.player--gated .player__video { pointer-events: none; }
.player--gated .player__chrome,
.player--gated .player__bigplay { display: none !important; }

.gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.82);
  overflow: auto;
}

.gate__dialog {
  width: min(380px, 100%);
  max-height: 100%;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.gate__kicker {
  margin: 0 0 4px;
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gate__title {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  color: var(--text-strong);
}

.gate__body {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 16px;
}

.gate__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.gate__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #3f3f46;
  background: var(--panel-3);
  color: #f4f4f5;
  text-align: center;
}
.gate__btn:hover { border-color: #52525c; background: #2f2f35; }
.gate__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.gate__btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #18181b;
}
.gate__btn--primary:hover { background: #ffd84a; border-color: #ffd84a; }

.gate__btn-title { font-size: 14px; font-weight: 700; line-height: 18px; }
.gate__btn-sub { font-size: 12px; line-height: 15px; opacity: 0.8; }

.watch__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 56px;
  padding: 10px 5px 10px 0;
  color: #fff;
}
.watch__actions-left { display: flex; align-items: center; min-height: 36px; }
.watch__views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px;
  font-size: 19px;
  line-height: 36px;
  font-weight: 700;
}
.watch__vote {
  margin-left: 10px;
  font-size: 12px;
  line-height: 36px;
  font-weight: 700;
}
.watch__tools { display: flex; align-items: center; margin-left: auto; }
.watch__tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin-left: 10px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 12px;
  line-height: 36px;
  font-weight: 700;
  cursor: pointer;
}
.watch__tool:hover { color: var(--accent); }

/* ---------------------------------------------------------------- misc --- */

.empty, .notice {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--muted);
  font-size: 13.5px;
}
.notice { border-color: #3f3a1a; background: #1c1a10; color: #f5d97a; }

/* --------------------------------------------------------------- feed --- */

.feed-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 0 12px;
}

.feed-more__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: var(--panel-3);
  color: #f4f4f5;
  font-size: 13.5px;
}
.feed-more__link:hover { border-color: #52525c; background: #2f2f35; }

.feed-more__status {
  min-height: 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.feed-more__status[data-kind="error"] { color: #fca5a5; }
.feed-more__status[data-kind="loading"] { color: var(--muted); }

.feed-end {
  padding: 30px 0 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-2);
}

/* A rotation swaps the still frame under the badge overlay; a short fade keeps
   it from looking like a broken image. */
.card--rotated .card__thumb { animation: thumb-swap 0.32s ease; }
@keyframes thumb-swap {
  from { opacity: 0.35; transform: scale(1.02); }
  to { opacity: 1; transform: none; }
}
.card--clicked { outline: 1px solid rgba(245, 197, 24, 0.35); outline-offset: -1px; }

/* Only freshly appended cards animate: the first page must paint instantly and
   must not shift while the layout is being measured. */
.card--new { animation: card-in 0.22s ease both; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card--new { animation: none; }
}

.site-footer {
  margin-top: 28px;
  padding: 18px 0 26px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 12.5px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer__sep { opacity: 0.5; }

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

/* ----------------------------------------------------------- moderation --- */

.mod-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.mod-search {
  display: flex;
  flex: 1 1 240px;
  gap: 8px;
  min-width: 0;
}
.mod-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 8px 12px;
  color: #f4f4f5;
  background: var(--bg);
  border: 1px solid #3f3f46;
  border-radius: 8px;
}
.mod-form {
  display: grid;
  gap: 10px;
  max-width: 640px;
  margin-bottom: 18px;
}
.mod-field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.mod-field input,
.mod-field textarea {
  width: 100%;
  padding: 8px 12px;
  color: #f4f4f5;
  background: var(--bg);
  border: 1px solid #3f3f46;
  border-radius: 8px;
  resize: vertical;
}
.mod-btn {
  height: 38px;
  padding: 0 14px;
  color: #111;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.mod-btn--quiet { color: var(--text); background: var(--panel-3); }
.mod-btn--danger { color: #fff; background: #9f1239; }
.mod-error { color: #fda4af; margin: 8px 0; }
.mod-ok { color: #86efac; }
.mod-results { margin: 0 0 16px; padding-left: 18px; }
.mod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mod-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel);
  border-radius: 8px;
}
.mod-row__main {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.mod-row__id { color: var(--muted-2); font-size: 12px; }
.mod-row__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mod-row__meta { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .mod-row { align-items: stretch; flex-direction: column; }
  .mod-row .mod-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
