/* Final Fantasy game picker, "The shop shelf": real boxes, true to scale, on steel shelving.
   Bungee / Wix Madefor Text / Ubuntu Sans Mono. Concrete, steel, ink, and price-gun orange
   for the one loud thing: your progress, the chosen switch and keyboard focus. */
:root {
  --ground: #dcd8d0;
  --ground-2: #d2cec5;
  --steel: #2a2c30;
  --steel-2: #44474d;
  --ink: #141210;
  --soft: #4a4640;
  --paper: #fbfaf7;
  --orange: #ff5f1f;
  --mm: 1.42px;           /* one millimetre of real box, on screen */
  --display: 'Bungee', 'Arial Black', sans-serif;
  --body: 'Wix Madefor Text', system-ui, sans-serif;
  --mono: 'Ubuntu Sans Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); }
body {
  margin: 0; font: 400 17px/1.55 var(--body);
  background:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.035) 0 1px, transparent 1.5px) 0 0 / 7px 7px,
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.25) 0 1px, transparent 1.5px) 0 0 / 11px 11px,
    var(--ground);
  overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 14px; z-index: 9; }
.skip:focus { left: 8px; }

/* Header: the headline is the hero, small labels in the corners. */
.top { position: relative; max-width: 1240px; margin: 0 auto; padding: 64px 24px 28px; }
.corner { position: absolute; top: 18px; margin: 0; font: 600 13px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--soft); }
.corner-l { left: 24px; }
.corner-r { right: 24px; text-align: right; }
.corner a { text-decoration: none; color: var(--ink); }
.corner a:hover { text-decoration: underline; }
h1 { font: 400 clamp(40px, 8.5vw, 104px)/.95 var(--display); margin: 10px 0 18px; letter-spacing: -.01em; }
h1 span { background: var(--orange); padding: 0 .12em; display: inline-block; transform: rotate(-2deg); box-shadow: 4px 4px 0 var(--ink); }
.lede { max-width: 40em; font-size: clamp(17px, 2vw, 20px); margin: 0 0 26px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.covers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.covers legend { float: left; font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; padding: 0; }
.covers label { position: relative; cursor: pointer; }
.covers input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.covers span { display: block; padding: 8px 14px; background: var(--paper); border: 2px solid var(--ink); font: 600 15px/1.2 var(--body); }
.covers input:checked + span { background: var(--orange); box-shadow: 3px 3px 0 var(--ink); }
.covers input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 3px; }
.covers label:hover span { background: #fff; }
.covers label:hover input:checked + span { background: var(--orange); }
.help { margin: 0; font-size: 15px; color: var(--soft); max-width: 34em; }
.yours { margin: 18px 0 0; font: 600 16px/1.4 var(--body); }
.yours::before { content: ''; display: inline-block; width: 12px; height: 12px; background: var(--orange); margin-right: 8px; transform: rotate(45deg); }

/* The wall of shelving: one unit per machine, as wide as its boxes. */
.shelves { max-width: 1320px; margin: 0 auto; padding: 18px 24px 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 40px 30px; align-items: flex-end; }
.shelf { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.sign { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; background: var(--steel); color: #fff; padding: 8px 14px 7px; border-radius: 3px 3px 0 0; }
.sign h2 { margin: 0; font: 400 20px/1.15 var(--display); letter-spacing: .02em; }
.sign p { margin: 0; font: 400 14px/1.2 var(--mono); color: #d9dadd; }
.unit {
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
  background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,0) 40%), var(--ground-2);
  border-left: 6px solid var(--steel); border-right: 6px solid var(--steel);
  box-shadow: inset 0 10px 18px -12px rgba(0,0,0,.35);
}
.row { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-template-rows: auto auto; grid-auto-columns: max-content; min-width: 100%; }
.row::after { content: ''; grid-row: 1; grid-column: span 1; width: 100%; min-width: 4px; border-bottom: 14px solid var(--steel); }
.row { grid-template-columns: repeat(var(--n, 4), max-content) 1fr; }
.game { display: contents; }
.game.dim .stand, .game.dim .ticket { opacity: .42; filter: saturate(.25); }

/* Each box stands on the shelf; the shelf's front edge is the steel band under it. */
.stand { grid-row: 1; align-self: end; position: relative; padding: 26px 16px 0; border-bottom: 14px solid var(--steel); }
.box { display: block; position: relative; height: calc(var(--h) * var(--mm)); aspect-ratio: var(--ar); background: #111; transform-origin: 50% 100%; transition: transform .25s cubic-bezier(.3,1.4,.5,1), box-shadow .25s; box-shadow: 5px 2px 0 rgba(0,0,0,.28); }
.box img { display: block; width: 100%; height: 100%; object-fit: cover; }
a.box:hover, a.box:focus-visible { transform: translateY(-10px) rotate(-1.5deg); box-shadow: 10px 14px 18px rgba(0,0,0,.30); }
a.box:focus-visible { outline-offset: 6px; }
.box-off { cursor: default; filter: grayscale(.6); opacity: .7; }

/* Cardboard boxes: NES, Famicom, Super Famicom, Game Boy Advance. */
.box-nes, .box-fam, .box-sfc, .box-gba { border-radius: 2px; }
.box-nes::after, .box-fam::after, .box-sfc::after, .box-gba::after { content: ''; position: absolute; inset: 0; box-shadow: inset -3px 0 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.25); pointer-events: none; }
/* PlayStation jewel case: the clear hinge down the left, a sheen across the lid. */
.box-ps1 { padding: 3px 3px 3px 11px; border-radius: 3px; background: linear-gradient(90deg, #a9afb4, #eef1f3 35%, #b7bcc1 55%, #d6dadd); }
.box-ps1::after { content: ''; position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(115deg, rgba(255,255,255,.38), rgba(255,255,255,0) 38%, rgba(255,255,255,0) 70%, rgba(255,255,255,.12)); pointer-events: none; }
/* Keep cases: each machine's own plastic. */
.box-ps2 { padding: 6px 5px; border-radius: 5px; background: #0e0e0f; }
.box-ps3 { padding: 5px; border-radius: 7px; background: #1c1d20; }
.box-ps4 { padding: 5px; border-radius: 7px; background: #1d3f97; }
.box-ps5 { padding: 5px; border-radius: 7px; background: #f2f2f0; box-shadow: 5px 2px 0 rgba(0,0,0,.2), inset 0 0 0 1px #c9c9c6; }
.box-ds { padding: 5px; border-radius: 6px; background: #e4e5e7; box-shadow: 5px 2px 0 rgba(0,0,0,.22), inset 0 0 0 1px #bfc1c4; }
.box-psp { padding: 5px; border-radius: 8px; background: linear-gradient(90deg, #c4cace, #eef1f3 40%, #cfd4d8); }
.box-ps2 img, .box-ps3 img, .box-ps4 img, .box-ps5 img, .box-ds img, .box-psp img, .box-ps1 img { border-radius: 2px; }
.box-ps2::after, .box-ps3::after, .box-ps4::after, .box-ps5::after, .box-ds::after, .box-psp::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255,255,255,.22), rgba(255,255,255,0) 35%); pointer-events: none; }

/* Price-gun sticker: how far you are, read from your ticks in that guide. */
.sticker { position: absolute; top: 14px; right: 6px; z-index: 2; font: 700 15px/1 var(--mono); background: var(--orange); color: var(--ink); padding: 6px 9px 5px; border-radius: 3px; transform: rotate(7deg); box-shadow: 2px 2px 0 rgba(0,0,0,.35); pointer-events: none; }
.sticker[hidden] { display: none; }

/* Shelf-edge ticket under each box. */
.ticket { grid-row: 2; width: 0; min-width: 100%; padding: 10px 16px 16px; }
.ticket h3 { margin: 0 0 2px; font: 700 16px/1.25 var(--body); }
.ticket h3 a { text-decoration: none; }
.ticket h3 a:hover { text-decoration: underline; }
.facts { margin: 0 0 8px; font: 400 13.5px/1.4 var(--mono); color: var(--soft); }
.to-b { display: inline-block; font: 700 14px/1.2 var(--body); background: var(--paper); border: 2px solid var(--ink); padding: 5px 9px; text-decoration: none; }
.to-b span { font-weight: 400; color: var(--soft); }
.to-b:hover { background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.soon { margin: 0; font: 600 14px/1.3 var(--mono); color: var(--soft); }

/* Footer */
.foot { max-width: 1240px; margin: 0 auto; padding: 26px 24px 60px; border-top: 3px solid var(--steel); font-size: 15px; color: var(--soft); }
.foot p { max-width: 52em; margin: 0 0 10px; }
.foot strong { color: var(--ink); }
.credits summary { cursor: pointer; font-weight: 700; color: var(--ink); margin: 6px 0; }
.credits ul { margin: 8px 0 12px; padding-left: 20px; columns: 2 300px; font-size: 14px; }
.made { font: 600 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .04em; margin-top: 18px; }

@media (max-width: 760px) {
  :root { --mm: .82px; }
  body { font-size: 16px; }
  .top { padding: 70px 16px 20px; }
  .corner-l { left: 16px; } .corner-r { right: 16px; max-width: 46%; }
  .shelves { padding: 10px 12px 30px; gap: 26px; }
  .shelf { flex-basis: 100%; }
  .stand { padding: 22px 10px 0; }
  .ticket { padding: 8px 10px 14px; }
  .help { font-size: 14px; }
}
@media (max-width: 380px) { :root { --mm: .72px; } }
@media (prefers-reduced-motion: reduce) {
  .box { transition: none; }
  a.box:hover, a.box:focus-visible { transform: none; }
}
@media (max-width: 1100px) and (min-width: 761px) { :root { --mm: 1.12px; } }
/* A shelf wider than the screen scrolls on its own; say so on its sign. */
.more-hint { display: none; margin-left: auto !important; font: 600 13px/1.2 var(--mono) !important; color: #fff !important; }
.shelf.has-more .more-hint { display: block; }
