:root {
  color-scheme: dark;
  font: 16px/1.55 system-ui, sans-serif;
  color: #f3f6ff;
  background: #090c15;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid #8fddff; outline-offset: 4px; }

header {
  background: #0d1220;
  border-bottom: 1px solid #252d42;
}

.bar, main, footer {
  width: min(1160px, calc(100% - 64px));
  margin-inline: auto;
}

.bar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.logo span { color: #8fddff; }

.studio-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid #92dcfb;
  border-radius: 10px;
  background: #a4e5ff;
  color: #0b2037;
  font-weight: 800;
}

.studio-link:hover { background: #c9f0ff; }

main { flex: 1; padding-block: 26px 42px; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 2.7;
  overflow: hidden;
  border: 1px solid #34435a;
  border-radius: 22px;
  padding: clamp(18px, 4vw, 48px);
  background: #152942;
}

.hero picture, .hero img, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero picture { z-index: -2; }
.hero img { display: block; object-fit: cover; object-position: center 54%; }
.hero::after {
  z-index: -1;
  content: '';
  background: linear-gradient(0deg, #080b16e8, transparent 64%),
    linear-gradient(90deg, #0a112ebf, transparent 55%);
}

.hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1.08; letter-spacing: -.07em; }
section { margin-top: clamp(26px, 4vw, 44px); }
section > h2 { margin: 0 0 14px; font-size: clamp(1.2rem, 2.6vw, 1.7rem); letter-spacing: -.04em; }
.listing-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.listing-heading h2 { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.7rem); letter-spacing: -.04em; }
.sort-games { display: flex; gap: 6px; }
.sort-games a { padding: 4px 9px; border: 1px solid #34425e; border-radius: 8px; color: #bdc9df; font-size: .9rem; }
.sort-games [aria-current] { color: #a4e5ff; border-color: #a4e5ff; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr));
  gap: 20px;
}

.game-card { min-width: 0; }

.game-link {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #2c3853;
  border-radius: 16px;
  background: #121a2b;
  transition: border-color .18s ease, background-color .18s ease;
}

.game-link:hover, .game-link:focus-visible { border-color: #8fddff; background: #18253b; }
.game-art { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #17263c; }
.game-info { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 16px 18px 18px; }
.game-info h3 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; overflow-wrap: anywhere; }
.game-info p { margin: 5px 0 14px; color: #bdc9df; }
.game-info .play-count { color: #91d6f1; font-size: .9rem; }
.play-label { margin-top: auto; color: #a4e5ff; font-size: .95rem; font-weight: 800; }
.empty-games { margin: 0; padding: 20px; border: 1px solid #28334b; border-radius: 14px; background: #111827; color: #bfcae0; }
footer { padding-block: 18px 24px; border-top: 1px solid #252d42; color: #98a8c4; font-size: .875rem; }

@media (max-width: 640px) {
  .bar, main, footer { width: calc(100% - 28px); }
  .bar { min-height: 64px; gap: 12px; }
  .logo { font-size: 1.13rem; }
  .studio-link { padding-inline: 14px; font-size: .9rem; }
  main { padding-top: 14px; }
  .hero { aspect-ratio: 1.48; border-radius: 15px; }
  .hero img { object-position: 55% center; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-link { border-radius: 12px; }
  .game-art { aspect-ratio: 1; }
  .game-info { padding: 10px 10px 12px; }
  .game-info h3 { font-size: 1rem; }
  .game-info p { margin-bottom: 10px; font-size: .875rem; }
  .play-label { font-size: .875rem; }
}
