:root {
  --bg: #000;
  --fg: #fff;
  --muted: #9a9a9a;
  --card: #0a0a0a;
  --border: #1c1c1c;
  --border-strong: #2a2a2a;
  --accent: #d4a017;        /* mustard yellow */
  --accent-2: #b8860b;
  --accent-fg: #1a1300;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Inter", "Segoe UI", sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.brand-name { font-weight: 800; font-size: 34px; line-height: 40px; letter-spacing: 0.06em; white-space: nowrap; }
.brand-name .accent { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.icon-btn {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--fg); width: 38px; height: 38px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.icon-btn:hover { background: #111; border-color: var(--accent); color: var(--accent); }
.btn {
  background: var(--accent); color: var(--accent-fg);
  border: none; padding: 8px 14px; border-radius: 999px; font-weight: 700;
}
.btn:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent; color: var(--fg); border: 1px solid var(--border-strong);
  padding: 8px 14px; border-radius: 999px;
}
.btn-ghost:hover { background: #111; }
.muted { color: var(--muted); }
.admin-link {
  color: var(--accent); font-weight: 700; font-size: 13px;
  padding: 6px 10px; border: 1px solid var(--accent); border-radius: 999px;
}
@media (max-width: 480px) {
  .brand-name { font-size: 26px; line-height: 34px; letter-spacing: 0.05em; }
  .brand img { width: 34px; height: 34px; }
  .admin-link { padding: 5px 8px; font-size: 12px; }
  .icon-btn { width: 36px; height: 36px; }
}

/* Header search overlay */
.search-overlay {
  position: fixed; left: 0; right: 0; top: 58px;
  background: rgba(0,0,0,0.96); border-bottom: 1px solid var(--border);
  padding: 14px 16px; z-index: 49; display: none;
}
.search-overlay.open { display: block; }
.search-overlay input {
  width: 100%; max-width: 720px; margin: 0 auto; display: block;
  padding: 12px 16px; background: var(--card); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: 999px;
  outline: none; font-size: 15px;
}
.search-overlay input:focus { border-color: var(--accent); }

/* Container */
.container { max-width: 1400px; margin: 0 auto; padding: 16px; }

/* Chips */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chips::-webkit-scrollbar { height: 6px; }
.chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border-strong);
  color: var(--fg); font-size: 13px; white-space: nowrap;
}
.chip.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; }

/* Section */
.section-title { font-size: 20px; font-weight: 700; margin: 4px 0 14px; }
@media (min-width: 768px) { .section-title { font-size: 22px; } }

/* Grid */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.thumb {
  width: 100%; aspect-ratio: 16/9;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); font-size: 28px; font-weight: 700;
  position: relative;
}
.card-body { padding: 10px 12px 14px; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 768px) { .card-title { font-size: 15px; } }

/* Collection badge - bottom right */
.badge-collection {
  position: absolute; bottom: 8px; right: 8px;
  background: var(--accent); color: var(--accent-fg);
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Auth & generic modals */
.modal-overlay {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); z-index: 100; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #0a0a0a; border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 24px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  max-height: 92vh; overflow: auto;
}
.modal h2 { margin: 0 0 18px; font-size: 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1; padding: 10px; background: transparent; color: var(--muted);
  border: none; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 600;
}
.tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  background: #050505; color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.modal .btn { width: 100%; margin-top: 6px; }
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0; }
.gbtn {
  width: 100%; background: #fff; color: #000; border: none;
  padding: 10px; border-radius: 999px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.error { color: #ff6b6b; font-size: 13px; margin-top: 8px; }
.success { color: #4ade80; font-size: 13px; margin-top: 8px; }
.close-x {
  float: right; background: transparent; border: none; color: var(--muted); font-size: 22px;
  margin-top: -8px; margin-right: -8px;
}

/* Watch page */
.watch-layout { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1024px) {
  .watch-layout { grid-template-columns: minmax(0,1fr) 360px; }
}
.player-wrap {
  width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
}
.player-wrap iframe, .player-wrap video {
  width: 100%; height: 100%; border: 0; display: block; background: #000;
}
.video-title { font-size: 18px; font-weight: 700; margin: 14px 0 8px; }
@media (min-width: 768px) { .video-title { font-size: 22px; } }
.suggestion-row {
  display: flex; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; position: relative;
}
.suggestion-row:hover { background: #0a0a0a; border-color: var(--border); }
.suggestion-row .thumb-sm {
  width: 160px; aspect-ratio: 16/9; border-radius: 8px; flex-shrink: 0;
  background-size: cover; background-position: center; position: relative;
}
.suggestion-row .meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.suggestion-row .t {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sidebar-suggestions { display: none; }
@media (min-width: 1024px) { .sidebar-suggestions { display: flex; flex-direction: column; gap: 4px; } }
.more-grid { display: block; margin-top: 24px; }
@media (min-width: 1024px) { .more-grid { display: none; } }

/* Admin */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.admin-tab {
  padding: 10px 14px; background: transparent; color: var(--muted);
  border: none; border-bottom: 2px solid transparent; font-weight: 600; font-size: 14px;
}
.admin-tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.panel { display: none; max-width: 760px; }
.panel.active { display: block; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 10px;
}
.list-row img { width: 80px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #111; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.list-row .actions button, .list-row .actions a { padding: 6px 10px; font-size: 12px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.progress { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* Collection page: stacked players */
.collection-list { display: flex; flex-direction: column; gap: 28px; }
.collection-item .player-wrap { aspect-ratio: 16/9; }

/* Admin collection builder */
.coll-builder { display: flex; flex-direction: column; gap: 12px; }
.coll-item {
  background: #0a0a0a; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.coll-item-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.coll-item-head button { padding: 4px 10px; font-size: 12px; }

/* Cropper */
.cropper {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-strong); touch-action: none;
  user-select: none;
}
.cropper canvas { display: block; width: 100%; height: 100%; }
.cropper-controls {
  display: flex; gap: 10px; align-items: center; margin-top: 10px;
}
.cropper-controls input[type=range] { flex: 1; }
.cropper-actions { display: flex; gap: 8px; margin-top: 12px; }
.cropper-actions .btn, .cropper-actions .btn-ghost { flex: 1; margin: 0; }

/* Sort drawer (dropdown adjacent to section title) */
.sort-drawer { position: relative; }
.sort-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); color: var(--fg); border: 1px solid var(--border-strong);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sort-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sort-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #0a0a0a; border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 6px; min-width: 160px;
  display: none; flex-direction: column; gap: 2px; z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.sort-menu.open { display: flex; }
.sort-menu button {
  background: transparent; color: var(--fg); border: none;
  padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
  text-align: left; cursor: pointer;
}
.sort-menu button:hover { background: #161616; }
.sort-menu button.active { background: var(--accent); color: var(--accent-fg); }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 18px 0 14px; }
.section-head .section-title { margin: 0; }
