:root {
  color-scheme: dark;
  --bg: #080608;
  --bg-deep: #12070d;
  --surface: rgba(25, 18, 23, 0.78);
  --surface-solid: #191217;
  --surface-strong: rgba(49, 34, 42, 0.88);
  --surface-hot: rgba(115, 24, 39, 0.36);
  --ink: #fff7f0;
  --muted: #c7ada0;
  --line: rgba(242, 198, 151, 0.18);
  --line-strong: rgba(242, 198, 151, 0.34);
  --accent: #d7a06a;
  --accent-strong: #f2c697;
  --accent-soft: rgba(215, 160, 106, 0.17);
  --teal: #64d0bd;
  --gold: #f2c697;
  --violet: #8f5bff;
  --danger: #ff4d4d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.44);
  --glow: 0 0 28px rgba(215, 160, 106, 0.2), 0 0 46px rgba(100, 208, 189, 0.08);
  --scroll-lift: 0px;
  --scroll-tilt: 0deg;
  --pointer-x: 50%;
  --pointer-y: 22%;
  --hero-image: none;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(215, 160, 106, 0.18), transparent 26vw),
    linear-gradient(135deg, rgba(125, 26, 42, 0.16), transparent 28%),
    linear-gradient(225deg, rgba(100, 208, 189, 0.08), transparent 34%),
    linear-gradient(180deg, #070505 0%, #160b0b 44%, #070708 100%);
  color: var(--ink);
}

body.player-open .scene-canvas,
body.player-open .scene-ribbons,
body.player-open .heat-haze,
body.player-open .scene-depth {
  visibility: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 78%);
  transform: translateY(calc(var(--scroll-lift) * -0.35));
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

h1,
h2,
h3,
p {
  margin: 0;
}

select,
input {
  color-scheme: dark;
}

.scene-canvas,
.scene-ribbons,
.heat-haze,
.scene-depth {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.scene-canvas {
  z-index: 0;
  opacity: 0.78;
  filter: saturate(1.05) contrast(1.03);
}

.scene-ribbons {
  z-index: 0;
  overflow: hidden;
  perspective: 900px;
  transform-style: preserve-3d;
  opacity: 0.74;
}

.heat-haze {
  z-index: 0;
  overflow: hidden;
  opacity: 0.52;
  mix-blend-mode: screen;
}

.heat-haze span {
  position: absolute;
  left: calc(8vw + var(--i) * 11vw);
  bottom: -18vh;
  width: 1px;
  height: 64vh;
  background: linear-gradient(180deg, transparent, rgba(242, 198, 151, 0.22), transparent);
  filter: blur(1px);
  transform: translateY(calc(var(--scroll-lift) * -0.42)) rotate(calc(-8deg + var(--i) * 2.5deg));
  animation: heat-rise 8s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.8s);
}

@keyframes heat-rise {
  from {
    opacity: 0.12;
    translate: 0 4vh;
  }

  to {
    opacity: 0.52;
    translate: 1.8vw -10vh;
  }
}

.scene-ribbons span {
  position: absolute;
  left: -18vw;
  top: calc(8vh + var(--i) * 14vh);
  display: block;
  width: 136vw;
  height: 13vh;
  border: 1px solid rgba(255, 224, 204, 0.08);
  background:
    linear-gradient(90deg, transparent, rgba(125, 26, 42, 0.2), rgba(242, 198, 151, 0.14), rgba(100, 208, 189, 0.1), transparent),
    repeating-linear-gradient(90deg, transparent 0 52px, rgba(255, 255, 255, 0.08) 52px 53px, transparent 53px 104px);
  box-shadow: 0 0 34px rgba(255, 48, 93, 0.16), inset 0 0 32px rgba(60, 230, 208, 0.06);
  transform: translate3d(0, calc(var(--scroll-lift) * -0.28), calc(var(--i) * -22px)) rotateX(64deg) rotateZ(calc(-10deg + var(--i) * 3deg));
  animation: ribbon-drift 12s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -1.35s);
}

.scene-ribbons span:nth-child(even) {
  background:
    linear-gradient(90deg, transparent, rgba(100, 208, 189, 0.1), rgba(143, 91, 255, 0.09), rgba(215, 160, 106, 0.16), transparent),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(255, 255, 255, 0.07) 44px 45px, transparent 45px 88px);
  transform: translate3d(0, calc(var(--scroll-lift) * -0.22), calc(var(--i) * -24px)) rotateX(58deg) rotateZ(calc(8deg - var(--i) * 2deg));
}

