/* ════════════════════════════════════════════
   MT2TV — Style B · Neutralny nowoczesny dark
   ════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

:root {
  --bg:          #0E0E10;
  --surface:     #18181B;
  --surface-2:   #212125;
  --surface-3:   #2A2A2E;
  --border:      #27272A;
  --border-2:    #3F3F46;

  --text:        #F4F4F5;
  --text-2:      #D4D4D8;
  --text-dim:    #A1A1AA;
  --text-mute:   #71717A;

  --accent:      #FF6A3D;
  --accent-hover:#FF835D;
  --accent-dim:  #C84D26;
  --accent-soft: rgba(255, 106, 61, 0.12);

  --ok:          #34D399;
  --warn:        #FBBF24;
  --err:         #F87171;
  --discord:     #5865F2;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;

  --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg:   0 20px 40px -15px rgba(0,0,0,0.6);

  --font: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', Menlo, Consolas, monospace;

  --sidebar-w: 240px;
  --topbar-h: 64px;
  --max-w: 1440px;
  --gutter: clamp(1rem, 2.5vw, 2rem);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ───── Reset ───── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ═══════════ FLASH MESSAGES ═══════════ */
.flash-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  width: 100%;
  pointer-events: none;
}
.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  pointer-events: all;
  animation: flash-in 0.3s var(--ease);
}
@keyframes flash-in {
  from { opacity: 0; transform: translateX(12px); }
}
.flash--success { border-color: var(--ok); }
.flash--success .flash__icon { color: var(--ok); }
.flash--error { border-color: var(--err); }
.flash--error .flash__icon { color: var(--err); }
.flash--info { border-color: var(--border-2); }
.flash--info .flash__icon { color: var(--text-dim); }
.flash__icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.flash__text { flex: 1; line-height: 1.4; color: var(--text-2); }
.flash__close { color: var(--text-mute); width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center; }
.flash__close:hover { color: var(--text); }

/* ═══════════ APP SHELL ═══════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ═══════════ SIDEBAR ═══════════ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  z-index: 20;
}
.sidebar.is-open { display: flex; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.025em;
}
.logo__mark {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 12px -2px rgba(255,106,61,0.4);
  flex-shrink: 0;
}
.logo__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bg);
  position: relative;
}
.logo__dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--accent);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
  position: relative;
}
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item--active {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav__item--active::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav__icon { width: 18px; height: 18px; color: currentColor; flex-shrink: 0; }
.nav__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.nav__item--active .nav__badge { background: var(--accent); color: var(--bg); }

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.nav-section__title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  padding: 0 12px;
  margin-bottom: 6px;
}

.sidebar__user {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  transition: background 0.2s;
  cursor: pointer;
}
.sidebar__user:hover { background: var(--surface-2); }
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 11px; color: var(--text-mute); margin-top: 1px; }

/* ═══════════ MAIN ═══════════ */
.main { min-width: 0; max-width: 100%; }

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  background: rgba(14,14,16,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar__menu-btn {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border-radius: 8px;
  transition: background 0.2s;
}
.topbar__menu-btn:hover { background: var(--surface-2); }
.topbar__menu-btn svg { width: 22px; height: 22px; }

.topbar__breadcrumb {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.searchbar {
  justify-self: stretch;
  max-width: 720px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.searchbar:focus-within { border-color: var(--border-2); background: var(--surface-2); }
.searchbar__icon { width: 16px; height: 16px; color: var(--text-mute); flex-shrink: 0; }
.searchbar input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 14px;
}
.searchbar input::placeholder { color: var(--text-mute); }
.searchbar__kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--bg);
}

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--discord);
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 12px -4px rgba(88,101,242,0.5);
  white-space: nowrap;
}
.discord-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.discord-btn:hover { background: #4752C4; transform: translateY(-1px); }

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.upload-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.upload-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

.user-avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.user-avatar-btn:hover { border-color: var(--accent); }
.user-avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════ HERO ═══════════ */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s var(--ease);
}
.hero__media:hover { transform: translateY(-2px); }
.hero__media img, .hero__media svg { width: 100%; height: 100%; object-fit: cover; }
.hero__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(244,244,245,0.92);
  display: grid;
  place-items: center;
  transition: transform 0.3s var(--ease), background 0.2s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.hero__play svg { width: 32px; height: 32px; margin-left: 3px; fill: #0E0E10; }
.hero__media:hover .hero__play { transform: translate(-50%, -50%) scale(1.08); background: var(--accent); }
.hero__media:hover .hero__play svg { fill: var(--bg); }
.hero__badge {
  position: absolute;
  top: 16px; left: 16px;
  background: var(--accent);
  color: var(--bg);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero__duration {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(14,14,16,0.88);
  color: var(--text);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.hero__info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  min-width: 0;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,106,61,0.2);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,106,61,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(255,106,61,0.08); }
}
.hero__title {
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
.hero__desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 48ch;
}
.hero__creator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.hero__creator-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.verified-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.hero__creator-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.hero__stats {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.hero__stats strong { color: var(--text); font-weight: 600; }
.hero__dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--text-mute); }
.hero__actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

