/* Find the Letters by EdNinja: shared styles for every page of the site.
   Text colors are checked against their backgrounds for WCAG AA (>= 4.5:1 for body text);
   the pairs and ratios are listed in website/README.md. */

:root {
  --blue-900: #0a2d4a;   /* headings, footer */
  --blue-800: #0b4672;   /* hero and dark panels */
  --blue-700: #0b5f99;   /* links, hero start */
  --sky: #29a8e0;        /* decoration only (logo blue) */
  --sky-50: #eaf5fb;
  --orange: #ff8a1f;     /* decoration and badges with dark digits */
  --orange-ink: #a14700; /* orange dark enough for text on white and cream */
  --yellow: #ffd23f;
  --green: #2f8a3c;
  --ink: #182b3c;
  --ink-soft: #46586a;
  --paper: #ffffff;
  --cream: #fffaf0;
  --line: #d9e6ee;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(11, 70, 114, 0.13);
  --shadow-sm: 0 4px 14px rgba(11, 70, 114, 0.10);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Arial Rounded MT Bold", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-700); }
a:hover { color: var(--blue-900); }
/* Orange ring with a dark halo: visible (>= 3:1) on both the light and the dark sections. */
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; box-shadow: 0 0 0 6px var(--blue-900); border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--paper); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { left: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--blue-900); font-family: var(--font-display); font-size: 19px; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.top nav a { text-decoration: none; color: var(--ink-soft); font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.top nav a:hover { background: var(--sky-50); color: var(--ink); }
.lang {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line); color: var(--ink); font: inherit; font-weight: 800; font-size: 14px;
  padding: 6px 30px 6px 12px; border-radius: 999px; cursor: pointer; margin-left: 6px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2346586a'/%3E%3C/svg%3E") right 8px center / 18px no-repeat;
}
.lang:hover { background-color: var(--sky-50); }
@media (max-width: 860px) { .top nav a.hide-sm { display: none; } }
@media (max-width: 420px) { .brand span { display: none; } }

