:root {
  color-scheme: light;
  --paper: #f1eddf;
  --paper-light: #fffdf5;
  --ink: #11110f;
  --blue: #1645a3;
  --red: #e6472e;
  --yellow: #f5c51b;
  --green: #2c8b57;
  --muted: #5e5b53;
  --line: 3px solid var(--ink);
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  overflow-x: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(17, 17, 15, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 15, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }

a:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.masthead,
main,
.site-footer {
  width: min(1380px, 100%);
  margin-inline: auto;
}

.masthead {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 22px;
  padding: 10px 12px 12px;
  border: var(--line);
  background: var(--paper-light);
  box-shadow: 7px 7px 0 var(--ink);
}

.brand {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  overflow: hidden;
  border: var(--line);
  background: var(--yellow);
}

.brand-mark i:first-child {
  position: absolute;
  left: -3px;
  bottom: -3px;
  width: 30px;
  height: 30px;
  border: var(--line);
  border-radius: 50%;
  background: var(--blue);
}

.brand-mark i:nth-child(2) {
  position: absolute;
  right: -3px;
  top: -3px;
  width: 28px;
  height: 28px;
  border: var(--line);
  background: var(--red);
}

.brand-mark i:last-child {
  position: absolute;
  right: 4px;
  bottom: 3px;
  width: 19px;
  height: 19px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.brand-copy { min-width: 0; }

.brand-copy strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(17px, 2.1vw, 27px);
  font-weight: 950;
  line-height: 0.76;
  letter-spacing: -0.065em;
}

.brand-copy small {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.masthead-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border-left: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: uppercase;
}

.masthead-nav a[data-open-source] { color: var(--blue); }

.star-balance {
  min-width: 104px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 11px;
  border: var(--line);
  background: var(--yellow);
  font-variant-numeric: tabular-nums;
}

.star-shape { display: grid; place-items: center; width: 28px; height: 28px; line-height: 1; }
.star-shape svg, .game-stars svg { display: block; width: 100%; height: 100%; }
.game-stars svg { width: 14px; height: 14px; }
.link-icon { width: 1em; height: 1em; vertical-align: -0.12em; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.star-balance > span:last-child { display: grid; }
.star-balance small { font-size: 7px; font-weight: 950; letter-spacing: 0.08em; white-space: nowrap; }
.star-balance strong { font-family: var(--display); font-size: 24px; line-height: 1; }

.language-switch {
  display: flex;
  align-items: stretch;
  border: var(--line);
  background: var(--paper-light);
}

.language-switch button {
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-left: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.language-switch button:first-child { border-left: 0; }
.language-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper-light); }
.language-switch button:focus-visible { outline: 4px solid var(--yellow); outline-offset: -4px; }

.play-zone { padding-top: clamp(28px, 5vw, 68px); }

.catalog-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  padding: 0 4px clamp(24px, 4vw, 45px);
  border-bottom: var(--line);
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.14em;
  line-height: 1.3;
}

.catalog-intro h1,
.manifesto h2,
.parent-note h2,
.section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 950;
  letter-spacing: -0.075em;
}

.catalog-intro h1 {
  max-width: 950px;
  margin-top: 12px;
  font-size: clamp(46px, 8vw, 110px);
  line-height: 0.82;
}

.catalog-promise > p {
  max-width: 480px;
  margin: 0;
  font-size: clamp(16px, 2vw, 23px);
  font-weight: 750;
  line-height: 1.25;
}

.catalog-promise ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.catalog-promise li {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-top: clamp(22px, 4vw, 44px);
}