/* ═══════════ BUTTONS ═══════════ */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
  cursor: pointer;
}
.button svg { width: 16px; height: 16px; flex-shrink: 0; }
.button--primary { background: var(--accent); color: var(--bg); }
.button--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.button--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.button--ghost:hover { background: var(--surface-2); border-color: var(--border-2); }
.button--outline { background: transparent; color: var(--text); border-color: var(--border-2); }
.button--outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.button--sm { padding: 7px 14px; font-size: 12px; }
.button--lg { padding: 13px 24px; font-size: 15px; }
.button--danger { background: var(--err); color: #fff; }
.button--danger:hover { filter: brightness(1.1); }
.button--full { width: 100%; justify-content: center; }

/* ═══════════ CONTENT BLOCKS ═══════════ */
.block {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter);
}
.block__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.block__title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.block__sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.block__footer { display: flex; justify-content: center; margin-top: 2rem; }

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}
.sort-btn:hover { background: var(--surface-2); color: var(--text); }
.sort-btn svg { width: 12px; height: 12px; }

/* ═══════════ VIDEO GRID + CARDS ═══════════ */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.card:hover .card__thumb {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(255,106,61,0.35);
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card:hover .card__thumb img { transform: scale(1.04); }

.duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(14,14,16,0.92);
  color: var(--text);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255,255,255,0.05);
}

.card__hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,14,16,0.6), transparent 40%);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.card__hover-overlay svg {
  width: 56px; height: 56px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(255,106,61,0.4);
  transform: scale(0.85);
  transition: transform 0.25s var(--ease);
}
.card:hover .card__hover-overlay { opacity: 1; }
.card:hover .card__hover-overlay svg { transform: scale(1); }

