:root {
  --bg: #08090b;
  --panel: #121318;
  --panel-soft: #1a1d24;
  --text: #f7f3ee;
  --muted: #a9a3a0;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff4b2f;
  --accent-2: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(260px, 420px) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(8, 9, 11, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  color: var(--muted);
  padding: 10px 12px;
  transition: color 180ms ease, background 180ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.search input {
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  padding: 12px 14px;
  outline: none;
}

.search button,
.primary,
.secondary,
.ghost,
.upload-trigger,
.view-toggle button,
.filter {
  border: 0;
  min-height: 44px;
  padding: 0 16px;
  color: var(--text);
  background: var(--panel-soft);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.search button,
.upload-trigger,
.primary {
  color: #170d09;
  background: var(--accent-2);
  font-weight: 800;
}

.upload-trigger {
  min-width: 78px;
}

.secondary,
.ghost {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
}

.ghost {
  border: 1px solid var(--line);
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.upload-trigger:hover,
.view-toggle button:hover {
  transform: translateY(-1px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

.section-head h2 {
  margin-bottom: 16px;
  font-size: 24px;
}

.feed {
  padding: 36px 32px 80px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
}

.view-toggle button {
  min-height: 38px;
  color: var(--muted);
  background: transparent;
}

.view-toggle button.active {
  color: #170d09;
  background: var(--accent-2);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.video-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.video-card {
  display: grid;
  grid-template-rows: auto minmax(72px, auto);
  gap: 12px;
  align-content: start;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
}

.thumb-button {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: inherit;
}

.thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 150px;
  height: clamp(150px, 13vw, 220px);
  background: var(--panel);
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: saturate(0.92) contrast(1.05);
  transition: transform 260ms ease, filter 260ms ease;
}

.video-card:hover img,
.thumb-button:focus-visible img {
  transform: scale(1.055);
  filter: saturate(1.15) contrast(1.12);
}

.duration,
.quality {
  position: absolute;
  bottom: 8px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.duration {
  right: 8px;
}

.quality {
  left: 8px;
  color: var(--accent-2);
}

.upload-progress {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
}

.upload-progress strong {
  position: relative;
  z-index: 1;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.72);
  font-size: 15px;
  line-height: 1;
}

.upload-progress i {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.upload-progress i::before {
  content: "";
  display: block;
  width: var(--upload-progress);
  height: 100%;
  background: var(--accent-2);
  transition: width 260ms ease;
}

.video-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(42px, auto) 18px;
  align-content: start;
  column-gap: 10px;
  min-height: 72px;
  padding-top: 0;
}

.video-meta h3 {
  grid-column: 1 / 2;
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  max-height: 46px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.video-meta p {
  grid-column: 1 / 2;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-button {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: start;
  min-height: 34px;
  border: 1px solid var(--line);
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 800;
}

.share-button:hover,
.share-button:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

.empty {
  display: none;
  color: var(--muted);
  padding: 32px 0;
}

.empty.show {
  display: block;
}

.age-gate,
.player,
.upload-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
}

.age-gate.hidden,
.player,
.upload-modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.player.open,
.upload-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.age-panel,
.player-shell,
.upload-shell {
  width: min(760px, 100%);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.age-panel {
  padding: 40px;
  border: 1px solid var(--line);
  animation: riseIn 500ms ease both;
}

.age-panel h1 {
  font-size: clamp(36px, 7vw, 68px);
}

.age-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.age-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  transform: translateY(18px) scale(0.98);
  transition: transform 220ms ease;
}

.player.open .player-shell,
.upload-modal.open .upload-shell {
  transform: translateY(0) scale(1);
}

.upload-shell {
  position: relative;
  display: grid;
  gap: 18px;
  max-height: min(900px, calc(100svh - 48px));
  overflow-y: auto;
  padding: 32px;
  border: 1px solid var(--line);
  transform: translateY(18px) scale(0.98);
  transition: transform 220ms ease;
}

.upload-shell h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 150px;
  padding: 24px;
  border: 1px dashed rgba(255, 209, 102, 0.45);
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease;
}

.dropzone:hover {
  border-color: var(--accent-2);
  background: rgba(255, 209, 102, 0.08);
}

.dropzone input {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dropzone span {
  font-size: 20px;
  font-weight: 900;
}

.dropzone small,
.classification small,
.cover-controls small,
.batch-item small {
  color: var(--muted);
  line-height: 1.5;
}

.batch-panel {
  display: none;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.batch-panel.has-items {
  display: grid;
}

.batch-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.batch-head strong {
  color: var(--accent-2);
}

.batch-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
}

.batch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  width: 100%;
  border: 1px solid transparent;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease;
}

.batch-item:hover,
.batch-item:focus-visible {
  border-color: rgba(255, 209, 102, 0.34);
  background: rgba(255, 209, 102, 0.06);
  outline: none;
}

.batch-item.active {
  border-color: var(--accent-2);
  background: rgba(255, 209, 102, 0.1);
}

.batch-item strong,
.batch-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
}

.cover-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 14px;
  align-items: stretch;
}

.cover-picker.is-empty {
  opacity: 0.72;
}

.cover-video-wrap,
.cover-preview {
  overflow: hidden;
  background: #050506;
}

.cover-video-wrap {
  grid-column: 1 / 2;
  aspect-ratio: 16 / 9;
}

.cover-video-wrap video,
.cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover-preview img:not([src]) {
  display: none;
}

.cover-controls {
  grid-column: 1 / 2;
  display: grid;
  gap: 8px;
}

.cover-controls label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cover-controls input {
  width: 100%;
  accent-color: var(--accent-2);
}

.cover-preview {
  position: relative;
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  min-height: 150px;
  border: 1px solid var(--line);
}

.cover-preview span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: var(--accent-2);
  background: rgba(0, 0, 0, 0.72);
  font-size: 12px;
  font-weight: 800;
}

#coverCanvas {
  display: none;
}

.upload-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.upload-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.upload-fields input {
  min-width: 0;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 13px 14px;
  outline: none;
}

.upload-fields input:focus {
  border-color: rgba(255, 209, 102, 0.62);
}

.classification {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.055);
  border-left: 3px solid var(--accent-2);
}

.classification span {
  color: var(--muted);
  font-size: 13px;
}

.classification strong {
  color: var(--accent-2);
}

.publish {
  justify-self: start;
}

.player video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-meta {
  padding: 22px 24px 26px;
}

.player-meta h2 {
  margin-bottom: 8px;
}

.player-meta p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.app-lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease;
}