@keyframes ribbon-drift {
  from {
    translate: -3vw 0;
  }

  to {
    translate: 3vw -2vh;
  }
}

.scene-canvas-fallback {
  background:
    linear-gradient(115deg, rgba(255, 48, 93, 0.22), transparent 32%),
    linear-gradient(245deg, rgba(60, 230, 208, 0.18), transparent 38%),
    repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 26px);
}

.scene-depth {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(8, 6, 8, 0.12), rgba(8, 6, 8, 0.9) 84%),
    linear-gradient(90deg, rgba(8, 6, 8, 0.76), transparent 34%, transparent 66%, rgba(8, 6, 8, 0.76));
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.72);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1510px, 100%);
  margin: 0 auto;
  padding: 26px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -8px 18px;
  padding: 14px 8px 18px;
  border-bottom: 1px solid rgba(242, 198, 151, 0.18);
  background: linear-gradient(180deg, rgba(7, 5, 5, 0.8), rgba(7, 5, 5, 0.36));
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 2.15rem;
  line-height: 1.05;
  text-shadow: 0 0 22px rgba(255, 48, 93, 0.36);
}

.age-badge {
  display: inline-grid;
  min-width: 48px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 191, 85, 0.46);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(255, 191, 85, 0.28), rgba(255, 48, 93, 0.2));
  color: #ffe6b6;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(255, 191, 85, 0.12);
}

.top-actions,
.view-toggle,
.player-buttons,
.player-actions,
.auth-tabs,
.load-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.profile-button,
.ghost-button,
.primary-button,
.tab-button,
.menu-button,
.star-button,
.favorite-chip,
.category-card,
.category-image-button,
.category-hide-button,
.tag-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.profile-button,
.ghost-button,
.primary-button,
.tab-button,
.menu-button,
.favorite-chip {
  gap: 8px;
  padding: 0 13px;
  white-space: nowrap;
}

.primary-button,
.icon-button.active,
.tab-button.active,
.menu-button.active,
.ghost-button.active,
.favorite-chip.active {
  border-color: rgba(255, 48, 93, 0.76);
  background: linear-gradient(135deg, rgba(255, 48, 93, 0.92), rgba(255, 107, 61, 0.78));
  color: #fff9f4;
  box-shadow: 0 0 22px rgba(255, 48, 93, 0.24);
}

.icon-button:hover,
.profile-button:hover,
.ghost-button:hover,
.primary-button:hover,
.tab-button:hover,
.menu-button:hover,
.favorite-chip:hover {
  border-color: rgba(60, 230, 208, 0.58);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 22px rgba(60, 230, 208, 0.08);
  transform: translateY(-1px);
}

.icon-button:focus-visible,
.profile-button:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
.tab-button:focus-visible,
.menu-button:focus-visible,
.favorite-chip:focus-visible,
.star-button:focus-visible,
.category-card:focus-visible,
.category-image-button:focus-visible,
.category-hide-button:focus-visible,
.tag-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.icon-button svg,
.profile-button svg,
.ghost-button svg,
.favorite-chip svg,
.menu-button svg,
.preview-toggle svg,
.category-image-button svg,
.category-hide-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.favorite-chip.active svg,
.ghost-button.active svg {
  fill: currentColor;
}

.main-menu {
  position: sticky;
  top: 86px;
  z-index: 8;
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 8, 8, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.menu-button {
  min-width: 128px;
  background: transparent;
}

.app-page {
  min-width: 0;
  transform: translateY(calc(var(--scroll-lift) * -0.04));
  transition: transform 100ms linear;
}

.access-gate {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(25, 18, 23, 0.82), rgba(65, 20, 34, 0.38));
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(18px);
}

.access-gate h2 {
  font-size: 1.35rem;
}

.access-gate p {
  max-width: 560px;
  color: var(--muted);
}