.card__body {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 0 2px;
}
.card__text { min-width: 0; }
.card__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.card:hover .card__title { color: var(--accent); }
.card__creator { font-size: 12px; color: var(--text-dim); font-weight: 500; transition: color 0.2s; }
.card__creator:hover { color: var(--text); }
.card__meta { font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.card__more {
  width: 26px; height: 26px;
  color: var(--text-mute);
  border-radius: 6px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.card__more svg { width: 14px; height: 14px; }
.card:hover .card__more { opacity: 1; }
.card__more:hover { background: var(--surface-2); color: var(--text); }

/* ═══════════ AVATARS ═══════════ */
.avatar {
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  background: linear-gradient(135deg, #FF6A3D, #C84D26);
  letter-spacing: 0;
  border-radius: 50%;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.avatar--md { width: 36px; height: 36px; font-size: 14px; }
.avatar--lg { width: 44px; height: 44px; font-size: 16px; }
.avatar--xl { width: 64px; height: 64px; font-size: 22px; }
.avatar--2xl { width: 96px; height: 96px; font-size: 32px; }

/* ═══════════ CREATOR CARDS ═══════════ */
.creators { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.creator {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 20px 20px;
  text-align: center;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.creator:hover { border-color: var(--border-2); transform: translateY(-2px); }
.creator__banner {
  height: 80px;
  margin: 0 -20px 0;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.creator__banner svg, .creator__banner img { width: 100%; height: 100%; object-fit: cover; }
.creator__avatar {
  margin: -32px auto 12px;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
}
.creator__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.creator__sub { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.creator__btn { width: 100%; justify-content: center; }

/* ═══════════ VIDEO PAGE ═══════════ */
.video-page {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter);
  align-items: start;
}

.player-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);

  /* Plyr variables */
  --plyr-color-main:                          var(--accent);
  --plyr-video-background:                    #000;
  --plyr-font-family:                         'Geist', sans-serif;
  --plyr-font-size-base:                      13px;
  --plyr-font-weight-regular:                 500;
  --plyr-control-spacing:                     8px;
  --plyr-control-icon-size:                   17px;
  --plyr-control-radius:                      4px;
  --plyr-video-control-color:                 rgba(255,255,255,0.82);
  --plyr-video-control-color-hover:           #fff;
  --plyr-video-control-background-hover:      rgba(255,255,255,0.1);
  --plyr-range-track-height:                  3px;
  --plyr-range-thumb-height:                  12px;
  --plyr-range-thumb-background:              #fff;
  --plyr-range-thumb-shadow:                  0 1px 3px rgba(0,0,0,0.5);
  --plyr-range-fill-background:               var(--accent);
  --plyr-video-progress-buffered-background:  rgba(255,255,255,0.18);
  --plyr-progress-loading-background:         rgba(255,255,255,0.12);
  --plyr-menu-background:                     #111114;
  --plyr-menu-color:                          #e4e4e7;
  --plyr-menu-border-color:                   #27272a;
  --plyr-tooltip-background:                  rgba(10,10,12,0.92);
  --plyr-tooltip-color:                       #e4e4e7;
  --plyr-tooltip-border-radius:               4px;
  --plyr-tooltip-padding:                     4px 8px;
}

.player-wrap .plyr         { width: 100%; border-radius: var(--radius-lg); }
.player-wrap .plyr--video  { background: #000; }
.player-wrap video         { width: 100%; display: block; }

/* ── Progress bar floats to the very top of the controls ── */
.player-wrap .plyr--video .plyr__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 12px 10px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.55) 65%,
    transparent 100%
  );
  gap: 0;
}

.player-wrap .plyr__progress__container {
  order: -1;
  flex: 0 0 100%;
  padding: 0;
}

.player-wrap .plyr__progress {
  height: var(--plyr-range-track-height);
  left: 0;
  right: 0;
}

.player-wrap .plyr__progress input[type="range"],
.player-wrap .plyr__progress .plyr__progress__buffer {
  border-radius: 0;
  height: var(--plyr-range-track-height);
}

/* Thumb — visible only on hover */
.player-wrap .plyr__progress input[type="range"]::-webkit-slider-thumb {
  opacity: 0;
  transition: opacity .15s, transform .15s;
  transform: scale(0.7);
}
.player-wrap .plyr__controls:hover .plyr__progress input[type="range"]::-webkit-slider-thumb {
  opacity: 1;
  transform: scale(1);
}
.player-wrap .plyr__progress input[type="range"]::-moz-range-thumb {
  opacity: 0;
  transition: opacity .15s;
}
.player-wrap .plyr__controls:hover .plyr__progress input[type="range"]::-moz-range-thumb {
  opacity: 1;
}

/* Slight expand on hover */
.player-wrap .plyr__controls:hover .plyr__progress,
.player-wrap .plyr__controls:hover .plyr__progress input[type="range"],
.player-wrap .plyr__controls:hover .plyr__progress .plyr__progress__buffer {
  height: 5px;
}

/* ── Controls row ── */
.player-wrap .plyr--video .plyr__controls > *:not(.plyr__progress__container) {
  padding-top: 2px;
  padding-bottom: 0;
}

/* Cancel Plyr's built-in first-child margin-right: auto (would isolate rewind alone) */
.player-wrap .plyr--video .plyr__controls .plyr__controls__item:first-child {
  margin-right: 2.5px;
}

/* Push right-side controls to the far right */
.player-wrap .plyr--video .plyr__controls .plyr__time--current {
  margin-left: auto;
}

/* ── Time ── */
.player-wrap .plyr__time {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ── Volume slider — narrower ── */
.player-wrap .plyr__volume input[type="range"] {
  width: 68px;
}

/* ── Settings / menu ── */
.player-wrap .plyr__menu__container {
  border: 1px solid #27272a;
  border-radius: 6px;
}

/* ── Hide captions — not configured ── */
.player-wrap .plyr__controls [data-plyr="captions"] {
  display: none !important;
}

/* ── Big play button ── */
.player-wrap .plyr__control--overlaid {
  background: rgba(255,106,61,0.85);
  border: 2px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  padding: 18px;
}
.player-wrap .plyr__control--overlaid:hover {
  background: var(--accent);
}

.video-meta { padding: 20px 0; }
.video-meta__title {
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 14px;
}
.video-meta__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.video-meta__stats { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--text-dim); }
.video-meta__stats strong { color: var(--text); font-weight: 600; }
.video-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.creator-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.creator-bar__info { flex: 1; min-width: 0; }
.creator-bar__name { font-size: 15px; font-weight: 600; color: var(--text); }
.creator-bar__sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.video-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 24px;
}
.video-desc--collapsed { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; }
.desc-toggle:hover { color: var(--accent-hover); }

/* Comments */
.comments { margin-top: 24px; }
.comments__head { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px; }
.comment-form { display: flex; gap: 12px; margin-bottom: 28px; }
.comment-form__field {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  resize: none;
  min-height: 80px;
  transition: border-color 0.2s;
  outline: none;
}
.comment-form__field:focus { border-color: var(--border-2); }
.comment-form__field::placeholder { color: var(--text-mute); }
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment__body { flex: 1; min-width: 0; }
.comment__header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.comment__author { font-size: 13px; font-weight: 600; color: var(--text); }
.comment__date { font-size: 11px; color: var(--text-mute); }
.comment__text { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* Disclaimer */
.disclaimer { font-size: 12px; color: var(--text-mute); line-height: 1.6; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Sidebar */
.video-sidebar { display: flex; flex-direction: column; gap: 20px; }
.video-sidebar__title { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
.sidebar-card { display: flex; gap: 10px; min-width: 0; }
.sidebar-card__thumb {
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.sidebar-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-card__info { flex: 1; min-width: 0; }
.sidebar-card__title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.sidebar-card:hover .sidebar-card__title { color: var(--accent); }
.sidebar-card__creator { font-size: 11px; color: var(--text-dim); }
.sidebar-card__meta { font-size: 11px; color: var(--text-mute); margin-top: 2px; }

/* ═══════════ CHANNEL PAGE ═══════════ */
.channel-header {
  position: relative;
  margin-bottom: 80px;
}
.channel-banner {
  height: 220px;
  background: var(--surface);
  overflow: hidden;
}
.channel-banner img, .channel-banner svg { width: 100%; height: 100%; object-fit: cover; }
.channel-info {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: flex-end;
  gap: 20px;
  position: relative;
  top: -48px;
  flex-wrap: wrap;
}
.channel-avatar {
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.channel-meta { flex: 1; min-width: 200px; padding-bottom: 8px; }
.channel-name { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 4px; }
.channel-sub { font-size: 14px; color: var(--text-dim); }
.channel-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }

.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 0; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.tab-btn {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn--active { color: var(--text); border-bottom-color: var(--accent); }

/* ═══════════ SEARCH PAGE ═══════════ */
.search-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter);
  align-items: start;
}
.search-results { display: flex; flex-direction: column; gap: 16px; }
.result-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s;
}
.result-card:hover { border-color: var(--border-2); }
.result-card__thumb {
  width: 200px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.result-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.result-card__body { flex: 1; min-width: 0; }
.result-card__title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin-bottom: 8px; }
.result-card:hover .result-card__title { color: var(--accent); }
.result-card__desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-card__meta { font-size: 12px; color: var(--text-mute); display: flex; gap: 12px; flex-wrap: wrap; }

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}
.filter-panel__title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 16px; }
.filter-group { margin-bottom: 20px; }
.filter-group__label { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filter-option:hover { background: var(--surface-2); color: var(--text); }
.filter-option--active { background: var(--accent-soft); color: var(--accent); }
.filter-option input { accent-color: var(--accent); }

/* ═══════════ UPLOAD PAGE ═══════════ */
.upload-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--gutter);
}
.upload-layout h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.upload-layout .subtitle { font-size: 14px; color: var(--text-dim); margin-bottom: 32px; }

.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
  margin-bottom: 32px;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone__icon { width: 56px; height: 56px; color: var(--text-mute); }
.dropzone__title { font-size: 15px; font-weight: 600; color: var(--text); }
.dropzone__sub { font-size: 13px; color: var(--text-mute); }
.dropzone__btn { display: none; }

.progress-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-filename { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 12px; display: flex; justify-content: space-between; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar__fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0; transition: width 0.4s; }

.form-section { margin-bottom: 28px; }
.form-section__title { font-size: 14px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.field input[type=text],
.field input[type=url],
.field input[type=password],
.field input[type=email],
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--border-2); }
.field textarea { resize: vertical; min-height: 100px; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717A' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; -webkit-appearance: none; }
.field__hint { font-size: 12px; color: var(--text-mute); margin-top: 5px; }

.storage-options { display: flex; flex-direction: column; gap: 10px; }
.storage-option {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.storage-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.storage-option label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.storage-option input { margin-top: 2px; accent-color: var(--accent); }
.storage-option__title { font-size: 14px; font-weight: 600; color: var(--text); }
.storage-option__sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ═══════════ AUTH PAGES ═══════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255,106,61,0.08), transparent);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.auth-card__logo { margin-bottom: 32px; }
.auth-card__title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.auth-card__sub { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 28px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-mute); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-tiers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.auth-tier {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-tier__name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.auth-tier__desc { font-size: 13px; color: var(--text-dim); }

/* ═══════════ APPLY PAGE ═══════════ */
.apply-card {
  max-width: 640px;
  margin: clamp(2rem, 5vw, 4rem) auto;
  padding: 0 var(--gutter);
}
.apply-card h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 8px; }
.apply-card .subtitle { font-size: 14px; color: var(--text-dim); margin-bottom: 32px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}
.status-badge--pending { background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.3); color: var(--warn); }
.status-badge--approved { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.3); color: var(--ok); }
.status-badge--rejected { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.3); color: var(--err); }

