/* Tricky Puzzle Party — same "hand-drawn scrapbook" look as the app (TrickIos/Theme.swift). */

@font-face { font-family: "Baloo 2"; src: url("fonts/baloo2_bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("fonts/baloo2_extrabold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito_bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito_extrabold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --ink: #2a2238;
  --paper: #fffcf7;
  --cream: #fff6ec;
  --muted: #5a6075;
  --orange: #ff8a2b;
  --sky: #38b2f2;
  --green: #46c83a;
  --red: #f2463d;
  --yellow: #ffd84a;
  --pink: #ff92c4;
  --tape-orange: rgba(255, 176, 110, 0.85);
  --tape-blue: rgba(143, 214, 255, 0.85);
  --tape-yellow: rgba(255, 216, 74, 0.85);
  --radius: 18px;
  --shadow: 3px 4px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(180deg, #fff7e0 0%, #ffedc7 55%, #ffe3b3 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

main { flex: 1; }

a { color: inherit; }

h1, h2, h3 { font-family: "Baloo 2", system-ui, sans-serif; line-height: 1.15; margin: 0; }

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

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 252, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 20px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; border: 2px solid var(--ink); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 800; font-size: 15px; padding: 6px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--ink); }

/* Chunky ink button (InkButtonStyle) */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "Baloo 2", sans-serif; font-weight: 700; font-size: 19px;
  text-decoration: none; color: #fff;
  background: var(--orange);
  padding: 12px 22px;
  border: 2px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn.secondary { background: var(--paper); color: var(--ink); }
.btn svg { width: 22px; height: 22px; flex: none; }

/* Hero */
.hero { padding-block: 48px 32px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; }
.hero .wrap > * { min-width: 0; }
.hero-logo { width: min(520px, 100%); filter: drop-shadow(0 6px 0 rgba(42, 34, 56, 0.08)); }
.hero p.lead { font-size: 20px; color: var(--muted); margin: 18px 0 26px; max-width: 34ch; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art { position: relative; }
.hero-art img { width: 100%; transform: rotate(2deg); }
.badge-soon {
  position: absolute; left: 4%; bottom: 8%;
  font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 17px;
  background: var(--yellow); padding: 6px 16px;
  border: 2px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow);
  transform: rotate(-6deg);
}

/* Paper card with washi tape (PaperPanel) */
.card {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px 22px;
}
.card::before {
  content: ""; position: absolute; top: -12px; left: 50%;
  width: 84px; height: 24px; transform: translateX(-50%) rotate(-3deg);
  background: var(--tape, var(--tape-orange));
}
.card.tape-blue { --tape: var(--tape-blue); }
.card.tape-yellow { --tape: var(--tape-yellow); }

/* Sections */
section { padding-block: 40px; }
.section-title { font-size: clamp(30px, 5vw, 42px); font-weight: 800; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--muted); margin: 0 auto 34px; max-width: 52ch; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.features .card h3 { font-size: 23px; margin: 10px 0 6px; }
.features .card p { margin: 0; color: var(--muted); }
.feature-icon {
  width: 64px; height: 64px; border-radius: 16px; border: 2px solid var(--ink);
  display: grid; place-items: center; background: var(--cream);
}
.feature-icon img { width: 48px; height: 48px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: step; }
.step { text-align: center; }
.step::after {
  counter-increment: step; content: counter(step);
  position: absolute; top: -18px; right: -12px;
  width: 40px; height: 40px; display: grid; place-items: center;
  font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 21px; color: #fff;
  background: var(--sky); border: 2px solid var(--ink); border-radius: 50%;
}
.step .emoji { font-size: 42px; line-height: 1; }
.step h3 { font-size: 21px; margin: 10px 0 4px; }
.step p { margin: 0; color: var(--muted); }

.cta { text-align: center; }
.cta .card { max-width: 640px; margin-inline: auto; padding: 36px 24px; }
.cta img { width: 96px; height: 96px; border-radius: 24px; border: 2px solid var(--ink); margin: 0 auto 14px; }
.cta h2 { font-size: 34px; margin-bottom: 8px; }
.cta p { color: var(--muted); margin: 0 0 22px; }

/* Footer */
footer { border-top: 2px solid var(--ink); background: var(--paper); margin-top: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; padding-block: 22px; font-size: 15px; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; }
footer .muted { color: var(--muted); }

/* Legal pages */
.legal { padding-block: 36px 20px; }
.legal .card { padding: 36px clamp(20px, 5vw, 56px); }
.legal h1 { font-size: clamp(34px, 6vw, 48px); font-weight: 800; }
.legal .meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.chip {
  font-size: 14px; font-weight: 800; padding: 3px 12px; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--cream);
}
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.toc { background: var(--cream); border: 2px dashed var(--ink); border-radius: 14px; padding: 16px 20px; margin: 22px 0 8px; }
.legal .toc h2 { font-size: 20px; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.legal h2 { font-size: 26px; margin: 34px 0 8px; scroll-margin-top: 80px; }
.legal h3 { font-size: 20px; margin: 20px 0 6px; }
.legal p, .legal li { font-weight: 400; }
.legal strong { font-weight: 800; }
.legal ul { padding-left: 22px; margin: 6px 0 12px; }
.legal li { margin: 3px 0; }
.legal p { margin: 8px 0; }
.back-top { display: inline-block; margin-top: 28px; }

/* Phones */
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero-logo { margin-inline: auto; }
  .hero p.lead { margin-inline: auto; }
  .hero .actions { justify-content: center; }
  .hero-art { max-width: 420px; margin-inline: auto; }
  .features, .steps { grid-template-columns: 1fr; gap: 30px; }
  .toc ol { columns: 1; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .brand span { display: none; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 6px; }
}
