:root {
  --bg: #0f1226;
  --bg-2: #161b38;
  --panel: #1a2044;
  --panel-2: #202750;
  --text: #f2f5ff;
  --muted: #98a2c8;
  --gold: #ffcf4a;
  --gold-2: #e8a91b;
  --line: rgba(255, 255, 255, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 60% at 50% -10%, #242a58 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 55%);
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- шапка ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 15px;
}

.brand:hover { text-decoration: none; }

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffe08a, var(--gold-2));
  color: #3a2500;
  font-size: 12px;
}

.topbar__nav { display: flex; gap: 18px; font-size: 14px; }
.topbar__nav a { color: var(--muted); }
.topbar__nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- контент ---------- */

.wrap {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) 0 72px;
  flex: 1 0 auto;
}

.hero { max-width: 720px; margin-bottom: 34px; }

.hero h1 {
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}

.hero__lead { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.55; margin: 0; }

h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 16px; }
h2 { font-size: clamp(20px, 2.4vw, 26px); margin: 28px 0 10px; }
p { line-height: 1.6; }

/* ---------- каталог ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(255, 207, 74, 0.35);
  background: linear-gradient(180deg, rgba(255, 207, 74, 0.09), rgba(255, 255, 255, 0.02));
}

.card__icon {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #0b0e1f;
}

.card__icon--empty { display: grid; place-items: center; font-size: 34px; }

.card__body { min-width: 0; flex: 1 1 auto; }
.card__title { font-weight: 800; font-size: 18px; margin-bottom: 2px; }
.card__genre { color: var(--gold); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 6px; }
.card__desc { color: var(--muted); font-size: 14px; line-height: 1.45; }

.card__play {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #3a2500;
  background: linear-gradient(180deg, #ffe08a, var(--gold-2));
  padding: 9px 16px;
  border-radius: 999px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty__title { color: var(--text); font-weight: 800; font-size: 20px; margin-bottom: 8px; }

/* ---------- страница игры ---------- */

.backlink { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.game-head {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.game-head__icon {
  width: 128px;
  height: 128px;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.game-head__genre {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.game-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  color: #3a2500;
  background: linear-gradient(180deg, #ffe08a, var(--gold-2));
  box-shadow: 0 10px 24px rgba(255, 207, 74, 0.22);
}

.btn--primary:hover { filter: brightness(1.05); }

.btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }

.btn--sm { padding: 9px 14px; font-size: 13px; }
.btn--xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn--danger { color: #fff; background: rgba(255, 90, 95, 0.85); }
.btn--danger:hover { background: rgba(255, 90, 95, 1); }

.game-body { max-width: 740px; color: #d7ddf5; font-size: 16px; }
.game-body p { margin: 0 0 14px; }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0b0e1f; }
.shot img { display: block; width: 100%; height: auto; }

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

.footer {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 22px 16px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer__sep { opacity: 0.5; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ---------- 404 ---------- */

@media (max-width: 560px) {
  .card { flex-wrap: wrap; }
  .card__icon { width: 72px; height: 72px; border-radius: 12px; }
  .card__play { width: 100%; text-align: center; }
}
