:root{
  --bg:#0b0f14;
  --card:#141b23;
  --muted:#8ba3b6;
  --text:#eaf2f7;
  --accent:#e11d48;
  --pill:#233243;
  --border:#223040;
  --header:#0b1218;
  --header-border:#121b24;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,sans-serif;
}
a{color:inherit;text-decoration:none}
.muted{color:var(--muted)}
.container{max-width:1200px;margin:0 auto;padding:12px}

/* ================= header ================= */
.site-header{
  background:var(--header);
  border-bottom:1px solid var(--header-border);
}
.header-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px;
}
.brand{display:inline-flex; align-items:center; gap:10px}
.brand-logo{position:relative; width:28px; height:28px; display:inline-block}
.brand-logo .lg-outer{
  position:absolute; inset:0; border-radius:8px;
  background:linear-gradient(135deg,#3b82f6,#8b5cf6);
}
.brand-logo .lg-inner{
  position:absolute; left:7px; top:7px; width:14px; height:14px; border-radius:6px;
  background:#0d1320; box-shadow:inset 0 0 0 2px rgba(255,255,255,.15);
}
.brand-text{font-size:18px; letter-spacing:.2px}
.brand-text strong{font-weight:700}
.brand-text .brand-accent{color:#78e7ff}

/* Hamburger */
.hamburger{
  display:none; width:36px; height:36px; border-radius:10px;
  background:#0e141b; border:1px solid var(--border);
  align-items:center; justify-content:center; gap:3px; padding:6px; cursor:pointer;
}
.hamburger .hb-line{width:18px; height:2px; background:#cfe0ef; display:block; border-radius:2px}
.hamburger:active{transform:scale(.98)}

/* ================= filters ================= */
.filters{
  background:#0e141b;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  margin:12px 0 16px 0;
}
.filters form{display:flex; flex-wrap:wrap; align-items:center; gap:12px}
.filters label{
  display:flex; flex-direction:column; gap:6px;
  font-size:13px; color:var(--muted); min-width:150px;
}
.filters select,.filters input{
  background:#0b1218; color:var(--text);
  border:1px solid var(--border); border-radius:8px;
  padding:8px 10px; font-size:14px;
}
.filters .search-grow{flex:1 1 220px}

/* ======= MOBILE (≤600px): бургер, фильтры по клику ======= */
@media (max-width:600px){
  .hamburger{display:flex}
  .filters{display:none}
  body.mobile-filters-open .filters{display:block}
  .container{padding:8px}
}
@media (min-width:601px){
  .hamburger{display:none}
  .filters{display:block}
}

/* ================= grid/cards ================= */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:14px;
  padding:0 4px;
}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  will-change:transform;
}
.card:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 18px rgba(0,0,0,.22);
  border-color:#243645;
}
.card .thumb-wrap{position:relative; overflow:hidden}
.card .thumb{
  width:100%;
  aspect-ratio:4/3;          /* крупнее, чем 16/9 */
  object-fit:cover;          /* не растягиваем — обрезаем лишнее */
  display:block;
  transform:translateZ(0);
  transition:transform .22s ease, filter .22s ease;
}
.card:hover .thumb{ transform:scale(1.01); filter:brightness(1.03) }
.card .thumb--ph{
  width:100%; aspect-ratio:4/3; background:#192431; 
  display:flex; align-items:center; justify-content:center;
  color:#5e778c; font-weight:600; letter-spacing:.3px;
}

/* флаг/HD — аккуратные и «острые» */
.badge{position:absolute; top:8px}
.badge-flag{left:8px}
.badge-flag img{
  width:20px; height:14px; border-radius:2px;
  image-rendering:auto; /* без «мыла» */
  box-shadow:0 1px 2px rgba(0,0,0,.35)
}
.badge-hd{
  right:8px; background:var(--accent); color:#fff;
  font-weight:800; font-size:10px; padding:2px 5px; border-radius:4px;
  letter-spacing:.4px; opacity:.95;
  box-shadow:0 1px 2px rgba(0,0,0,.35)
}

.card .body{padding:10px 12px 12px}
.card .row-1{display:flex; align-items:center; justify-content:space-between; gap:8px}
.card .name{font-weight:700; font-size:15px}
.pill{
  display:inline-block; font-size:12px; padding:2px 8px; border-radius:999px;
  background:var(--pill); color:#c8d8e6; border:1px solid var(--border);
}
.card .meta{margin-top:4px; font-size:13px}
.card .viewers{margin-top:6px; font-weight:600; color:#cfe6ff}

/* ================= pagination ================= */
.pagination{
  display:flex; gap:8px; align-items:center; justify-content:center;
  margin:22px 0; flex-wrap:wrap;
}
.pagination .btn{
  display:inline-block; padding:8px 12px; border:1px solid var(--border);
  border-radius:8px; color:#d9e6f2; background:#0b1218;
}
.pagination .btn:hover{background:#101923}
.pagination .btn.current{background:#193047; border-color:#2b4257; cursor:default}
.pagination .btn.disabled{opacity:.5; pointer-events:none}

/* ================= footer ================= */
.site-footer{padding:16px 0; border-top:1px solid var(--header-border); margin-top:10px}

/* ===== Mobile previews 1:1 ===== */
@media (max-width:600px){
  .card .thumb,
  .card .thumb--ph{ aspect-ratio:4/3; }
}
