/* Candystood launcher: a neon arcade at night. The pixel logo glows like a marquee, each game is a
   cabinet with a lit marquee and a screen of real gameplay, over a horizon with a grid floor.
   Fonts are self-hosted (fonts/, SIL OFL): Press Start 2P for marquee lettering, Space Grotesk for
   reading. Also styles the About and 404 pages. */

@font-face { font-family: "Press Start 2P"; src: url(fonts/press-start-2p.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(fonts/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #08061a;
  --pink: #ff3fd0;
  --cyan: #29e6ff;
  --yellow: #ffe14a;
  --ink: #e9e4ff;
  --dim: #a39bd0;
  --c-minigolf: #3dff7a;
  --c-bowling: #ff3fd0;
  --c-billiards: #29e6ff;
  --c-boardwalk: #ffb12a;
  --c-homerun: #ff5468;
  --c-bobsled: #7fb4ff;
  --c-bullpen: #b57bff;
  --c-pineapple: #ffd23a;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  overflow-x: hidden;
}

/* ---------- the night sky: a glow on the horizon, a few stars and a grid floor ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(900px 380px at 50% 6%, rgba(255, 63, 208, .22), rgba(255, 63, 208, 0) 70%),
    radial-gradient(700px 300px at 50% 0%, rgba(41, 230, 255, .16), rgba(41, 230, 255, 0) 70%),
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 72% 12%, #fff, transparent),
    radial-gradient(1px 1px at 38% 32%, #cfc8ff, transparent), radial-gradient(1.5px 1.5px at 88% 36%, #fff, transparent),
    radial-gradient(1px 1px at 22% 48%, #cfc8ff, transparent), radial-gradient(1px 1px at 58% 44%, #fff, transparent),
    radial-gradient(1px 1px at 6% 62%, #fff, transparent), radial-gradient(1px 1px at 94% 58%, #cfc8ff, transparent),
    var(--bg);
}
.sky::after { content: ""; position: absolute; left: -50%; right: -50%; bottom: -12%; height: 52%;
  background:
    linear-gradient(var(--bg), rgba(8, 6, 26, 0) 35%),
    repeating-linear-gradient(90deg, rgba(255, 63, 208, .35) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(0deg, rgba(41, 230, 255, .28) 0 2px, transparent 2px 60px);
  transform: perspective(500px) rotateX(62deg); transform-origin: top; opacity: .65;
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: max(36px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

/* ---------- header: the logo as a lit marquee ---------- */
.head { text-align: center; }
.logo { margin: 0; line-height: 0; }
.logo-link { display: inline-block; line-height: 0; border-radius: 6px; }
.logo-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.logo-gif { display: none; image-rendering: pixelated;
  filter: drop-shadow(0 0 6px rgba(255, 63, 208, .9)) drop-shadow(0 0 22px rgba(255, 63, 208, .5)) drop-shadow(0 0 40px rgba(41, 230, 255, .35)); }
.has-logo .logo-gif { display: inline-block; }
.has-logo .logo-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo-text { font: 28px/1.2 var(--pixel); color: var(--pink); text-shadow: 0 0 12px var(--pink); }
.tag { margin: 18px 0 0; font: 10px/1.8 var(--pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 10px rgba(41, 230, 255, .8); }
.tag em { font-style: normal; color: var(--yellow); text-shadow: 0 0 10px rgba(255, 225, 74, .8); }
.ticker { display: inline-flex; align-items: center; margin: 20px 0 0; padding: 10px 18px; border: 1px solid rgba(255, 225, 74, .55); border-radius: 6px;
  font: 10px/1.5 var(--pixel); text-transform: uppercase; color: var(--yellow); text-shadow: 0 0 8px rgba(255, 225, 74, .7);
  box-shadow: 0 0 18px rgba(255, 225, 74, .15), inset 0 0 14px rgba(255, 225, 74, .08); }
.blink { display: inline-flex; align-items: center; gap: 8px; margin-right: 14px; animation: blink 1.1s steps(2, jump-none) infinite; }
/* a star (the pixel font has none), sized and centred to the text */
.star { display: inline-block; position: relative; top: -2px; width: 12px; height: 12px; background: currentColor; filter: drop-shadow(0 0 4px rgba(255, 225, 74, .8));
  clip-path: polygon(50% 0, 62% 36%, 100% 37%, 69% 59%, 81% 96%, 50% 73%, 19% 96%, 31% 59%, 0 37%, 38% 36%); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- the games: arcade cabinets ---------- */
.games { --per-row: 3; --gap: 26px; list-style: none; margin: 46px auto 0; padding: 0; max-width: 1180px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
/* at most three cabinets a row, a shorter last row centred */
.games > li { flex: 0 0 calc((100% - (var(--per-row) - 1) * var(--gap)) / var(--per-row)); min-width: 0; }
.cab {
  position: relative; display: flex; flex-direction: column; height: 100%;
  padding: 12px 12px 16px; border-radius: 14px; text-decoration: none; color: inherit;
  background: linear-gradient(180deg, #1b1640, #0f0c26);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 18px 40px rgba(0, 0, 0, .55), 0 0 30px color-mix(in srgb, var(--c) 18%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cab:hover, .cab:focus-visible { transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 22px 46px rgba(0, 0, 0, .6), 0 0 46px color-mix(in srgb, var(--c) 45%, transparent); }
.cab:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
.marquee {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: -2px 0 10px; padding: 10px 8px 9px; border-radius: 8px;
  font: 11px/1.3 var(--pixel); font-weight: 400; color: #fff; letter-spacing: .04em; text-transform: uppercase; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 55%, #000), color-mix(in srgb, var(--c) 22%, #000));
  text-shadow: 0 0 8px var(--c), 0 0 2px #fff;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .5), 0 0 16px color-mix(in srgb, var(--c) 40%, transparent);
}
.icon { width: 16px; height: 16px; flex: none; image-rendering: pixelated; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .35)); }
.screen { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 384 / 240; background: #000;
  box-shadow: 0 0 0 3px #05040f, 0 0 0 4px rgba(255, 255, 255, .07), 0 0 24px color-mix(in srgb, var(--c) 35%, transparent); }
.screen canvas { display: block; width: 100%; height: 100%; filter: saturate(1.12) contrast(1.04); }
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px), radial-gradient(120% 90% at 50% 50%, transparent 60%, rgba(0, 0, 0, .45)); }
.flag { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 4px 7px; border-radius: 4px;
  font: 7px/1.4 var(--pixel); text-transform: uppercase; color: #0b0820; background: var(--yellow); box-shadow: 0 0 10px rgba(255, 225, 74, .7); }
.info { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; }
.blurb { font-size: 14px; line-height: 1.4; color: var(--dim); }
.btn { flex: none; padding: 9px 12px; border-radius: 6px; font: 9px/1 var(--pixel); text-transform: uppercase; color: #0b0820;
  background: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 70%, transparent); }
.cab:hover .btn { filter: brightness(1.12); }

/* coming soon: under construction, and not a link */
.cab.is-soon { cursor: default; filter: saturate(.4) brightness(.8); }
.cab.is-soon:hover { transform: none; }

/* ---------- text boxes: the launcher's blurb, the About page, the 404 ---------- */
.about {
  max-width: 760px; margin: 60px auto 0; padding: 24px 28px; border-radius: 12px;
  background: rgba(18, 14, 44, .78); border: 1px solid rgba(41, 230, 255, .25);
  box-shadow: 0 0 30px rgba(41, 230, 255, .08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.about h1, .about h2 { margin: 0 0 12px; font: 13px/1.6 var(--pixel); font-weight: 400; text-transform: uppercase; color: var(--pink); text-shadow: 0 0 10px rgba(255, 63, 208, .6); }
.about h3 { margin: 18px 0 4px; font-size: 17px; font-weight: 700; color: #fff; }
.about p { margin: 0 0 12px; color: #d4cef2; }
.about a { color: var(--cyan); text-underline-offset: 3px; }
.about a:hover { color: #fff; text-shadow: 0 0 8px var(--cyan); }
.about ul { margin: 0 0 12px; padding-left: 20px; color: #d4cef2; }
.about li { margin-bottom: 8px; }
.about .more { margin: 0; font-weight: 700; }

.doc { max-width: 760px; margin: 0 auto; }
.doc-page .head { margin-bottom: 32px; }
.doc .about { margin: 0; padding: 30px 34px; }
.doc .about h1 { font-size: 16px; }
.doc .about h2 { margin-top: 28px; font-size: 12px; color: var(--cyan); text-shadow: 0 0 10px rgba(41, 230, 255, .6); }
.lost { margin: 40px auto 0; text-align: center; }
.lost h1 { font-size: 14px; }

/* ---------- footer ---------- */
.foot { margin-top: 32px; text-align: center; font-size: 13px; color: #8079b0; }
.foot p { margin: 4px 0; }
.foot a { color: inherit; text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }
.counter-wrap { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 10px !important; font: 8px/1 var(--pixel); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.counter { display: inline-flex; gap: 2px; padding: 3px; border-radius: 4px; background: #000; border: 1px solid rgba(61, 255, 122, .35); box-shadow: 0 0 12px rgba(61, 255, 122, .15); }
.counter span { width: 13px; font: 10px/1.6 var(--pixel); color: var(--c-minigolf); text-align: center; text-shadow: 0 0 6px var(--c-minigolf); }

/* ---------- sizes ---------- */
@media (max-width: 1000px) { .games { --per-row: 2; } }
@media (max-width: 600px) {
  .page { padding-top: max(26px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .games { --per-row: 1; --gap: 20px; margin-top: 32px; }
  .tag { font-size: 8px; }
  .ticker { font-size: 8px; padding: 9px 12px; }
  .star { width: 10px; height: 10px; }
  .about { padding: 20px; margin-top: 44px; }
  .doc .about { padding: 22px 20px; }
}
/* phones on their side: three small cabinets a row */
@media (max-height: 500px) and (orientation: landscape) {
  .page { padding-top: max(16px, env(safe-area-inset-top)); }
  .games { --per-row: 3; --gap: 12px; margin-top: 20px; max-width: 760px; }
  .cab { padding: 8px 8px 10px; }
  .marquee { font-size: 7px; padding: 7px 4px; gap: 6px; }
  .blurb { display: none; }
  .info { justify-content: center; padding-top: 10px; }
  .tag, .ticker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
  .cab, .cab:hover { transition: none; transform: none; }
}
