:root {
  color: #172033;
  background: #f5f7fb;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
}

button, a, input { font: inherit; }

.app-shell {
  min-height: 100vh;
  background: #f5f7fb;
}

.app-shell__navigation {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 4.5rem;
  padding: 0.75rem max(1rem, 4vw);
  color: #fff;
  background: #18233d;
}

.menu-toggle,
.menu-drawer__close {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  font-weight: 700;
}

.menu-toggle span:first-child { font-size: 1.35rem; }

.app-shell__main {
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.collection-page__heading {
  margin: 0 0 0.75rem;
  color: #18233d;
  font-size: clamp(2.1rem, 7vw, 4.5rem);
  line-height: 1.05;
  text-align: center;
}

.collection-page__intro {
  margin: 0 0 2rem;
  color: #526078;
  text-align: center;
}

.game-grid {
  display: grid;
  gap: 1.25rem;
}

.game-card {
  position: relative;
  display: block;
  min-height: 19rem;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background: #24304d;
  border-radius: 1.1rem;
  box-shadow: 0 0.75rem 2rem rgb(24 35 61 / 15%);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.game-card:hover {
  transform: translateY(-0.2rem);
  box-shadow: 0 1rem 2.5rem rgb(24 35 61 / 24%);
}

.game-card__visual,
.game-card__visual img {
  width: 100%;
  height: 100%;
}

.game-card__visual {
  position: absolute;
  inset: 0;
  background: #52738e;
}

.game-card__visual img {
  display: block;
  object-fit: cover;
}

.game-card__visual--fallback::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  content: "Visual unavailable";
  background: #52738e;
}

.game-card__details {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1.2rem 1.25rem;
  background: linear-gradient(transparent, rgb(11 20 42 / 92%));
}

.game-card__name {
  margin: 0;
  font-size: 1.45rem;
}

.game-card__score { margin: 0.35rem 0 0; color: #e8f1ff; }

.game-card:focus-visible,
.menu-toggle:focus-visible,
.menu-drawer button:focus-visible,
.menu-drawer input:focus-visible {
  outline: 3px solid #ffd166;
  outline-offset: 4px;
}

.menu-layer {
  position: fixed;
  z-index: 10;
  inset: 0;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgb(8 15 32 / 54%);
  cursor: pointer;
}

.menu-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(86vw, 23rem);
  height: 100%;
  padding: 1.5rem;
  color: #172033;
  background: #fff;
  box-shadow: -0.5rem 0 2rem rgb(0 0 0 / 18%);
}

.menu-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.menu-drawer h2,
.menu-drawer h3 { margin: 0; }

.menu-drawer__close {
  color: #172033;
  font-size: 1.8rem;
  line-height: 1;
}

.sound-setting {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  cursor: pointer;
}

.sound-setting input { width: 1.2rem; height: 1.2rem; }

.placeholder-page {
  display: grid;
  align-content: start;
  gap: 1rem;
  max-width: 50rem;
}

.placeholder-page h1,
.placeholder-page p { margin: 0; }

.return-link {
  width: fit-content;
  color: #18233d;
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (min-width: 48rem) {
  .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .game-card { min-height: 22rem; }
}

@media (prefers-reduced-motion: reduce) {
  .game-card { transition: none; }
}