.cinema-hero {
  position: relative;
  min-height: clamp(520px, 64vh, 760px);
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(7, 5, 5, 0.96) 0%, rgba(7, 5, 5, 0.76) 36%, rgba(7, 5, 5, 0.25) 72%, rgba(7, 5, 5, 0.88) 100%),
    var(--hero-image);
  background-position: center;
  background-size: cover;
  box-shadow: 0 22px 78px rgba(0, 0, 0, 0.48), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  isolation: isolate;
  transform-style: preserve-3d;
}

.cinema-hero::before,
.cinema-hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.cinema-hero::before {
  background:
    radial-gradient(circle at 76% 26%, rgba(242, 198, 151, 0.24), transparent 22%),
    radial-gradient(circle at 18% 70%, rgba(125, 26, 42, 0.32), transparent 28%),
    linear-gradient(180deg, rgba(7, 5, 5, 0.08), rgba(7, 5, 5, 0.78));
  animation: hero-breathe 7s ease-in-out infinite alternate;
}

.cinema-hero::after {
  background:
    linear-gradient(rgba(242, 198, 151, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 198, 151, 0.035) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.6), transparent 76%);
  transform: translateY(calc(var(--scroll-lift) * -0.18));
}

.hero-visual {
  position: absolute;
  inset: 0 0 0 38%;
  z-index: -2;
  background-position: center;
  background-size: cover;
  filter: sepia(0.18) saturate(0.9) contrast(1.08);
  opacity: 0.72;
  transform: translate3d(calc(var(--scroll-lift) * -0.08), calc(var(--scroll-lift) * -0.22), -40px) scale(1.09);
  animation: poster-drift 12s ease-in-out infinite alternate;
}

.hero-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(7, 5, 5, 0.98), rgba(7, 5, 5, 0.32), rgba(7, 5, 5, 0.84));
}

.hero-copy {
  display: grid;
  max-width: min(680px, 70%);
  min-height: 380px;
  align-content: center;
  gap: 14px;
  padding: clamp(28px, 6vw, 76px);
}

.hero-kicker {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
}

.hero-copy h2 {
  max-width: 720px;
  color: #f6dfc7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 0.9;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.58), 0 0 30px rgba(215, 160, 106, 0.12);
}

.hero-copy p:not(.hero-kicker) {
  max-width: 560px;
  color: #e0c7b6;
  font-size: clamp(0.98rem, 1.4vw, 1.15rem);
  line-height: 1.55;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 10px;
}

.hero-stats span {
  display: grid;
  gap: 4px;
  min-width: 92px;
  padding-left: 14px;
  border-left: 1px solid rgba(242, 198, 151, 0.3);
}

.hero-stats strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 400;
}

.hero-stats em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.hero-posters {
  position: absolute;
  right: clamp(18px, 4vw, 64px);
  top: clamp(88px, 12vh, 160px);
  z-index: 2;
  display: grid;
  width: min(360px, 32vw);
  min-height: 340px;
  perspective: 1000px;
  pointer-events: none;
}

.hero-poster {
  position: absolute;
  width: clamp(120px, 13vw, 190px);
  aspect-ratio: 9 / 13;
  overflow: hidden;
  border: 1px solid rgba(242, 198, 151, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.74)),
    var(--poster-image);
  background-position: center;
  background-size: cover;
  color: #f8e0c4;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transform: translate3d(calc(var(--i) * -34px), calc(var(--i) * 34px), calc(var(--i) * -30px)) rotateY(calc(-18deg + var(--i) * 7deg)) rotateZ(calc(-4deg + var(--i) * 2deg));
  transform-style: preserve-3d;
  animation: poster-float 6.5s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.75s);
}

.hero-poster::after,
.hero-strip-item::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.12), transparent 54%);
  opacity: 0;
  transform: translateX(-55%);
  transition: opacity 180ms ease, transform 520ms ease;
}

.hero-poster:hover::after,
.hero-strip-item:hover::after {
  opacity: 1;
  transform: translateX(60%);
}

