:root {
  --bg: #2b2b2b;
  --bar: #1f1f1f;
  --card: #333;
  --line: #444;
  --text: #eee;
  --muted: #a8a8a8;
  --gold: #ffb400;
  --orange: #ff6a00;
  --pink: #ff4d6d;
  --green: #06d6a0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; }
a { color: var(--gold); }
img { display: block; }

.topline { height: 6px; background: linear-gradient(90deg, var(--gold), var(--orange) 60%, var(--bar) 60.5%); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; padding: 0 24px; background: var(--bar); }
.logo { text-decoration: none; font: 800 22px/1 system-ui, sans-serif; letter-spacing: .04em;
  background: linear-gradient(90deg, #ff4fa0, var(--gold) 50%, #3fd0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo small { display: block; margin-top: 4px; font: 500 10px/1 system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.links-top { display: flex; gap: 24px; font-size: 14px; font-weight: 700; }
.links-top a { color: var(--text); text-decoration: none; }
.links-top a:hover { color: var(--gold); }

/* Featured game: blurred cover behind, cover + text in front */
.hero { position: relative; overflow: hidden; }
.hero .bg { position: absolute; inset: -40px; background: center / cover; filter: blur(24px) brightness(.5); }
.hero .inner { position: relative; display: flex; gap: 32px; align-items: center; max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.hero .art { width: 240px; aspect-ratio: 3 / 4; object-fit: cover; flex: none; box-shadow: 0 12px 40px #0009; }
.hero h1 { margin: 8px 0; font-size: 34px; line-height: 1.2; }
.hero p { margin: 0 0 16px; opacity: .85; max-width: 60ch; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-block; padding: 10px 22px; border-radius: 99px; font-weight: 700; text-decoration: none; color: #000; background: linear-gradient(90deg, var(--gold), var(--orange)); }
.btn.ghost { background: #0006; color: #fff; box-shadow: inset 0 0 0 1px #fff6; }

.strip { display: flex; overflow-x: auto; background: #1a1a1a; scrollbar-width: thin; }
.strip button { flex: 1 0 160px; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 0; border-right: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 12px; font-weight: 700; line-height: 1.3; text-align: left; cursor: pointer; }
.strip button[aria-current="true"] { background: var(--card); box-shadow: inset 0 3px var(--gold); }
.strip img, .strip .mini { width: 44px; height: 58px; object-fit: cover; flex: none; }

.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { padding: 1px 7px; font: 700 11px/1.5 system-ui, sans-serif; color: #fff; background: #666; }
.chip--SNES { background: #6a4c93; } .chip--GBA { background: #3a0ca3; } .chip--NDS { background: #5c677d; }
.chip--PS1 { background: #003791; } .chip--PSP { background: #111; } .chip--Other { background: #666; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 48px 24px; }
.head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; }
.head h2 { margin: 0; font-size: 40px; font-weight: 900; line-height: 1; letter-spacing: .02em; }
.head span { color: var(--muted); font-size: 13px; letter-spacing: .2em; }
#count { margin-left: auto; letter-spacing: .05em; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { padding: 6px 14px; border: 0; border-radius: 99px; background: #3a3a3a; color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.pills button[aria-pressed="true"] { background: var(--gold); color: #000; }
.controls { display: flex; gap: 6px; }
.controls input, .controls select { height: 34px; padding: 0 12px; background-color: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 99px; font: inherit; font-size: 13px; line-height: 32px; }
/* own chevron: the native arrow sits off-centre in a pill-shaped select */
.controls select { appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23eee' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.empty { grid-column: 1 / -1; color: var(--muted); }
.card { display: flex; flex-direction: column; gap: 4px; }
.cover { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 14px #0007; background: #000; }
.placeholder { display: flex; align-items: center; justify-content: center; font: 900 1.2rem system-ui, sans-serif; color: #fff9; }
.cover--SNES { background: linear-gradient(135deg, #6a4c93, #1982c4); }
.cover--GBA { background: linear-gradient(135deg, #3a0ca3, #4cc9f0); }
.cover--NDS { background: linear-gradient(135deg, #8d99ae, #2b2d42); }
.cover--PS1 { background: linear-gradient(135deg, #343a40, #adb5bd); }
.cover--PSP { background: linear-gradient(135deg, #111, #555); }
.cover--Other { background: linear-gradient(135deg, #444, #222); }
.card h3 { margin: 4px 0 0; font-size: 13px; font-weight: 700; line-height: 1.35; }
.meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .label { min-width: 5.6em; padding: 0 4px; background: #3a3a3a; color: #bbb; font-size: 10px; text-align: center; }
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.shots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: 2px; }
.links { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; }
.links { align-items: center; }
.links .report { position: relative; margin-left: auto; color: var(--gold); font-size: 14px; line-height: 1; text-decoration: none; }
.links .dl { color: var(--green); }
/* custom tooltip: native title tooltips are slow and don't show on touch */
.links .report::after { content: attr(aria-label); position: absolute; right: 0; bottom: calc(100% + 6px); padding: 3px 7px; border-radius: 4px; background: #000; color: #fff; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.links .report:hover::after, .links .report:focus-visible::after { opacity: 1; }

.bottom { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center; padding: 24px; background: #1a1a1a; color: var(--muted); text-align: center; }
.bottom p { margin: 0; }
.supporters { flex-basis: 100%; }
.supporters ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 8px 0 0; padding: 0; list-style: none; }
.supporters li { display: flex; align-items: center; gap: 6px; color: var(--text); }
.supporters img { border-radius: 50%; object-fit: cover; }
.bottom .counter { flex-basis: 100%; font-size: 12px; }
.bottom .counter img { display: inline-block; vertical-align: middle; }
.bottom .small { flex-basis: 100%; font-size: 11px; }

@media (max-width: 640px) {
  .nav { padding: 10px 16px; }
  .logo small { font-size: 8px; letter-spacing: .15em; }
  .links-top { gap: 12px; }
  .hero .inner { flex-direction: column; text-align: center; padding: 24px 16px; gap: 16px; }
  .hero .art { width: 160px; }
  .hero h1 { font-size: 24px; }
  .hero .chips, .hero .actions { justify-content: center; }
  .strip button { flex-basis: 150px; }
  .wrap { padding: 32px 16px; }
  .head h2 { font-size: 28px; }
  .controls { width: 100%; }
  .controls input { flex: 1; min-width: 0; }
  .controls select { min-width: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