/* ---------- Buttons ---------- */
.store {
  display: inline-flex; align-items: center; gap: 10px;
  background: #000; color: #fff; text-decoration: none;
  padding: 10px 20px 10px 16px; border-radius: 14px; line-height: 1.1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease;
}
.store:hover { color: #fff; transform: translateY(-2px); }
.store svg { width: 26px; height: 26px; fill: currentColor; }
.store small { display: block; font-size: 11px; opacity: 0.85; }
.store strong { font-size: 20px; letter-spacing: -0.2px; }
@media (prefers-reduced-motion: reduce) { .store { transition: none; } .store:hover { transform: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(41, 168, 224, 0.35), transparent 45%),
    radial-gradient(circle at 10% 110%, rgba(255, 138, 31, 0.22), transparent 40%),
    linear-gradient(160deg, var(--blue-700), var(--blue-800) 70%);
}
.hero::after { /* soft letter-grid texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.10;
  background-image: linear-gradient(#fff 1.5px, transparent 1.5px), linear-gradient(90deg, #fff 1.5px, transparent 1.5px);
  background-size: 34px 34px;
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 56px 0 96px; }
.hero .logo { width: min(340px, 80%); margin: 0 0 6px -8px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25)); }
.eyebrow { display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; background: rgba(255, 255, 255, 0.14); padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.07; margin: 18px 0 16px; letter-spacing: -1px; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero p.lead { font-size: clamp(18px, 2vw, 21px); max-width: 38ch; margin: 0 0 28px; }
.hero .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.hero .cta .note { font-size: 15px; }

.hero-art { position: relative; justify-self: center; width: min(460px, 100%); }
.hero-art .board { width: 88%; border-radius: 26px; box-shadow: 0 22px 44px rgba(0, 0, 0, 0.3); transform: rotate(3deg); margin-left: 8%; }
.hero-art .ninjas { position: absolute; width: 62%; left: -10%; bottom: -16%; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.3)); animation: hop 5s ease-in-out infinite; }
@keyframes hop { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .hero-art .ninjas { animation: none; } }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding: 40px 0 96px; }
  .hero .logo { margin-inline: auto; }
  .hero p.lead { margin-inline: auto; }
  .hero .cta { justify-content: center; }
  .hero-art { width: min(380px, 88%); }
}

/* Numbered circle used across the site. */
.num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--orange); color: var(--ink); font-family: var(--font-display); font-size: 19px; /* dark digits: >= 4.5:1 on orange */
  border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* ---------- Sections ---------- */
main, section { scroll-margin-top: 64px; }
section { padding: 88px 0; }
section.alt { background: var(--paper); }
.kicker { color: var(--orange-ink); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; margin: 0 0 8px; }
h2 { font-size: clamp(30px, 4vw, 42px); line-height: 1.12; letter-spacing: -0.5px; margin: 0 0 14px; color: var(--blue-900); }
.sub { color: var(--ink-soft); font-size: 19px; max-width: 62ch; margin: 0 0 40px; }
.center { text-align: center; }
.center .sub { margin-inline: auto; }
@media (max-width: 720px) { section { padding: 64px 0; } }

/* ---------- Try it (mini board) ---------- */
.try-card {
  background: var(--sky-50) url("img/bg-house.webp") center bottom / cover no-repeat;
  border: 1px solid #c9e3f0; border-radius: 32px; padding: 32px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: center;
}
.try-text { background: rgba(255, 255, 255, 0.92); border-radius: 24px; padding: 24px; }
.try-card h2 { font-size: 28px; margin: 0 0 8px; line-height: 1.15; }
.try-card p { margin: 0 0 14px; color: var(--ink-soft); }
.try-status { font-weight: 800; min-height: 3.2em; color: var(--blue-800) !important; }
.try-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  font: inherit; font-weight: 800; font-size: 15px; background: var(--paper); color: var(--blue-800);
  border: 1px solid #b9d7e8; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.pill:hover { background: var(--sky-50); }
.pill svg { width: 18px; height: 18px; fill: currentColor; }

.play { display: grid; gap: 16px; justify-items: center; }
.crayons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.crayon {
  position: relative; width: 132px; height: 48px; padding: 0; border: 0; cursor: pointer;
  background: transparent center / contain no-repeat; border-radius: 12px;
  transition: transform 0.15s ease;
}
.crayon[data-color="blue"] { background-image: url("img/crayon-blue.webp"); }
.crayon[data-color="red"] { background-image: url("img/crayon-red.webp"); }
.crayon[data-color="orange"] { background-image: url("img/crayon-orange.webp"); }
.crayon[data-color="brown"] { background-image: url("img/crayon-brown.webp"); }
.crayon span { /* the crayon's letter, on a white label: dark text >= 4.5:1 */
  position: absolute; left: 50%; top: 50%; transform: translate(-30%, -50%);
  width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--ink);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.crayon[aria-pressed="true"] { transform: translateY(-6px) scale(1.06); filter: drop-shadow(0 6px 6px rgba(11, 70, 114, 0.35)); }
.grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; width: min(360px, 100%);
  background: #fff; padding: 9px; border-radius: 22px; box-shadow: var(--shadow); touch-action: none;
}
.tile {
  aspect-ratio: 1; border: 0; padding: 0; border-radius: 9px; cursor: pointer;
  background: #eaf2f7; color: var(--ink); font-family: var(--font-display); font-size: clamp(20px, 5vw, 28px); line-height: 1;
  transition: background-color 0.2s ease;
}
.tile.painted { color: transparent; background-size: cover; cursor: default; }
.tile.painted.blue { background-color: #1ca3b6; background-image: url("img/slide-blue.webp"); }
.tile.painted.red { background-color: #b12a2a; background-image: url("img/slide-red.webp"); }
.tile.painted.orange { background-color: #e58333; background-image: url("img/slide-orange.webp"); }
.tile.painted.brown { background-color: #884828; background-image: url("img/slide-brown.webp"); }
.tile.nope { animation: nope 0.4s ease; }
.grid.done { animation: snap 0.5s ease; }
@keyframes nope { 25%, 75% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@keyframes snap { 50% { transform: scale(1.04); } }
.word { min-height: 1.4em; margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1.4; color: var(--blue-900); }
.word:not(:empty) { background: #fff; padding: 0 20px; border-radius: 999px; box-shadow: var(--shadow-sm); }
@media (prefers-reduced-motion: reduce) {
  .crayon, .tile { transition: none; }
  .crayon[aria-pressed="true"] { transform: none; }
  .tile.nope, .grid.done { animation: none; }
}
@media (max-width: 860px) { .try-card { grid-template-columns: 1fr; text-align: center; padding: 18px; } .try-actions { justify-content: center; } }
@media (max-width: 420px) { .crayon { width: 104px; height: 40px; } .crayon span { width: 28px; height: 28px; font-size: 19px; } }

/* ---------- How it works ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 26px 26px; position: relative; text-align: left; }
.steps li > .num { position: absolute; top: -20px; left: 24px; }
.steps .pic { height: 190px; display: grid; place-items: center; margin-bottom: 14px; }
.steps .pic img { max-height: 190px; width: auto; }
.steps .pic.crayon-pic { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.steps .pic.crayon-pic img { width: 200px; height: auto; }
.steps .pic.board-pic img { border-radius: 16px; box-shadow: var(--shadow-sm); }
.steps h3 { margin: 4px 0 6px; font-size: 21px; color: var(--blue-900); }
.steps p { margin: 0; color: var(--ink-soft); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Levels ---------- */
.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; text-align: left; }
.level { background: var(--paper); border: 1px solid var(--line); border-radius: 26px; padding: 24px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto 1fr auto; gap: 6px 18px; }
.level > img { grid-row: 1 / 3; width: 38px; height: auto; align-self: start; }
.level h3 { margin: 0; font-size: 22px; color: var(--blue-900); line-height: 1.2; }
.level h3 small { display: block; font-family: var(--font); font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.level p { margin: 0; color: var(--ink-soft); font-size: 16px; align-self: start; }
.level .pics { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 12px; list-style: none; padding: 0; }
.level .pics img { width: 100%; aspect-ratio: 1; border-radius: 12px; }
.free-note { margin: 28px auto 0; font-size: 15px; color: var(--ink-soft); max-width: 70ch; }
@media (max-width: 920px) { .levels { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .level .pics { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Players ---------- */
.players { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.player-card { background: var(--paper); border: 1px solid var(--line); border-radius: 28px; padding: 26px; box-shadow: var(--shadow); }
.avatars { display: flex; gap: 14px; justify-content: center; margin-bottom: 18px; }
.avatars figure { margin: 0; text-align: center; font-weight: 800; color: var(--blue-900); font-size: 15px; }
.avatars img { width: 92px; height: 92px; border-radius: 22px; box-shadow: var(--shadow-sm); margin-bottom: 6px; }
.history { width: 100%; border-collapse: collapse; font-size: 15px; }
.history caption { text-align: left; font-weight: 800; color: var(--blue-900); padding-bottom: 6px; }
.history th, .history td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.history th { color: var(--ink-soft); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; }
.history td img { width: 34px; height: 34px; border-radius: 8px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.sample { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; }
@media (max-width: 860px) { .players { grid-template-columns: 1fr; } }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--cream); border-radius: var(--radius); padding: 26px; border: 1px solid var(--line); }
.feature .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--sky-50); }
.feature .ic svg { width: 26px; height: 26px; fill: var(--blue-700); }
.feature h3 { margin: 14px 0 6px; font-size: 19px; color: var(--blue-900); }
.feature p { margin: 0; color: var(--ink-soft); font-size: 16px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.checks { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.checks li::before { content: ""; flex: none; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; background: var(--blue-700) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6 11-11-1.4-1.4z' fill='%23fff'/%3E%3C/svg%3E") center / 18px no-repeat; }

.trust { margin-top: 28px; background: var(--blue-800); color: #fff; border-radius: 28px; padding: 32px; position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: center; }
.trust h3 { margin: 0 0 12px; font-size: 24px; }
.trust p { margin: 0 0 10px; }
.trust a { color: var(--yellow); font-weight: 800; }
.trust img { width: 100%; }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; } .trust img { width: 220px; margin: 0 auto; } }

/* ---------- Help / FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 0 22px; }
.faq details[open] { box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 32px 18px 0; font-weight: 800; position: relative; color: var(--blue-900); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 400; color: var(--orange-ink); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 18px; color: var(--ink-soft); }
.faq details > div p { margin: 0 0 10px; }
.faq details > div ol, .faq details > div ul { margin: 0 0 10px; padding-left: 22px; }
.contact-card { max-width: 820px; margin: 28px auto 0; background: var(--sky-50); border-radius: 20px; padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.contact-card p { margin: 0; }
.contact-card a { font-weight: 800; }

/* ---------- Get it ---------- */
.get { text-align: center; background: linear-gradient(180deg, var(--cream), #fdeedd); }
.get img.icon { width: 120px; margin: 0 auto 20px; border-radius: 26px; box-shadow: var(--shadow); }
.get .sub { margin-inline: auto; }

/* ---------- Footer ---------- */
footer { background: var(--blue-900); color: rgba(255, 255, 255, 0.88); padding: 56px 0 40px; font-size: 15px; }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
footer img.logo { width: 200px; margin-bottom: 12px; }
footer .fh { color: #fff; font-weight: 800; margin: 0 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.8px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
footer a { color: rgba(255, 255, 255, 0.88); text-decoration: none; }
footer a:hover { color: #fff; text-decoration: underline; }
footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 20px; font-size: 13px; color: rgba(255, 255, 255, 0.8); margin: 0; }
@media (max-width: 720px) { footer .wrap { grid-template-columns: 1fr 1fr; } footer .wrap > div:first-child { grid-column: 1 / -1; } }

/* ---------- Legal pages ---------- */
.doc-hero { background: linear-gradient(160deg, var(--blue-700), var(--blue-900)); color: #fff; padding: 56px 0 48px; }
.doc-hero h1 { margin: 0 0 6px; font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.5px; }
.doc-hero p { margin: 0; }
.doc-hero .wrap { max-width: 760px; }
.doc { padding: 48px 0 80px; }
.doc .wrap { max-width: 760px; }
.doc h2 { font-size: 24px; margin: 40px 0 10px; letter-spacing: -0.2px; }
.doc h3 { font-size: 18px; margin: 24px 0 6px; color: var(--blue-900); }
.doc p, .doc li { color: #26394a; }
.doc .tldr { background: var(--sky-50); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 8px; }
.doc .tldr h2 { margin-top: 0; }
.doc .note { font-size: 15px; color: var(--ink-soft); border-left: 4px solid var(--sky); padding-left: 14px; }

/* ---------- 404 ---------- */
.lost { min-height: 100vh; display: grid; place-items: center; text-align: center; background: linear-gradient(160deg, var(--blue-700), var(--blue-900)); color: #fff; padding: 40px 0; }
.lost img { margin: 0 auto 24px; width: min(360px, 80%); }
.lost h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 10px; }
.lost a { color: var(--yellow); font-weight: 800; }

/* Language switching: elements marked for the other language are hidden.
   The page defaults to English (html lang="en"), so it reads fine without JavaScript. */
html:not([lang="en"]) [data-only="en"],
html:not([lang="es"]) [data-only="es"] { display: none !important; }
[hidden] { display: none !important; }