.game-link {
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: var(--line);
  background: var(--paper-light);
  box-shadow: 7px 7px 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.game-link:nth-child(4n + 1) .game-copy { border-top-color: var(--blue); }
.game-link:nth-child(4n + 2) .game-copy { border-top-color: var(--red); }
.game-link:nth-child(4n + 3) .game-copy { border-top-color: var(--yellow); }
.game-link:nth-child(4n) .game-copy { border-top-color: var(--green); }

.game-link:active {
  transform: translate(5px, 5px);
  box-shadow: 2px 2px 0 var(--ink);
}

.preview {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  flex: 0 0 auto;
  overflow: hidden;
  contain: paint;
  background: #d7d0bd;
  transition: transform 180ms ease, filter 180ms ease;
}

.preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.preview > span {
  position: absolute;
  left: 0;
  bottom: 0;
  min-width: 44px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border-top: var(--line);
  border-right: var(--line);
  background: var(--yellow);
  font-family: var(--display);
  font-size: 15px;
}

.game-copy {
  min-height: 88px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-top: 9px solid var(--blue);
}

.game-copy > div { min-width: 0; }
.game-copy h2, .game-copy p { margin: 0; }

.game-copy h2 {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--display);
  font-size: clamp(15px, 2.3vw, 21px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-copy p {
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(10px, 1.5vw, 13px);
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-stars {
  min-width: 46px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  background: var(--yellow);
  font-size: 15px;
  line-height: 1;
}

.game-stars strong { font-size: 12px; font-variant-numeric: tabular-nums; }

.manifesto {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-top: clamp(64px, 10vw, 140px);
  border: var(--line);
  box-shadow: 9px 9px 0 var(--ink);
}

.manifesto-art { min-height: 100%; overflow: hidden; border-right: var(--line); background: var(--paper-light); }
.manifesto-art img { width: 100%; height: 100%; object-fit: cover; }

.manifesto-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 72px);
  background: var(--blue);
  color: white;
}

.manifesto-copy .eyebrow { color: var(--yellow); }
.manifesto h2 { margin-top: 18px; overflow-wrap: break-word; font-size: clamp(38px, 4.8vw, 66px); line-height: 0.88; }
.manifesto-copy > p:not(.eyebrow) { margin: 28px 0 0; font-size: clamp(15px, 1.7vw, 19px); font-weight: 600; line-height: 1.48; }

.button-link {
  min-height: 52px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
  padding: 0 18px;
  border: 3px solid white;
  background: var(--yellow);
  box-shadow: 6px 6px 0 white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
}

.parent-note {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(30px, 6vw, 90px);
  margin-top: clamp(70px, 11vw, 150px);
  padding: clamp(28px, 5vw, 68px);
  border: var(--line);
  background: var(--red);
  box-shadow: 9px 9px 0 var(--ink);
}

.parent-note .eyebrow { color: var(--ink); }
.parent-note h2 { margin-top: 16px; color: var(--paper-light); font-size: clamp(42px, 6vw, 78px); line-height: 0.86; }

.parent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: var(--line); border-left: var(--line); }
.parent-grid article { min-width: 0; padding: 18px; border-right: var(--line); border-bottom: var(--line); background: var(--paper-light); }
.parent-grid strong { font-family: var(--display); color: var(--blue); font-size: 15px; }
.parent-grid h3 { margin: 28px 0 9px; font-family: var(--display); font-size: 18px; letter-spacing: -0.04em; line-height: 1; }
.parent-grid p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 650; line-height: 1.45; }

.spec-library { margin-top: clamp(72px, 12vw, 160px); }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr); align-items: end; gap: 30px; padding-bottom: 36px; }
.section-heading .eyebrow { grid-column: 1 / -1; }
.section-heading h2 { max-width: 920px; font-size: clamp(40px, 6vw, 78px); line-height: 0.9; }
.section-heading > p:last-child { max-width: 480px; margin: 0; color: var(--muted); font-size: 16px; font-weight: 650; line-height: 1.45; }

.spec-list { border-top: var(--line); }
.game-spec { border-bottom: var(--line); }
.game-spec details { background: var(--paper-light); }

.game-spec summary {
  min-height: 88px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  cursor: pointer;
  list-style: none;
  transition: background 140ms ease, color 140ms ease;
}

