:root {
  --bg: #07070b;
  --bg-elev: #101018;
  --surface: #16161f;
  --surface-2: #1d1d29;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f1ea;
  --muted: #9a97a8;
  --gold: #e8c547;
  --gold-2: #b8942a;
  --crimson: #e11d2e;
  --ok: #3dd68c;
  --warn: #f5b942;
  --danger: #ff6b7a;
  --blue: #6ea8ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --sidebar: 268px;
  --font: "Outfit", system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(232, 197, 71, 0.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(225, 29, 46, 0.08), transparent 45%),
    var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
}
a { color: var(--gold); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 600;
}
.brand small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--crimson));
  position: relative;
  box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.25);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px 11px 10px 13px;
  background: #07070b;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: rgba(10, 10, 16, 0.92);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; overflow: auto; flex: 1; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 10px;
}
.side-link svg { width: 18px; height: 18px; flex: none; }
.side-link:hover, .side-link.is-active {
  background: var(--surface);
  color: var(--text);
}
.side-link.is-active { box-shadow: inset 2px 0 0 var(--gold); }
.side-user {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.side-user strong { display: block; color: var(--text); }

.workspace { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px 8px;
}
.topbar h1 { margin: 0; font-size: 26px; font-weight: 600; }
.topbar-meta { margin-left: auto; color: var(--muted); font-size: 12px; }
.content { padding: 8px 28px 48px; }
.nav-toggle { display: none; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 6px 10px; }

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.flash-ok { background: rgba(61, 214, 140, 0.12); color: var(--ok); }
.flash-warn { background: rgba(245, 185, 66, 0.12); color: var(--warn); }
.flash-danger { background: rgba(255, 107, 122, 0.12); color: var(--danger); }

.stat-grid, .grid-2, .grid-3 { display: grid; gap: 16px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.grid-2 { grid-template-columns: 1.3fr 0.7fr; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card, .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-card p { margin: 0; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 30px; margin: 6px 0 2px; }
.stat-card small { color: var(--muted); }
.stat-card.gold strong { color: var(--gold); }
.stat-card.ok strong { color: var(--ok); }
.card h2, .card h3 { margin: 0 0 14px; font-size: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }

.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 11px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
table.data tr:hover td { background: rgba(255,255,255,0.02); }
.thumb {
  width: 42px; height: 62px; object-fit: cover; border-radius: 6px; background: #000;
}

.btn, .btn-ghost, .btn-danger, .btn-ok {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 600; cursor: pointer;
}
.btn { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #1a1404; }
.btn:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(225, 29, 46, 0.15); color: var(--danger); border: 1px solid rgba(225, 29, 46, 0.35); }
.btn-ok { background: rgba(61, 214, 140, 0.14); color: var(--ok); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.badge-ok { color: var(--ok); background: rgba(61,214,140,.1); }
.badge-warn { color: var(--warn); background: rgba(245,185,66,.1); }
.badge-danger { color: var(--danger); background: rgba(255,107,122,.1); }
.badge-muted { color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.input, input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=search], input[type=date], select, textarea {
  background: #0c0c12;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
textarea { min-height: 110px; resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: rgba(232, 197, 71, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.12);
}
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }

.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager-link {
  min-width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text);
}
.pager-link.is-active { background: var(--gold); color: #1a1404; border-color: var(--gold); }
.pager-gap { color: var(--muted); padding: 8px; }

.empty {
  padding: 48px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}

.bars { display: flex; align-items: flex-end; gap: 8px; height: 160px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--gold), rgba(232,197,71,.15)); border-radius: 8px 8px 0 0; min-height: 4px; position: relative; }
.bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }

/* Auth / landing */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.auth-hero {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(7,7,11,0.2), rgba(7,7,11,0.92)),
    url("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/Sintel.jpg") center/cover;
}
.auth-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 68px);
  margin: 0 0 12px;
  line-height: 1.05;
}
.auth-hero p { max-width: 520px; color: #d8d4c8; font-size: 18px; }
.auth-panel {
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: rgba(8,8,12,0.72);
  backdrop-filter: blur(16px);
}
.auth-card { width: min(420px, 100%); }
.auth-card h2 { margin: 10px 0 6px; }
.cred-hint {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
}
.cred-hint code { color: var(--gold); }

/* Catalog */
.catalog-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(7,7,11,.95), rgba(7,7,11,.65) 70%, transparent);
}
.catalog-nav { display: flex; gap: 16px; }
.catalog-nav a { color: var(--muted); font-weight: 500; }
.catalog-nav a.is-active, .catalog-nav a:hover { color: var(--text); }
.catalog-search { margin-left: auto; }
.catalog-search input { min-width: 220px; }
.catalog-main { padding: 8px 28px 60px; }

