:root {
  --sat-t: env(safe-area-inset-top, 0px);
  --sat-b: env(safe-area-inset-bottom, 0px);
  --yellow: #ffe640; --pink: #ff6fd8; --cyan: #3ce6ff;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: #000; color: #fff; }
body {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
main {
  max-width: 960px; margin: 0 auto;
  padding: calc(var(--sat-t) + 20px) 16px calc(var(--sat-b) + 24px);
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
h1 {
  margin: 0; font-size: clamp(36px, 9vw, 72px); letter-spacing: 0.15em; color: var(--yellow);
  text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 var(--cyan);
}
#games {
  width: 100%;
  display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px) { #games { grid-template-columns: repeat(3, 1fr); max-width: 760px; gap: 20px; } }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px 14px; border: 3px solid #333; border-radius: 16px;
  color: inherit; text-decoration: none; background: #0b0b0b;
}
.tile:active { border-color: var(--yellow); transform: scale(0.97); }
.tile img { width: 96px; height: 96px; border-radius: 20px; image-rendering: pixelated; }
.tile .name { font-size: 18px; font-weight: bold; text-align: center; }
.tile .year { font-size: 13px; color: #888; }
.tile .score { font-size: 14px; color: var(--yellow); min-height: 1.2em; }

button {
  font: inherit; font-size: 16px; color: #fff; background: #111;
  border: 2px solid #555; border-radius: 10px; padding: 10px 18px;
}
button:active { border-color: var(--yellow); }
#install { margin: -8px 0 0; padding: 10px 14px; border: 2px dashed var(--cyan); border-radius: 10px; color: #ddd; text-align: center; line-height: 1.4; }
#bring { color: #aaa; border-color: #333; font-size: 14px; }

dialog {
  max-width: min(520px, calc(100vw - 32px)); background: #000; color: #fff;
  border: 3px solid var(--cyan); border-radius: 16px; padding: 20px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
dialog h2 { margin-top: 0; color: var(--cyan); font-size: 20px; }
dialog ol { padding-left: 1.4em; line-height: 1.5; }
dialog p { color: #bbb; line-height: 1.4; }
#paste { display: block; width: 100%; margin: 12px 0; color: var(--yellow); border-color: var(--yellow); font-size: 18px; }
textarea {
  width: 100%; font: inherit; font-size: 16px; background: #111; color: #fff;
  border: 2px solid #333; border-radius: 8px; padding: 8px; -webkit-user-select: text; user-select: text;
}
#result { color: var(--yellow); min-height: 1.4em; }
#close { float: right; }