/* ═══════════ ERROR PAGES ═══════════ */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
.error-page__code { font-size: clamp(6rem, 20vw, 12rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1; color: var(--surface-3); margin-bottom: 16px; }
.error-page__title { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.error-page__sub { font-size: 14px; color: var(--text-dim); max-width: 40ch; margin-bottom: 32px; }

/* ═══════════ FOOTER ═══════════ */
.footer { margin-top: 2rem; border-top: 1px solid var(--border); background: var(--surface); }
.footer__bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__copy { font-size: 12px; color: var(--text-mute); white-space: nowrap; }
.footer__links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer__links a { font-size: 12px; color: var(--text-dim); transition: color 0.2s; white-space: nowrap; }
.footer__links a:hover { color: var(--text); }

/* ═══════════ PAGINATION ═══════════ */
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ═══════════ UTILITY ═══════════ */
.chip-inline {
  display: inline-block;
  padding: 1px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.text-accent { color: var(--accent); }
.text-dim { color: var(--text-dim); }
.text-mute { color: var(--text-mute); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1280px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .creators { grid-template-columns: repeat(3, 1fr); }
  .creators .creator:nth-child(4) { display: none; }
  .video-page { grid-template-columns: 1fr 300px; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 72px; }
  .logo__text, .nav__item span, .nav__badge, .nav-section__title, .sidebar__user-info { display: none; }
  .nav__item { justify-content: center; padding: 10px; }
  .nav__item--active::before { display: none; }
  .nav-section { padding-top: 12px; }
  .hero { grid-template-columns: 1fr; }
  .video-page { grid-template-columns: 1fr; }
  .video-sidebar { display: none; }
  .search-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; inset: 0; width: var(--sidebar-w); z-index: 50; }
  .sidebar.is-open { display: flex; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .topbar__menu-btn { display: flex; }
  .topbar__breadcrumb { display: none; }
  .discord-btn span { display: none; }
  .discord-btn { padding: 9px 10px; }
  .upload-btn span { display: none; }
  .upload-btn { padding: 8px 10px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .creators { grid-template-columns: repeat(2, 1fr); }
  .result-card { flex-direction: column; }
  .result-card__thumb { width: 100%; }
}

@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
  .creators { grid-template-columns: 1fr; }
  .creators .creator:nth-child(n+3) { display: none; }
  .searchbar__kbd { display: none; }
  .hero__title { font-size: 1.5rem; }
}
