:root {
  --bg: #0a0806;
  --panel: #15110d;
  --panel-2: #1d1812;
  --line: #3a2f22;
  --text: #f1e7d6;
  --muted: #a8977e;
  --gold: #e8b85a;
  --gold-2: #f6d891;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
  overflow-x: hidden;
}

/* a warm torch light behind the title, and faint scanlines over everything */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 50% -10%, rgba(232, 160, 64, .22), transparent 70%),
    radial-gradient(40vmax 30vmax at 100% 100%, rgba(176, 58, 46, .12), transparent 70%);
  z-index: -1;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.hero, main, footer { max-width: 1100px; margin: 0 auto; }

.hero { padding: 56px 0 28px; }
.kicker {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(38px, 9vw, 72px);
  line-height: 1.02;
  letter-spacing: -.01em;
}
h1 span {
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, #b07a2a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { max-width: 38em; margin: 18px 0 0; color: var(--muted); font-size: 17px; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }
.grid > li { display: flex; }
.grid > li > .card { flex: 1; }

.card {
  --accent: var(--gold);
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: .85;
}
a.card:hover, a.card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 34px -12px var(--accent);
  outline: none;
}
a.card:active { transform: translateY(0) scale(.99); }

.icon {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .03);
}
.icon img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.icon .mono {
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
}

.body { min-width: 0; display: flex; flex-direction: column; }
.card h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.meta { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.blurb { margin: 0 0 14px; font-size: 14.5px; color: #d6c8b0; }

.play {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #120c06;
  font-weight: 700;
  font-size: 15px;
}
.play svg { width: 14px; height: 14px; }

.card.off { cursor: default; }
.card.off .icon, .card.off h2, .card.off .blurb { filter: grayscale(1); opacity: .55; }
.card.off::before { background: var(--line); }
.badge {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
}

.note { color: var(--muted); text-align: center; padding: 24px 0; }

footer { padding: 40px 0 32px; color: var(--muted); font-size: 14px; }
footer p { margin: 0 0 6px; }
footer .fine { font-size: 12px; opacity: .7; }

/* "do you own the original?" before a game opens */
dialog {
  --accent: var(--gold);
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  color: var(--text);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8), 0 0 50px -24px var(--accent);
}
dialog::backdrop { background: rgba(5, 4, 3, .72); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.own { padding: 22px 20px 18px; }
.own-icon { width: 64px; height: 64px; margin-bottom: 12px; }
.own-icon .icon { width: 64px; height: 64px; }
.own h2 { margin: 0 0 6px; font-family: Georgia, serif; font-size: 22px; }
.own p { margin: 0 0 16px; color: #d6c8b0; font-size: 15px; }
.own strong { color: var(--text); }
.own-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .25);
  cursor: pointer;
  font-size: 15px;
}
.own-check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent); }
.own-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.own-actions button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.own-actions .ghost { background: none; border: 1px solid var(--line); color: var(--muted); }
.own-actions .go { background: var(--accent); border: 0; color: #120c06; }
.own-actions .go:disabled { opacity: .35; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  dialog[open] { animation: none; }
}
