/*  ============================================================
 *  HUB — вертикальный список игр
 *  ============================================================
 *  Одна игра — одна длинная полоса во всю ширину с широким
 *  артом. Статистика свёрнута в шапку и занимает минимум места.
 *  ============================================================ */

:root {
  --bg:        #06070d;
  --bg-deep:   #03040a;
  --surface:   rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.062);
  --line:      rgba(255, 255, 255, 0.085);
  --line-soft: rgba(255, 255, 255, 0.045);
  --text:      #edeff7;
  --muted:     #8a90a8;
  --faint:     #5a6075;

  --brand:     #7c5cff;
  --brand-2:   #4ddbff;

  --st-completed:   #3ddc97;
  --st-in-progress: #ffb347;
  --st-on-hold:     #b48cff;
  --st-planned:     #6aa6ff;
  --st-dropped:     #ff5f6d;

  --shell: 1420px;
  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

/*  ---------- Фон ------------------------------------------- */

.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 560px at 10% -8%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(760px 500px at 90% 4%,  rgba(77, 219, 255, 0.1), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

#stars { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.7; }

.grain {
  position: fixed;
  inset: -200%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  17% { transform: translate(-2%, -3%); }
  34% { transform: translate(3%, -2%); }
  51% { transform: translate(-1%, 2%); }
  68% { transform: translate(2%, 3%); }
  85% { transform: translate(-3%, 1%); }
}

.shell {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 clamp(16px, 3.5vw, 44px);
}

/*  ---------- Шапка со статистикой -------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(180deg, rgba(6, 7, 13, 0.92), rgba(6, 7, 13, 0.62));
  border-bottom: 1px solid var(--line-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  min-height: 64px;
  padding-block: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: none;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
}

.brand__mark svg { width: 18px; height: 18px; }
.brand__text { font-size: 1rem; }
.brand__text span { color: var(--muted); font-weight: 600; }

.ticker {
  display: flex;
  gap: clamp(0.9rem, 2.4vw, 2.2rem);
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.ticker::-webkit-scrollbar { display: none; }

.ticker__cell {
  display: grid;
  gap: 0.1rem;
  flex: none;
  padding-left: 0.9rem;
  border-left: 1px solid var(--line);
}

.ticker__value {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--tc, var(--text));
  font-variant-numeric: tabular-nums;
}

.ticker__label {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--faint);
  white-space: nowrap;
}

.ticker__bar {
  display: block;
  height: 2px;
  margin-top: 0.2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.ticker__bar i { display: block; height: 100%; background: var(--tc); }

/*  ---------- Панель фильтров ------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: clamp(1.3rem, 3vw, 2rem) 0 clamp(1rem, 2vw, 1.4rem);
}

.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.chip:hover { color: var(--text); background: var(--surface); }

.chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip, var(--muted));
  transition: box-shadow 0.25s;
}

.chip b { font-size: 0.78rem; opacity: 0.7; font-variant-numeric: tabular-nums; }

.chip[aria-pressed='true'] {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

.chip[aria-pressed='true'] i { box-shadow: 0 0 12px var(--chip); }

.toolbar__spacer { flex: 1 1 auto; }

.search { position: relative; flex: 0 1 220px; }

.search input {
  width: 100%;
  padding: 0.55rem 0.9rem 0.55rem 2.2rem;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.search input::placeholder { color: var(--faint); }

.search input:focus {
  outline: none;
  background: var(--surface-2);
  border-color: rgba(124, 92, 255, 0.6);
}

.search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.sort {
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.sort option { background: #12141f; color: var(--text); }

/*  ============================================================
 *  ПОЛКА: вертикальный список длинных баннеров
 *  ============================================================ */

.shelf {
  display: grid;
  gap: clamp(0.8rem, 1.6vw, 1.3rem);
  padding-bottom: 4.5rem;
}

.band {
  --px: 0px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  height: clamp(185px, 21vw, 250px);
  overflow: hidden;
  text-decoration: none;
  background: linear-gradient(110deg, #12141f, #0a0b12);
  transition: box-shadow 0.45s var(--ease), transform 0.45s var(--ease);
}

/* Текущая игра выше остальных — её видно первой. */
.band[data-status='in-progress'] { height: clamp(240px, 28vw, 330px); }

.band:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 60px -26px rgba(0, 0, 0, 0.9),
              0 0 70px -22px rgba(var(--card-rgb), 0.5);
}

.band.reveal { opacity: 0; transform: translateY(18px); }

.band.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.7s var(--ease);
}