.app-lock.open {
  opacity: 1;
  pointer-events: auto;
}

.app-lock-panel {
  width: min(460px, 100%);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.app-lock-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
}

.app-lock-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
}

.app-lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.share-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.share-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  color: var(--text);
  background: rgba(0, 0, 0, 0.7);
  font-size: 28px;
  line-height: 1;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 18px;
  }

  .nav {
    overflow-x: auto;
  }

  .feed {
    padding: 28px 18px 64px;
  }

  .video-grid,
  .video-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .video-grid,
  .video-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .video-grid,
  .video-grid.compact {
    grid-template-columns: 1fr;
  }

  .video-card {
    grid-template-rows: auto auto;
    gap: 14px;
    margin-bottom: 30px;
  }

  .thumb {
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;
    background: #050506;
  }

  .thumb img {
    object-fit: cover;
  }

  .video-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 10px;
    min-height: 0;
    padding-bottom: 8px;
  }

  .video-meta h3 {
    grid-column: 1 / -1;
    margin: 0;
    max-height: 58px;
    font-size: 20px;
    line-height: 1.32;
  }

  .video-meta p {
    grid-column: 1 / 2;
    align-self: center;
    font-size: 14px;
  }

  .share-button {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    min-height: 42px;
    padding: 0 16px;
  }

  .age-panel {
    padding: 28px;
  }

  .upload-fields,
  .classification,
  .cover-picker {
    grid-template-columns: 1fr;
  }

  .cover-preview {
    grid-column: 1;
    grid-row: auto;
    aspect-ratio: 16 / 9;
  }
}
