:root {
  --ink: #101828;
  --muted: #667085;
  --paper: #f7f8fb;
  --card: #ffffff;
  --line: #e4e7ec;
  --blue: #4169e1;
  --blue-dark: #2949ad;
  --lime: #c6ff45;
  --navy: #101735;
  --radius-xl: 30px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.modal-open { overflow: hidden; }
.hidden { display: none !important; }
.catalog-status { padding: 56px 20px; color: var(--muted); text-align: center; }
.catalog-status strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 22px; }
.game-card__cover:focus-visible, .game-card__body button:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(65,105,225,.45); outline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0 5vw;
  background: rgba(247, 248, 251, 0.9);
  border-bottom: 1px solid rgba(228, 231, 236, 0.8);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; font-size: 21px; font-weight: 850; letter-spacing: -0.04em; }
.brand__mark { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 11px; color: var(--navy); background: var(--lime); font-size: 18px; transform: rotate(-4deg); }
.site-header nav { display: flex; align-items: center; gap: 34px; color: #475467; font-size: 14px; font-weight: 650; }
.site-header nav a:hover { color: var(--blue); }

.header-search { justify-self: end; display: flex; align-items: center; gap: 8px; width: min(250px, 100%); padding: 10px 13px; color: #98a2b3; background: white; border: 1px solid var(--line); border-radius: 14px; }
.header-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(65,105,225,.13); }
.header-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }

.hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin: 22px 3vw 0;
  border-radius: var(--radius-xl);
  background: var(--navy);
  color: white;
}
.hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero__overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,16,40,.98) 0%, rgba(11,16,40,.87) 36%, rgba(11,16,40,.26) 75%, rgba(11,16,40,.08) 100%), linear-gradient(0deg, rgba(9,14,34,.45), transparent 45%); }
.hero__content { position: relative; z-index: 2; width: min(650px, 62vw); padding: 80px 7vw 120px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--lime); font-size: 12px; line-height: 1; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 22px; height: 3px; border-radius: 99px; background: currentColor; }
.eyebrow--dark { color: var(--blue); }
.hero h1 { max-width: 620px; margin: 22px 0 20px; font-size: clamp(46px, 6.2vw, 88px); line-height: .94; letter-spacing: -.07em; }
.hero__content > p { max-width: 560px; margin: 0; color: #d0d5dd; font-size: 18px; line-height: 1.65; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border: 1px solid transparent; border-radius: 15px; font-weight: 780; transition: transform .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); }
.button--primary { color: var(--navy); background: var(--lime); box-shadow: 0 12px 36px rgba(198,255,69,.18); }
.button--ghost { color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); backdrop-filter: blur(8px); }
.hero__stats { position: absolute; z-index: 2; right: 2.5vw; bottom: 28px; display: flex; align-items: center; gap: 1px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(11,16,40,.74); backdrop-filter: blur(15px); }
.hero__stats span { display: grid; gap: 2px; min-width: 135px; padding: 17px 22px; color: #aeb7ca; font-size: 12px; }
.hero__stats span + span { border-left: 1px solid rgba(255,255,255,.14); }
.hero__stats strong { color: white; font-size: 20px; }

.catalog-shell { max-width: 1480px; margin: 0 auto; padding: 104px 5vw; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-heading h2, .about h2 { margin: 12px 0 0; font-size: clamp(34px, 4vw, 60px); line-height: 1; letter-spacing: -.055em; }
.section-heading > p { margin: 0 0 7px; color: var(--muted); font-size: 14px; }
.category-row { display: flex; gap: 9px; overflow-x: auto; padding: 4px 2px 18px; scrollbar-width: none; }
.category-row::-webkit-scrollbar { display: none; }
.category-row a { flex: 0 0 auto; padding: 11px 17px; border: 1px solid var(--line); border-radius: 12px; color: #475467; background: white; font-size: 13px; font-weight: 720; }
.category-row a:hover, .category-row .is-active { color: white; border-color: var(--blue); background: var(--blue); }

.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
.game-card { min-width: 0; }
.game-card__cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; padding: 0; border: 0; border-radius: var(--radius-lg); background: #d9dcec; box-shadow: 0 4px 12px rgba(16,24,40,.04); }
.game-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2,.7,.2,1), filter .3s ease; }
.game-card:hover .game-card__cover img { transform: scale(1.05); filter: brightness(.78); }
.game-card__play { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 52px; aspect-ratio: 1; padding-left: 4px; color: var(--navy); background: var(--lime); border-radius: 50%; opacity: 0; transform: translate(-50%, -35%) scale(.85); transition: .25s ease; box-shadow: 0 14px 32px rgba(0,0,0,.25); }
.game-card:hover .game-card__play, .game-card__cover:focus-visible .game-card__play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.game-card__badge { position: absolute; top: 12px; left: 12px; padding: 6px 9px; border-radius: 8px; color: var(--navy); background: var(--lime); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.game-card__fallback { display: grid; place-items: center; width: 100%; height: 100%; color: white; background: var(--blue); font-size: 28px; font-weight: 900; }
.game-card__body { padding: 13px 3px 0; }
.game-card__body p { margin: 0 0 5px; color: var(--blue); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.game-card__body button { display: block; max-width: 100%; overflow: hidden; padding: 0; border: 0; color: var(--ink); background: none; font-size: 17px; line-height: 1.3; font-weight: 760; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.game-card__body button:hover { color: var(--blue); }
.load-more { display: block; margin: 50px auto 0; padding: 15px 24px; border: 1px solid #cdd4e4; border-radius: 14px; color: var(--blue-dark); background: white; font-weight: 780; }
.load-more:hover { border-color: var(--blue); box-shadow: 0 8px 24px rgba(65,105,225,.12); }
.empty-state { padding: 72px 24px; border: 1px dashed #cbd2df; border-radius: var(--radius-lg); text-align: center; background: white; }
.empty-state strong { font-size: 24px; }
.empty-state p { color: var(--muted); }
.empty-state a { display: inline-block; padding: 11px 16px; border-radius: 10px; color: white; background: var(--blue); font-weight: 750; }

.about { display: grid; grid-template-columns: 1.25fr 1fr auto; align-items: end; gap: 48px; margin: 0 3vw 32px; padding: 74px 6vw; border-radius: var(--radius-xl); color: white; background: var(--navy); }
.about p { margin: 0; color: #b8c0d1; line-height: 1.65; }
.about a { padding-bottom: 5px; color: var(--lime); border-bottom: 1px solid currentColor; font-weight: 750; white-space: nowrap; }
footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 30px 5vw 50px; color: var(--muted); font-size: 13px; }
footer p { margin: 0; }
footer > span { justify-self: end; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(7,11,28,.86); backdrop-filter: blur(14px); animation: fade-in .2s ease; }
.game-modal { width: min(1180px, 96vw); max-height: 94vh; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 24px; background: #0a1026; box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.game-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding: 14px 18px 14px 24px; color: white; }
.game-modal__header span { color: var(--lime); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.game-modal__header h2 { margin: 3px 0 0; font-size: clamp(18px, 2.5vw, 28px); letter-spacing: -.03em; }
.game-modal__actions { display: flex; gap: 8px; }
.game-modal__actions button { min-height: 42px; padding: 0 14px; border: 1px solid rgba(255,255,255,.17); border-radius: 11px; color: white; background: rgba(255,255,255,.08); }
.game-modal__actions .close-button { width: 42px; padding: 0; color: var(--navy); background: var(--lime); border-color: var(--lime); font-size: 27px; line-height: 1; }
.game-player { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.game-player iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.game-player:fullscreen { display: grid; place-items: center; background: #000; }
.game-player:fullscreen iframe { width: 100vw; height: 100vh; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1020px) {
  .site-header { grid-template-columns: auto 1fr; gap: 22px; }
  .site-header nav { display: none; }
  .header-search { width: 100%; }
  .hero { min-height: 590px; }
  .hero__content { width: 78vw; padding-bottom: 140px; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .about { grid-template-columns: 1fr 1fr; }
  .about a { grid-column: 2; justify-self: start; }
}

@media (max-width: 720px) {
  .site-header { min-height: 66px; padding: 0 18px; }
  .brand { font-size: 18px; }
  .brand__mark { width: 30px; border-radius: 9px; }
  .header-search { padding: 9px 11px; }
  .hero { min-height: 630px; margin: 10px 10px 0; border-radius: 22px; align-items: end; }
  .hero__image { object-position: 66% center; }
  .hero__overlay { background: linear-gradient(0deg, rgba(9,14,34,.99) 5%, rgba(9,14,34,.84) 50%, rgba(9,14,34,.16) 100%); }
  .hero__content { width: 100%; padding: 52px 24px 154px; }
  .hero h1 { margin-top: 16px; font-size: clamp(42px, 13vw, 62px); }
  .hero__content > p { font-size: 15px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__stats { right: 14px; left: 14px; bottom: 16px; }
  .hero__stats span { min-width: 0; flex: 1; padding: 13px 10px; text-align: center; }
  .hero__stats strong { font-size: 16px; }
  .catalog-shell { padding: 74px 18px; }
  .section-heading { align-items: start; }
  .section-heading > p { display: none; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
  .game-card__cover { border-radius: 15px; aspect-ratio: 1 / 1; }
  .game-card__body button { font-size: 14px; }
  .game-card__body p { font-size: 9px; }
  .game-card__badge { top: 8px; left: 8px; }
  .game-card__play { opacity: 1; width: 42px; transform: translate(-50%, -50%) scale(1); }
  .about { grid-template-columns: 1fr; gap: 24px; margin: 0 10px 18px; padding: 48px 24px; border-radius: 22px; }
  .about a { grid-column: auto; }
  footer { grid-template-columns: 1fr auto; padding: 24px 18px 36px; }
  footer p { display: none; }
  .modal-backdrop { padding: 0; }
  .game-modal { width: 100vw; max-height: 100vh; border: 0; border-radius: 0; }
  .game-modal__header { min-height: 68px; padding: 10px 10px 10px 16px; }
  .game-modal__actions button:first-child { display: none; }
  .game-player { height: calc(100vh - 68px); aspect-ratio: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
