:root {
  color-scheme: dark;
  --bg: #121116;
  --surface: #1b191f;
  --surface-up: #232027;
  --line: #37313e;
  --fg: #f7f3f3;
  --muted: #b8b0bd;
  --accent: #ff8057;
  --title: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Outfit', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; background: radial-gradient(ellipse at 86% 7%, #2a1a28 0, transparent 40rem), var(--bg); color: var(--fg); font: 16px/1.5 var(--body); }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid #ffb79c; outline-offset: 4px; }
.shell { width: min(1200px, calc(100% - 72px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 5; top: 10px; left: 10px; padding: 10px; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.topbar { border-bottom: 1px solid #2b272f; }
.topbar-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand, .nav, .nav-link { display: flex; align-items: center; }
.brand { gap: 10px; font: 700 20px/1 var(--title); letter-spacing: -.05em; }
.brand img { flex: none; }
.brand-arcade { margin-left: 4px; color: var(--accent); }
.nav { gap: 30px; }
.nav-link { min-height: 44px; gap: 6px; border: 0; padding: 0; background: none; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav-link:hover, .nav-link[aria-pressed='true'] { color: var(--accent); }
.nav-favorites { padding-inline: 12px; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; }

.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 420px; margin-block: 28px 46px; display: grid; align-items: center; border: 1px solid #4a3040; border-radius: 22px; background: #17141d; }
.hero-atmosphere, .hero::after { position: absolute; inset: 0; pointer-events: none; }
.hero-atmosphere {
  z-index: -2;
  left: 32%;
  background:
    radial-gradient(ellipse at 64% 68%, #ad443560, transparent 68%),
    radial-gradient(#ffc5a324 1px, transparent 1px) 0 0 / 21px 21px,
    linear-gradient(145deg, #251a2b, #39253e 47%, #682e41);
}
.hero-sun {
  position: absolute;
  top: 11%;
  left: 44%;
  width: min(28vw, 285px);
  aspect-ratio: 1;
  border: 1px solid #ffb98a92;
  border-radius: 50%;
  background: linear-gradient(165deg, #fd9a6e 0%, #ee6955 39%, #a93e52 100%);
  box-shadow: 0 0 70px #fb78506b, 0 0 0 18px #fb7b4812, 0 0 0 39px #fb7b480b;
}
.hero-sun::after {
  content: '';
  position: absolute;
  inset: 35% -1px -1px;
  border-radius: 0 0 180px 180px;
  background: repeating-linear-gradient(0deg, #84244f73 0 2px, transparent 3px 14px);
}
.hero-ridge {
  position: absolute;
  inset: 29% -10% -18% -7%;
  background: linear-gradient(167deg, #715163, #312238 57%, #1a1523);
  clip-path: polygon(0 68%, 13% 59%, 28% 71%, 46% 42%, 56% 35%, 62% 17%, 70% 26%, 77% 51%, 83% 47%, 100% 72%, 100% 100%, 0 100%);
}
.hero-ridge-front {
  inset: 48% -20% -13% -6%;
  background: linear-gradient(155deg, #432338, #1c1725 60%);
  clip-path: polygon(0 59%, 17% 35%, 33% 58%, 50% 48%, 67% 67%, 83% 54%, 100% 67%, 100% 100%, 0 100%);
}
.hero::after { content: ''; z-index: -1; background: linear-gradient(90deg, #17141d 9%, #17141d 24%, #17141dd9 38%, #17141d38 58%, transparent 80%), linear-gradient(0deg, #17141da6, transparent 43%); }
.hero-copy { padding: 44px 51px; }
.hero-label { display: flex; align-items: center; gap: 8px; color: #ffc4b1; font-size: .76rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.hero-label span { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px #ff805799; }
.hero h1 { margin-block: 14px 16px; font: 700 clamp(3.1rem, 6.4vw, 6.3rem)/.91 var(--title); letter-spacing: -.09em; }
.hero h1 span { color: var(--accent); }
.hero-description { max-width: 31ch; color: #ded2df; font-size: 1.07rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; padding: 8px 17px; border: 1px solid transparent; border-radius: 10px; font-weight: 600; line-height: 1.2; transition: background .18s, border-color .18s, color .18s; }
.button-primary { background: var(--accent); color: #21141a; }
.button-primary:hover { background: #ffa083; }
.button-quiet, .button-outline { border-color: #65505c; background: #271d2766; }
.button-quiet:hover, .button-outline:hover { background: #3b2734; border-color: #a17687; }

.catalog { scroll-margin-top: 20px; }
.section-heading, .filter-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2 { font: 700 clamp(1.9rem, 3.5vw, 2.8rem)/1.05 var(--title); letter-spacing: -.065em; }
.section-heading p { margin-top: 7px; color: var(--muted); }
.search { display: flex; align-items: center; gap: 7px; width: min(100%, 270px); min-height: 44px; padding-inline: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); }
.search svg { flex: none; }
.search:focus-within { border-color: var(--accent); }
.search input { min-width: 0; width: 100%; align-self: stretch; color: var(--fg); border: 0; background: none; outline: none; }
.search input::placeholder { color: #a8a0b0; }
.filter-row { margin-block: 20px 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { min-height: 38px; padding: 6px 15px; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); background: var(--surface); font-size: .9rem; font-weight: 600; }
.filter:hover { border-color: #846463; color: var(--fg); }
.filter[aria-pressed='true'] { border-color: var(--accent); background: var(--accent); color: #24141c; }
.catalog-count { flex: none; color: var(--muted); font-size: .88rem; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.game-card { overflow: hidden; position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); transition: border-color .2s, transform .2s; }
.game-card:hover, .game-card:focus-within { border-color: var(--game-color); }
.game-card:hover { transform: translateY(-3px); }
.card-art { position: relative; display: grid; place-items: center; aspect-ratio: 2.06; border-bottom: 1px solid #37313e; background: linear-gradient(135deg, #282530, #211e28); color: #a39aaf; }
.card-art::before { content: ''; position: absolute; inset: 10px; border: 1px dashed #514859; border-radius: 9px; pointer-events: none; }
.card-art span { font-size: .78rem; }
.card-art .cover-label { display: grid; justify-items: center; gap: 4px; }
.card-copy { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 10px; padding: 15px 16px 16px; }
.card-category { color: var(--game-color); display: block; font-size: .72rem; line-height: 1.25; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.card-title { margin-top: 4px; font: 700 1.58rem/1.1 var(--title); letter-spacing: -.055em; }
.card-title button { display: inline; padding: 0; border: 0; background: none; font: inherit; text-align: left; letter-spacing: inherit; }
.card-title button::after { content: ''; position: absolute; inset: 0; }
.card-description { grid-column: 1 / -1; color: var(--muted); font-size: .92rem; }
.card-play { display: grid; grid-column: 2; grid-row: 1; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; color: var(--fg); background: var(--surface-up); transition: color .2s, background .2s; }
.game-card:hover .card-play { background: var(--game-color); color: #22151c; }
.favorite { position: absolute; z-index: 1; top: 10px; right: 10px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #fff4; border-radius: 10px; color: #fff; background: #17131ccd; }
.favorite:hover, .favorite[aria-pressed='true'] { color: #ffa88c; background: #241824; }
.favorite[aria-pressed='true'] svg { fill: currentColor; }
.empty { grid-column: 1 / -1; padding: 42px 20px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--fg); font: 700 1.2rem/1.3 var(--title); margin-bottom: 4px; }

.daily-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-block: 24px 40px; padding: 16px 18px; border: 1px solid #44313d; border-radius: 14px; background: linear-gradient(105deg, #281c28, #1d1923 74%); scroll-margin-top: 20px; }
.daily-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; background: #3b2630; color: #ffab8d; }
.daily-strip h2 { font: 700 1.22rem/1.3 var(--title); letter-spacing: -.03em; }
.daily-strip p { color: var(--muted); font-size: .9rem; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-block: 20px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .87rem; }
.footer strong { margin-right: 6px; color: var(--fg); font-family: var(--title); }
.footer a:hover { color: var(--accent); }

.game-dialog { position: fixed; inset: 0; width: min(660px, calc(100% - 30px)); max-height: min(90dvh, 820px); padding: 20px; border: 1px solid #5d4659; border-radius: 18px; background: var(--surface); color: var(--fg); box-shadow: 0 20px 120px #000a; }
.game-dialog::backdrop { background: #0d0a12d9; backdrop-filter: blur(4px); }
.dialog-head, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-category { color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.dialog-head h2 { font: 700 clamp(1.7rem, 5vw, 2.6rem)/1.1 var(--title); letter-spacing: -.055em; }
.close-button { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-up); font-size: 1.75rem; line-height: 1; }
.close-button:hover { border-color: var(--accent); }
.game-instructions { margin-block: 10px 14px; color: var(--muted); }
.game-stage {
  min-height: 205px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed #665665;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 50%, #25202c, #17141d);
  color: var(--muted);
  text-align: center;
}
.dialog-footer { justify-content: end; margin-top: 12px; }
@media (max-width: 850px) {
  .shell { width: calc(100% - 40px); }
  .hero { min-height: 404px; }
  .hero-copy { padding-inline: 32px; }
  .hero-atmosphere { left: 25%; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 26px); }
  .topbar-inner { min-height: 61px; gap: 7px; }
  .brand { font-size: 1rem; gap: 6px; }
  .brand img { width: 31px; height: 31px; }
  .nav { gap: 10px; }
  .nav-link { font-size: .86rem; }
  #nav-catalog, .nav-favorites span { display: none; }
  .nav-favorites { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .hero { min-height: 432px; align-items: end; margin-block: 16px 32px; border-radius: 15px; }
  .hero-atmosphere { left: 0; bottom: 20%; }
  .hero-sun { left: auto; right: 13%; width: min(43vw, 185px); }
  .hero::after { background: linear-gradient(0deg, #17141d 5%, #17141d 28%, #17141df2 43%, #17141d00 82%); }
  .hero-copy { padding: 20px 17px 23px; }
  .hero-label { font-size: .68rem; }
  .hero h1 { margin-block: 10px; font-size: clamp(3rem, 13vw, 4.4rem); }
  .hero-description { font-size: .95rem; }
  .hero-actions { margin-top: 15px; }
  .section-heading { align-items: stretch; flex-direction: column; gap: 10px; }
  .search { width: 100%; }
  .filter-row { align-items: start; gap: 7px; flex-wrap: wrap; margin-block: 12px; }
  .filter { min-height: 36px; padding-inline: 10px; font-size: .84rem; }
  .filters { gap: 5px; }
  .game-grid { gap: 9px; }
  .game-card { border-radius: 11px; }
  .card-art { aspect-ratio: 1.45; }
  .card-art .cover-label { gap: 3px; }
  .card-art .cover-label span { font-size: .69rem; }
  .card-copy { padding: 10px; gap: 6px; }
  .card-category { font-size: .61rem; }
  .card-title { font-size: 1.28rem; }
  .card-description { font-size: .82rem; line-height: 1.4; }
  .card-play { width: 27px; height: 27px; }
  .favorite { width: 34px; height: 34px; top: 6px; right: 6px; }
  .daily-strip { grid-template-columns: auto 1fr; gap: 9px; margin-bottom: 25px; padding: 12px; }
  .daily-strip .button { grid-column: 2; justify-self: start; }
  .game-dialog { padding: 12px; }
  .game-stage { padding: 8px; }
}

@media (max-width: 345px) {
  .card-copy { grid-template-columns: 1fr; }
  .card-play { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
