:root {
  --bg: #0b0d12;
  --panel: #141821;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eceae4;
  --muted: #9aa0ab;
  --gold: #f2c75c;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 20px; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px); background: rgba(11, 13, 18, 0.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 18px; letter-spacing: 0.01em; white-space: nowrap; }
.brand__logo { width: 32px; height: 32px; border-radius: 9px; background: var(--gold); position: relative; }
.brand__logo::after { content: ''; position: absolute; left: 12px; top: 9px; border-left: 11px solid var(--bg); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.search { flex: 0 1 420px; display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 42px; border-radius: 21px; background: var(--panel); border: 1px solid var(--line); }
.search:focus-within { border-color: rgba(242, 199, 92, 0.6); }
.search svg { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; }

main { padding: 22px clamp(16px, 4vw, 48px) 60px; max-width: 1680px; margin: 0 auto; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tags button { padding: 7px 15px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.tags button:hover { border-color: rgba(255, 255, 255, 0.25); }
.tags button.is-on { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 600; }
.count { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 26px 22px; }
.card { display: block; border-radius: var(--radius); outline-offset: 4px; }
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #1a1f2a; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); transition: transform 0.25s, box-shadow 0.25s; }
.card:hover .thumb, .card:focus-visible .thumb { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(242, 199, 92, 0.55); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb__scrub { position: absolute; inset: 0; background-repeat: no-repeat; opacity: 0; transition: opacity 0.12s; }
.thumb.is-scrub .thumb__scrub { opacity: 1; }
.thumb__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, 0.4); opacity: 0; }
.thumb__bar span { display: block; height: 100%; width: 0; background: var(--gold); }
.thumb.is-scrub .thumb__bar { opacity: 1; }
.badge { position: absolute; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; background: rgba(0, 0, 0, 0.72); font-variant-numeric: tabular-nums; }
.badge--time { right: 10px; bottom: 10px; }
.badge--q { left: 10px; top: 10px; background: rgba(242, 199, 92, 0.92); color: #111; }
.thumb.is-scrub .badge--time { bottom: 14px; }
.play { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px; border-radius: 50%; background: rgba(11, 13, 18, 0.55); backdrop-filter: blur(4px); border: 1.5px solid rgba(255, 255, 255, 0.6); opacity: 0; transform: scale(0.85); transition: 0.2s; }
.play::after { content: ''; position: absolute; left: 24px; top: 19px; border-left: 19px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.card:hover .play { opacity: 1; transform: scale(1); }
.thumb.is-scrub .play { opacity: 0; }
.card__body { padding: 12px 4px 0; }
.card__body h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 620; line-height: 1.35; }
.meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips span { font-size: 12px; padding: 2px 9px; border-radius: 10px; background: rgba(242, 199, 92, 0.12); color: var(--gold); }

.player { padding: 0; border: 0; background: transparent; max-width: min(1280px, 94vw); width: 100%; color: var(--text); }
.player::backdrop { background: rgba(3, 4, 7, 0.86); backdrop-filter: blur(6px); }
.player__box { position: relative; background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; max-height: 76vh; }
.player__close { position: absolute; right: 12px; top: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 17px; cursor: pointer; }
.player__close:hover { background: rgba(0, 0, 0, 0.85); }
.player__info { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; padding: 18px 22px 22px; }
.player__info h2 { margin: 0 0 4px; font-size: 20px; }
.desc { margin: 10px 0 0; color: #c9ccd3; max-width: 760px; }
.player__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; flex: none; }
.btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line); background: #1d2230; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: rgba(255, 255, 255, 0.3); }
.btn--gold { background: var(--gold); color: #111; border-color: var(--gold); }
.btn[hidden] { display: none; }

@media (max-width: 720px) {
  .brand span:last-child { display: none; }
  .player { max-width: 100vw; }
  .player__box { border-radius: 0; }
  .player__info { flex-direction: column; }
  .player__actions { justify-content: flex-start; }
}
