:root {
  --bg:#0b0c10;
  --card:#121317;
  --text:#e6e6e6;
  --muted:#a0a0a0;
  --accent:#18a0fb;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

.container { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* старые заголовки страницы (не используются в новой шапке, но оставим совместимость) */
header h1 { margin: 0 0 4px; }
.subtitle { color: var(--muted); margin: 0; }

/* ===== Фильтры ===== */
.filters {
  display: flex;
  align-items: center;
  justify-content: center;   /* 👈 центрируем */
  gap: 8px;
  flex-wrap: nowrap;
  margin: 16px auto;          /* сверху/снизу чуть больше отступ */
  max-width: 1000px;          /* ограничиваем ширину блока */
}

/* только поле поиска тянется */
.filters input[type="text"] {
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 320px;           /* 👈 не слишком длинное */
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a2b31;
  background: #0f1014;
  color: var(--text);
}

/* селекты */
.filters select {
  flex: 0 0 200px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a2b31;
  background: #0f1014;
  color: var(--text);
}

/* чекбокс + подпись */
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
  flex: 0 0 auto;
}
.filters input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* кнопка справа */
.filters button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #00131f;
  font-weight: 700;
  cursor: pointer;
}

/* адаптив */
@media (max-width: 720px) {
  .filters {
    flex-wrap: wrap;
    justify-content: center;  /* даже на мобилках центрируем */
  }
  .filters select { flex: 1 1 180px; }
}

/* ===== Сетка ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* ===== Card ===== */
.card {
  background: var(--card);
  border: 1px solid #1e1f25;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  min-width: 0; /* чтобы текст не выпирал в гриде */
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  border-color: #2a2b31;
}

/* кликабельные ссылки внутри карточки оставляем кликабельными */
.card a.link { text-decoration: none; }

/* шапка карточки */
.headerline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow: hidden;
}

/* ——— логотип с плейсхолдером ——— */
.logo-box{
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #1a1b20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
  border: 1px solid #2a2b31;
}
.logo-box img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: none; /* скрыт, пока не подгрузится */
}
.logo-box.ok img{ display:block; }
.logo-fallback{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
}
/* если есть картинка → убираем букву */
.logo-box.ok .logo-fallback { display: none; }

/* ---- Текст: безопасные переносы и фолбэки ---- */

/* Заголовок: до 2 строк с аккуратным усечением (без вендор-хака) */
.card .title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  max-height: calc(1.3em * 2); /* максимум 2 строки */
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}

/* Описание: до 3 строк (фолбэк без -webkit-line-clamp) */
.card .desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  max-height: calc(1.4em * 3); /* максимум 3 строки */
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}

/* бейджи */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  background: #18191f;
  border: 1px solid #2b2c32;
  font-size: 12px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* теги (если где-то используешь) */
.tag {
  display: inline-block; padding: 4px 8px; border-radius: 8px;
  background:#101218; border:1px solid #23242a; font-size:12px; margin-right:6px;
}

/* нижняя полоска карточки: рейтинг */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.rating { font-variant-numeric: tabular-nums; color: var(--accent); }

.link { color: var(--accent); font-weight: 600; }

/* кнопка "Загрузить ещё" */
#more{
  padding: 10px 14px; border-radius: 10px; background:#171821;
  color: var(--text); border:1px solid #2a2b31; cursor:pointer;
}
#more:hover{ background:#1b1c26; }

/* футер прибит к низу */
main { flex: 1; }
.foot {
  color: var(--muted); text-align: center; padding: 12px;
  border-top: 1px solid #2a2b31; background: #0f1014;
}

/* ===== Skeleton loading ===== */
.skeleton {
  background: linear-gradient(90deg, #14161c 25%, #1a1c23 37%, #14161c 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.skel-card {
  height: 120px;
  padding: 16px;
  border: 1px solid #1e1f25;
  background: var(--card);
  border-radius: 16px;
}

/* ===== Header (красивая шапка) ===== */
.site-header {
  background: #0f1014;
  border-bottom: 1px solid #2a2b31;
  padding: 0 16px 20px;
  margin-bottom: 16px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.site-header .container{ padding-left: 0; padding-right: 0; }

/* Верхняя панель */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: #1a1b20;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; letter-spacing: .5px; color: var(--text);
  border:1px solid #2a2b31;
}
.brand-name { font-weight: 800; font-size: 18px; color: var(--text); }
.brand-badge{
  margin-left: 6px; font-size: 11px; color:#00131f; background: var(--accent);
  padding: 2px 6px; border-radius: 999px; font-weight: 700;
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-link {
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
}
.nav-link:hover { color: var(--text); border-color: #24252b; background: #121219; }
.nav-cta {
  background: var(--accent); color: #00131f; text-decoration: none;
  font-weight: 700; padding: 8px 12px; border-radius: 10px; border: 0;
}
.nav-cta:hover { filter: brightness(1.05); }

/* Hero блок под топбаром */
.hero { padding-block: 12px 6px; text-align:center; }
.hero-title {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.1;
  color: var(--text);
}
.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 10px; justify-content:center;
}
.stat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: #101218; border: 1px solid #23242a; color: var(--muted);
  font-size: 12px;
}
.stat-pill b { color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 640px){
  .topbar { padding-block: 10px; }
  .nav-actions { gap: 6px; }
  .nav-link { display:none; } /* оставим только CTA */
}

.tagline {
  text-align: center;
  flex: 1;
}

.tagline .hero-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.tagline .hero-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}



