* { box-sizing: border-box; }

:root {
  --paper: #fcf8ef;
  --ink: #242321;
  --muted: #5b5349;
  --line: #ded6c7;
  --accent: #76501c;
  --highlight: #ffe697;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

a { color: inherit; }

.wrap {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(17px, 4vw, 44px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.045em;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 23px;
  height: 21px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: radial-gradient(circle at 35% 45%, var(--ink) 1px, transparent 1.7px),
              radial-gradient(circle at 65% 45%, var(--ink) 1px, transparent 1.7px),
              var(--highlight);
  box-shadow: 2px 2px var(--ink);
  transform: rotate(-7deg);
}

.lang, footer { color: var(--muted); font-size: 13px; }
.lang a, footer a { text-underline-offset: 2px; }

main { padding: 26px 0 43px; }

.collection-heading, .catalog-heading {
  border: 1px solid #dfd1b8;
  border-radius: 16px;
  margin-bottom: 22px;
  padding: clamp(18px, 4vw, 32px);
  background-color: #f9ebce;
  background-image: radial-gradient(#815c3026 1px, transparent 1px);
  background-size: 12px 12px;
}

.collection-heading, .page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.collection-heading h1, .page-heading h1 {
  margin: 0;
  font-size: clamp(28px, 5.2vw, 54px);
  line-height: 1.1;
  letter-spacing: -.06em;
  font-weight: 820;
}

.collection-heading p, .intro { margin: 9px 0 0; color: var(--muted); }
.catalog-heading .page-heading h1 { font-size: clamp(27px, 4vw, 40px); }

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--highlight);
  box-shadow: 2px 2px var(--ink);
  font-size: 14px;
  font-weight: 730;
  text-decoration: none;
}

.page-link:hover { background: #ffde73; }

.game-card {
  display: block;
  overflow: hidden;
  background: #fffdf8;
  border: 1px solid #dacebb;
  border-radius: 12px;
  text-decoration: none;
}

.game-card:hover { border-color: var(--accent); }
.game-card:hover .game-title { background: #fff3d2; }

.game-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  background: #e9d9ca;
}

.game-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  font-weight: 750;
}

.game-description {
  display: block;
  padding: 0 11px 12px;
  color: var(--muted);
  font-size: 14px;
}

.preview-strip { position: relative; }

.preview-list {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 2px 2px 8px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
}

.preview-list > li { flex: 0 0 clamp(136px, 27%, 270px); scroll-snap-align: start; min-width: 0; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  align-items: start;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.preview-strip:not([data-at-end])::after {
  content: "";
  position: absolute;
  inset: 0 0 8px auto;
  width: 55px;
  background: linear-gradient(to right, transparent, var(--paper));
  pointer-events: none;
}

.preview-step {
  position: absolute;
  z-index: 1;
  top: 44%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: #fffcf3;
  box-shadow: 2px 2px var(--ink);
  color: var(--ink);
  font: 26px/1 system-ui, sans-serif;
  cursor: pointer;
}

.preview-step[hidden] { display: none; }
.preview-step[data-direction="-1"] { left: 5px; }
.preview-step[data-direction="1"] { right: 5px; }
.preview-step:focus-visible, .preview-list:focus-visible, .game-card:focus-visible, .page-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

footer { border-top: 1px solid var(--line); padding: 12px 0 30px; }

@media (max-width: 480px) {
  main { padding-top: 19px; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .preview-list { gap: 8px; }
  .preview-strip:not([data-at-end])::after { width: 37px; }
}