.hero-feature {
  position: relative;
  min-height: 380px;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  background: #000 center/cover no-repeat;
}
.hero-feature::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7,7,11,.92) 10%, rgba(7,7,11,.2) 70%);
}
.hero-copy { position: relative; z-index: 1; padding: 36px; max-width: 560px; }
.hero-copy h2 { font-family: var(--serif); font-size: 42px; margin: 0 0 8px; }
.hero-copy p { color: #d5d1c6; }

.rail { margin: 28px 0; }
.rail h3 { margin: 0 0 12px; font-size: 18px; }
.rail-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 160px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.poster-card {
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poster-card img, .poster-ph {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.poster-card span { font-size: 13px; color: #ddd; }
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.player-wrap {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 20px;
}
.player-box {
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.player-box video { width: 100%; aspect-ratio: 16/9; background: #000; }
.meta-block h2 { font-family: var(--serif); margin: 0 0 8px; }
.related { display: flex; flex-direction: column; gap: 10px; }

.codeblock {
  background: #0b0b12;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  color: #d7d2c4;
}

.install-wrap { max-width: 860px; margin: 40px auto; padding: 0 20px 60px; }
.steps { display: flex; gap: 8px; margin: 18px 0 24px; }
.step {
  flex: 1; padding: 10px; border-radius: 12px; text-align: center;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.step.is-on { color: #1a1404; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.check-list { list-style: none; padding: 0; }
.check-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ok { color: var(--ok); }
.bad { color: var(--danger); }

@media (max-width: 1080px) {
  .stat-grid, .grid-2, .grid-3, .player-wrap, .auth-page { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30;
    transform: translateX(-110%);
    transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; }
  .nav-toggle { display: inline-flex; }
  .catalog-nav { display: none; }
  body.nav-open .catalog-nav {
    display: flex; flex-direction: column;
    position: absolute; top: 62px; left: 12px; right: 12px;
    background: var(--bg-elev); padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  }
  .content, .catalog-main, .catalog-top, .topbar { padding-left: 16px; padding-right: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-hero { min-height: 280px; }
}

.lang-switch {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.poster-frame { position: relative; display: block; }
.poster-frame img { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 12px; }
.progress-bar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px;
  background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden;
}
.progress-bar i { display: block; height: 100%; background: var(--gold); }
.age-tag {
  position: absolute; top: 8px; right: 8px; font-style: normal;
  background: rgba(0,0,0,.7); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 6px;
}
.profiles-wrap { text-align: center; padding: 24px 0 48px; }
.profiles-wrap h1 { font-family: var(--serif); margin: 0 0 24px; }
.eyebrow { letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-size: 12px; }
.profile-grid {
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center;
}
.profile-card { background: none; border: 0; }
.profile-card button {
  background: none; border: 0; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.avatar-blob {
  width: 110px; height: 110px; border-radius: 18px; display: grid; place-items: center;
  font-size: 42px; font-weight: 700; border: 3px solid transparent;
}
.profile-card button:focus .avatar-blob,
.profile-card button:hover .avatar-blob { border-color: var(--gold); }
.avatar-gold .avatar-blob { background: linear-gradient(135deg,#e8c547,#8a5a12); color: #1a1404; }
.avatar-mint .avatar-blob { background: linear-gradient(135deg,#7ddec4,#1b6b5a); }
.avatar-rose .avatar-blob { background: linear-gradient(135deg,#f0a3b2,#8a3044); }
.avatar-blue .avatar-blob { background: linear-gradient(135deg,#8bb7ff,#2a4d8a); }
.avatar-violet .avatar-blob { background: linear-gradient(135deg,#c9a6ff,#4c2d7a); }
.pin-box { max-width: 360px; margin: 24px auto 0; text-align: left; }
.mode-tv { font-size: 18px; }
.tv-bar {
  display: flex; align-items: center; gap: 18px; padding: 18px 32px;
  background: rgba(0,0,0,.45);
}
.tv-bar p { margin: 0; color: var(--muted); flex: 1; }
.tv-main { padding: 20px 32px 60px; }
.tv-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 18px; }
.tv-tile {
  flex: 0 0 180px; color: var(--text); outline: none;
}
.tv-tile img { width: 180px; height: 270px; object-fit: cover; border-radius: 14px; border: 3px solid transparent; }
.tv-tile:focus img, .tv-tile:hover img { border-color: var(--gold); }
.tv-tile span { display: block; margin-top: 8px; }