.hero-poster span,
.hero-poster em {
  position: absolute;
  right: 10px;
  left: 10px;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-poster span {
  bottom: 30px;
  font-size: 0.86rem;
}

.hero-poster em {
  bottom: 12px;
  color: var(--gold);
  font-size: 0.76rem;
  font-style: normal;
}

.hero-strip {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  bottom: clamp(16px, 3vw, 34px);
  left: clamp(16px, 3vw, 40px);
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.hero-strip-item {
  position: relative;
  display: grid;
  min-height: 104px;
  align-content: end;
  overflow: hidden;
  padding: 11px;
  border: 1px solid rgba(242, 198, 151, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.78)),
    var(--poster-image);
  background-position: center;
  background-size: cover;
  color: #f8e0c4;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  transform: translateY(0);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.hero-strip-item:hover {
  border-color: rgba(242, 198, 151, 0.58);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42), 0 0 24px rgba(215, 160, 106, 0.14);
  transform: translateY(-5px);
}

.hero-strip-item span,
.hero-strip-item em {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-strip-item span {
  font-size: 0.82rem;
}

.hero-strip-item em {
  color: var(--gold);
  font-size: 0.72rem;
  font-style: normal;
}

@keyframes hero-breathe {
  from {
    opacity: 0.78;
    transform: scale(1);
  }

  to {
    opacity: 1;
    transform: scale(1.025);
  }
}

@keyframes poster-drift {
  from {
    filter: sepia(0.18) saturate(0.9) contrast(1.08);
  }

  to {
    filter: sepia(0.32) saturate(1.06) contrast(1.12);
  }
}

@keyframes poster-float {
  from {
    translate: 0 -8px;
  }

  to {
    translate: 0 10px;
  }
}

.toolbar {
  position: sticky;
  top: 146px;
  z-index: 7;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, auto) minmax(150px, auto) minmax(160px, auto) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(16, 11, 10, 0.78), rgba(28, 18, 15, 0.64));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-box,
.select-box,
.meta-editor label,
.auth-form label {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.search-box {
  gap: 10px;
  padding: 0 14px;
}

.search-box svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-box input,
.meta-editor input,
.auth-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box input::placeholder,
.auth-form input::placeholder,
.meta-editor input::placeholder {
  color: rgba(255, 247, 240, 0.44);
}

.select-box {
  gap: 8px;
  padding: 0 10px 0 14px;
}

.select-box span,
.meta-editor span,
.auth-form span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.select-box select {
  width: 100%;
  min-width: 88px;
  height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.videos-workspace {
  grid-template-columns: 1fr;
}

.facets {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding-right: 2px;
}

.category-head,
.profile-head,
.library-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(25, 18, 23, 0.7), rgba(255, 48, 93, 0.08));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.category-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
}

.category-head h2,
.profile-head h2,
.library-head h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.category-head p,
.profile-head p,
.library-head p {
  margin-top: 5px;
  color: var(--muted);
}

.category-search {
  min-height: 46px;
}

.category-tabs,
.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.profile-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.profile-stat {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 18, 23, 0.76);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
}

.profile-stat strong {
  color: var(--gold);
  font-size: 1.4rem;
  line-height: 1;
}

.profile-stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

.profile-section {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 18, 23, 0.76);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-head h3 {
  font-size: 1rem;
}

.section-head p,
.muted-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.password-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.password-form span,
.switch-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.password-form input,
.admin-actions select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
}

.password-form input {
  padding: 0 12px;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.switch-row input {
  accent-color: var(--accent);
}

.admin-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-maintenance {
  align-items: flex-start;
}

.admin-tool-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.maintenance-output {
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.84rem;
}

.maintenance-output strong,
.maintenance-output span {
  display: block;
}

.maintenance-output ol {
  display: grid;
  gap: 4px;
  margin: 8px 0 0 18px;
}

.maintenance-output li {
  overflow-wrap: anywhere;
}

.maintenance-progress {
  height: 10px;
  overflow: hidden;
  margin: 8px 0;
  border: 1px solid rgba(242, 198, 151, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.maintenance-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  box-shadow: 0 0 18px rgba(255, 48, 93, 0.22);
  transition: width 240ms ease;
}

.maintenance-log {
  margin-top: 10px;
}

.maintenance-log strong {
  color: var(--ink);
}

.maintenance-log ol {
  margin-top: 6px;
}

.admin-tools strong,
.admin-tools span {
  display: block;
}

.admin-tools strong {
  color: var(--ink);
}

.admin-tools span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-users {
  display: grid;
  gap: 10px;
}

.admin-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-user.locked {
  opacity: 0.72;
}

.admin-user strong,
.admin-user span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-actions select {
  min-width: 100px;
  padding: 0 8px;
}

.ghost-button.danger {
  border-color: rgba(255, 77, 77, 0.5);
  color: #ffd0d0;
}

.ghost-button.danger:hover {
  border-color: var(--danger);
  background: rgba(255, 77, 77, 0.16);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  perspective: 1200px;
}

.category-card {
  --card-tilt-x: 0deg;
  --card-tilt-y: 0deg;
  display: grid;
  justify-content: stretch;
  overflow: hidden;
  padding: 0;
  background: rgba(25, 18, 23, 0.74);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
  text-align: left;
  transform-style: preserve-3d;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.category-card:hover {
  border-color: rgba(60, 230, 208, 0.52);
  box-shadow: var(--shadow), var(--glow);
  transform: translateY(-5px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y));
}

.category-media {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 48, 93, 0.32), rgba(60, 230, 208, 0.16)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 12px);
}

