:root {
  --ink: #141a2b;
  --panel: #1d2438;
  --gold: #ffd34d;
  --text: #f4f6fb;
  --muted: #9aa3b8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { display: flex; flex-direction: column; min-height: 100dvh; }

/* The game: a portrait column, full height on phones. */
#wrap { position: relative; flex: 1; width: 100%; max-width: 480px; margin: 0 auto; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none;
  background: linear-gradient(#5d7cd0, #9fb5e6 55%, #f4c995);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  font-weight: 600; pointer-events: none; }
footer { height: 28px; display: flex; gap: 8px; justify-content: center; align-items: center;
  font-size: 12px; color: var(--muted); }
footer a { color: var(--muted); }

/* The result card. */
.modal { position: fixed; inset: 0; background: rgba(10, 13, 24, 0.72); display: grid;
  place-items: center; padding: 16px; z-index: 10; }
.modal[hidden] { display: none; }
.card { position: relative; width: 100%; max-width: 360px; background: var(--panel);
  border-radius: 22px; padding: 28px 22px 22px; text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); }
.card h2 { margin: 4px 0 6px; font-size: 20px; }
.kicker { margin: 0; color: var(--gold); font-weight: 700; letter-spacing: 0.08em; font-size: 12px;
  text-transform: uppercase; }
.big { font-size: 48px; font-weight: 800; margin: 4px 0; }
.squares { font-size: 22px; letter-spacing: 2px; margin: 6px 0 14px; word-break: break-all; }
.stats { display: flex; justify-content: center; gap: 28px; margin: 6px 0 18px; }
.stats b { display: block; font-size: 22px; }
.stats span { color: var(--muted); font-size: 12px; }
.share { width: 100%; padding: 14px; border: 0; border-radius: 999px; background: var(--gold);
  color: var(--ink); font-size: 18px; font-weight: 800; cursor: pointer; }
.share:active { transform: scale(0.97); }
.close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted);
  font-size: 26px; cursor: pointer; line-height: 1; }
.toast { color: var(--gold); margin: 10px 0 0; font-size: 13px; }

/* Plain pages: privacy, a shared score. */
.page { max-width: 640px; margin: 0 auto; padding: 32px 20px 60px; }
.page h1 { font-size: 28px; }
.page a { color: var(--gold); }
.note { color: var(--muted); }
.cta { display: inline-block; margin-top: 18px; padding: 14px 28px; border-radius: 999px;
  background: var(--gold); color: var(--ink) !important; font-weight: 800; text-decoration: none; }

/* The words for search engines and screen readers: present in the page, visually hidden
   behind the game (the game says the same thing by being played). */
.about { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  clip-path: inset(50%); white-space: normal; }
