/* Koiluna Kids — koilunakids.com: the landing page, the legal pages and the pages the Worker renders (sign-in, account,
   purchase). One stylesheet, system fonts only, nothing loaded from anywhere else. The colours and the type are the game's
   own (Koiluna Kids 3 app/kids.css and app/splash.css): cream paper, jade ink, a gold button, Georgia for the tale.
   - Text is never under 16 px; buttons and links to press are at least 44 px tall.
   - Everything fits a 360 px phone with no sideways scroll (the postcard strip scrolls inside itself).
   - No inline styles anywhere on the site: the pages' security rule is style-src 'self'. */
:root {
  --ink: #1f3d33; --ink-soft: #445c4f; --cream: #fbf6e6; --paper: #fffdf3; --sand: #f3eedd; --jade: #1f6a52; --jade-deep: #154a3b; --night: #123c36;
  --gold: #c9973b; --gold-ink: #6b4d0a; --gold-soft: #f6e3ae; --coral: #b9502b; --sky: #dcefe6; --line: #d6dcc6;
  --ui: ui-rounded, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --tale: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; font: 17px/1.65 var(--ui); color: var(--ink); background: var(--sand); overflow-wrap: break-word; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--tale); color: var(--jade-deep); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 6vw, 44px); } h2 { font-size: clamp(26px, 4.6vw, 36px); } h3 { font-size: 21px; }