.category-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 38%, rgba(0, 0, 0, 0.56));
}

.category-media img,
.category-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-media img {
  object-position: center center;
  transition: transform 500ms ease, filter 500ms ease;
}

.category-card:hover .category-media img {
  filter: saturate(1.18) contrast(1.04);
  transform: scale(1.05);
}

.category-thumb-placeholder {
  display: grid;
  place-items: center;
  color: rgba(255, 247, 240, 0.72);
}

.category-thumb-placeholder svg {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.category-media span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(8, 6, 8, 0.72);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.category-image-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(8, 6, 8, 0.68);
  color: #ffffff;
}

.category-image-button:hover {
  border-color: var(--teal);
  background: rgba(60, 230, 208, 0.22);
}

.category-hide-button {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: rgba(242, 198, 151, 0.34);
  background: rgba(8, 6, 8, 0.68);
  color: #ffe2bb;
}

.category-hide-button:hover {
  border-color: var(--gold);
  background: rgba(242, 198, 151, 0.2);
}

.category-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
}

.category-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.facet-block {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 18, 23, 0.72);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.facet-block h2 {
  padding: 0 4px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.facet-list {
  display: grid;
  gap: 8px;
}

.facet-pill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.facet-pill:hover,
.facet-pill.active {
  background: var(--accent-soft);
  color: #ffdbe4;
}

.facet-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facet-pill strong {
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.library-area {
  min-width: 0;
}

.library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  perspective: 1300px;
}

.video-grid.list {
  grid-template-columns: 1fr;
}

.video-card {
  --card-tilt-x: 0deg;
  --card-tilt-y: 0deg;
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 18, 23, 0.78);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
  outline: none;
  transform: translateY(0) rotateX(0) rotateY(0);
  transform-style: preserve-3d;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
  backdrop-filter: blur(10px);
  animation: card-rise 520ms ease both;
  animation-delay: calc(var(--card-index) * 28ms);
}

.video-card::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.13), transparent 24%, transparent 72%, rgba(60, 230, 208, 0.08));
  opacity: 0;
  transition: opacity 180ms ease;
}

.video-card:hover,
.video-card:focus-visible {
  border-color: rgba(60, 230, 208, 0.5);
  box-shadow: var(--shadow), var(--glow);
  transform: translateY(-6px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y));
}

.video-card:hover::before,
.video-card:focus-visible::before {
  opacity: 1;
}

.video-grid.list .video-card {
  grid-template-columns: minmax(210px, 28%) minmax(0, 1fr);
}

.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 48, 93, 0.34), rgba(60, 230, 208, 0.16)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 12px);
}

.preview::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.0), rgba(8, 6, 8, 0.42));
}

.preview::before {
  position: absolute;
  inset: 0;
  z-index: 4;
  content: "";
  pointer-events: none;
  background: linear-gradient(112deg, transparent 0%, rgba(242, 198, 151, 0.16) 45%, transparent 58%);
  opacity: 0;
  transform: translateX(-70%);
  transition: opacity 180ms ease, transform 620ms ease;
}

.video-card:hover .preview::before,
.video-card:focus-visible .preview::before {
  opacity: 1;
  transform: translateX(60%);
}