.band__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--crop, 60% 34%);
  opacity: 0;
  transform: translate3d(var(--px), 0, 0) scale(1.04);
  transition: opacity 0.7s var(--ease), transform 0.5s var(--ease);
}

.band.has-art .band__art { opacity: 1; }

.band.has-art:hover .band__art {
  transform: translate3d(var(--px), 0, 0) scale(1.08);
}

.band__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 7, 13, 0.9) 0%, rgba(6, 7, 13, 0.42) 34%,
      rgba(6, 7, 13, 0) 58%, rgba(6, 7, 13, 0.35) 100%),
    linear-gradient(180deg, rgba(6, 7, 13, 0.3), transparent 38%,
      rgba(6, 7, 13, 0.45) 100%);
}

/* Декоративная кромка — у каждой игры своя, см. скины ниже. */
.band__edge { position: absolute; inset: 0; pointer-events: none; }

.band__body {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.35rem;
  align-content: end;
  min-width: 0;
  padding: clamp(1.1rem, 2.4vw, 1.9rem);
}

.band__status {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--card-status);
}

.band__logo {
  max-width: min(100%, 290px);
  max-height: 72px;
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.95));
}

.band.has-logo .band__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.band__title {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9);
}

.band__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.79rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

.band__meta i { font-style: normal; opacity: 0.4; }

/* --- Правая колонка с прогрессом --- */

.band__side {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: end;
  align-content: end;
  gap: 0.35rem;
  padding: clamp(1.1rem, 2.4vw, 1.9rem);
  text-align: right;
  white-space: nowrap;
}

.band__pct {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9);
}

.band__pct i { font-style: normal; font-size: 0.4em; color: var(--card-status); }

.band__count {
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

.band__count b { color: #fff; }

.band__track {
  display: block;
  width: clamp(110px, 15vw, 180px);
  height: 4px;
  margin-top: 0.3rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.band__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--card-status);
  box-shadow: 0 0 12px var(--card-status);
  transition: width 1.1s var(--ease);
}

.band__seal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.2rem;
  font-size: 0.59rem;
  font-weight: 800;
  color: var(--st-completed);
  border: 1.5px solid var(--st-completed);
  border-radius: 50%;
  background: rgba(6, 7, 13, 0.6);
  box-shadow: 0 0 18px rgba(61, 220, 151, 0.4);
}

/*  ============================================================
 *  СКИНЫ ПОЛОС — форма и подсветка под конкретную игру
 *  ============================================================ */

/* --- Cyberpunk: срезанный угол, жёлтая засечка, развёртка --- */
.band[data-skin='cyberpunk-2077'] {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px),
                     calc(100% - 24px) 100%, 0 100%);
}

.band[data-skin='cyberpunk-2077'] .band__edge {
  border-left: 3px solid #fcee0a;
  background:
    linear-gradient(90deg, rgba(252, 238, 10, 0.14), transparent 16%),
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0 2px, transparent 2px 4px);
}

.band[data-skin='cyberpunk-2077'] { --crop: 72% 28%; }

.band[data-skin='cyberpunk-2077'] .band__status {
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.26em;
}

/* --- Elden Ring: золотая двойная рамка с угловыми засечками --- */
.band[data-skin='elden-ring'] { --crop: 52% 38%; }

.band[data-skin='elden-ring'] .band__edge {
  box-shadow: inset 0 0 0 1px rgba(212, 164, 76, 0.4),
              inset 0 0 0 5px rgba(6, 7, 13, 0.5),
              inset 0 0 0 6px rgba(212, 164, 76, 0.2);
}

