@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("fonts/Fredoka-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Lilita One";
  src: url("fonts/LilitaOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* Colors follow the game's palette (lib/ui/theme/tokens.dart). */
:root {
  --bg: #eef2ff;
  --bg-alt: #e0e7ff;
  --surface: #ffffff;
  --ink: #1e1b4b;
  --ink-muted: #4b5280;
  --ink-subtle: #7c83b0;
  --outline: #d6dcf5;
  --blue: #3b82f6;
  --indigo: #4f46e5;
  --indigo-edge: #3730a3;
  --sky: #38bdf8;
  --green: #22c55e;
  --green-edge: #15803d;
  --yellow: #fbbf24;
  --yellow-edge: #b45309;
  --red: #f43f5e;
  --red-edge: #9f1239;
  --violet: #8b5cf6;
  --shadow: 0 18px 40px -18px rgba(49, 46, 129, 0.35);
  --radius: 22px;
  --max: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110f2e;
    --bg-alt: #1a1745;
    --surface: #221e55;
    --ink: #eef0ff;
    --ink-muted: #b7bbe6;
    --ink-subtle: #8a8fc4;
    --outline: #34307a;
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--indigo);
}

@media (prefers-color-scheme: dark) {
  a {
    color: #a5b4fc;
  }
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.display {
  font-family: "Lilita One", "Fredoka", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--outline) 60%, transparent);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Lilita One", sans-serif;
  font-size: 22px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--indigo-edge);
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.site-nav a:hover {
  color: var(--ink);
}

