/*  ============================================================
 *  BASE — общий фундамент для хаба и всех страниц игр
 *  ============================================================
 *  Здесь только сброс и КАРКАС карточек целей: сетка, пропорции,
 *  поведение. Никакой декорации — цвета, рамки, шрифты, формы
 *  и эффекты задаёт каждая страница игры в своём style.css.
 *  ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }

a { color: inherit; }

/* Атрибут hidden должен побеждать любой display из классов. */
[hidden] { display: none !important; }

button {
  font: inherit;
  color: inherit;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/*  ------------------------------------------------------------
 *  ГРУППЫ ЦЕЛЕЙ
 *  Разметку генерирует assets/js/game.js
 *  ------------------------------------------------------------ */

.g-group + .g-group { margin-top: clamp(1.8rem, 4vw, 2.8rem); }

.g-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.g-group__name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.g-group__count {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  opacity: 0.65;
}

/*  ------------------------------------------------------------
 *  КАРТОЧКА ЦЕЛИ
 *  У цели есть свой арт: босс, глава, предмет. Если арта нет,
 *  видно процедурный знак с номером — это штатный вид.
 *  ------------------------------------------------------------ */

.g-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(0.7rem, 1.4vw, 1.1rem);
}

.g-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Арт --- */

.g-card__art {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.g-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.g-card:hover .g-card__art img { transform: scale(1.06); }

/* Крупный номер как запасной арт. */
.g-card__glyph {
  position: absolute;
  right: -0.04em;
  bottom: -0.3em;
  font-size: 5.6rem;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.06em;
  user-select: none;
  pointer-events: none;
}

.g-card.has-art .g-card__glyph { display: none; }

.g-card__veil { position: absolute; inset: 0; pointer-events: none; }

.g-card__no {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- Текст --- */

.g-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem 0.95rem;
}

.g-card__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.g-card__note {
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.68;
}

.g-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.55rem;
}

.g-card__state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.g-card__state i {
  display: grid;
  place-items: center;
  width: 0.78rem;
  height: 0.78rem;
}

.g-card__state svg {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.34, 1.7, 0.64, 1);
}

.g-card.is-done .g-card__state svg { opacity: 1; transform: scale(1); }

.g-card__flag {
  padding: 0.2rem 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.g-card__link {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-left: auto;
  text-decoration: none;
  transition: color 0.25s, background 0.25s, transform 0.25s;
}

.g-card__link svg { width: 0.95rem; height: 0.95rem; }
.g-card__link:hover { transform: translateY(-1px); }

/*  ------------------------------------------------------------
 *  СВОДКА ПО РАЗДЕЛАМ
 *  ------------------------------------------------------------ */

.sum__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.8rem;
  padding: 0.6rem 0;
}

.sum__row + .sum__row { border-top: 1px solid currentColor; }

.sum__name { font-size: 0.82rem; }

.sum__num {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sum__dots {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.sum__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.22;
}

.sum__dots i.is-on { opacity: 1; }

/*  ------------------------------------------------------------
 *  ССЫЛКИ ИГРЫ и ЛОГОТИП
 *  ------------------------------------------------------------ */

[data-links] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.g-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  white-space: nowrap;
}

.g-link svg { flex: none; width: 0.85em; height: 0.85em; }

.game-logo { max-width: 100%; height: auto; }

/*  ------------------------------------------------------------
 *  КОЛЬЦО ПРОГРЕССА
 *  ------------------------------------------------------------ */

.ring { overflow: visible; }

.ring__track { stroke: rgba(255, 255, 255, 0.08); }

.ring__value {
  stroke: var(--accent, #fff);
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/*  ------------------------------------------------------------
 *  УВАЖАЕМ НАСТРОЙКУ «УМЕНЬШИТЬ АНИМАЦИЮ»
 *  ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/*  ------------------------------------------------------------
 *  ПЕЧАТЬ
 *  ------------------------------------------------------------ */

@media print {
  body { background: #fff !important; color: #000 !important; }
  canvas, .fx, [data-fx] { display: none !important; }
}