.band[data-skin='elden-ring'] .band__edge::before,
.band[data-skin='elden-ring'] .band__edge::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid #d4a44c;
}

.band[data-skin='elden-ring'] .band__edge::before {
  left: 11px;
  top: 11px;
  border-width: 1px 0 0 1px;
}

.band[data-skin='elden-ring'] .band__edge::after {
  right: 11px;
  bottom: 11px;
  border-width: 0 1px 1px 0;
}

/* --- Hollow Knight: мягкая форма и свечение из глубины --- */
.band[data-skin='hollow-knight'] { border-radius: 18px; --crop: 62% 36%; }

.band[data-skin='hollow-knight'] .band__edge {
  border-radius: 18px;
  box-shadow: inset 0 0 90px rgba(127, 212, 232, 0.18),
              inset 0 0 0 1px rgba(127, 212, 232, 0.2);
}

/* --- Starfield: технические скобки по углам --- */
.band[data-skin='starfield'] { --crop: 54% 44%; }

.band[data-skin='starfield'] .band__edge {
  box-shadow: inset 0 0 0 1px rgba(159, 180, 199, 0.2);
  background-image:
    linear-gradient(#ff7a3d, #ff7a3d), linear-gradient(#ff7a3d, #ff7a3d),
    linear-gradient(#ff7a3d, #ff7a3d), linear-gradient(#ff7a3d, #ff7a3d);
  background-repeat: no-repeat;
  background-size: 20px 2px, 2px 20px, 20px 2px, 2px 20px;
  background-position:
    12px 12px, 12px 12px,
    calc(100% - 12px) calc(100% - 12px), calc(100% - 12px) calc(100% - 12px);
}

/* --- Fire Emblem: витая кромка как у тканого полотна --- */
.band[data-skin='fire-emblem-fortunes-weave'] { --crop: 50% 42%; }

.band[data-skin='fire-emblem-fortunes-weave'] .band__edge {
  box-shadow: inset 0 0 0 1px rgba(224, 180, 87, 0.28);
}

.band[data-skin='fire-emblem-fortunes-weave'] .band__edge::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, #5b4a9e 0 10px, #e0b457 10px 20px);
  opacity: 0.8;
}

/*  ---------- Пустое состояние ------------------------------ */

.empty {
  display: grid;
  place-items: center;
  gap: 0.6rem;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.empty svg { width: 38px; height: 38px; color: var(--faint); }
.empty h3 { font-size: 1.1rem; font-weight: 700; }
.empty p { max-width: 38ch; font-size: 0.9rem; color: var(--muted); }

/*  ---------- Подвал ---------------------------------------- */

.footer {
  position: relative;
  z-index: 3;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line-soft);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--faint);
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.footer a:hover { color: var(--text); }

/*  ---------- Адаптив --------------------------------------- */

@media (max-width: 760px) {
  .topbar__inner { flex-wrap: wrap; }
  .ticker { margin-left: 0; width: 100%; padding-bottom: 0.3rem; }
  .ticker__cell:first-child { padding-left: 0; border-left: 0; }
  .search { flex-basis: 100%; order: 10; }

  .band,
  .band[data-status='in-progress'] {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 220px;
  }

  .band__side { justify-items: start; text-align: left; padding-top: 0; }
  .band__seal { display: none; }

  /* На узком экране текст идёт ПОД артом, а не сбоку, поэтому
     затемнение тоже должно идти сверху вниз: горизонтальная
     подложка здесь просто гасила картинку. */
  .band__scrim {
    background: linear-gradient(180deg,
      rgba(6, 7, 13, 0.25) 0%, rgba(6, 7, 13, 0.1) 26%,
      rgba(6, 7, 13, 0.82) 62%, rgba(6, 7, 13, 0.96) 100%);
  }

  .band__art { object-position: var(--crop-m, 56% 26%); }
  .band[data-skin='cyberpunk-2077'] { --crop-m: 64% 20%; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { display: none; }
  .band.reveal { opacity: 1; transform: none; }
  .band__art { transform: none !important; }
}
