:root {
  color-scheme: dark;
  --ink: #13151c;
  --text: #f5f3ec;
  --muted: #c8c8ce;
  --mint: #aff4ba;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  background: var(--ink);
  font-family: system-ui, "Yu Gothic", sans-serif;
}
.wrap { width: min(1152px, calc(100% - clamp(32px, 8vw, 128px))); margin-inline: auto; }
main { padding-bottom: clamp(40px, 6vw, 84px); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
main a:focus-visible { outline: 3px solid var(--mint); outline-offset: 6px; }

.lobby {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  position: relative;
  isolation: isolate;
  padding-block: clamp(32px, 4vw, 64px);
}
.lobby::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -2% 0 36%;
  background: radial-gradient(#d9bbf236 1px, transparent 1px) 0 0 / 8px 8px,
    radial-gradient(ellipse, #54465b 0%, #362e40 42%, transparent 73%);
  mask-image: radial-gradient(ellipse, black 25%, transparent 72%);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--mint);
  font-size: .875rem;
  font-weight: 750;
  letter-spacing: .12em;
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 10px;
  background: repeating-linear-gradient(115deg, var(--mint) 0 4px, transparent 4px 7px);
}
h1 {
  font-size: clamp(2.8rem, 5.7vw, 5rem);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.065em;
}
h1 span { color: var(--mint); }
.intro { max-width: 30em; margin-top: 19px; font-size: 1rem; line-height: 1.85; color: var(--muted); }
code { font-family: var(--mono); }
.practice-links {
  display: grid;
  justify-items: start;
  margin-top: 12px;
}
.practice-links a {
  display: block;
  padding: 10px 0;
  color: var(--mint);
  font-weight: 650;
  line-height: 1.55;
  text-decoration: underline;
  text-decoration-color: #637f6b;
  text-underline-offset: .25em;
}
.practice-links a:hover, .practice-links a:focus-visible { text-decoration-color: currentColor; }

/* The title screen, its instructions and the control deck form one game link. */
.cabinet {
  --rim: #514958;
  display: block;
  width: min(100%, 490px);
  justify-self: center;
  border: 2px solid var(--rim);
  border-radius: 12px 12px 8px 8px;
  background: #2e2c39;
  box-shadow: 0 6px 0 #27252d, 0 9px 0 #090a10, 0 16px 30px #07080d6b;
}
.cabinet:hover, .cabinet:focus-visible { --rim: #a4cead; }
.marquee {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 6px 0;
  padding: 5px 0 7px;
  border-radius: 5px 5px 0 0;
  background: #222b30;
  box-shadow: inset 0 1px #74958c;
}
.marquee h2 {
  color: #e2ffdc;
  font: italic 900 clamp(1.55rem, 2.8vw, 2.4rem)/1 var(--mono);
  letter-spacing: -.06em;
  text-shadow: 2px 2px #386e64;
  text-transform: uppercase;
}
.marquee::before, .marquee::after {
  content: "";
  flex: 1;
  height: 14px;
  background: linear-gradient(to bottom, #a4dcb4 0 4px, transparent 4px 6px,
    #7fa798 6px 9px, transparent 9px 11px, #c19bb4 11px);
}
.marquee::before { clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%); }
.marquee::after { clip-path: polygon(9px 0, 100% 0, 100% 100%, 0 100%); }
.bezel {
  margin: 0 6px;
  padding: 9px 10px 7px;
  background: #191921;
  border-inline: 1px solid #3d3946;
}
.screen { position: relative; aspect-ratio: 2.55; overflow: hidden; border-radius: 7px; background: #54445f; }
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 10px 2px #14122370;
  background: repeating-linear-gradient(transparent 0 3px, #231c2e15 3px 4px);
}
.screen canvas, .cover canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; image-rendering: pixelated; }
.bezel p { margin-top: 7px; color: #d7d3d8; font-size: .875rem; line-height: 1.55; text-align: center; }
.deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 6px 18px;
  border-top: 2px solid #777080;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(#514b5a, #373441);
}
.controls { display: flex; align-items: end; gap: 8px; padding-left: 5px; }
.stick {
  position: relative;
  width: 25px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: #171821;
  box-shadow: 0 2px #79707c;
}
.stick::before, .stick::after { content: ""; position: absolute; }
.stick::before { left: 9px; bottom: 4px; height: 17px; width: 5px; background: #d0becd; transform: rotate(-12deg); }
.stick::after {
  left: 1px; bottom: 15px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ffddd2 0 10%, #f89d9f 20%, #bc6378 61%, #66394f);
}
.key { width: 17px; height: 8px; border-radius: 50%; background: #c1eac2; box-shadow: 0 3px #4d6f69, 0 5px #22212b; }
.key:last-child { align-self: start; background: #edc2a0; box-shadow: 0 3px #886a66, 0 5px #22212b; }
.play { display: inline-flex; align-items: center; gap: 8px; color: var(--accent, var(--mint)); font-size: .9rem; font-weight: 750; }
.play::before { content: ""; border-block: 4px solid transparent; border-left: 6px solid currentColor; }
.deck .play { padding: 5px 13px; border-radius: 3px; background: #d5f3ce; color: #21332d; box-shadow: 0 3px #23282d; }

.collection { padding-top: 12px; }
.collection h2 { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; font-size: 1.15rem; }
.collection h2::after { content: ""; flex: 1; height: 1px; background: #41434d; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 26px); }
.game-card {
  --accent: var(--mint);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #42434e;
  border-radius: 7px;
  background: #202128;
}
.rally-card { --accent: #ffcb92; }
.explorer { --accent: #ffe39a; }
.game-card:hover, .game-card:focus-visible { border-color: var(--accent); }
.game-card:hover .play, .cabinet:hover .play { text-decoration: underline; text-underline-offset: .2em; }
.cover { position: relative; width: 100%; aspect-ratio: 9/4; overflow: hidden; border-bottom: 2px solid var(--accent); }
.rally-card .cover { background: #343949; }
.explorer .cover { background: #334a39; }
.gmt-card .cover {
  background: repeating-linear-gradient(0deg, transparent 0 18px, #b3d8bc0b 18px 19px),
    repeating-linear-gradient(90deg, transparent 0 18px, #b3d8bc0b 18px 19px),
    radial-gradient(ellipse at 40% 30%, #3a5745, #172d23 79%);
}
.gmt-cover { width: 100%; height: 131%; position: absolute; top: -15.5%; transform: rotate(-18deg); object-fit: contain; }
.card-copy { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: clamp(16px, 1.8vw, 24px); }
.card-copy h3 { font: 750 clamp(1.35rem, 2vw, 1.85rem)/1.25 var(--mono); letter-spacing: -.055em; }
.gmt-card h3 { font-family: inherit; font-size: clamp(1.2rem, 1.8vw, 1.65rem); }
.card-copy p { color: var(--muted); margin-block: 8px 17px; font-size: 1rem; line-height: 1.65; }
.card-copy .play { margin-top: auto; }

@media (max-width: 760px) {
  .lobby { grid-template-columns: 1fr; gap: 24px; padding-block: 28px 36px; }
  .lobby::before { inset: 34% -2% -4%; }
  .lobby-copy, .cabinet { width: min(100%, 490px); justify-self: center; }
  .eyebrow { margin-bottom: 12px; }
  h1 { font-size: clamp(2.6rem, 9vw, 3.75rem); }
  .intro { margin-top: 12px; }
  .game-grid { grid-template-columns: 1fr; }
  .game-card { flex-direction: row; }
  .cover { flex: 0 0 36%; width: auto; aspect-ratio: auto; border: 0; border-right: 2px solid var(--accent); }
  .explorer .cover canvas { object-fit: cover; object-position: 55% center; }
}
@media (max-width: 520px) {
  .screen { aspect-ratio: 2; }
  .game-card { flex-direction: column; }
  .cover { flex: none; width: 100%; aspect-ratio: 9/4; border: 0; border-bottom: 2px solid var(--accent); }
  .intro br { display: none; }
}

.inspection-card { --accent: #b4eed1; }
.ghost-card { --accent: #c9b6ff; }
.cafe-card { --accent: #ffce96; }
.inspection-card .cover canvas,.ghost-card .cover canvas,.cafe-card .cover canvas { object-fit: cover; }
