/* Zigo City — mirrors app/src/theme/theme.ts (Cozy UI: washi paper, lacquer ribbons, chunky buttons). */
:root {
  color-scheme: light;
  --sky: #30b6a7;
  --sky-mid: #5fc48b;
  --grass: #8fd16f;
  --grass-2: #7cc964;
  --grass-3: #6fbd58;
  --earth: #c9834a;
  --earth-dark: #9d5f33;
  --ink: #4a2a18;
  --navy: #1f1d36;
  --paper: #fff4dc;
  --paper-edge: #e6cfa3;
  --cream: #fff6e3;
  --muted: #80604a;
  --score: #c9362e;
  --sun: #fff0c2;
  --sun-ring: #ffd65c;
  --sakura: #ffa9c2;
  --lacquer: #e8574a; --lacquer-lip: #a8322d;
  --gold: #ffc95f; --gold-lip: #cc8726;
  --wood: #cf9460; --wood-lip: #8f5a30;
  --paper-lip: #d4b98a;
  --border: 3px;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--grass); color: var(--ink); font: 400 17px/1.6 'Fredoka', system-ui, sans-serif; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.1; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--ink); }
.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.game-skip { position: fixed; top: -80px; left: 16px; z-index: 30; padding: 10px 16px; background: var(--cream); border: var(--border) solid var(--ink); border-radius: 12px; font-weight: 600; text-decoration: none; }
.game-skip:focus { top: 12px; }

/* Outlined cream lettering, as on the store captions. */
.outlined { color: var(--cream); -webkit-text-stroke: .14em var(--ink); paint-order: stroke fill; text-shadow: 0 .07em 0 var(--ink); letter-spacing: -.01em; }

