/* Cinnabar — shared styles.
   Colours are the game's own palette (lib/theme/palette.dart).
   Fonts are self-hosted: a privacy page should not phone a font CDN. */

@font-face {
  font-family: 'Press Start 2P';
  src: url('fonts/PressStart2P-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #0a0a10;
  --bg-mid: #16161e;
  --panel-top: #26262e;
  --panel-bottom: #17171d;
  --border: #3c3c46;
  --text: #f0f0f4;
  --text-faint: #c8c8d4;
  --text-dim: #7c7c8c;
  --gold: #f8d878;
  --green: #28c840;
  --green-bright: #68e080;
  --red: #e8283c;
  --blue: #2860e8;
  --pixel: 'Press Start 2P', 'Courier New', monospace;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-faint);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Headings carry the pixel type; body copy stays legible. */
h1,
h2,
h3 {
  font-family: var(--pixel);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: 1px;
}

h1 {
  font-size: clamp(22px, 5vw, 38px);
  margin: 0;
  text-shadow: 3px 3px 0 #000;
}

h2 {
  font-size: clamp(14px, 2.6vw, 18px);
  color: var(--gold);
  margin: 56px 0 18px;
}

h3 {
  font-size: 12px;
  color: var(--green-bright);
  margin: 32px 0 10px;
}

a {
  color: var(--gold);
}

a:hover {
  color: var(--green-bright);
}

/* ---------- hero ---------- */

.hero {
  background: radial-gradient(
    ellipse at 50% 0%,
    var(--bg-mid) 0%,
    var(--bg) 62%
  );
  border-bottom: 4px solid var(--border);
  padding: 72px 0 64px;
  text-align: center;
}

.hero img.icon {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  border: 4px solid #000;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75);
}

.tagline {
  font-family: var(--pixel);
  font-size: clamp(9px, 1.8vw, 11px);
  color: var(--text-dim);
  letter-spacing: 2px;
  margin: 14px 0 0;
}

.pitch {
  max-width: 560px;
  margin: 26px auto 0;
  color: var(--text-faint);
}

/* The privacy page reuses the hero at a smaller scale. These lived as
   inline style attributes, which forced 'unsafe-inline' into the
   stylesheet half of the Content-Security-Policy for the sake of two
   declarations. */
.hero-legal {
  padding: 46px 0 38px;
}

.hero-legal h1 {
  font-size: clamp(16px, 4vw, 26px);
}

/* ---------- store badges ---------- */

/* Apple's badge artwork runs to the edge of its SVG; Google's PNG carries
   its clear space baked in — 564x168 of artwork inside a 646x250 canvas.
   Sizing both from one artwork height, and giving Apple the same
   proportional clear space by hand, makes the pair read as a matched set
   instead of one badge looking shrunken beside the other. Neither image
   is recoloured, cropped or faded: both companies forbid altering them. */
.stores {
  --badge-h: 54px;
  --badge-pad: calc(var(--badge-h) * 0.244);
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.badge-shell {
  display: inline-flex;
  padding: var(--badge-pad);
}

.badge-img {
  display: block;
  height: var(--badge-h);
  width: auto;
}

/* 250/168 scales the padded PNG until its artwork is --badge-h tall. */
.badge-play {
  height: calc(var(--badge-h) * 250 / 168);
}

.stores-note {
  font-family: var(--pixel);
  font-size: clamp(9px, 1.8vw, 11px);
  letter-spacing: 2px;
  color: var(--gold);
  margin: 12px 0 0;
}

@media (max-width: 520px) {
  .stores {
    --badge-h: 44px;
  }
}

/* Headings the page does not show but crawlers and screen readers still
   need. Clipped rather than display:none, which would hide them from
   assistive tech too. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* A pixel divider instead of section headings: a rule with a block sitting
   on it, as though one had slid into place. */
.rule {
  position: relative;
  height: 2px;
  background: var(--border);
  margin: 62px 0 46px;
}

.rule::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -7px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--gold);
  border: 4px solid var(--bg);
}

/* ---------- screenshots carousel ---------- */

.carousel {
  position: relative;
  margin-top: 46px;
}

.track {
  display: flex;
  /* "safe" so that a track wider than its box still scrolls to the start
     instead of clipping the first shot. */
  justify-content: safe center;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 4px 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.track::-webkit-scrollbar {
  display: none;
}

.track:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.track img {
  flex: 0 0 auto;
  width: 264px;
  /* Essential, not decorative: the <img> carries width/height attributes
     for layout stability, and without height:auto the attribute's height
     stays applied while CSS sets the width — squashing the picture to
     half its proper width at full height. */
  height: auto;
  max-width: 78vw;
  scroll-snap-align: center;
  border-radius: 22px;
  border: 3px solid var(--border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 2px;
}

/* Arcade-style arrows, matching the game's buttons. */
.nav {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--text-faint);
  background: var(--panel-top);
  border: 3px solid #000;
  border-radius: 8px;
  box-shadow: 0 3px 0 #000;
  padding: 14px 14px 12px;
  min-height: 44px;
  cursor: pointer;
}

.nav:hover:not(:disabled) {
  color: var(--gold);
}

.nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.dots {
  display: flex;
  /* 12 rather than 10 so the invisible 24px targets below meet
     without overlapping: a tap landing on the wrong dot is worse
     than a small one. */
  gap: 12px;
}

.dot {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  background: var(--panel-top);
  border: 3px solid #000;
  border-radius: 3px;
  cursor: pointer;
}

/* Grows the touch target to the 24px WCAG 2.5.8 minimum without
   growing the dot. */
.dot::after {
  content: '';
  position: absolute;
  inset: -6px;
}
.dot.on {
  background: var(--gold);
}

/* ---------- feature list ---------- */

.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  /* Two up on desktop, one up on a phone — never an orphan third. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 22px;
}

.features li {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  border: 3px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}

.features strong {
  display: block;
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.features p {
  margin: 0;
  font-size: 15px;
  color: var(--text-dim);
}

/* ---------- long-form content ---------- */

.prose {
  max-width: 68ch;
  margin: 0 auto;
}

.prose h2 {
  margin-top: 46px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 18px;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  position: relative;
  padding: 0 0 0 52px;
  margin-bottom: 22px;
}

/* Numbered like the level tiles: a lit pixel square. */
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pixel);
  font-size: 11px;
  color: var(--gold);
  background: var(--panel-top);
  border: 3px solid #000;
  border-radius: 6px;
}

.steps strong {
  color: var(--text);
}

.faq h3 {
  margin-top: 28px;
}

/* ---------- legal pages ---------- */

.legal {
  /* The horizontal 24px repeats .wrap's padding on purpose. Both are
     single-class selectors and this rule comes later, so a shorthand
     `padding: 56px 0 40px` here silently cancelled .wrap's side gutter
     and ran the policy text into both screen edges on a phone. */
  padding: 56px 24px 40px;
}

.legal p,
.legal li {
  font-size: 16px;
}

.legal ul {
  padding-left: 22px;
}

.legal .updated {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* Anything the owner still has to fill in, made impossible to miss. */

/* ---------- footer ---------- */

footer {
  margin-top: 72px;
  border-top: 2px solid var(--border);
  padding: 28px 0 46px;
  text-align: center;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

/* The pixel font puts these links in a 9px-tall line box, which is a
   9px-tall finger target. The padding is vertical only and the colour
   is unchanged, so the footer looks the same and the target is three
   times the height. */
footer a {
  display: inline-block;
  margin: 0 6px;
  padding: 11px 4px;
  vertical-align: middle;
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding: 48px 0 44px;
  }
}