.preview-poster,
.preview-video,
.preview-placeholder {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-poster {
  transition: transform 500ms ease, filter 500ms ease;
}

.fallback-poster {
  filter: saturate(1.18) contrast(1.08) brightness(0.94);
  transform: scale(1.02);
}

.video-card:hover .preview-poster {
  filter: saturate(1.22) contrast(1.05);
  transform: scale(1.04);
}

.video-card:hover .fallback-poster {
  filter: saturate(1.32) contrast(1.12) brightness(0.98);
  transform: scale(1.08) translateY(-1%);
}

.preview-video {
  z-index: 2;
  background: #000000;
  opacity: 0;
  transition: opacity 140ms ease;
}

.video-card.previewing .preview-video {
  opacity: 1;
}

.preview-placeholder {
  display: grid;
  place-items: center;
  color: rgba(255, 247, 240, 0.72);
}

.preview-placeholder svg {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.preview-toggle {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 5;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 6, 8, 0.68);
  color: #ffffff;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.preview-toggle:hover,
.video-card.previewing .preview-toggle {
  border-color: var(--teal);
  background: rgba(60, 230, 208, 0.24);
  transform: scale(1.04);
}

.play-mark {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(8, 6, 8, 0.58);
  color: #f9d6b0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 22px rgba(215, 160, 106, 0.18);
  backdrop-filter: blur(8px);
}

.play-mark svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.format-badge,
.support-badge,
.duration-badge {
  position: absolute;
  top: 10px;
  min-width: 44px;
  max-width: calc(100% - 70px);
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 6, 8, 0.7);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.format-badge {
  right: 10px;
  z-index: 4;
  color: var(--teal);
}

.duration-badge {
  right: 10px;
  top: auto;
  bottom: 12px;
  z-index: 4;
  color: var(--gold);
}

.support-badge {
  left: 56px;
  z-index: 4;
  background: rgba(255, 77, 77, 0.72);
}

.progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7d1a2a, var(--gold), var(--teal));
}

.video-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
}

.video-copy h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.video-copy p {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row,
.video-stats,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip,
.video-stats span {
  min-height: 0;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
}

.tag-chip {
  max-width: 100%;
}

.tag-chip:hover {
  border-color: rgba(60, 230, 208, 0.42);
  background: rgba(60, 230, 208, 0.12);
  color: #d9fffa;
  transform: translateY(-1px);
}

.card-actions {
  align-items: center;
  justify-content: space-between;
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 247, 240, 0.42);
  font-size: 1.25rem;
}

.star-button.active {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 191, 85, 0.46);
}

.rating-text {
  color: var(--muted);
  font-size: 0.78rem;
}

.load-row {
  justify-content: center;
  margin: 22px 0 4px;
}

.load-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-state {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 18, 23, 0.72);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(14px);
}

.empty-state p {
  max-width: 580px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.player-shell,
.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  overscroll-behavior: contain;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 3, 0.82);
  backdrop-filter: blur(8px);
}

.player-panel,
.auth-panel {
  position: relative;
  display: grid;
  width: min(1180px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(13, 9, 12, 0.94);
  color: #ffffff;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58), 0 0 50px rgba(255, 48, 93, 0.12);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.auth-panel {
  width: min(480px, 100%);
}

.player-header,
.player-footer,
.player-actions,
.meta-editor,
.auth-current,
.auth-form {
  padding: 14px;
}

.player-header,
.player-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.player-header p {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
}

.player-header h2 {
  max-width: 760px;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
  line-height: 1.25;
}

.player-panel .icon-button,
.auth-panel .icon-button,
.player-panel .ghost-button,
.auth-panel .tab-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.player-panel .ghost-button.active {
  border-color: rgba(255, 107, 61, 0.86);
  background: linear-gradient(135deg, rgba(255, 48, 93, 0.82), rgba(255, 107, 61, 0.76));
}

.player-panel video {
  width: 100%;
  max-height: min(62vh, 700px);
  background: #000000;
}

.player-gallery {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gallery-head strong,
.gallery-head span {
  display: block;
}

.gallery-head span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
}

.gallery-strip {
  display: grid;
  grid-auto-columns: minmax(110px, 150px);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
}

.gallery-item {
  position: relative;
  display: block;
  min-height: 72px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #090607;
  color: #ffffff;
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gallery-item span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 3px 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item:hover {
  border-color: var(--gold);
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.86);
}

.image-viewer .icon-button {
  position: absolute;
  top: 18px;
  right: 18px;
}

.image-viewer img {
  max-width: min(1100px, 92vw);
  max-height: 82vh;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58);
}

