:root {
  color-scheme: dark;
  --canvas: #101119;
  --surface: #191b26;
  --raised: #222534;
  --line: #343749;
  --ink: #f6f5ff;
  --muted: #bcbdd0;
  --accent: #c9fa64;
  --accent-hover: #e2ff9c;
  --on-accent: #171a12;
  --space: clamp(1rem, 3vw, 2rem);
  --width: 75rem;
  --radius: .75rem;
  --display: "Barlow", "Arial", sans-serif;
  font: 100%/1.55 "DM Sans", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  scrollbar-gutter: stable;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img, iframe { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .23em; }
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: .42rem;
  padding: .45rem .85rem;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: background-color 160ms ease;
}
button:hover { background: #303447; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip {
  position: fixed;
  z-index: 2;
  inset: .5rem auto auto .75rem;
  padding: .6rem 1rem;
  background: var(--canvas);
  transform: translateY(-160%);
}
.skip:focus { transform: none; }
.wrap { width: min(var(--width), calc(100% - 2 * var(--space))); margin-inline: auto; }
.mast { border-bottom: 1px solid var(--line); background: var(--surface); }
.mast-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: .9rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  text-decoration: none;
  font: 800 1.4rem/1 var(--display);
  letter-spacing: -.045em;
}
.brand img { margin-right: .55rem; }
.brand span, h1 span { color: var(--accent); }
nav { display: flex; gap: .25rem 1.4rem; flex-wrap: wrap; }
nav[hidden] { display: none; }
nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 650;
  text-decoration: none;
}
nav a:hover, nav a[aria-current] { color: var(--accent); text-decoration: underline; }
main { padding-block: clamp(2rem, 5vw, 4.5rem); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; }
h1 { font-size: clamp(2.75rem, 7vw, 6rem); letter-spacing: -.065em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.5rem, 3.1vw, 2.5rem); letter-spacing: -.035em; }
p { color: var(--muted); }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: var(--space); margin-bottom: var(--space); }
.catalog-heading p { max-width: 31ch; padding-bottom: .3rem; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: .75rem;
  margin: 0 0 clamp(3rem, 7vw, 6rem);
  padding: 0;
  list-style: none;
}
.game {
  grid-column: span 4;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.game img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.game:first-child img { object-position: center 65%; }
.game:nth-child(6) img { object-position: center 30%; }
.game-caption { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .65rem .8rem; }
.game h2 { font-size: clamp(1rem, 2vw, 1.35rem); letter-spacing: -.02em; }
.play, .actions [aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.play:hover, .actions [aria-pressed="true"]:hover { background: var(--accent-hover); }
.play { display: inline-flex; align-items: center; gap: .5rem; }
.play::before { content: ""; border-block: .3em solid transparent; border-left: .46em solid currentColor; }
.guide, .memory {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
  gap: var(--space);
  padding-block: clamp(1.5rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}
.guide p + p, .legal-copy p + p { margin-top: .75rem; }
.guide p, .legal-copy p { max-width: 65ch; }
.memory {
  margin-block: 1rem;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding-inline: var(--space);
}
.memory h2 + p, .actions { margin-top: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
#history-status:not(:empty) { margin-top: .8rem; }
#history-content { border: 1px dashed #545871; border-radius: .5rem; padding: .8rem; }
#recent-list { list-style: none; margin: 0; padding: 0; }
.recent-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.recent-row + .recent-row { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.recent-row img { width: 3.25rem; height: 2.5rem; object-fit: cover; border-radius: .25rem; }
.recent-row h3 { flex: 1; min-width: 5rem; font-size: 1rem; }
.text-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; margin-top: .55rem; color: var(--accent); font-weight: 700; }
.legal { min-height: 54vh; }
.legal h1 { font-size: clamp(2.4rem, 6vw, 5rem); margin-bottom: var(--space); }
.legal-copy { border-top: 1px solid var(--line); max-width: 45rem; padding-block: var(--space); overflow-wrap: anywhere; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { padding-block: 1.5rem; }
.footer-inner p { margin-top: .55rem; }
html:has(#player[open]) { overflow: hidden; }
dialog {
  width: min(68rem, calc(100% - 1.25rem));
  max-width: none;
  max-height: calc(100dvh - 1.25rem);
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1rem 4rem #0009;
}
dialog::backdrop { background: #080910d9; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.player-bar h2 { font-size: clamp(1rem, 4vw, 1.6rem); }
.player-bar button { flex-shrink: 0; }
iframe { width: 100%; height: min(70dvh, 42rem, max(10rem, 100dvh - 8rem)); background: #07080d; border: 0; }
.player-note { padding-top: .55rem; font-size: .85rem; }

@media (min-width: 801px) {
  .game:first-child { grid-column: span 7; grid-row: span 3; grid-template-rows: 1fr auto; }
  .game:first-child img { height: 100%; min-height: 0; aspect-ratio: 2; }
  .game:first-child .game-caption { padding: .9rem 1rem; }
  .game:first-child h2 { font-size: 1.55rem; }
  .game:nth-child(n+2):nth-child(-n+4) {
    grid-column: span 5;
    grid-template-columns: minmax(0, 39%) minmax(0, 1fr);
    grid-template-rows: 1fr;
  }
  .game:nth-child(n+2):nth-child(-n+4) img {
    height: 100%;
    aspect-ratio: 3/2;
    border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  }
}
@media (max-width: 800px) {
  .mast-inner { flex-wrap: wrap; column-gap: .75rem; }
  #primary { flex-basis: 100%; gap: 0 1.25rem; border-top: 1px solid var(--line); padding-top: .5rem; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game { grid-column: auto; }
  .game:first-child { grid-column: 1 / -1; grid-template-columns: minmax(0, 62%) minmax(0, 1fr); grid-template-rows: 1fr; }
  .game:first-child img { height: 100%; aspect-ratio: 2; border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px); }

}
@media (max-width: 590px) {
  .catalog-heading, .footer-inner { flex-direction: column; align-items: flex-start; }
  .catalog-heading { gap: .6rem; }
  .game-caption { flex-direction: column; align-items: flex-start; justify-content: space-between; }
  .game:first-child .game-caption { justify-content: center; }
  .play { justify-content: center; width: 100%; padding-inline: .45rem; }
  .guide, .memory { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
