/* Каталог игр в стиле ДС Холодильник.ру (тема theme-sky2 из shared/hub.css). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  color: #333333; font: 15px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--game-glow, #f5f5f5); background-attachment: fixed;
}
.wrap { max-width: 560px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom)); }

.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 18px; color: #fff; margin-bottom: 12px;
  background: var(--game-gr); box-shadow: 0 10px 24px var(--game-shadow);
}
.hero h1 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -0.01em; }
.hero p { margin: 2px 0 0; font-size: 13px; font-weight: 600; opacity: 0.92; }
.hero-ic { font-size: 34px; }

/* Две плитки в ряд: на телефоне сразу видно 6 игр */
.list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  display: flex; flex-direction: column; color: inherit; text-decoration: none; background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07); transition: transform 0.12s;
}
.card:active { transform: scale(0.97); }
.pic { position: relative; aspect-ratio: 8 / 5; background: #ebebeb; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.played { background: #f4f5f6; box-shadow: none; }
.card.played .pic img { filter: grayscale(1) opacity(0.5); }
.card.played .t { color: #8f8f8f; }
/* Метка на обложке: «+30» или «✓ Сыграно». Класс не «done» — он занят итоговым экраном игр в hub.css. */
.chip {
  position: absolute; left: 6px; bottom: 6px;
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 9px;
  border-radius: 999px; background: #fff; color: #333;
  font-weight: 900; font-size: 11px; line-height: 1; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}
.chip.played { background: rgba(51, 51, 51, 0.72); color: #fff; box-shadow: none; }
/* «🎁 +30 бонусов» — заметно: градиент каталога, крупнее, с тенью */
.chip.bonus {
  height: 26px; padding: 0 11px; font-size: 13px; color: #fff;
  background: linear-gradient(120deg, #ff7120, #e64de6); box-shadow: 0 4px 12px rgba(230, 77, 230, 0.45);
}
.body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.t {
  font-weight: 900; font-size: 14px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.when { margin-top: auto; font-size: 11px; font-weight: 700; color: #8f8f8f; }
.card.played .when { color: #8f8f8f; }
.empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: #8f8f8f; }
.spinner { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; border: 4px solid #e5f6ff; border-top-color: #00aaff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.t .test { margin-left: 6px; vertical-align: middle; font-size: 11px; font-weight: 800; color: #9951e5; background: #f6eeff; border-radius: 6px; padding: 2px 7px; }

/* ——— карточка игры поверх каталога ——— */
.sheet-bg { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 24, 31, 0); transition: background 0.25s; }
.sheet-bg.open { background: rgba(20, 24, 31, 0.45); }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet-bg.open .sheet { transform: none; }
.sheet-grab { position: absolute; z-index: 2; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255, 255, 255, 0.8); }
.sheet-x { position: absolute; z-index: 2; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 16px; cursor: pointer; }
.sheet .hub-gcard { max-width: none; border-radius: 0; box-shadow: none; }
body.sheet-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-bg { transition: none; } }