.image-viewer span {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.player-actions {
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-editor label,
.auth-form label {
  gap: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.meta-editor input,
.auth-form input {
  color: #ffffff;
}

.player-footer {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.88rem;
}

.auth-current,
.auth-form {
  display: grid;
  gap: 12px;
}

.auth-current p {
  color: rgba(255, 255, 255, 0.78);
}

.auth-note {
  min-height: 18px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
}

.auth-tabs {
  width: 100%;
}

.auth-tabs .tab-button {
  flex: 1 1 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 9, 12, 0.94);
  color: #ffffff;
  box-shadow: var(--shadow), var(--glow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) rotateX(4deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }

  .video-card:hover,
  .video-card:focus-visible,
  .category-card:hover {
    transform: translateY(-2px);
  }

  .scene-ribbons span {
    animation: none;
  }

  .heat-haze span,
  .cinema-hero::before,
  .hero-visual,
  .hero-poster {
    animation: none;
  }
}

@media (max-width: 1050px) {
  .cinema-hero {
    min-height: 620px;
  }

  .hero-copy {
    max-width: 78%;
  }

  .hero-posters {
    top: auto;
    right: 24px;
    bottom: 138px;
    width: 280px;
    min-height: 220px;
  }

  .hero-poster {
    width: 136px;
  }

  .hero-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 1fr 1fr 1fr;
    top: 142px;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .view-toggle {
    justify-self: stretch;
  }

  .view-toggle .icon-button {
    flex: 1 1 0;
  }
}

@media (max-width: 860px) {
  .shell {
    padding: 16px;
  }

  .cinema-hero {
    min-height: 680px;
  }

  .hero-visual {
    inset: 0;
    opacity: 0.58;
  }

  .hero-copy {
    max-width: none;
    min-height: 330px;
    padding: 28px;
  }

  .hero-posters {
    position: relative;
    right: auto;
    bottom: auto;
    top: auto;
    width: auto;
    min-height: 150px;
    margin: 0 22px 18px;
  }

  .hero-poster {
    width: min(34vw, 150px);
  }

  .hero-strip {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 22px 22px;
  }

  .topbar,
  .main-menu,
  .toolbar {
    position: relative;
    top: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .category-head {
    grid-template-columns: 1fr;
  }

  .profile-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .password-form {
    grid-template-columns: 1fr;
  }

  .admin-user {
    grid-template-columns: 1fr;
  }

  .admin-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .facets {
    position: static;
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .facet-block {
    min-width: 220px;
  }

  .video-grid.list .video-card {
    grid-template-columns: 1fr;
  }

  .meta-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cinema-hero {
    min-height: 760px;
  }

  .hero-copy {
    padding: 24px 20px 18px;
  }

  .hero-copy h2 {
    font-size: clamp(2.45rem, 16vw, 4rem);
  }

  .hero-stats {
    gap: 10px;
  }

  .hero-stats span {
    min-width: 76px;
    padding-left: 10px;
  }

  .hero-posters {
    min-height: 136px;
    margin-inline: 16px;
  }

  .hero-poster {
    width: 118px;
  }

  .hero-poster span {
    bottom: 28px;
    font-size: 0.76rem;
  }

  .hero-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-inline: 16px;
  }

  .hero-strip-item {
    min-height: 88px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .top-actions {
    align-items: stretch;
    justify-content: flex-end;
    margin-left: auto;
  }

  .age-badge {
    width: 42px;
    min-width: 42px;
    font-size: 0.84rem;
  }

  .main-menu,
  .category-tabs,
  .profile-tabs {
    overflow-x: auto;
  }

  .menu-button,
  .category-tabs .tab-button,
  .profile-tabs .tab-button {
    flex: 1 0 auto;
  }

  .profile-button span {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .select-box,
  .view-toggle,
  .library-head,
  .player-actions,
  .player-footer {
    width: 100%;
  }

  .library-head,
  .player-actions,
  .player-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-copy {
    padding: 10px;
  }

  .player-shell,
  .auth-shell {
    padding: 0;
  }

  .player-panel,
  .auth-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .player-panel video {
    max-height: 48vh;
  }
}