p { margin: 0 0 1em; }
a { color: var(--jade); text-underline-offset: 3px; }
a:hover { color: var(--jade-deep); }
:focus-visible { outline: 3px solid #0b5fa8; outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--jade-deep); color: #fff; padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 8px; }
.eyebrow { margin: 0 0 6px; font: 800 16px/1.3 var(--ui); letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold-ink); }
.muted { color: var(--ink-soft); font-size: 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 11px 24px; border-radius: 28px; border: 2px solid transparent; font: 800 17px/1.2 var(--ui); text-decoration: none; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn b { font-weight: 600; font-size: 16px; opacity: .9; }
.btn.gold { color: #4a3104; background: linear-gradient(#ffe9a6, #f4c655); border-color: #a9781a; box-shadow: 0 4px 0 #8a5f10; }
.btn.gold:hover { background: linear-gradient(#fff1c2, #f8d06a); color: #4a3104; }
.btn.gold:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a5f10; }
.btn.ghost { color: var(--jade-deep); background: var(--paper); border-color: var(--jade); }
.btn.ghost:hover { background: var(--sky); }
.btn.glass { color: #fffaf0; background: #0b2f2a99; border-color: #fff3c4aa; }
.btn.glass:hover { background: #0b2f2acc; color: #fff; }
.btn.big { min-height: 58px; padding: 14px 32px; font-size: 19px; }
.btn.small { min-height: 44px; padding: 8px 18px; font-size: 16px; box-shadow: 0 3px 0 #8a5f10; }
.btn[aria-disabled="true"] { opacity: .75; cursor: default; }

/* ---------- the top bar ---------- */
.top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--paper); border-bottom: 2px solid var(--line); }
.top.over { position: absolute; inset: 0 0 auto 0; z-index: 5; background: none; border: 0; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none; font: 700 21px/1.1 var(--tale); color: var(--jade-deep); }
.brand img { width: 48px; height: 48px; flex: none; }
.brand small { display: block; font: 800 12.5px/1.3 var(--ui); letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-ink); margin-top: 2px; }
.top.over .brand { color: #fffaf0; text-shadow: 0 2px 8px #000a; } .top.over .brand small { color: #ffe08a; }
.top-nav { display: none; gap: 4px; margin-left: 10px; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 22px; color: #fffaf0; font-weight: 700; text-decoration: none; text-shadow: 0 2px 8px #000c; }
.top-nav a:hover { background: #0b2f2a99; color: #fff; }
.top-cta { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-weight: 700; white-space: nowrap; }
.top.over .signin { color: #fffaf0; text-shadow: 0 2px 8px #000c; }
.top-note { margin-left: auto; font: 800 14px/1.3 var(--ui); letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-ink); }
@media (min-width: 900px) { .top-nav { display: flex; } }
@media (max-width: 479px) { .top { padding: 8px 12px; gap: 8px; } .brand { font-size: 18px; gap: 8px; } .brand img { width: 40px; height: 40px; } .top-cta [data-top] { display: none; } }

/* ---------- the hero: the pond, the two friends, the name ---------- */
.hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: min(100svh, 860px); padding: 84px 16px 34px; color: #fff6d9; background: var(--night) url(/art/pond-800.webp) center 30% / cover no-repeat; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 40% at 50% 14%, #fff3c444 0, transparent 70%), linear-gradient(#0b2f2a55 0, #0b2f2a11 26%, #0b2f2a88 56%, #082621f5 100%); }
.hero-friends { position: relative; display: flex; align-items: flex-end; justify-content: space-between; width: min(100%, 900px); flex: 1 1 auto; min-height: 150px; padding: 0 2%; }
.hero-friends img { width: auto; height: clamp(150px, 42vw, 360px); filter: drop-shadow(0 18px 16px #0a2a2599); }
.hero-lumi { animation: bob 5s ease-in-out infinite; } .hero-jade { animation: bob 6s ease-in-out .6s infinite; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(1.2deg); } }
.hero-words { position: relative; width: min(100%, 780px); text-align: center; }
.kicker { margin: 0; font: 800 clamp(16px, 2.2vw, 18px)/1.4 var(--ui); letter-spacing: 2.4px; text-transform: uppercase; color: #ffe08a; text-shadow: 0 2px 8px #000b; }
.hero h1 { margin: 4px 0 0; font: 700 clamp(44px, 9vw, 88px)/1 var(--tale); color: #fffaf0; text-shadow: 0 4px 0 #0c3a33, 0 10px 26px #0009; }
.hero h1 span { color: #ffd76a; font-style: italic; }
.hero h1 em { display: block; margin-top: 4px; font: italic 700 clamp(24px, 4.4vw, 40px)/1.1 var(--tale); color: #ffe08a; text-shadow: 0 3px 10px #000a; }
.hero-line { margin: 14px auto 18px; max-width: 640px; font-size: clamp(17px, 2.4vw, 21px); font-weight: 600; color: #f1f7ea; text-shadow: 0 2px 8px #000d; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-soon { margin: 12px 0 0; font-size: 16px; color: #f1f7ea; text-shadow: 0 2px 8px #000d; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; list-style: none; margin: 18px 0 0; padding: 0; }
.chips li { padding: 6px 14px; border-radius: 20px; background: #082621cc; border: 1.5px solid #fff3c466; color: #fff6d9; font-weight: 700; font-size: 16px; }
@media (min-width: 700px) { .hero { background-image: url(/art/pond.webp); } }

/* ---------- the bands of the landing page ---------- */
.band { padding: clamp(40px, 7vw, 76px) 16px; background: var(--paper); }
.band.cream { background: var(--sand); }
.band.dark { background: var(--night); color: #f1f7ea; padding-left: 0; padding-right: 0; }
.band.dark h2 { color: #fffaf0; } .band.dark .wrap { padding: 0 16px; }
.wrap { max-width: 1080px; margin: 0 auto; } .wrap.narrow { max-width: 760px; }
.lead { font-size: clamp(18px, 2.2vw, 20px); max-width: 760px; }
.cards, .steps, .cast, .facts, .runs, .postcards { list-style: none; margin: 0; padding: 0; }
.cards { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 26px; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } } @media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }   /* four cards: never three and one */
.cards li, .facts li { padding: 20px; border-radius: 20px; background: var(--cream); border: 2px solid var(--line); }
.cards li:nth-child(1) { border-top: 6px solid var(--gold); } .cards li:nth-child(2) { border-top: 6px solid var(--jade); } .cards li:nth-child(3) { border-top: 6px solid var(--coral); } .cards li:nth-child(4) { border-top: 6px solid #3d7fa6; }
.cards p, .facts p, .steps p, .cast p { margin: 0; }
.numbers { margin: 28px 0 0; padding: 16px 20px; border-radius: 18px; background: var(--gold-soft); border: 2px solid var(--gold); color: #4a3104; font-weight: 600; text-align: center; }
.numbers b { font: 700 22px var(--tale); }
.numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
.numbers span { white-space: normal; padding: 0 12px; border-left: 2px solid #c9973b66; } .numbers span:first-child { border-left: 0; }
@media (max-width: 559px) { .numbers { display: grid; text-align: left; } .numbers span { border-left: 0; padding: 2px 0; } }
/* what it practices: the thirty puzzles by skill, a big number each */
.skills { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.skills li { position: relative; padding: 18px 20px 18px 86px; min-height: 96px; border-radius: 20px; background: var(--cream); border: 2px solid var(--line); }
.skills li > b { position: absolute; left: 18px; top: 16px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--jade); color: #fff8e2; font: 700 24px var(--tale); }
.skills h3 { font-size: 19px; margin: 2px 0 4px; } .skills p { margin: 0; font-size: 16px; color: var(--ink-soft); }
.plain-line { padding: 12px 16px; border-radius: 14px; background: var(--sky); border: 2px solid #b9dccb; }
.play-link { display: inline-block; margin-top: 6px; font-weight: 700; }
.steps { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 26px; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, 1fr); } }   /* three steps: one row, or one column */
.steps li { padding: 20px; border-radius: 22px; background: var(--paper); border: 2px solid var(--line); text-align: center; }
.steps img { width: auto; height: 150px; }
.steps h3 { display: flex; align-items: center; justify-content: center; gap: 10px; }
.steps h3 span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--jade); color: #fff8e2; font: 800 19px var(--ui); }
.aside { margin: 24px auto 0; max-width: 820px; padding: 16px 20px; border-left: 6px solid var(--gold); border-radius: 0 16px 16px 0; background: var(--paper); }
/* the postcards: one strip that scrolls sideways inside itself (the page never does) */
.postcards { display: flex; gap: 16px; margin-top: 24px; padding: 8px 16px 18px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-color: #ffe08a #0b2f2a; }
.postcards li { flex: none; width: min(78vw, 380px); scroll-snap-align: center; padding: 8px 8px 0; border-radius: 14px; background: #fffdf3; box-shadow: 0 10px 24px #0007; transform: rotate(-1.2deg); }
.postcards li:nth-child(even) { transform: rotate(1.4deg); }
.postcards img { display: block; width: 100%; border-radius: 8px; aspect-ratio: 16 / 9; object-fit: cover; }
.postcards li::after { content: "A future to find"; display: block; padding: 6px 0 8px; font: italic 700 16px var(--tale); color: var(--jade-deep); text-align: center; }
.cast { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 22px; }
.cast li { text-align: center; }
.cast img { width: auto; height: 170px; }
.cast h3 { margin: 6px 0 4px; font-size: 19px; }
.cast p { font-size: 16px; color: var(--ink-soft); }
.facts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 22px; }
.facts li { background: var(--paper); }
.themes { margin-top: 28px; padding: 22px; border-radius: 22px; background: var(--paper); border: 2px solid var(--gold); }
.themes ul { margin: 0; padding-left: 22px; } .themes li { margin-bottom: 8px; }
.plans { display: grid; gap: 20px; margin: 26px auto 0; max-width: 520px; }
.plans.two { max-width: 900px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.plan { padding: 26px 22px; border-radius: 26px; background: var(--cream); border: 3px solid var(--gold); box-shadow: 0 10px 0 var(--gold-soft); text-align: center; }
.plan h3 { font-size: 26px; margin-bottom: 4px; }
.price { margin: 0 0 12px; } .price b { font: 700 46px/1 var(--tale); color: var(--jade-deep); } .price span { font-weight: 700; color: var(--ink-soft); }
.plan ul { margin: 0 0 18px; padding: 0; list-style: none; text-align: left; }
.plan li { position: relative; padding: 6px 0 6px 30px; border-top: 1px dashed var(--line); }
.plan li::before { content: "✓"; position: absolute; left: 4px; color: var(--jade); font-weight: 800; }
.fine { margin: 16px 0 0; font-size: 16px; color: var(--ink-soft); text-align: left; }
.soon { margin: 20px auto 0; max-width: 620px; text-align: center; }
.when-open { display: none; }
html.shop-open .when-open { display: block; } html.shop-open .when-closed { display: none; }
.runs-title { margin: 44px 0 0; text-align: center; font-size: 24px; }
.runs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 16px; }
.runs li { padding: 16px 18px; border-radius: 18px; background: var(--sky); border: 2px solid #bcd9c9; }
.runs b { display: block; font: 700 19px var(--tale); color: var(--jade-deep); } .runs span { font-size: 16px; }
details { margin: 0 0 10px; border-radius: 16px; background: var(--cream); border: 2px solid var(--line); }
summary { min-height: 52px; padding: 13px 18px; font: 700 18px/1.4 var(--ui); color: var(--jade-deep); cursor: pointer; }
details[open] summary { border-bottom: 2px dashed var(--line); }
details > p { margin: 0; padding: 14px 18px 16px; }

/* ---------- the footer ---------- */
.foot { padding: 28px 16px 40px; background: var(--jade-deep); color: #e3efe2; text-align: center; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-bottom: 12px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: #fff6d9; font-weight: 700; }
.foot-note { max-width: 760px; margin: 0 auto 6px; font-size: 16px; color: #e3efe2; }

/* ---------- the legal pages ---------- */
.doc-main { max-width: 780px; margin: 0 auto; padding: 34px 18px 60px; }
.doc-main h2 { font-size: 24px; margin-top: 1.5em; }
.doc-main li { margin-bottom: 8px; }
.updated { color: var(--ink-soft); font-size: 16px; }
.plain { margin: 20px 0; padding: 6px 20px 10px; border-radius: 20px; background: var(--paper); border: 2px solid var(--gold); }
.plain h2 { margin-top: .7em; }

/* ---------- the pages the Worker renders: sign-in, account, purchase, owner ---------- */
.acct-main { display: flex; justify-content: center; padding: 28px 14px 60px; }
.acct-card { width: min(100%, 720px); padding: clamp(18px, 4vw, 34px); border-radius: 24px; background: var(--paper); border: 2px solid var(--line); box-shadow: 0 12px 30px #1f3d3318; }
.acct-card h2 { font-size: 22px; margin-top: 1.4em; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 18px 0; }
.note { padding: 12px 16px; border-radius: 14px; background: #fff3cf; border: 2px solid var(--gold); color: #4a3104; }
.note.ok { background: #e2f3e6; border-color: #5a9c78; color: #123c2c; }
.note.err { background: #fde5dc; border-color: var(--coral); color: #6d2410; }
.ways { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.acct-form { display: grid; gap: 12px; align-content: start; padding: 18px; border-radius: 18px; background: var(--cream); border: 2px solid var(--line); }
.acct-form h2 { margin: 0; font-size: 20px; }
.acct-form p { margin: 0; }
label { display: grid; gap: 4px; font-weight: 700; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 2px solid #8fa596; background: #fff; max-width: 100%; }
input[type="checkbox"] { min-height: 0; width: 22px; height: 22px; }
textarea.codes { width: 100%; font-family: Consolas, "Courier New", monospace; }
button { font: inherit; cursor: pointer; }
.license { margin: 18px 0; padding: 16px; border-radius: 18px; background: var(--gold-soft); border: 2px dashed var(--gold); text-align: center; }
.license small { display: block; font: 800 14px var(--ui); letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold-ink); }
.license code { display: block; margin: 6px 0; font: 700 clamp(19px, 5.4vw, 28px) Consolas, "Courier New", monospace; white-space: nowrap; user-select: all; color: var(--jade-deep); }
.license p { margin: 0; font-size: 16px; }
.rows, .purchases { list-style: none; margin: 0 0 12px; padding: 0; }
.rows li, .purchases li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px dashed var(--line); }
.rows code, .purchases code { font-family: Consolas, "Courier New", monospace; background: var(--gold-soft); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.rows button, .purchases button, .signout button { min-height: 44px; padding: 8px 14px; border-radius: 22px; border: 2px solid var(--jade); background: var(--paper); color: var(--jade-deep); font-weight: 700; }
.rows button:hover, .signout button:hover { background: var(--sky); }
.rows form, .purchases form { display: inline-flex; margin: 0 6px 0 0; }
.receipt { line-height: 1.8; } .receipt-more { margin: 8px 0 0; } .receipt-more summary { min-height: 44px; padding: 9px 14px; font-size: 16px; } .receipt-more p { padding: 10px 14px; }
.signout { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.getin li { margin-bottom: 6px; }
/* the Windows download on a phone: a sentence instead of the button (worker/src/index.js downloadButton) */
.phone-only { display: none; } .phone-only.always { display: block; }
@media (max-width: 700px) { .pc-only { display: none; } .phone-only { display: block; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
