/* ngy.space: light paper, ink outlines, hard shadows, bright colour only on game art. */
:root {
  --paper: #f8f3e9;
  --card: #fffdf8;
  --ink: #17171f;
  --muted: #55524a;
  --orange: #ff8a4c;
  --teal: #3fd1c0;
  --blue: #7da2ff;
  --yellow: #ffd84a;
  --pink: #ff9fbd;
  --lime: #b4e66a;
  --bw: 2.5px;
  --shadow: 5px 5px 0 var(--ink);
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 32px);
  --max: 1120px;
  --display: "Big Shoulders Display Variable", "Arial Narrow", sans-serif;
  --text: "Hanken Grotesk Variable", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.55 var(--text);
  background-image: radial-gradient(rgba(23, 23, 31, .07) 1px, transparent 1px); background-size: 22px 22px;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 .8em; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1; letter-spacing: .005em; margin: 0 0 .3em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

main, .top, .foot-inner, .fine { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
main > section, main > .stage, main > details { margin-top: clamp(40px, 6vw, 72px); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 18px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.8rem/1 var(--display); text-decoration: none; }
.dot { width: 20px; height: 20px; border-radius: 50%; background: var(--orange); border: var(--bw) solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.top nav, .foot nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a, .foot nav a { text-decoration: none; padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center;
  border-radius: 999px; border: var(--bw) solid transparent; font-weight: 700; }
.top nav a:hover { border-color: var(--ink); background: var(--card); }

/* hero */
.hero { padding-top: clamp(8px, 3vw, 32px); }
main > .hero { margin-top: 8px; }
.hero h1 { font-size: clamp(3.6rem, 11vw, 8rem); line-height: .9; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 44ch; }
.chips { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: var(--bw) solid var(--ink); padding: 3px 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.chips li:nth-child(1) { background: var(--yellow); }
.chips li:nth-child(2) { background: var(--teal); }
.chips li:nth-child(3) { background: var(--pink); }
.chips li:nth-child(4) { background: var(--lime); }

.sec-title { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 20px; }

/* shelf header: title, genre filter, random pick */
.shelf-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.shelf-head .sec-title { margin: 0; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font: inherit; font-weight: 700; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: var(--bw) solid var(--ink); background: var(--card); color: var(--ink); }
.filters button:hover { background: var(--yellow); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* game cards */
.grid, .shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; text-decoration: none; background: var(--card);
  border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease; }
a.card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
a.card:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.thumb { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--tile, var(--yellow));
  border-bottom: var(--bw) solid var(--ink); overflow: hidden; }
.thumb svg { width: 52%; height: auto; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.best { position: absolute; top: 12px; left: 12px; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 8px;
  font-weight: 800; font-size: .85rem; padding: 2px 10px; transform: rotate(-4deg); box-shadow: 2px 2px 0 var(--ink); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: clamp(1.8rem, 2.6vw, 2.2rem); margin-bottom: 4px; }
.card-body p { color: var(--muted); margin: 0 0 14px; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.genre { font-size: .9rem; font-weight: 700; color: var(--muted); }
.cta { font-weight: 800; background: var(--ink); color: var(--card); padding: 4px 16px; border-radius: 999px; }
a.card:hover .cta { background: var(--tile); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.card.soon { box-shadow: 3px 3px 0 var(--ink); }
.card.soon .thumb { filter: saturate(.55); }
.card.soon .cta { background: none; color: var(--muted); padding: 0; }
.grid.compact .card-body p { display: none; }
.grid.compact .card-body h3 { font-size: 1.6rem; }

.c-orange { --tile: var(--orange); } .c-teal { --tile: var(--teal); } .c-blue { --tile: var(--blue); }
.c-yellow { --tile: var(--yellow); } .c-pink { --tile: var(--pink); } .c-lime { --tile: var(--lime); }

/* panels */
.panel { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 32px); }
.about { max-width: 760px; }
.about h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.about p { margin: 0; color: var(--muted); font-size: 1.1rem; }


.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.note { display: block; text-decoration: none; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink); padding: 16px 18px; }
.note:hover { background: var(--yellow); }
.note h3 { font-size: 1.6rem; }
.note p { margin: 0; color: var(--muted); }

/* buttons */
.btn { font: inherit; font-weight: 800; cursor: pointer; background: var(--yellow); color: var(--ink); border: var(--bw) solid var(--ink);
  border-radius: 999px; padding: 0 20px; min-height: 44px; box-shadow: 3px 3px 0 var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.alt { background: var(--card); }

/* game page */
.back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-weight: 700; text-underline-offset: 4px; }
.back::before { content: "\2190"; margin-right: 8px; }
main > .back { width: fit-content; }
.game-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 8px !important; }
.game-intro h1, .page-head h1 { font-size: clamp(3rem, 8vw, 5.5rem); line-height: .9; }
.game-intro .lead { margin-bottom: 0; }
.meta { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; border: var(--bw) solid var(--ink); background: var(--card); border-radius: 999px; padding: 0 12px; font-size: .9rem; font-weight: 700; }
.best-chip { background: var(--yellow); }
.stage { border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; background: #000; }
.stage-inner { aspect-ratio: var(--aspect, 16 / 10); }
@media (max-width: 600px) { .stage-inner { aspect-ratio: var(--aspect-mobile, 16 / 10); } }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage-bar { margin: 14px 0 0; display: flex; justify-content: flex-end; }

.slip { margin-top: 20px !important; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px clamp(16px, 3vw, 28px); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 32px;
  animation: slip-in .3s cubic-bezier(.2, .8, .2, 1); }
.slip h2 { font-size: 1.4rem; margin: 0; }
.slip-score p { margin: 0; font-weight: 700; }
.slip-score strong { font: 800 clamp(3rem, 7vw, 4.5rem)/1 var(--display); margin-right: 6px; }
.slip-best { margin: 0; color: var(--muted); font-size: 1.1rem; }
.slip.is-best { background: var(--yellow); }
.slip.is-best .slip-best { color: var(--ink); font-weight: 800; }
.slip-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.slip-actions .btn:not(.alt) { background: var(--orange); }
@keyframes slip-in { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--radius); padding: 0 clamp(16px, 3vw, 28px); max-width: 760px; }
.sheet summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; font: 800 1.8rem/1 var(--display); }
.sheet[open] { box-shadow: 4px 4px 0 var(--ink); }
.sheet p, .sheet ol { color: var(--muted); max-width: 60ch; }
.sheet ol { padding-left: 1.3em; margin: 0 0 18px; }
.page-head { max-width: 760px; margin-top: 8px; }

/* footer */
.foot { margin-top: clamp(56px, 9vw, 112px); border-top: var(--bw) solid var(--ink); background: var(--card); padding: 28px 0 32px; }
.foot-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.sub label { display: block; font: 800 1.5rem/1.1 var(--display); margin-bottom: 10px; }
.sub-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sub input { font: inherit; padding: 0 16px; min-height: 44px; border: var(--bw) solid var(--ink); border-radius: 999px; background: #fff; min-width: min(100%, 280px); }
.sub p { margin: 8px 0 0; min-height: 1.5em; color: var(--muted); }
.fine { margin: 20px auto 0; color: var(--muted); font-size: .9rem; }

@media (max-width: 900px) {
  .grid, .shelf, .trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slip { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid, .shelf, .trio { grid-template-columns: 1fr; }
  .top nav a { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, .slip { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