.game-spec summary::-webkit-details-marker { display: none; }
.game-spec summary > span { font-family: var(--display); color: var(--red); font-size: 18px; }
.game-spec summary h3 { margin: 0; font-family: var(--display); font-size: clamp(20px, 3vw, 31px); letter-spacing: -0.055em; line-height: 0.95; }
.game-spec summary p { margin: 7px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.game-spec summary b { min-height: 36px; display: inline-flex; align-items: center; padding: 0 10px; border: 2px solid currentColor; font-size: 9px; letter-spacing: 0.08em; }
.game-spec summary b::after { content: "+"; margin-left: 10px; font-family: var(--display); font-size: 16px; }
.game-spec details[open] summary { background: var(--ink); color: var(--paper-light); }
.game-spec details[open] summary p { color: #c7c1b3; }
.game-spec details[open] summary b::after { content: "−"; }

.spec-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: clamp(24px, 4vw, 52px);
  border-top: var(--line);
  background: var(--paper);
}

.spec-lead {
  grid-column: 1 / -1;
  max-width: 980px;
  margin: 0 0 34px;
  font-size: clamp(18px, 2.2vw, 27px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.spec-body section { padding: 24px; border-top: 2px solid var(--ink); }
.spec-body section:nth-of-type(odd) { border-right: 2px solid var(--ink); }
.spec-body h4 { margin: 0 0 10px; color: var(--blue); font-family: var(--display); font-size: 15px; letter-spacing: -0.03em; text-transform: uppercase; }
.spec-body section p { margin: 0; color: #3f3d38; font-size: 14px; line-height: 1.55; }
.spec-body > a { min-height: 48px; width: fit-content; grid-column: 1 / -1; display: inline-flex; align-items: center; margin-top: 34px; padding: 0 15px; border: var(--line); background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); font-size: 12px; font-weight: 950; text-decoration: none; text-transform: uppercase; }

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  margin-top: clamp(70px, 10vw, 140px);
  padding: clamp(26px, 5vw, 56px);
  background: var(--ink);
  color: var(--paper-light);
}

.site-footer strong { font-family: var(--display); font-size: clamp(28px, 5vw, 56px); letter-spacing: -0.07em; }
.site-footer p { margin: 8px 0 0; color: #c6c0b2; font-size: 12px; font-weight: 700; line-height: 1.4; }
.site-footer > p { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid #66635b; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border: 2px solid var(--paper-light); font-size: 10px; font-weight: 900; text-decoration: none; text-transform: uppercase; }

@media (hover: hover) {
  .masthead-nav a:hover { background: var(--yellow); color: var(--ink); }
  .language-switch button:hover:not([aria-pressed="true"]) { background: var(--yellow); }
  .game-link:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 var(--ink); }
  .game-link:hover .preview { filter: saturate(1.07) contrast(1.02); }
  .game-spec summary:hover { background: var(--yellow); color: var(--ink); }
  .button-link:hover, .spec-body > a:hover { background: var(--red); color: white; }
}

@media (min-width: 600px) {
  body {
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(32px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
  .game-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
}

@media (min-width: 900px) {
  .game-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
}

@media (max-width: 760px) {
  .masthead { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 8px; }
  .masthead-nav { display: none; }
  .language-switch { grid-column: 1 / -1; grid-row: 2; }
  .language-switch button { flex: 1 1 0; }
  .brand-mark { width: 46px; height: 46px; }
  .brand-copy small { max-width: 150px; }
  .star-balance { min-width: 85px; min-height: 50px; padding-inline: 7px; }
  .star-balance small { font-size: 6px; }
  .star-balance strong { font-size: 21px; }
  .star-shape { width: 23px; height: 23px; }
  .catalog-intro, .manifesto, .parent-note, .section-heading { grid-template-columns: 1fr; }
  .catalog-intro { gap: 22px; }
  .catalog-promise > p { font-size: 15px; }
  .manifesto-art { border-right: 0; border-bottom: var(--line); }
  .manifesto-art img { aspect-ratio: 16 / 10; }
  .parent-note { gap: 28px; }
  .section-heading { gap: 20px; }
  .spec-body { grid-template-columns: 1fr; }
  .spec-body section { padding: 20px 0; }
  .spec-body section:nth-of-type(odd) { border-right: 0; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer nav { justify-content: start; }
}

@media (max-width: 420px) {
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { max-width: 108px; font-size: 6px; }
  .catalog-intro h1 { font-size: 43px; }
  .catalog-promise li { font-size: 8px; }
  .game-list { gap: 13px; }
  .game-link { box-shadow: 5px 5px 0 var(--ink); }
  .game-copy { min-height: 84px; padding: 9px; border-top-width: 7px; }
  .game-copy h2 { font-size: 14px; }
  .game-copy p { font-size: 9px; }
  .game-stars { min-width: 38px; min-height: 30px; font-size: 12px; }
  .preview > span { min-width: 38px; min-height: 34px; font-size: 12px; }
  .parent-grid { grid-template-columns: 1fr; }
  .game-spec summary { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding-inline: 9px; }
  .game-spec summary b { display: none; }
  .game-spec summary h3 { font-size: 17px; }
  .game-spec summary p { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