@media (max-width: 640px) {
  .site-nav .optional {
    display: none;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 16px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #4ade80, var(--green));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    0 5px 0 var(--green-edge);
  transition:
    transform 0.08s ease,
    box-shadow 0.08s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    0 1px 0 var(--green-edge);
}

.btn svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.btn-ghost {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 5px 0 var(--outline);
}

.btn-ghost:active {
  box-shadow: 0 1px 0 var(--outline);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 88px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--yellow);
  color: #422006;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--yellow-edge);
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(44px, 7vw, 76px);
  background: linear-gradient(135deg, var(--blue), var(--indigo) 60%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  margin: 0 0 30px;
  max-width: 34ch;
  font-size: 21px;
  color: var(--ink-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero-note {
  margin-top: 16px;
  font-size: 15px;
  color: var(--ink-subtle);
}

.phones {
  position: relative;
  height: 600px;
}

.phone {
  position: absolute;
  width: 270px;
  aspect-ratio: 1170 / 2532;
  border-radius: 38px;
  padding: 10px;
  background: #15132f;
  box-shadow:
    0 0 0 2px #2c2960,
    var(--shadow),
    0 30px 60px -20px rgba(49, 46, 129, 0.45);
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 29px;
}

.phones .phone-back {
  left: 4%;
  top: 40px;
  transform: rotate(-7deg);
}

.phones .phone-front {
  right: 4%;
  top: 0;
  transform: rotate(5deg);
}

/* Floating arrow shapes behind the hero, like the game's backdrop. */
.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.floaters span {
  position: absolute;
  width: 46px;
  height: 46px;
  opacity: 0.18;
  background: currentColor;
  clip-path: polygon(0 35%, 55% 35%, 55% 10%, 100% 50%, 55% 90%, 55% 65%, 0 65%);
  animation: drift 9s ease-in-out infinite;
}

.floaters span:nth-child(1) { top: 12%; left: 6%; color: var(--blue); --r: -20deg; }
.floaters span:nth-child(2) { top: 70%; left: 2%; color: var(--red); --r: 90deg; animation-delay: -3s; }
.floaters span:nth-child(3) { top: 8%; right: 44%; color: var(--yellow); --r: 160deg; animation-delay: -5s; }
.floaters span:nth-child(4) { bottom: 8%; right: 38%; color: var(--green); --r: -90deg; animation-delay: -1s; }
.floaters span:nth-child(5) { top: 30%; right: 3%; color: var(--violet); --r: 200deg; animation-delay: -7s; }

@keyframes drift {
  0%, 100% { transform: rotate(var(--r)) translateX(0); }
  50% { transform: rotate(var(--r)) translateX(18px); }
}

@media (prefers-reduced-motion: reduce) {
  .floaters span {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 900px) {
  .hero {
    padding: 40px 0 64px;
  }
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .phones {
    height: 470px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
  }
  .phone {
    width: 205px;
    border-radius: 30px;
    padding: 8px;
  }
  .phone img {
    border-radius: 23px;
  }
}

/* ---------- Sections ---------- */

section {
  padding: 80px 0;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
}

.section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 48px);
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
}

.alt {
  background: var(--bg-alt);
}

/* How to play */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 6px 0 var(--outline);
}

.step-art {
  height: 130px;
  border-radius: 16px;
  margin-bottom: 18px;
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.step-art svg {
  width: 100%;
  height: 100%;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--indigo);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 3px 0 var(--indigo-edge);
  vertical-align: 3px;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.step p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 17px;
}

/* Arrow sliding off the board, then coming back. */
.slide-out {
  animation: slide-out 3.2s ease-in infinite;
}

@keyframes slide-out {
  0%, 25% { transform: translateX(0); opacity: 1; }
  60% { transform: translateX(170px); opacity: 1; }
  61%, 80% { transform: translateX(170px); opacity: 0; }
  81% { transform: translateX(0); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.bump {
  animation: bump 3.2s ease-in-out infinite;
}

@keyframes bump {
  0%, 30% { transform: translateY(0); }
  42% { transform: translateY(-22px); }
  55%, 100% { transform: translateY(0); }
}

.heart-pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: heart-pop 3.2s ease-in-out infinite;
}

@keyframes heart-pop {
  0%, 40% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
  60%, 90% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.star {
  transform-box: fill-box;
  transform-origin: center;
  animation: star 3.2s ease-out infinite;
}

.star:nth-of-type(2) { animation-delay: 0.25s; }
.star:nth-of-type(3) { animation-delay: 0.5s; }

@keyframes star {
  0%, 60% { transform: scale(1); }
  68%, 75% { transform: scale(0); }
  88% { transform: scale(1.2); }
  96%, 100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .slide-out, .bump, .heart-pop, .star {
    animation: none;
  }
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 6px 0 var(--outline);
}

.feature-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature h3 {
  margin: 2px 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.feature p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.5;
}

.c-blue { background: linear-gradient(160deg, #60a5fa, var(--blue)); box-shadow: 0 4px 0 #1d4ed8; }
.c-indigo { background: linear-gradient(160deg, #818cf8, var(--indigo)); box-shadow: 0 4px 0 var(--indigo-edge); }
.c-yellow { background: linear-gradient(160deg, #fcd34d, #f59e0b); box-shadow: 0 4px 0 var(--yellow-edge); }
.c-green { background: linear-gradient(160deg, #4ade80, var(--green)); box-shadow: 0 4px 0 var(--green-edge); }
.c-red { background: linear-gradient(160deg, #fb7185, var(--red)); box-shadow: 0 4px 0 var(--red-edge); }
.c-violet { background: linear-gradient(160deg, #a78bfa, var(--violet)); box-shadow: 0 4px 0 #5b21b6; }

@media (max-width: 960px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* Screenshots */

.shots {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.shots .phone {
  position: static;
  width: 240px;
  flex: none;
}

.shots .phone:nth-child(2) {
  transform: translateY(-24px);
}

@media (max-width: 820px) {
  .shots {
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 30px 20px 24px;
    margin: 0 -20px;
  }
  .shots .phone {
    width: 210px;
    scroll-snap-align: center;
  }
  .shots .phone:nth-child(2) {
    transform: none;
  }
}

/* CTA band */

.cta {
  padding: 0 0 88px;
}

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 44px;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--indigo) 65%, var(--violet));
  box-shadow: 0 8px 0 var(--indigo-edge), var(--shadow);
}

.cta-card h2 {
  margin: 0 0 6px;
  font-size: clamp(30px, 4.4vw, 42px);
}

.cta-card p {
  margin: 0;
  opacity: 0.9;
}

.cta-card .app-mark {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  flex: none;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
}

.cta-text {
  display: flex;
  gap: 22px;
  align-items: center;
}

@media (max-width: 760px) {
  .cta-card,
  .cta-text {
    flex-direction: column;
    text-align: center;
  }
  .cta-card {
    padding: 32px 22px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 36px 0 44px;
  border-top: 1px solid var(--outline);
  color: var(--ink-subtle);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--ink);
}

/* ---------- Legal pages ---------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.doc h1 {
  margin: 0 0 6px;
  font-size: clamp(36px, 6vw, 52px);
}

.doc .meta {
  margin: 0 0 32px;
  color: var(--ink-subtle);
  font-size: 16px;
}

.doc h2 {
  margin: 44px 0 12px;
  font-size: 26px;
  font-weight: 700;
}

.doc h3 {
  margin: 26px 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.doc p,
.doc li {
  color: var(--ink-muted);
}

.doc strong {
  color: var(--ink);
  font-weight: 600;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.summary {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: 0 6px 0 var(--outline);
}

.summary h2 {
  margin-top: 0;
  font-size: 22px;
}

.summary ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary li {
  position: relative;
  padding-left: 32px;
}

.summary li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
}

.doc table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 16px;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--outline);
  color: var(--ink-muted);
}

.doc th {
  color: var(--ink);
  font-weight: 600;
  background: var(--bg-alt);
}

.doc tr:last-child td {
  border-bottom: 0;
}

.callout {
  margin: 20px 0;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--surface);
  border-left: 6px solid var(--indigo);
}

.callout p {
  margin: 0;
}

.callout .btn {
  margin-top: 16px;
}

/* ---------- Account deletion tool ---------- */

button.btn {
  border: 0;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-google {
  color: #1f1f1f;
  background: #fff;
  box-shadow:
    0 0 0 1px #dadce0,
    0 5px 0 #c4c7cf;
}

.btn-google:active {
  box-shadow:
    0 0 0 1px #dadce0,
    0 1px 0 #c4c7cf;
}

.btn-danger {
  background: linear-gradient(180deg, #fb7185, var(--red));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    0 5px 0 var(--red-edge);
}

.btn-danger:active {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    0 1px 0 var(--red-edge);
}

.tool {
  margin: 28px 0 8px;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 0 var(--outline);
}

.tool h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.tool .fine {
  margin: 16px 0 0;
  font-size: 15px;
  color: var(--ink-subtle);
}

.account {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}

.account img,
.account-initial {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
}

.account-initial {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  background: linear-gradient(160deg, #818cf8, var(--indigo));
}

.account-initial[hidden],
.account img[hidden] {
  display: none;
}

.account-name {
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}

.account-email {
  font-size: 15px;
  color: var(--ink-subtle);
  word-break: break-all;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 20px;
}

.stats div {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
}

.stats dt {
  font-size: 14px;
  color: var(--ink-subtle);
}

.stats dd {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 520px) {
  .stats div {
    padding: 10px;
  }
  .stats dt {
    font-size: 12px;
    line-height: 1.3;
  }
  .stats dd {
    font-size: 18px;
  }
}

.tool .btn-ghost {
  background: var(--bg);
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 16px;
}

.check input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  flex: none;
  accent-color: var(--red);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.tool-error {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  color: #9f1239;
  background: #ffe4e6;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  .tool-error {
    color: #fecdd3;
    background: #4c0519;
  }
}
