/*
 * beatthatgame.com. Plain HTML and CSS, no build step. The look follows the game's menus
 * (docs/STYLE-GUIDE.md): cream and gold panels on the bright sky, Fredoka throughout, plum outlines.
 * Colours are the menu tokens from src/styles/global.css; keep them in step if those change.
 */
@font-face {
  font-family: Fredoka;
  src: url('/assets/fonts/fredoka-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Fredoka;
  src: url('/assets/fonts/fredoka-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Fredoka;
  src: url('/assets/fonts/fredoka-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #fbf7ee;
  --cream2: #f3ecdc;
  --gold: #dcc485;
  --gold-deep: #c9993a;
  --char: #2e2b35;
  --grey: #6f6a74;
  --plum: #2b2340;
  --radius: 18px;
  --soft: 0 2px 0 #00000014, 0 8px 18px #2a3b7a26;
  --panel: inset 0 0 0 2px var(--gold), inset 0 0 0 4px #fff, var(--soft);
  --on-sky: 0 1px 0 #2a3b7a40, 0 2px 8px #2a3b7a40;
  --sky: linear-gradient(180deg, #4d7ff2 0%, #78a6ff 38%, #b9d3ff 70%, #e6efff 100%);
  --play-face1: #7fdb3f;
  --play-face2: #3aa81b;
  --play-rim1: #b8f27a;
  --play-edge: #23760f;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font: 500 17px/1.55 Fredoka, system-ui, sans-serif;
  color: var(--char);
  background: #b9d3ff;
  overflow-x: clip;
}

/* The sky, fixed behind everything, with a few clouds drifting slowly. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--sky);
  overflow: clip;
}

.cloud {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: calc(var(--w) * 0.42);
  animation: drift var(--t, 70s) ease-in-out infinite alternate;
  will-change: translate;
}

.cloud i {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: #ffffffd9;
}
.cloud i:nth-child(1) { left: 0; width: 42%; height: 62%; }
.cloud i:nth-child(2) { left: 22%; width: 46%; height: 100%; }
.cloud i:nth-child(3) { left: 52%; width: 36%; height: 78%; }
.cloud i:nth-child(4) { left: 8%; right: 0; height: 40%; border-radius: 999px; }

@keyframes drift {
  to {
    translate: 6vw 0;
  }
}

a {
  color: #1d5fc4;
  text-underline-offset: 2px;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

.wrap {
  width: min(100% - 40px, 1040px);
  margin-inline: auto;
}

/* ---------- home page ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
  padding: 56px 0 40px;
}

.logo {
  display: block;
  width: min(100%, 380px);
  height: auto;
  animation: logo-bob 3.6s ease-in-out infinite alternate;
}

@keyframes logo-bob {
  to {
    translate: 0 -5px;
  }
}

.tagline {
  margin: 20px 0 8px;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  color: #fff;
  text-shadow: var(--on-sky);
}

.lede {
  margin: 0 0 28px;
  max-width: 30em;
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  text-shadow: var(--on-sky);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* The game's chunky key: lighter rim, glossed face, a solid edge underneath. */
.key {
  display: inline-block;
  padding: 14px 26px 15px;
  border-radius: 16px;
  font: 700 19px/1 Fredoka, system-ui, sans-serif;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 2px 0 var(--play-edge);
  background: linear-gradient(180deg, #ffffff40 0 48%, transparent 48%), linear-gradient(180deg, var(--play-face1), var(--play-face2));
  box-shadow:
    inset 0 0 0 2px var(--play-rim1),
    0 5px 0 var(--play-edge),
    0 0 0 3px var(--plum),
    0 5px 0 3px var(--plum),
    0 12px 18px #2a3b7a40;
}

.key[aria-disabled='true'] {
  cursor: default;
}

.soon {
  font-weight: 600;
  color: #fff;
  text-shadow: var(--on-sky);
}

.phone {
  width: min(64vw, 270px);
  aspect-ratio: 390 / 844;
  border-radius: 34px;
  border: 8px solid var(--plum);
  background: var(--plum);
  box-shadow:
    0 8px 0 #1a1530,
    0 26px 40px #2a3b7a59;
  overflow: hidden;
}

.phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .phone {
  rotate: 3deg;
}

.panel {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--panel);
  padding: 28px;
}

section {
  padding: 28px 0;
}

.section-title {
  margin-bottom: 20px;
  text-align: center;
  font-size: 28px;
  color: #fff;
  text-shadow: var(--on-sky);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  font: 700 22px/1 Fredoka, system-ui, sans-serif;
  color: var(--gold-deep);
  background: linear-gradient(180deg, #fffdf7, var(--cream2));
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 4px #fff, 0 2px 0 #e6d6a8;
}

.steps h3 {
  font-size: 21px;
  margin-bottom: 6px;
}

.steps p {
  margin: 0;
  color: var(--grey);
}

.shots {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.shots figure {
  margin: 0;
  text-align: center;
}

.shots .phone {
  width: min(70vw, 230px);
}

.shots figcaption {
  margin-top: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: var(--on-sky);
}

/* Deck covers: the game's chunky card, picture only, with the deck's name on a ribbon. */
.decks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.deck {
  position: relative;
  aspect-ratio: 2 / 3;
  padding: 5%;
  border-radius: 9% / 6%;
  background: linear-gradient(180deg, #ffffff47 0 46%, transparent 46%), var(--accent);
  box-shadow:
    0 0 0 3px var(--plum),
    0 5px 0 3px var(--plum),
    0 12px 16px #2a3b7a40;
}

.deck img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6% / 4%;
}

.deck span {
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 9%;
  padding: 5px 4px 6px;
  font: 700 13px/1.1 Fredoka, system-ui, sans-serif;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 0 #0006;
  background: var(--accent);
  box-shadow:
    inset 0 2px 0 #ffffff59,
    0 0 0 2px var(--plum);
  border-radius: 6px;
}

.more {
  margin: 22px 0 0;
  text-align: center;
  font-weight: 600;
  color: var(--plum);
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.features h3 {
  font-size: 21px;
  margin-bottom: 6px;
}

.features p {
  margin: 0;
  color: var(--grey);
}

footer {
  margin-top: 28px;
  padding: 28px 0 40px;
  background: var(--cream);
  box-shadow: inset 0 2px 0 var(--gold);
  font-size: 15px;
  color: var(--grey);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 12px;
  font-weight: 600;
}

footer p {
  margin: 0;
}

/* ---------- document pages (privacy, terms, delete account) ---------- */
.topbar {
  padding: 22px 0 10px;
}

.topbar img {
  display: block;
  width: 130px;
  height: auto;
}

.doc {
  width: min(100% - 32px, 780px);
  margin: 12px auto 0;
  padding: 36px clamp(20px, 5vw, 48px);
}

.doc h1 {
  font-size: clamp(30px, 5vw, 40px);
  color: var(--plum);
}

.doc .updated {
  margin: 8px 0 24px;
  color: var(--grey);
  font-weight: 600;
}

.doc h2 {
  margin: 34px 0 10px;
  font-size: 23px;
  color: var(--plum);
}

.doc h3 {
  margin: 22px 0 6px;
  font-size: 18px;
}

.doc p,
.doc li {
  max-width: 68ch;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin-bottom: 6px;
}

.doc .summary {
  padding: 16px 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--gold), 0 2px 0 #e6d6a8;
}

.doc .summary p {
  margin: 0 0 8px;
}

.doc .summary p:last-child {
  margin: 0;
}

.table-scroll {
  overflow-x: auto;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}

.doc th,
.doc td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 2px solid var(--cream2);
}

.doc th {
  font-weight: 700;
  color: var(--plum);
  white-space: nowrap;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 36px;
    padding-top: 36px;
  }
  .logo {
    margin-inline: auto;
    width: min(78%, 320px);
  }
  .lede {
    margin-inline: auto;
  }
  .stores {
    justify-content: center;
  }
  .steps,
  .features {
    grid-template-columns: 1fr;
  }
  .decks {
    grid-template-columns: repeat(3, 1fr);
  }
  /* white text scrolls over the clouds on a narrow screen: keep them faint */
  .cloud {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloud,
  .logo {
    animation: none;
  }
}
