/* Siyah At — shared styles for the website and the web app.
   Design language derived from Tasda (navy night, mint primary, violet accent, Inter, rounded pressable buttons). See docs/BRAND.md. */
:root {
  --bg: #0c0f2b;
  --bg-deep: #070920;
  --panel: #171b45;
  --panel-2: #20255a;
  --panel-soft: rgba(32, 37, 90, .72);
  --line: rgba(190, 200, 255, .16);
  --line-strong: rgba(190, 200, 255, .32);
  --text: #f8fbff;
  --text-soft: #c8cdf0;
  --muted: #8d93c2;
  --mint: #52e5a5;
  --mint-dark: #25a974;
  --violet: #8664ff;
  --violet-dark: #5b3fd6;
  --gold: #ffd76a;
  --gold-dark: #d9a930;
  --pink: #ff9ec0;
  --sky: #6cc8ff;
  --radius: 20px;
  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Baloo 2', Inter, system-ui, sans-serif;
  --reader-size: 20px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text); line-height: 1.55;
  background: radial-gradient(120% 80% at 70% -10%, #2b2470 0%, var(--bg) 45%, var(--bg-deep) 100%) fixed;
  background-color: var(--bg);
  overflow-x: hidden;
}
a { color: var(--mint); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 6vw, 58px); }
h2 { font-size: clamp(26px, 4vw, 38px); }
h3 { font-size: 21px; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Night sky ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.stars { position: absolute; inset: -50%; background-repeat: repeat; opacity: .55; }
/* Each star twinkles on its own random duration/delay (set inline in partials/sky.php). */
.star { position: absolute; border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255, 247, 204, .8); animation: twinkle ease-in-out infinite alternate; opacity: .2; }
.stars-1 { background-image: radial-gradient(1.6px 1.6px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 120px 80px, #e8e4ff 50%, transparent 51%), radial-gradient(1.4px 1.4px at 200px 160px, #fff 50%, transparent 51%); background-size: 240px 220px; }
.stars-2 { background-image: radial-gradient(2px 2px at 60px 110px, #fff7cc 50%, transparent 51%), radial-gradient(1.4px 1.4px at 170px 40px, #fff 50%, transparent 51%); background-size: 310px 260px; animation-delay: -1.3s; animation-duration: 5s; }
.stars-3 { background-image: radial-gradient(2.4px 2.4px at 90px 60px, #d9ccff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 260px 200px, #fff 50%, transparent 51%); background-size: 420px 340px; animation-delay: -2.6s; animation-duration: 6s; }
@keyframes twinkle { from { opacity: .15; } to { opacity: 1; } }
.moon { position: absolute; top: 9vh; right: 8vw; width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9df, #ffe9a6 60%, #f5cf6a);
  box-shadow: 0 0 60px 18px rgba(255, 223, 128, .22), inset -14px -10px 0 rgba(214, 170, 70, .25);
  animation: float 9s ease-in-out infinite; }
.cloud { position: absolute; height: 46px; border-radius: 46px; background: rgba(200, 205, 255, .07); filter: blur(2px); }
.cloud::before, .cloud::after { content: ''; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 60px; height: 60px; top: -28px; left: 30px; }
.cloud::after { width: 44px; height: 44px; top: -18px; right: 34px; }
.cloud-1 { width: 180px; top: 26vh; left: -200px; animation: drift 70s linear infinite; }
.cloud-2 { width: 140px; top: 62vh; left: -160px; animation: drift 95s linear infinite -40s; }
@keyframes drift { to { transform: translateX(calc(100vw + 420px)); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.shooting-star { position: absolute; top: 14vh; left: 12vw; width: 120px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff); opacity: 0; transform: rotate(-18deg); animation: shoot 11s ease-in infinite 3s; }
@keyframes shoot { 0%, 90% { opacity: 0; transform: translate(0, 0) rotate(-18deg); } 92% { opacity: 1; } 100% { opacity: 0; transform: translate(380px, 130px) rotate(-18deg); } }

/* ---------- Mascot ---------- */
.mascot { width: 100%; height: auto; overflow: visible; }
.mascot .sa-eyes { transform-origin: 120px 130px; animation: blink 5.5s infinite; }
.mascot .sa-ear-l { transform-origin: 92px 72px; animation: ear-l 4s ease-in-out infinite; }
.mascot .sa-ear-r { transform-origin: 148px 72px; animation: ear-r 4s ease-in-out infinite 1.2s; }
.mascot .sa-forelock, .mascot .sa-mane-back { transform-origin: 120px 60px; animation: sway 3.2s ease-in-out infinite; }
.mascot .sa-star { transform-origin: 120px 112px; animation: star-pulse 2.4s ease-in-out infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes ear-l { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-12deg); } 92% { transform: rotate(4deg); } }
@keyframes ear-r { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(12deg); } 92% { transform: rotate(-4deg); } }
@keyframes sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
@keyframes star-pulse { 0%, 100% { transform: scale(1); filter: none; } 50% { transform: scale(1.15); filter: drop-shadow(0 0 6px #ffd76a); } }
.mascot-hero { animation: bob 3.4s ease-in-out infinite; filter: drop-shadow(0 18px 30px rgba(134, 100, 255, .35)); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.mascot.happy { animation: hop .6s ease 2; }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-26px) scale(1.04, .97); } 70% { transform: translateY(0) scale(1.05, .93); } }

/* ---------- Buttons (rounded, pressable like Tasda) ---------- */
.btn { --b: var(--panel-2); --s: #0f1236; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px; border: 0; border-radius: 999px; cursor: pointer;
  font: 800 16px/1.1 var(--font); color: var(--text); text-decoration: none; background: var(--b);
  box-shadow: 0 4px 0 var(--s); transition: transform .12s ease, box-shadow .12s ease, filter .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--s); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-mint { --b: var(--mint); --s: var(--mint-dark); color: #06231a; }
.btn-violet { --b: var(--violet); --s: var(--violet-dark); }
.btn-gold { --b: var(--gold); --s: var(--gold-dark); color: #3a2a00; }
.btn-ghost { --b: transparent; --s: transparent; border: 2px solid var(--line-strong); }
.btn-lg { min-height: 58px; padding: 16px 30px; font-size: 18px; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 48px; padding: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge-gold { background: var(--gold); color: #3a2a00; }
.badge-violet { background: rgba(134, 100, 255, .25); color: #d9ceff; }

/* ---------- Site chrome ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1160px; margin: 0 auto; padding: 18px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 24px var(--display); }
.brand-mascot { width: 46px; height: 46px; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.lang-pill { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-soft); text-decoration: none; font-weight: 700; font-size: 13px; }
main { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.site-footer { max-width: 1160px; margin: 60px auto 0; padding: 32px 20px 48px; border-top: 1px solid var(--line); text-align: center; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 12px 0; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-soft); }
.footer-mascot { width: 40px; height: 40px; }
.footer-brand p { margin: 0; }

/* ---------- Landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 30px; min-height: 72vh; padding: 20px 0 40px; }
.eyebrow { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(134, 100, 255, .18); color: #ddd4ff; font-weight: 700; font-size: 14px; }
.lead { font-size: 19px; color: var(--text-soft); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 14px; }
.hero-art { position: relative; display: grid; place-items: center; }
.mascot-stage { width: min(380px, 80vw); position: relative; }
.mascot-shadow { width: 60%; height: 18px; margin: -6px auto 0; border-radius: 50%; background: rgba(0, 0, 0, .35); filter: blur(6px); animation: shadow 3.4s ease-in-out infinite; }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: .5; } 50% { transform: scaleX(.8); opacity: .3; } }
.speech { position: relative; max-width: 300px; margin-bottom: 8px; padding: 14px 18px; border-radius: 22px; background: #fff; color: #1d1b3a; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: pop .5s cubic-bezier(.2,1.6,.4,1) both .4s; }
.speech::after { content: ''; position: absolute; bottom: -10px; left: 48%; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(10px); } to { opacity: 1; transform: none; } }
.floating-book { position: absolute; right: 6%; bottom: 18%; font-size: 46px; animation: float 5s ease-in-out infinite -1s; }
.section { padding: 46px 0; }
.section-title { text-align: center; margin-bottom: 28px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card { position: relative; padding: 28px 22px; border-radius: var(--radius); background: var(--panel-soft); border: 1px solid var(--line); text-align: center; }
.step-card p { color: var(--text-soft); margin: 0; }
.step-num { position: absolute; top: 14px; left: 16px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--violet); font-weight: 800; }
.step-icon { display: block; font-size: 52px; margin-bottom: 8px; animation: float 4s ease-in-out infinite; }
.step-card:nth-child(2) .step-icon { animation-delay: -1.3s; }
.step-card:nth-child(3) .step-icon { animation-delay: -2.6s; }
.feature-grid { list-style: none; padding: 0; margin: 0 auto; max-width: 900px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.feature { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--panel-soft); border: 1px solid var(--line); font-weight: 600; }
.feature { font-size: 16px; }
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 20px; }
.price-card { position: relative; padding: 28px; border-radius: 26px; background: var(--panel-soft); border: 1px solid var(--line); display: flex; flex-direction: column; }
.price-card ul { padding-left: 20px; color: var(--text-soft); flex: 1; }
.price-card li { margin-bottom: 6px; }
.price-card-premium { border: 2px solid var(--gold); background: linear-gradient(160deg, rgba(134, 100, 255, .32), var(--panel-soft)); }
.price-card-premium .badge { position: absolute; top: -12px; right: 22px; }
.price { font: 800 30px var(--display); color: var(--gold); margin: 0; }
.faq { max-width: 760px; margin: 0 auto; }
.faq details { margin-bottom: 10px; padding: 16px 20px; border-radius: 18px; background: var(--panel-soft); border: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--text-soft); }

/* ---------- Story cards & covers ---------- */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.story-card { display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .2s cubic-bezier(.2,1.4,.4,1), box-shadow .2s; cursor: pointer; text-align: left; padding: 0; font: inherit; width: 100%; }
.story-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 0, 0, .35); }
.story-card-body { padding: 12px 14px 14px; }
.story-card h3 { font-size: 18px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: 13px; margin: 0; }
.stars-inline { color: var(--gold); font-weight: 700; }
.story-cover { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; background: linear-gradient(160deg, #3b2f8f, #151a4a); }
.story-cover img { width: 100%; height: 100%; object-fit: cover; animation: fade-in .6s ease; }
.story-cover .badge { position: absolute; top: 10px; right: 10px; }
.story-cover .lock { position: absolute; top: 10px; left: 10px; font-size: 18px; }
.scene-emoji { font-size: 58px; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.scene-night_meadow { background: radial-gradient(circle at 75% 25%, #ffe9a6 0 9%, transparent 10%), linear-gradient(180deg, #2b2470, #1b4a52 75%, #1f6b4c); }
.scene-space { background: radial-gradient(circle at 25% 30%, #ff9ec0 0 8%, transparent 9%), radial-gradient(circle at 80% 70%, #6cc8ff 0 6%, transparent 7%), linear-gradient(160deg, #1a1050, #070920); }
.scene-ocean { background: linear-gradient(180deg, #2a3f9e 0, #1e78b5 55%, #0f4f7a); }
.scene-forest { background: radial-gradient(circle at 20% 90%, #2f8a55 0 30%, transparent 31%), radial-gradient(circle at 80% 95%, #26774a 0 34%, transparent 35%), linear-gradient(180deg, #2b2470, #224b5c); }
.scene-castle { background: radial-gradient(circle at 70% 25%, #ffd76a 0 7%, transparent 8%), linear-gradient(180deg, #5b3fd6, #2b2470 70%, #1a1a4a); }
.scene-city { background: linear-gradient(180deg, #3a2f8f, #233b7a 60%, #1a2550); }
.scene-dino { background: radial-gradient(circle at 80% 20%, #ffb36b 0 10%, transparent 11%), linear-gradient(180deg, #4a3a8f, #2f6b4f 70%, #3f5c2a); }
.scene-circus { background: repeating-linear-gradient(90deg, rgba(255,158,192,.25) 0 22px, rgba(255,255,255,.06) 22px 44px), linear-gradient(180deg, #5b3fd6, #2b2470); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Public story page ---------- */
.story-page { max-width: 760px; margin: 0 auto; }
.story-head { text-align: center; margin-bottom: 24px; }
.story-cover-lg { border-radius: 26px; margin-bottom: 18px; aspect-ratio: 16 / 9; }
.story-cover-lg .scene-emoji { font-size: 96px; }
.story-text p { font-size: var(--reader-size); line-height: 1.8; color: #eef0ff; }
.the-end { text-align: center; font: 800 26px var(--display); color: var(--gold); }
.moral { padding: 16px 20px; border-radius: 18px; background: rgba(82, 229, 165, .1); border: 1px solid rgba(82, 229, 165, .3); }
.locked-box { text-align: center; padding: 24px; border-radius: 22px; background: linear-gradient(160deg, rgba(134, 100, 255, .32), var(--panel-soft)); border: 2px solid var(--gold); }
.story-cta { display: flex; align-items: center; gap: 18px; margin: 32px 0; padding: 22px; border-radius: 24px; background: var(--panel-soft); border: 1px solid var(--line); }
.story-cta .mascot { width: 110px; flex: none; }
.story-cta h2 { font-size: 24px; }
.mascot-sm { width: 110px; }
.legal { max-width: 760px; margin: 0 auto; padding: 20px 0; }
.legal h2 { font-size: 22px; margin-top: 26px; }
.legal p, .legal li { color: var(--text-soft); }
.notfound .mascot { width: 200px; margin: 0 auto; }

/* =========================================================
   Web app
   ========================================================= */
.page-app { min-height: 100dvh; }
.app { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
.app-boot { display: grid; place-items: center; min-height: 80vh; text-align: center; color: var(--text-soft); }
.app-boot .mascot { width: 160px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.topbar .brand { font-size: 22px; }
.topbar .brand-mascot { width: 40px; height: 40px; }
.screen { animation: screen-in .35s cubic-bezier(.2, 1, .4, 1) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
/* Bottom navigation: docked like Tasda's Material NavigationBar (72px, rounded 14px indicator, 11px labels). */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  height: calc(72px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom);
  background: var(--panel); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: -.15px; -webkit-tap-highlight-color: transparent; }
.tabbar .tab-ind { display: grid; place-items: center; width: 64px; height: 32px; border-radius: 14px; transition: background .2s ease; }
.tabbar .ic { width: 28px; height: 28px; }
.tabbar a.active { color: var(--text); font-weight: 800; }
.tabbar a.active .tab-ind { background: rgba(82, 229, 165, .15); }
.tabbar a.active .ic { stroke-width: 2.25; }
.tabbar a:active .tab-ind { transform: scale(.94); }

/* Icons (design/icons, sprite) */
.ic { width: 22px; height: 22px; flex: none; vertical-align: -5px; }
.ic-xs { width: 16px; height: 16px; vertical-align: -3px; }
.ic-sm { width: 18px; height: 18px; vertical-align: -4px; }
.ic-md { width: 30px; height: 30px; }
.ic-lg { width: 36px; height: 36px; }
.ic-choice { width: 52px; height: 52px; transition: transform .25s cubic-bezier(.2, 1.8, .4, 1); }
.choice:hover .ic-choice { transform: scale(1.12) rotate(-6deg); }
.choices.compact .ic-choice { width: 42px; height: 42px; }
.ic-scene { width: 84px; height: 84px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.scene-icon { animation: float 4s ease-in-out infinite; display: grid; place-items: center; }
.reader-cover .ic-scene { width: 120px; height: 120px; }
.mini-icons .ic { margin-right: 2px; }
.story-cover .lock { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(12, 15, 43, .7); color: var(--gold); }
.locked-box .ic { color: var(--gold); }
.badge .ic { vertical-align: -3px; }
.badge-violet { text-decoration: none; }
.plan-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px 16px; border-radius: 20px; background: linear-gradient(135deg, rgba(255, 215, 106, .16), rgba(134, 100, 255, .16)); border: 1px solid rgba(255, 215, 106, .4); }
.plan-banner div { flex: 1; font-size: 14px; }
.search-wrap { position: relative; }
.search-wrap > .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap .search { padding-left: 46px; }
.edit-para { display: flex; gap: 10px; align-items: flex-start; padding: 12px; }
.edit-para textarea { flex: 1; min-height: 120px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg-deep); color: var(--text); font: 500 16px/1.6 var(--font); resize: vertical; outline: none; }
.edit-para textarea:focus { border-color: var(--violet); }
.gallop-track .trail .ic { width: 22px; height: 22px; }
.confetti i .ic { width: 26px; height: 26px; }
.perk-list li::before { content: none; }
.perk-list .ic { color: var(--gold); }
.new-story-card .plus .ic { color: #fff; }

/* Wizard */
.wizard { display: flex; flex-direction: column; min-height: calc(100dvh - 60px); }
.progress { height: 12px; border-radius: 999px; background: var(--panel); overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--mint)); transition: width .5s cubic-bezier(.2, 1.3, .4, 1); }
.wiz-head { display: flex; align-items: flex-end; gap: 12px; margin: 22px 0 16px; }
.wiz-head .mascot { width: 96px; flex: none; }
.wiz-head .speech { margin: 0 0 30px; font-size: 15px; animation-delay: 0s; }
.wiz-head .speech::after { left: -8px; bottom: 16px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
.wiz-q { font-size: clamp(28px, 6vw, 38px); margin: 6px 0 18px; }
.wiz-body { flex: 1; }
.wiz-foot { display: flex; gap: 10px; padding-top: 18px; position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); }
.wizard .wiz-foot { bottom: 12px; }
.wiz-foot .btn-mint { flex: 1; }
.name-input { width: 100%; padding: 20px 22px; border-radius: 22px; border: 2px solid var(--line-strong); background: var(--panel); color: var(--text); font: 800 28px var(--display); text-align: center; outline: none; transition: border-color .2s, box-shadow .2s; }
.name-input:focus { border-color: var(--mint); box-shadow: 0 0 0 5px rgba(82, 229, 165, .18); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.choices.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 112px; padding: 14px 10px;
  border-radius: 22px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font: 700 16px var(--font); cursor: pointer; text-align: center;
  box-shadow: 0 4px 0 #0f1236; transition: transform .18s cubic-bezier(.2, 1.6, .4, 1), border-color .2s, background .2s; -webkit-tap-highlight-color: transparent; }
.choice .emoji { font-size: 40px; line-height: 1; transition: transform .25s cubic-bezier(.2, 1.8, .4, 1); }
.choice small { color: var(--muted); font-weight: 500; font-size: 12px; }
.choice:hover .emoji { transform: scale(1.12) rotate(-6deg); }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 #0f1236; }
.choice.selected { border-color: var(--mint); background: linear-gradient(160deg, rgba(82, 229, 165, .22), var(--panel)); animation: picked .35s cubic-bezier(.2, 1.8, .4, 1); }
.choice.selected::after { content: '✓'; position: absolute; top: 8px; right: 10px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: #06231a; font-weight: 900; font-size: 14px; }
@keyframes picked { 50% { transform: scale(1.06); } }
.choices.compact .choice { min-height: 86px; }
.choices.compact .emoji { font-size: 32px; }
.ages { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px; }
.ages .choice { min-height: 86px; font: 800 30px var(--display); }
.ages .choice small { font-size: 12px; }

/* Generating */
.generating { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; text-align: center; overflow: hidden; }
.gallop-track { position: relative; width: 100%; height: 190px; }
.gallop { position: absolute; left: 50%; bottom: 10px; width: 150px; margin-left: -75px; animation: gallop .5s ease-in-out infinite alternate; }
@keyframes gallop { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-18px) rotate(4deg); } }
.gallop-track .trail { position: absolute; bottom: 40px; left: 0; right: 0; height: 60px; overflow: hidden; }
.gallop-track .trail i { position: absolute; font-style: normal; font-size: 22px; animation: trail 1.6s linear infinite; }
@keyframes trail { from { transform: translateX(110vw); opacity: 1; } to { transform: translateX(-20vw); opacity: .2; } }
.gen-msg { min-height: 1.6em; font-weight: 700; color: var(--text-soft); animation: fade-in .5s ease; }
.ink-bar { width: min(320px, 80%); height: 10px; border-radius: 999px; background: var(--panel); overflow: hidden; margin-top: 10px; }
.ink-bar i { display: block; height: 100%; width: 40%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--gold), var(--mint)); animation: ink 1.6s ease-in-out infinite; }
@keyframes ink { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* Home */
.hello { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.hello .mascot { width: 74px; flex: none; }
.hello h1 { font-size: clamp(26px, 6vw, 34px); margin: 0; }
.child-switch { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); color: var(--text-soft); font: 700 14px var(--font); cursor: pointer; white-space: nowrap; transition: border-color .2s, background .2s, transform .15s; }
.chip:active { transform: scale(.96); }
.chip.on { border-color: var(--mint); color: var(--text); background: rgba(82, 229, 165, .14); }
.new-story-card { position: relative; display: flex; align-items: center; gap: 16px; width: 100%; padding: 20px; border: 0; border-radius: 26px; cursor: pointer; text-align: left; overflow: hidden;
  background: linear-gradient(135deg, var(--violet), #b16cff 55%, var(--pink)); color: #fff; box-shadow: 0 5px 0 var(--violet-dark), 0 18px 40px rgba(134, 100, 255, .35); transition: transform .15s; font: inherit; }
.new-story-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--violet-dark); }
.new-story-card .plus { display: grid; place-items: center; flex: none; width: 62px; height: 62px; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: 34px; animation: float 3s ease-in-out infinite; }
.new-story-card strong { display: block; font: 800 24px var(--display); }
.new-story-card small { opacity: .9; font-weight: 600; }
.new-story-card::after { content: '✦'; position: absolute; right: 18px; top: 10px; font-size: 26px; opacity: .6; animation: star-pulse 2s infinite; }
.quota-note { margin: 10px 4px 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.row-section { margin-top: 26px; }
.row-section h2 { font-size: 22px; margin-bottom: 12px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 44%); gap: 14px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.row > * { scroll-snap-align: start; }
.row::-webkit-scrollbar, .child-switch::-webkit-scrollbar, .filters::-webkit-scrollbar { display: none; }

/* Library */
.search { width: 100%; padding: 15px 20px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font: 600 16px var(--font); outline: none; }
.search:focus { border-color: var(--violet); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.filter-select { flex: none; padding: 9px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font: 700 14px var(--font); }
.empty { text-align: center; padding: 40px 10px; color: var(--text-soft); }
.empty .mascot { width: 130px; margin: 0 auto 10px; }

/* Reader */
.reader-cover { border-radius: 26px; margin-bottom: 16px; aspect-ratio: 16 / 10; box-shadow: 0 20px 40px rgba(0, 0, 0, .35); }
.reader-cover .scene-emoji { font-size: 90px; }
.reader-cover .drawing { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .45); font-size: 13px; font-weight: 700; }
.reader h1 { font-size: clamp(28px, 6vw, 40px); text-align: center; }
.reader .meta { text-align: center; margin-bottom: 14px; }
.reader-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 20px; }
.reader-text p { font-size: var(--reader-size); line-height: 1.85; color: #eef0ff; animation: para-in .6s ease both; }
@keyframes para-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.reader-text p.speaking { color: #fff; text-shadow: 0 0 18px rgba(255, 215, 106, .35); }
.rating { text-align: center; margin: 26px 0; padding: 22px; border-radius: 24px; background: var(--panel-soft); border: 1px solid var(--line); }
.rating-stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0; }
.rating-stars button { border: 0; background: none; cursor: pointer; font-size: 40px; color: #3d4280; transition: transform .2s cubic-bezier(.2, 1.8, .4, 1), color .2s; padding: 2px; }
.rating-stars button.on { color: var(--gold); text-shadow: 0 0 14px rgba(255, 215, 106, .5); }
.rating-stars button:hover { transform: scale(1.2) rotate(-8deg); }
.audio-bar { position: sticky; top: 10px; z-index: 10; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 8px 10px 8px 8px; border-radius: 999px; background: rgba(23, 27, 69, .94); border: 1px solid var(--line-strong); backdrop-filter: blur(10px); }
.audio-bar progress { flex: 1; height: 8px; accent-color: var(--mint); }
.text-size { display: inline-flex; border-radius: 999px; border: 2px solid var(--line); overflow: hidden; }
.text-size button { border: 0; background: var(--panel); color: var(--text); font-weight: 800; width: 44px; height: 40px; cursor: pointer; }

/* Sheets, forms, toasts */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 6, 20, .66); animation: fade-in .2s; }
.sheet { width: min(560px, 100%); max-height: 92dvh; overflow: auto; padding: 26px 22px calc(26px + env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: linear-gradient(180deg, #221f63, var(--panel)); border: 1px solid var(--line-strong); animation: sheet-up .35s cubic-bezier(.2, 1.2, .4, 1); }
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 30px; } }
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .mascot { width: 110px; margin: -6px auto 6px; }
.sheet h2 { text-align: center; }
.perk-list { list-style: none; padding: 0; margin: 14px 0 20px; }
.perk-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; font-weight: 600; border-bottom: 1px dashed var(--line); }
.plan-box { padding: 18px; border-radius: 22px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); margin-bottom: 12px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--text-soft); }
.field input, .field textarea, .field select { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg-deep); color: var(--text); font: 500 16px var(--font); outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--violet); }
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.card { padding: 20px; border-radius: 24px; background: var(--panel-soft); border: 1px solid var(--line); margin-bottom: 14px; }
.card h2 { font-size: 22px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.avatar-bubble { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2); font-size: 22px; flex: none; }
.toast { position: fixed; left: 50%; top: 18px; z-index: 80; transform: translateX(-50%); max-width: 92vw; padding: 13px 20px; border-radius: 999px; background: #fff; color: #1d1b3a; font-weight: 700; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.toast.error { background: #ffe1e8; color: #7a0e2b; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; font-style: normal; font-size: 22px; animation: confetti 2.4s ease-in forwards; }
@keyframes confetti { to { transform: translateY(110vh) rotate(540deg); opacity: .6; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: 0; padding-top: 0; }
  .hero-art { order: -1; }
  .mascot-stage { width: min(240px, 60vw); }
  .hero-actions { justify-content: center; }
  .lead { margin: 0 auto; }
  .steps { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .moon { width: 64px; height: 64px; }
}
@media (max-width: 520px) {
  .site-header { padding: 14px 16px; }
  main { padding: 0 16px; }
  .brand span { font-size: 20px; }
  .site-nav .btn-sm { padding: 8px 12px; }
  .choices { grid-template-columns: repeat(2, 1fr); }
  .choices.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .row { grid-auto-columns: 72%; }
  .story-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .story-card h3 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Explainer & library pages (SEO) ---------- */
.site-links { display: flex; gap: 18px; margin: 0 auto 0 30px; }
.site-links a { color: var(--text-soft); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-links a:hover { color: var(--text); }
.section-title a, .step-card, .feature { color: inherit; text-decoration: none; }
.step-card { display: block; transition: transform .2s, border-color .2s; }
.step-card:hover, .feature:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.ic-step { width: 64px; height: 64px; }
.feature { transition: transform .2s, border-color .2s; }
.feature span:nth-child(2) { flex: 1; }
.feature-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--panel-2); color: var(--gold); flex: none; }
.feature-arrow { transform: rotate(180deg); color: var(--muted); }
.floating-book .ic { color: var(--gold); }
.eyebrow .ic { color: var(--gold); }
.crumbs { font-size: 14px; color: var(--muted); margin: 6px 0 16px; }
.crumbs a { color: var(--text-soft); }
.explainer { max-width: 780px; margin: 0 auto; padding-bottom: 20px; }
.explainer-head { display: flex; align-items: center; gap: 16px; }
.explainer-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; background: var(--panel-2); color: var(--gold); flex: none; }
.explainer h1 { font-size: clamp(32px, 5vw, 48px); margin: 0; }
.answer { margin: 22px 0; padding: 20px 22px; border-radius: 22px; background: linear-gradient(135deg, rgba(82, 229, 165, .12), rgba(134, 100, 255, .14)); border: 1px solid rgba(82, 229, 165, .3); font-size: 18px; line-height: 1.7; }
.explainer section { margin: 30px 0; }
.explainer h2 { font-size: 26px; }
.explainer p, .explainer li { color: var(--text-soft); font-size: 17px; line-height: 1.75; }
.explainer ul { padding-left: 22px; }
.explainer .faq { max-width: none; }
.related-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.related-card { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 18px; background: var(--panel-soft); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; }
.related-card .ic { color: var(--gold); }
.library-page h1 { font-size: clamp(32px, 5vw, 48px); }
.genre-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.genre-links .chip { text-decoration: none; }
.footer-explainers { font-size: 14px; max-width: 900px; margin: 18px auto !important; }
@media (max-width: 980px) { .site-links { display: none; } }
.brand, .site-nav .btn { white-space: nowrap; flex: none; }
@media (max-width: 560px) {
  .site-header .brand { font-size: 19px; gap: 6px; }
  .site-header .brand-mascot { width: 38px; height: 38px; }
  .site-nav { gap: 6px; }
  .site-nav .lang-pill { min-width: 34px; height: 34px; }
}
@media (max-width: 420px) { .site-nav .lang-pill { display: none; } }

/* ---------- story cards: big picture, text on the picture ---------- */
.story-card { background: var(--panel-2); }
.story-card .story-cover { aspect-ratio: 3 / 4; }
.story-card .story-cover .lock { left: auto; right: 10px; z-index: 2; }
.story-card .story-cover .story-card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px 12px; background: rgba(0, 0, 0, .2); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.story-card .story-card-body h3 { color: #fff; margin: 0 0 2px; }
.story-card .story-card-body .meta { color: #fff; margin: 0; font-size: 13px; }
.row { grid-auto-columns: 210px; justify-content: start; }
.row > * { min-width: 0; }
@media (min-width: 720px) { .row { grid-auto-columns: 240px; } }
.story-grid { grid-template-columns: repeat(auto-fill, minmax(min(46%, 260px), 1fr)); gap: 14px; }

/* ---------- new-story flow: one question per screen ---------- */
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-soft); color: var(--text); cursor: pointer; }
.icon-btn .ic { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.busy { animation: star-pulse 1s infinite; pointer-events: none; }
.flow-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.flow-head h1 { grid-column: 2; text-align: center; font-size: clamp(24px, 6vw, 32px); line-height: 1.2; margin: 0; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0 22px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); transition: background .2s, width .2s; }
.dots i.on { background: var(--mint); }
.flow-body { animation: fade-in .35s ease; }
.flow-sub { text-align: center; font-size: 20px; margin: 30px 0 16px; color: var(--gold); }
.round-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
@media (min-width: 720px) { .round-grid { grid-template-columns: repeat(3, 1fr); } }
.round-pick { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.round-img { display: grid; place-items: center; width: min(100%, 190px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--panel-2); box-shadow: 0 0 0 6px rgba(134, 100, 255, .16), 0 14px 30px rgba(0, 0, 0, .35); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), box-shadow .2s; }
.round-img img { width: 100%; height: 100%; object-fit: cover; }
.round-img .mascot { width: 78%; height: auto; }
.round-label { font: 800 18px/1.25 var(--display); text-align: center; letter-spacing: .02em; }
.round-pick:hover .round-img { transform: scale(1.04) rotate(-2deg); }
.round-pick.selected .round-img { transform: scale(1.06); box-shadow: 0 0 0 5px var(--mint), 0 0 34px rgba(82, 229, 165, .45); }
.flow .choices { grid-template-columns: repeat(2, 1fr); }
.flow .choices.cols-3 { grid-template-columns: repeat(3, 1fr); }
.flow .choice { min-height: 150px; font-size: 17px; text-align: center; }
.flow .choice .ic-choice { width: 56px; height: 56px; }
.wish-input { width: 100%; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font: 500 18px var(--font); resize: vertical; margin-bottom: 16px; }

/* ---------- generating ---------- */
.generating h1 { font-size: 30px; margin: 0 0 8px; }
.countdown { font: 800 56px var(--display); margin: 18px 0; letter-spacing: .04em; }
.gen-orb { display: grid; place-items: center; width: 210px; height: 210px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3b2f8f, #151a4a 70%); box-shadow: 0 0 0 18px rgba(134, 100, 255, .12), 0 0 60px rgba(134, 100, 255, .35); animation: orb 2.4s ease-in-out infinite; }
.gen-orb .mascot { width: 72%; animation: float 2.4s ease-in-out infinite; }
@keyframes orb { 50% { box-shadow: 0 0 0 26px rgba(134, 100, 255, .08), 0 0 80px rgba(255, 215, 106, .3); } }
.generating .gen-msg { margin-top: 34px; }

/* ---------- reader: one page per screen, swipe up like short videos ---------- */
body.reading { overflow: hidden; }
.pager { position: fixed; inset: 0; z-index: 30; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; background: var(--bg-deep); scrollbar-width: none; }
.pager::-webkit-scrollbar { display: none; }
.rp { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; justify-content: center; padding: 84px max(20px, calc((100vw - 720px) / 2)) 48px; overflow: hidden; }
.rp-cover { align-items: center; padding: 76px 16px 24px; gap: 14px; }
.rp-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(26px) brightness(.45) saturate(1.2); }
/* Hardcover picture book: the illustration is the whole front cover (never cropped), with spine, page block and gloss. */
.book { position: relative; display: inline-block; max-width: 100%; border-radius: 3px 14px 14px 3px; transform: perspective(1600px) rotateY(-9deg) rotateX(1deg);
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .55)) drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); animation: book-in .7s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes book-in { from { opacity: 0; transform: perspective(1600px) rotateY(-30deg) translateY(20px); } }
/* page block peeking out on the right and bottom */
.book::after { content: ''; position: absolute; z-index: -1; top: 5px; right: -9px; bottom: -7px; left: 12px; border-radius: 2px 10px 10px 2px;
  background: repeating-linear-gradient(90deg, #fbf6ea 0 2px, #e6dcc6 2px 3px), #f5eedc;
  box-shadow: inset -2px -2px 0 #d9ceb5; }
.book-img, .book-img.story-cover { position: relative; display: block; aspect-ratio: auto; overflow: hidden; border-radius: 3px 14px 14px 3px; background: #2a1f73; }
.book-img img, .book-img.story-cover img { display: block; width: auto; height: auto; max-width: min(100%, 560px); max-height: calc(100dvh - 250px); object-fit: contain; animation: fade-in .6s ease; }
/* spine hinge + glossy laminate */
.book-img::before { content: ''; position: absolute; z-index: 2; inset: 0 auto 0 0; width: 9%; max-width: 34px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .55) 0, rgba(0, 0, 0, .25) 30%, rgba(255, 255, 255, .28) 42%, rgba(0, 0, 0, .3) 58%, rgba(0, 0, 0, 0) 100%); }
.book-img::after { content: ''; position: absolute; z-index: 2; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, .06) 28%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .14) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), inset -6px 0 10px rgba(0, 0, 0, .18); }
.book-img.no-img, .book-img.story-cover.no-img { width: min(70vw, 360px); aspect-ratio: 3 / 4; display: grid; place-items: center; background: linear-gradient(160deg, #3b2f8f, #151a4a); }
.book-img .drawing { position: absolute; z-index: 3; top: 62%; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .45); font-size: 13px; font-weight: 700; white-space: nowrap; }
/* title printed on the cover like a children's book */
.book-title { position: absolute; z-index: 3; top: 5%; left: 12%; right: 6%; margin: 0; padding: 8px 12px 10px; border-radius: 16px; background: rgba(0, 0, 0, .2);
  color: #fff; text-align: center; font: 800 clamp(22px, 6.4vw, 36px)/1.08 var(--display); letter-spacing: .01em; text-wrap: balance;
  text-shadow: 0 2px 0 #3a2a8a, 2px 0 0 #3a2a8a, -2px 0 0 #3a2a8a, 0 -2px 0 #3a2a8a, 0 4px 14px rgba(0, 0, 0, .55); }
.book-mark { position: absolute; z-index: 3; right: 5%; bottom: 3.5%; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 246, 224, .92); box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 0 0 2px var(--gold); }
.book-mark .mascot { width: 30px; height: 30px; }
.cover-meta { position: relative; margin: 6px 0 0; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .2); color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
/* inner picture pages: printed on cream paper with the gutter shadow of an open book */
.paper-page { position: relative; padding: 14px 14px 18px 22px; border-radius: 4px 10px 10px 4px; background: #fbf6ea;
  box-shadow: 0 24px 40px rgba(0, 0, 0, .5), inset 18px 0 22px -14px rgba(90, 60, 20, .45); }
.paper-page img { display: block; max-width: min(100%, 560px); max-height: calc(100dvh - 190px); width: auto; height: auto; border-radius: 6px; box-shadow: 0 1px 3px rgba(90, 60, 20, .35); }
.rp-cover .swipe-hint { position: relative; color: #fff; }
.swipe-hint { display: flex; color: #fff; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 0; font-weight: 700; font-size: 14px; opacity: .9; animation: float 2s ease-in-out infinite; }
.ic.up { transform: rotate(90deg); }
.rp-text { background: radial-gradient(120% 70% at 70% 0%, #241f5e 0%, var(--bg) 55%, var(--bg-deep) 100%); }
.rp-text p { margin: 0; font: 600 var(--reader-size)/1.65 var(--font); color: var(--text); text-align: center; text-wrap: pretty; transition: color .3s; }
.rp-text p.speaking { color: var(--gold); }
.rp-no { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.rp-end { background: radial-gradient(120% 70% at 30% 0%, #2b2470 0%, var(--bg) 55%, var(--bg-deep) 100%); overflow-y: auto; }
.end-inner { width: 100%; }
.reader-float { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: max(12px, env(safe-area-inset-top)) 14px 10px; pointer-events: none; }
.reader-float > * { pointer-events: auto; }
.reader-float .grow { flex: 1; pointer-events: none; }
.reader-float .icon-btn { background: rgba(12, 15, 43, .55); backdrop-filter: blur(6px); border-color: rgba(255, 255, 255, .18); }
.reader-float .text-size { display: inline-flex; background: rgba(12, 15, 43, .55); border-radius: 999px; backdrop-filter: blur(6px); }
body.reading .audio-bar { position: fixed; z-index: 40; left: 14px; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }

.topbar-end { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- home: game-style main menu (no bottom tab bar) ---------- */
.topbar .icon-btn { margin-right: 4px; }
.topbar .brand { margin-right: auto; }
.game-hello { flex-direction: column; text-align: center; gap: 4px; margin: 4px 0 16px; }
.game-hello .mascot-hero { width: 120px; height: 120px; }
.game-hello h1 { font-size: clamp(26px, 7vw, 36px); margin: 0; }
.center-row { justify-content: center; }
.game-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 8px 0 14px; }
@media (min-width: 720px) { .game-menu { grid-template-columns: repeat(4, 1fr); } .game-menu .game-main { grid-column: 1 / -1; } }
.game-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 168px; padding: 18px 10px;
  border: 2px solid rgba(255, 255, 255, .12); border-radius: 28px; color: var(--text); font: inherit; cursor: pointer;
  background: linear-gradient(165deg, var(--panel-2), var(--panel)); box-shadow: 0 8px 0 #0f1236, 0 16px 30px rgba(0, 0, 0, .35);
  transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), box-shadow .15s; }
.game-tile:hover { transform: translateY(-3px) scale(1.02); }
.game-tile:active { transform: translateY(6px); box-shadow: 0 2px 0 #0f1236, 0 6px 14px rgba(0, 0, 0, .35); }
.game-ic .ic { width: 86px; height: 86px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); transition: transform .3s cubic-bezier(.2, 1.8, .4, 1); }
.game-tile:hover .game-ic .ic { transform: rotate(-6deg) scale(1.08); }
.game-label { font: 800 21px/1.15 var(--display); letter-spacing: .02em; text-align: center; }
.game-main { grid-column: 1 / -1; flex-direction: row; gap: 18px; min-height: 150px; border-color: rgba(255, 255, 255, .3);
  background: linear-gradient(135deg, var(--violet), #b46cff 55%, var(--pink)); box-shadow: 0 8px 0 var(--violet-dark), 0 18px 40px rgba(134, 100, 255, .45); animation: game-glow 2.6s ease-in-out infinite; }
.game-main:active { box-shadow: 0 2px 0 var(--violet-dark); }
.game-main .game-ic .ic { width: 104px; height: 104px; animation: float 3s ease-in-out infinite; }
.game-main .game-label { font-size: 30px; color: #fff; }
@keyframes game-glow { 50% { box-shadow: 0 8px 0 var(--violet-dark), 0 18px 54px rgba(255, 158, 192, .55); } }
.screen { padding-bottom: 32px; }

/* Public story page: the whole (portrait) cover is visible. */
.story-cover-lg { aspect-ratio: auto; max-width: 440px; margin-left: auto; margin-right: auto; background: none; }
.story-cover-lg img { height: auto; object-fit: contain; }

/* Story page: picture on top (whole, inside a paper page), text below; both sized to the screen. */
.rp-text { justify-content: flex-start; align-items: center; gap: 16px; padding-top: 74px; padding-bottom: 44px; }
.rp-figure { flex: 1 1 0; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.rp-figure:empty { display: none; }
.rp-figure .paper-page { max-height: 100%; height: 100%; display: flex; align-items: center; padding: 8px 8px 10px 14px; }
.rp-figure .paper-page img { max-height: 100%; max-width: 100%; height: 100%; width: auto; object-fit: contain; }
.rp-text p { flex: 0 0 auto; width: 100%; max-width: 680px; line-height: 1.5; }
.rp-text .rp-no { bottom: 14px; }

/* ---------- download page (the story app is mobile-only) ---------- */
.download { max-width: 640px; margin: 0 auto; padding: 24px 0 40px; text-align: center; }
.download-hero .mascot-hero { width: 150px; height: 150px; animation: float 3s ease-in-out infinite; }
.download h1 { font-size: clamp(30px, 7vw, 44px); margin: 10px 0 8px; }
.download .lead { color: var(--text-soft); font-size: 18px; margin: 0 auto 24px; max-width: 520px; }
.store-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 12px; }
.store-btn { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-width: 220px; padding: 12px 20px; border-radius: 18px; background: #000; color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 6px 0 #0f1236; text-align: left; }
.store-btn .store-os { font-size: 12px; opacity: .8; }
.store-btn strong { font-size: 18px; }
.store-btn.is-soon { opacity: .7; cursor: default; }
.store-btn small { position: absolute; top: -9px; right: 12px; padding: 2px 10px; border-radius: 999px; background: var(--gold); color: #3a2a00; font-weight: 800; font-size: 12px; }
.download-points { list-style: none; padding: 0; margin: 28px auto 0; display: grid; gap: 12px; text-align: left; max-width: 460px; }
.download-points li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--panel-soft); border: 1px solid var(--line); }
.download-points .ic { width: 40px; height: 40px; flex: none; }

/* Owner rule (31 Oct 2026): every button on the site and in the app has 13px corners, not pill/circle shapes. */
:root { --btn-radius: 13px; }
.btn, .chip, .icon-btn, .store-btn, .filter-select, .search, .choice, .text-size, .text-size button, .badge, .game-tile,
.new-story-card, .story-card, .rating-stars button, .lang-switch a, button.chip, a.chip { border-radius: var(--btn-radius); }

/* ---------- Home: one scrollable story row, see-all card, CTA spacing ---------- */
.story-row { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; }
.story-row > * { scroll-snap-align: start; min-width: 0; }
.see-all-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 100%; font: 700 19px var(--display); color: var(--text); background: var(--panel-soft); }
.see-all-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.section-cta { margin-top: 37px; }
.price-single { max-width: 420px; margin: 0 auto; text-align: center; }
.price-single ul { text-align: left; margin: 16px 0 22px; }
.price-then { margin: 4px 0 0; color: var(--text-soft); }
.footer-brand p { font-size: 1.3em; }
