:root {
  --bg: #07131f;
  --bg-soft: #102033;
  --panel: rgba(11, 28, 46, 0.84);
  --panel-strong: rgba(14, 36, 58, 0.96);
  --panel-border: rgba(164, 202, 255, 0.18);
  --text: #edf5ff;
  --muted: #96a9c0;
  --accent: #6ce0ff;
  --accent-strong: #ffc857;
  --accent-warm: #ff7a59;
  --success: #78e38b;
  --danger: #ff6f6f;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  --radius-xl: 22px;
  --radius-lg: 17px;
  --radius-md: 12px;
  --content-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(108, 224, 255, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 122, 89, 0.12), transparent 24%),
    linear-gradient(180deg, #08121c 0%, #0d1e31 52%, #06111c 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(255,255,255,.75), transparent 92%);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

button {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  touch-action: manipulation;
}

.site-shell {
  width: min(100% - 32px, var(--content-width));
  margin: 0 auto;
  padding-bottom: 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0 10px;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #07131f;
  font-weight: 800;
  letter-spacing: .08em;
  box-shadow: var(--shadow);
}
.brand__text { display: flex; flex-direction: column; gap: 1px; }
.brand__text strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  letter-spacing: .04em;
}
.brand__text small { color: var(--muted); font-size: .82rem; }

.topbar__nav { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.topbar__nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  transition: .2s ease;
}
.topbar__nav a:hover,
.topbar__nav a:focus-visible {
  color: var(--text);
  border-color: var(--panel-border);
  background: rgba(255,255,255,.04);
  outline: none;
}

main { display: flex; flex-direction: column; gap: 24px; }

.hero,
.library,
.about {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

/* --- СЕКЦИЯ HERO --- */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.eyebrow,
.section-head__eyebrow,
.hero-note__label,
.game-card__kicker {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  max-width: 22ch;
}

.hero__lead {
  max-width: 680px;
  font-size: 1.05rem;
}

.hero__lead,
.section-head__text,
.hero-note p,
.about-card p,
.footer p,
.game-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero__actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  font-weight: 600;
}
.button:hover,
.button:focus-visible { transform: translateY(-2px); outline: none; }

.button--primary {
  background: linear-gradient(135deg, var(--accent), #8ceca6);
  color: #07131f;
}
.button--ghost {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: var(--panel-border);
}

.hero__facts,
.about-grid,
.games-grid {
  display: grid;
  gap: 12px;
}

.hero__facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Общие базовые стили для всех типов карточек */
.fact-card,
.hero-note,
.mini-preview,
.game-card,
.about-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  background: var(--panel-strong);
}

.fact-card { padding: 14px; }
.fact-card strong {
  display: block;
  font-size: 1.4rem;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--accent);
  margin-bottom: 4px;
}
.fact-card span { color: var(--muted); font-size: .85rem; line-height: 1.2; }

.hero__panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-note,
.mini-preview { padding: 20px; }

.hero-note h2,
.about-card h3,
.game-card h3 {
  margin: 8px 0 7px;
  font-size: 1.2rem;
}
.mini-preview {
  display: grid;
  gap: 10px;
}
.mini-preview__line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: .94rem;
}
.mini-preview__line strong {
  color: var(--text);
  text-align: right;
}

/* --- СЕКЦИИ КАТАЛОГА И О САЙТЕ --- */
.library,
.about { padding: 22px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.5vw, 2.45rem);
  line-height: 1.08;
}
.section-head__text { max-width: 520px; }

.games-grid { grid-template-columns: repeat(auto-fit, minmax(218px, 1fr)); }

/* Карточка игры с исправленными отступами */
.game-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  padding: 20px;
  transition: transform .2s ease, border-color .2s ease;
}
.game-card:hover,
.game-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(108,224,255,.4);
}
.game-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.game-card__kicker,
.pill,
.meta-note { color: var(--accent); font-size: .82rem; }
.game-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(108,224,255,.12);
  border: 1px solid rgba(108,224,255,.16);
}
.game-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}
.meta-note { color: var(--muted); }

.about-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Карточка описания преимуществ с исправленными отступами */
.about-card {
  padding: 20px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 6px;
  color: var(--muted);
}

/* ==========================================================================
   ПОСЛЕДОВАТЕЛЬНЫЙ АДАПТИВ (МЕДИА-ЗАПРОСЫ)
   ========================================================================== */

/* 1. Ноутбуки и планшеты в ландшафтной ориентации */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* 2. Планшеты в портретной ориентации */
@media (max-width: 800px) {
  .hero__panel {
    display: none;
  }
  .section-head {
    flex-direction: column;
    align-items: start;
    gap: 8px;
  }
}

/* 3. Мобильные устройства (Смартфоны) */
@media (max-width: 640px) {
  .site-shell { 
    width: min(100% - 24px, var(--content-width)); 
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero, .library, .about { 
    padding: 16px; 
    border-radius: 18px; 
  }
  .hero__facts {
    grid-template-columns: 1fr;
  }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .button {
    width: 100%;
  }
  .games-grid {
    grid-template-columns: 1fr;
  }
  .game-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .game-card__footer .button {
    width: 100%;
    text-align: center;
  }
  .footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* 4. Совсем маленькие экраны */
@media (max-width: 400px) {
  .hero h1 {
    font-size: 1.6rem;
  }
}