/* ---------- Sky: header + hero ---------- */
.sky { position: relative; isolation: isolate; overflow: hidden; background: linear-gradient(180deg, var(--sky) 0%, var(--sky-mid) 55%, var(--grass) 100%); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22px; text-decoration: none; color: var(--cream); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.brand img { width: 46px; height: 46px; border: var(--border) solid var(--ink); border-radius: 13px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.site-nav a { padding: 6px 12px; border-radius: 99px; text-decoration: none; }
.site-nav a:hover { background: #fff6e366; }
.site-nav .nav-world { color: var(--navy); }
.site-nav .nav-cta { margin-left: 6px; }
.languages { display: flex; flex-wrap: wrap; gap: 8px; }
.languages a { min-width: 46px; padding: 3px 10px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--cream); box-shadow: 0 3px 0 var(--paper-lip); text-align: center; font-size: 13px; font-weight: 600; text-decoration: none; }
.languages a[aria-current="page"] { background: var(--gold); box-shadow: 0 3px 0 var(--gold-lip); }
.languages a:hover { transform: translateY(-1px); }

.hero { display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: 40px; padding-block: 40px 90px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--cream); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.eyebrow::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--lacquer); border: 2px solid var(--ink); }
h1 { margin: 22px 0 18px; font-size: clamp(70px, 9vw, 116px); }
.wordmark { position: relative; display: inline-flex; gap: .2em; padding: .5em .42em 0; isolation: isolate; }
.torii { position: absolute; inset: 0 0 .1em; z-index: -1; pointer-events: none; }
.torii .cap, .torii .lintel, .torii .post { position: absolute; border: var(--border) solid var(--navy); }
.torii .cap { left: 0; right: 0; top: .04em; height: .12em; background: #3d3850; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.torii .lintel { left: .06em; right: .06em; top: .18em; height: .11em; background: #e2483d; border-radius: 3px; }
.torii .post { top: .26em; bottom: 0; width: .085em; background: #e2483d; border-radius: 99px; }
.torii .post.left { left: .14em; }
.torii .post.right { right: .14em; }
/* Ink outline and extrusion underneath, gradient lettering on top (as in Wordmark.tsx). */
.wm { position: relative; letter-spacing: -.02em; color: var(--navy); -webkit-text-stroke: .075em var(--navy); text-shadow: .015em .015em 0 var(--navy), .03em .03em 0 var(--navy), .045em .045em 0 var(--navy), .06em .06em 0 var(--navy); }
.wm::after { content: attr(data-text); position: absolute; inset: 0; -webkit-text-stroke: 0; text-shadow: none; background: linear-gradient(180deg, var(--top) 15%, var(--bottom) 85%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-zigo { --top: #ff7a5c; --bottom: #d32f2b; }
.wm-city { --top: #ffe27a; --bottom: #ffa928; }
.h1-sub { display: block; margin-top: 18px; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.15; }
.intro { max-width: 470px; font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding: 0; list-style: none; }
.chips li { padding: 3px 12px; border-radius: 99px; background: #fff6e399; font-size: 13px; font-weight: 500; }

/* Chunky buttons: a face over a darker lip that collapses when pressed. */
.btn { --face: var(--paper); --lip: var(--paper-lip); --text: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border: var(--border) solid var(--ink); border-radius: 14px; background: var(--face); box-shadow: inset 0 3px 0 #ffffff55, 0 5px 0 var(--lip), 0 5px 0 var(--border) var(--ink); color: var(--text); font: 600 17px/1.2 'Fredoka', sans-serif; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 #ffffff55, 0 1px 0 var(--lip), 0 1px 0 var(--border) var(--ink); }
.btn-lacquer { --face: var(--lacquer); --lip: var(--lacquer-lip); --text: var(--cream); }
.btn-gold { --face: var(--gold); --lip: var(--gold-lip); }
.btn-wood { --face: var(--wood); --lip: var(--wood-lip); --text: var(--cream); }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 460px; }
.sun { position: absolute; width: min(500px, 92%); aspect-ratio: 1; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 14px var(--sun-ring); top: 0; }
.board { position: relative; width: 112%; max-width: 640px; margin-top: 70px; filter: drop-shadow(0 18px 0 #1f1d3622); }
.float-tag { position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: var(--border) solid var(--ink); border-radius: 99px; background: var(--cream); box-shadow: 0 4px 0 var(--paper-lip); font-size: 14px; font-weight: 600; white-space: nowrap; }
.float-tag img { width: 36px; height: 36px; }
.float-tag b { color: var(--score); }
.tag-a { top: 8%; left: 0; }
.tag-b { top: 26%; right: -2%; }
.petal { position: absolute; z-index: 1; width: 14px; height: 10px; border-radius: 80% 0 80% 0; background: var(--sakura); border: 2px solid var(--navy); opacity: .9; }
.petal:nth-of-type(1) { left: 8%; top: 12%; }
.petal:nth-of-type(2) { left: 45%; top: 4%; }
.petal:nth-of-type(3) { left: 74%; top: 18%; }
.petal:nth-of-type(4) { left: 30%; top: 30%; }
.petal:nth-of-type(5) { left: 88%; top: 40%; }

/* Board edge: the earth sides of the game board, used as a divider. */
.board-edge { height: 18px; background: linear-gradient(90deg, var(--earth) 50%, var(--earth-dark) 50%); border-block: var(--border) solid var(--navy); }

/* ---------- Sections ---------- */
main section { padding-block: 70px; }
.section-head { display: grid; justify-items: center; gap: 18px; margin-bottom: 40px; text-align: center; }
.section-head h2 { font-size: clamp(36px, 4.8vw, 58px); }
.section-head p { max-width: 560px; font-size: 18px; }
.ribbon { position: relative; isolation: isolate; display: inline-block; padding: 6px 26px; border: var(--border) solid var(--ink); border-radius: 10px; background: var(--lacquer); box-shadow: inset 0 3px 0 #f88d7f, 0 4px 0 var(--lacquer-lip); color: var(--cream); font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.ribbon::before, .ribbon::after { content: ''; position: absolute; z-index: -1; top: 12px; width: 26px; height: 100%; border: var(--border) solid var(--ink); background: var(--lacquer-lip); }
.ribbon::before { left: -18px; border-radius: 6px 0 0 6px; }
.ribbon::after { right: -18px; border-radius: 0 6px 6px 0; }
.ribbon.gold { background: var(--gold); box-shadow: inset 0 3px 0 #ffe6a3, 0 4px 0 var(--gold-lip); color: var(--ink); }
.ribbon.gold::before, .ribbon.gold::after { background: var(--gold-lip); }

.paper { border: var(--border) solid var(--ink); border-radius: var(--radius); background: var(--paper); box-shadow: inset 0 0 0 6px var(--cream), 0 6px 0 #4a2a1840; }
.paper p { color: var(--muted); }
.paper h3 { font-size: 24px; margin-bottom: 8px; color: var(--ink); }

/* How to play */
.merge-demo { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2.5vw, 28px); margin: 0 auto 44px; padding: 26px; max-width: 720px; }
.tile { position: relative; display: grid; place-items: center; width: clamp(64px, 11vw, 104px); aspect-ratio: 1; border: var(--border) solid var(--navy); border-radius: 16px; background: var(--grass-2); box-shadow: 0 7px 0 var(--earth), 0 7px 0 var(--border) var(--navy); }
.tile:nth-child(3) { background: var(--grass-3); }
.tile img { width: 82%; }
.tile.result { background: #fff27a; }
.merge-demo .op { font-size: clamp(26px, 4vw, 40px); font-weight: 700; }
.points { position: absolute; top: -18px; right: -14px; padding: 1px 10px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--cream); color: var(--score); font-size: 15px; font-weight: 700; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 0; list-style: none; counter-reset: step; }
.steps li { padding: 30px 26px 28px; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border: var(--border) solid var(--ink); border-radius: 12px; background: var(--gold); box-shadow: 0 4px 0 var(--gold-lip); font-size: 22px; font-weight: 700; }

/* City chain */
.chain-panel { padding: clamp(24px, 4vw, 44px); }
.chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 18px; padding: 0; margin: 0; list-style: none; }
.chain li { position: relative; display: grid; justify-items: center; gap: 2px; padding: 16px 10px 14px; border: 2.5px solid var(--paper-edge); border-radius: 18px; background: var(--cream); text-align: center; }
.chain li img { width: 88px; height: 88px; }
.chain .step-no { position: absolute; top: 8px; left: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.chain .name { font-size: 19px; font-weight: 600; }
.chain .pts { color: var(--score); font-weight: 600; font-size: 15px; }
.chain li.ultimate { grid-column: 1 / -1; justify-self: center; width: min(100%, 320px); border: var(--border) solid var(--ink); background: var(--gold); box-shadow: inset 0 3px 0 #ffe6a3, 0 5px 0 var(--gold-lip); }
.chain li.ultimate img { width: 120px; height: 120px; }
.chain li.ultimate .pts { color: var(--ink); }
.chain li.ultimate .step-no { color: var(--ink); }
.golden-note { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 30px; color: var(--muted); text-align: center; }
.golden-note b { color: var(--ink); }

/* Ninjas & tools */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.foe { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; padding: 26px; }
.foe > img, .tool > img { width: 84px; height: 84px; border: 2.5px solid var(--paper-edge); border-radius: 18px; background: var(--cream); }
.foe .tag { display: inline-block; margin-top: 12px; padding: 2px 10px; border-radius: 99px; background: var(--cream); border: 2px solid var(--paper-edge); color: var(--ink); font-size: 14px; font-weight: 600; }
.paths { margin-top: 22px; padding: 26px; }
.paths h3 { font-size: 22px; }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 0; list-style: none; }
.path li { padding: 4px 14px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--cream); font-weight: 600; font-size: 15px; }
.path li small { color: var(--score); font-size: 13px; }
.path li.arrow { padding: 0; border: 0; background: none; color: var(--ink); font-size: 20px; }
.path li.chest { background: var(--gold); }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 22px; }
.tool { display: grid; justify-items: start; gap: 10px; padding: 24px; }
.tool h3 { font-size: 21px; margin: 0; }
.tool p { font-size: 15px; }
.slot { display: grid; place-items: center; width: 84px; height: 84px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--wood); box-shadow: 0 4px 0 var(--wood-lip); color: var(--cream); font-size: 13px; font-weight: 700; }
.slot.chest { background: var(--gold); box-shadow: 0 4px 0 var(--gold-lip); color: var(--ink); font-size: 34px; }

/* Modes */
.mode { padding: 34px 30px 30px; }
.mode .ribbon { margin-bottom: 20px; }
.mode ul { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.mode li { display: flex; gap: 10px; color: var(--muted); }
.mode li::before { content: '✦'; color: var(--lacquer); }
.mode.zen li::before { color: var(--gold-lip); }
.leaderboard-note { margin-top: 22px; padding: 18px 24px; text-align: center; }

/* Gallery */
.gallery { display: flex; gap: 20px; overflow-x: auto; padding: 6px 4px 22px; scroll-snap-type: x mandatory; scrollbar-color: var(--ink) transparent; }
.gallery figure { flex: 0 0 auto; width: min(260px, 70vw); margin: 0; scroll-snap-align: center; }
.gallery img { width: 100%; border: var(--border) solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 #4a2a1840; }
.gallery figcaption { margin-top: 12px; text-align: center; font-size: 15px; font-weight: 500; }
.gallery-hint { margin-top: 4px; text-align: center; font-size: 14px; }

/* Promise */
.promise { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0; list-style: none; }
.promise li { padding: 24px; }
.promise .icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border: var(--border) solid var(--ink); border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 5px var(--sun-ring); font-size: 24px; }
.promise h3 { font-size: 20px; }
.promise p { font-size: 15px; }

/* Download */
.download { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 18px; padding: clamp(40px, 6vw, 70px) 24px; text-align: center; background: linear-gradient(180deg, var(--sky), var(--grass)); border: var(--border) solid var(--ink); border-radius: 28px; }
.download::before { content: ''; position: absolute; z-index: -1; width: 520px; aspect-ratio: 1; left: 50%; top: 40px; translate: -50% 0; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 14px var(--sun-ring); }
.download > img { width: 112px; height: 112px; border: var(--border) solid var(--ink); border-radius: 28px; box-shadow: 0 6px 0 #4a2a1855; }
.download h2 { font-size: clamp(38px, 5vw, 60px); }
.download p { max-width: 460px; }
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 6px; }
.store-link { text-align: left; line-height: 1.25; }
.store-link small { display: block; font-size: 13px; font-weight: 500; }
.store-link strong { font-size: 18px; }
.store-soon { display: grid; gap: 0; padding: 10px 22px; border: var(--border) dashed var(--ink); border-radius: 14px; background: var(--cream); text-align: left; line-height: 1.25; }
.store-soon small { color: var(--muted); font-size: 13px; }
.store-soon strong { font-size: 18px; }
.download .contact { font-size: 15px; }
.download .contact a { font-weight: 600; }

/* Footer */
.site-footer { background: var(--grass-3); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-block: 26px; font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { text-decoration: none; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 0 24px; font-size: 13px; }
.motion-toggle { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.motion-toggle[hidden] { display: none; }

/* ---------- Motion (paused by motion.js / reduced-motion) ---------- */
[data-reveal] { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .motion-ready [data-reveal]:not(.is-visible) { opacity: 0; transform: translateY(24px); }
  .motion-ready [data-reveal] { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
  .board { animation: board-float 7s ease-in-out infinite; }
  .tag-a { animation: tag-float 6s ease-in-out infinite; }
  .tag-b { animation: tag-float 6s 1.2s ease-in-out infinite; }
  .petal { animation: petal-fall 11s linear infinite; }
  .petal:nth-of-type(2) { animation-delay: -3s; animation-duration: 13s; }
  .petal:nth-of-type(3) { animation-delay: -6s; }
  .petal:nth-of-type(4) { animation-delay: -8s; animation-duration: 14s; }
  .petal:nth-of-type(5) { animation-delay: -1.5s; animation-duration: 12s; }
  .merge-demo .in img { animation: merge-in 4.2s ease-in-out infinite; }
  .merge-demo .in:nth-child(1) img { --dx: 30px; }
  .merge-demo .in:nth-child(5) img { --dx: -30px; }
  .merge-demo .result img, .merge-demo .points { animation: merge-pop 4.2s ease-in-out infinite; }
}
@keyframes board-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes tag-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes petal-fall { 0% { transform: translate(0, -40px) rotate(0); opacity: 0; } 10% { opacity: .9; } 90% { opacity: .9; } 100% { transform: translate(-80px, 520px) rotate(320deg); opacity: 0; } }
@keyframes merge-in { 0%, 35% { transform: none; opacity: 1; } 50% { transform: translateX(var(--dx, 0)) scale(.6); opacity: 0; } 85% { transform: scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes merge-pop { 0%, 45% { transform: scale(.4); opacity: 0; } 58% { transform: scale(1.15); opacity: 1; } 66%, 92% { transform: scale(1); opacity: 1; } 100% { transform: scale(.4); opacity: 0; } }
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }
.motion-paused .merge-demo img, .motion-paused .merge-demo .points { animation: none !important; }
.motion-paused [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .tools, .promise { grid-template-columns: 1fr 1fr; }
  .hero { gap: 20px; }
}
@media (max-width: 820px) {
  .site-nav .nav-section { display: none; }
  .hero { grid-template-columns: 1fr; padding-block: 20px 60px; text-align: center; }
  .hero > div:first-child { display: grid; justify-items: center; }
  .actions, .chips { justify-content: center; }
  .hero-visual { min-height: 0; padding-top: 10px; }
  .board { width: 100%; }
  .steps, .duo { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .site-header { flex-wrap: wrap; gap: 12px; padding-block: 14px; }
  .brand { font-size: 19px; }
  .brand img { width: 40px; height: 40px; }
  .site-nav { gap: 2px; font-size: 14px; }
  .site-nav a { padding: 6px 8px; }
  h1 { font-size: clamp(54px, 17vw, 76px); }
  .tag-b { right: 0; }
  .float-tag { font-size: 12px; }
  .float-tag img { width: 28px; height: 28px; }
  main section { padding-block: 50px; }
  .merge-demo { padding: 20px 12px; gap: 6px; }
  .tile { border-radius: 12px; }
  .chain { grid-template-columns: 1fr 1fr; gap: 16px 12px; }
  .chain li img { width: 72px; height: 72px; }
  .foe { grid-template-columns: 1fr; padding: 22px; }
  .tools, .promise { grid-template-columns: 1fr; }
  .tool { grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; }
  .tool > img, .tool > .slot { grid-row: span 2; width: 64px; height: 64px; }
  .download::before { width: 380px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
