:root {
  --ink: #1C2340;
  --ink-2: #37405C;
  --muted: #55607A;
  --line: #E6E9EE;
  --soft: #F3F5F8;
  --link: #2B4C8C;
  --accent: #FF5A36;
  --accent-shadow: #C2341A;
  --teal: #0E8F7E;
  --font-body: 'Noto Sans', system-ui, sans-serif;
  --font-display: 'Baloo 2', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); }
a:hover { color: var(--link); }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.paper-grid {
  background-color: #F7F8FA;
  background-image:
    repeating-linear-gradient(30deg, transparent 0 63px, #E9ECF0 63px 64px),
    repeating-linear-gradient(150deg, transparent 0 63px, #E9ECF0 63px 64px);
}

/* ---------- Nav ---------- */

.nav {
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: auto; }
.brand span { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; }

.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; font-weight: 700; font-size: 16px; }
.nav-links a { text-decoration: none; padding: 10px 0; color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--accent-shadow); }

/* ---------- Language menu ---------- */

.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 20px; height: 20px; flex: none; }
.lang-menu summary:hover { color: var(--link); }
.lang-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  margin: 0;
  padding: 8px;
  list-style: none;
  min-width: 200px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(28, 35, 64, .12), 0 4px 0 #E1E5EB;
}
.lang-menu li a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.lang-menu li a:hover { background: var(--soft); color: var(--ink); }
.lang-menu li a[aria-current] { color: var(--accent-shadow); font-weight: 900; }

@media (max-width: 560px) {
  .lang-menu summary span { display: none; }
  .lang-menu ul { right: auto; left: 50%; transform: translateX(-50%); }
}

/* ---------- CJK ---------- */

:lang(zh) .hero-copy h1, :lang(ja) .hero-copy h1, :lang(ko) .hero-copy h1,
:lang(zh) .h2, :lang(ja) .h2, :lang(ko) .h2 { letter-spacing: 0; line-height: 1.2; }
:lang(ko) { word-break: keep-all; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 17px;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(3px); }

.btn-accent { background: var(--accent); color: #FFFFFF; box-shadow: 0 5px 0 var(--accent-shadow); }
.btn-accent:hover { color: #FFFFFF; }
.btn-accent:active { box-shadow: 0 2px 0 var(--accent-shadow); }

.btn-dark { background: var(--ink); color: #FFFFFF; box-shadow: 0 5px 0 #0E1328; }
.btn-dark:hover { color: #FFFFFF; }
.btn-dark:active { box-shadow: 0 2px 0 #0E1328; }

.btn-light { background: #FFFFFF; color: var(--ink); border: 2px solid var(--line); box-shadow: 0 5px 0 #E1E5EB; }
.btn-light:active { box-shadow: 0 2px 0 #E1E5EB; }

.btn-small { padding: 11px 22px; font-size: 16px; box-shadow: 0 4px 0 var(--accent-shadow); }

/* ---------- Type ---------- */

.h2 { margin: 0; font-weight: 900; font-size: clamp(32px, 4vw, 46px); line-height: 1.1; letter-spacing: -0.8px; }
.lead { margin: 0; font-size: 17px; line-height: 1.6; color: var(--muted); }
.display { font-family: var(--font-display); font-weight: 800; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); }
.footer-inner {
  padding-top: 32px;
  padding-bottom: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer p { margin: 0; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 700; font-size: 15px; }
.footer-links a { padding: 10px 0; }

/* ======================================================
   Home
   ====================================================== */

.hero {
  padding-top: 40px;
  padding-bottom: 96px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}
.hero-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.hero-copy h1 { margin: 0; font-weight: 900; font-size: clamp(44px, 6vw, 76px); line-height: 1.02; letter-spacing: -1.5px; }
.hero-copy .intro { margin: 0; font-size: 19px; line-height: 1.6; color: var(--ink-2); max-width: 480px; }
.hero-copy .meta { margin: 0; font-size: 15px; color: var(--muted); }
.store-buttons { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 6px; }

.hero-art-col { flex: 1 1 460px; min-width: 0; display: flex; justify-content: center; }

/* The hero scene is laid out on a 620 × 520 grid, in percentages so it scales. */
.scene { position: relative; width: 100%; max-width: 620px; aspect-ratio: 620 / 520; }
.scene > * { position: absolute; }
.scene .score { left: 2%; top: 0; display: flex; flex-direction: column; gap: 2px; z-index: 2; }
.scene .score-now { font-size: clamp(44px, 5vw, 64px); line-height: 1; }
.scene .score-best { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--muted); }
.scene .gift { left: 69.4%; top: 13.5%; width: 25.5%; animation: bob 1.8s ease-in-out infinite alternate; }
.scene .cylinder {
  left: 41.9%; top: 38.5%; width: 19.8%;
  filter: hue-rotate(62deg) saturate(1.6) brightness(1.04); /* pink art → yellow */
  animation: land 3.2s linear infinite;
}
.scene .start { left: 4.8%; top: 57.7%; width: 25.5%; }
.scene .arc { left: 0; top: 0; width: 100%; height: 100%; }
.scene .arc path { animation: dash 1.2s linear infinite; }
.scene .pop {
  left: 51.8%; top: 24%;
  opacity: 0;
  font-size: clamp(22px, 2.6vw, 32px);
  color: var(--accent);
  white-space: nowrap;
  text-shadow: 0 2px 0 #FFFFFF;
  animation: pop 3.2s linear infinite;
}
.scene .sparkle { height: auto; animation: twinkle 2.4s ease-in-out infinite; }
.scene .sparkle-1 { left: 60%; top: 6%; width: 4.5%; }
.scene .sparkle-2 { left: 90%; top: 50%; width: 3.2%; animation-delay: .8s; }
.scene .sparkle-3 { left: 22%; top: 40%; width: 3.5%; animation-delay: 1.6s; }

/* Hopper: X and Y move on separate layers so the arc keeps its easing. */
.scene .hop-x, .scene .hop-y { left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.scene .hop-x { animation: hop-x 3.2s linear infinite; }
.scene .hop-y { position: absolute; animation: hop-y 3.2s linear infinite; }
.scene .hopper {
  position: absolute;
  left: 17.58%; top: 63.46%; width: 8.9%;
  transform: translate(-50%, -50%);
  transform-origin: 50% 100%;
  animation: hop-body 3.2s linear infinite;
}

.brand.bounce img { transform-origin: 50% 100%; animation: logo-hop 3.2s ease-in-out infinite; }

/* How to play */
.steps { padding-top: 96px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 36px; }
.steps .h2 { max-width: 640px; }
.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.step { display: flex; flex-direction: column; gap: 14px; }
.step-art { position: relative; aspect-ratio: 360 / 270; background: var(--soft); border-radius: 24px; overflow: hidden; }
.step-art > * { position: absolute; }
.step-art svg { left: 0; top: 0; width: 100%; height: 100%; }
.step h3 { margin: 0; font-weight: 900; font-size: 22px; }
.step p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.step-text { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.chip {
  background: #FFFFFF;
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 3px 0 #E1E5EB;
  white-space: nowrap;
}
.chip-center { left: 50%; transform: translateX(-50%); }

/* Worlds */
.worlds { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
.worlds-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 48px; }
.worlds-head > div { display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.worlds-head .lead { max-width: 420px; }
.kicker { margin: 0; font-size: 18px; color: var(--teal); }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.zone { display: flex; flex-direction: column; gap: 10px; }
.zone-art { position: relative; aspect-ratio: 220 / 200; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.zone-art img { position: absolute; width: 50%; }
.zone-art .back { left: 44%; top: 18%; }
.zone-art .front { left: 6%; top: 36%; }
.zone-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.zone-label span:first-child { font-weight: 900; font-size: 18px; }
.zone-label span:last-child { font-size: 16px; color: var(--muted); }

.bg-grid {
  background-color: var(--g, #F7F8FA);
  background-image:
    repeating-linear-gradient(30deg, transparent 0 31px, var(--l, #E6E9EE) 31px 32px),
    repeating-linear-gradient(150deg, transparent 0 31px, var(--l, #E6E9EE) 31px 32px);
}
.bg-dots {
  background-color: var(--g);
  background-image: radial-gradient(var(--l) 1.6px, transparent 2px);
  background-size: 22px 14px;
}

.more-worlds { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 8px; }
.more-worlds > span:first-child { font-size: 16px; font-weight: 700; color: var(--muted); padding-right: 4px; }
.tag { background: #E6ECF6; color: var(--link); border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 15px; }

/* Blocks */
.blocks { background: #F7F9FC; }
.blocks .wrap { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 32px; }
.blocks-head { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.block-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.block-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: transform .15s ease;
}
.block-card:hover { transform: translateY(-4px); }
.block-card img { width: 62%; }
.block-card .name { font-weight: 900; font-size: 16px; }
.block-card .effect { font-size: 14px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 4px 12px; }

/* Hoppers */
.hoppers { padding-top: 96px; padding-bottom: 72px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hoppers-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.items { display: flex; flex-direction: column; gap: 12px; }
.item { display: flex; gap: 14px; align-items: center; }
.item p { margin: 0; font-size: 16px; line-height: 1.5; }
.item-icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.item-icon svg { width: 22px; height: 22px; }
.hopper-row {
  flex: 1 1 460px;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(10px, 2.5vw, 28px);
  padding: 40px 16px 32px;
  border-radius: 28px;
  background-color: #E6F5E1;
  background-image: radial-gradient(#B6E3A8 2px, transparent 2.5px);
  background-size: 38px 22px;
}
.hopper-row img { height: auto; transition: transform .15s ease; }
.hopper-row img:hover { transform: translateY(-8px); }

/* Download */
.download { padding: 24px 24px 96px; }
.download-card {
  max-width: 1200px;
  margin: 0 auto;
  border: 2px solid var(--line);
  border-radius: 32px;
  padding: 48px clamp(24px, 5vw, 64px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  background: #FFFFFF;
  box-shadow: 0 6px 0 #E1E5EB;
}
.download-art { flex: none; position: relative; width: 150px; height: 150px; }
.download-art img { position: absolute; }
.download-copy { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.download-copy h2 { margin: 0; font-weight: 900; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; letter-spacing: -0.6px; }
.download-copy p { margin: 0; font-size: 17px; color: var(--muted); }
.download .btn { padding: 15px 26px; }

/* ======================================================
   Legal pages
   ====================================================== */

.legal-header { border-bottom: 1px solid var(--line); }
.legal-title {
  padding-top: 32px;
  padding-bottom: 56px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.legal-title > div:first-child { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.legal-title h1 { margin: 0; font-weight: 900; font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -1.2px; }
.legal-title p { margin: 0; font-size: 16px; color: var(--muted); }
.legal-art { position: relative; width: 130px; height: 120px; flex: none; }
.legal-art img { position: absolute; }
.legal-art .base { left: 0; bottom: 0; width: 130px; }
.legal-art .top { left: 49px; width: 32px; }

.legal {
  padding-top: 56px;
  padding-bottom: 96px;
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: flex-start;
}
.legal a { color: var(--link); }
.legal a:hover { color: var(--ink); }
.summary {
  flex: 1 1 260px;
  min-width: 0;
  background: var(--soft);
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.summary h2 { margin: 0; font-weight: 900; font-size: 20px; }
.summary ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.5; color: #3D4566; }
.legal article { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 40px; font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.legal article section { display: flex; flex-direction: column; gap: 12px; }
.legal article h2 { margin: 0; font-weight: 900; font-size: 24px; line-height: 1.3; color: var(--ink); }
.legal article p { margin: 0; }
.legal article ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal article .contact { background: var(--soft); border-radius: 24px; padding: 28px; gap: 8px; }
.legal .legal-body { display: contents; }
.legal .legal-note {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  border: 1px dashed #C9D0DB;
  border-radius: 16px;
  padding: 14px 18px;
}
.legal article .contact h2 { font-size: 22px; }
.legal + .footer .footer-inner { padding-top: 40px; padding-bottom: 56px; }

/* ======================================================
   Animations
   ====================================================== */

@keyframes hop-x {
  0%, 35% { transform: translateX(0); }
  70%, 93% { transform: translateX(34.19%); }
  94%, 100% { transform: translateX(0); }
}
@keyframes hop-y {
  0%, 35% { transform: translateY(0); animation-timing-function: cubic-bezier(.3, .6, .6, 1); }
  56.5% { transform: translateY(-34.2%); animation-timing-function: cubic-bezier(.4, 0, .7, .4); }
  70%, 93% { transform: translateY(-20.77%); }
  94%, 100% { transform: translateY(0); }
}
@keyframes hop-body {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1, 1); }
  5%, 8% { opacity: 1; transform: translate(-50%, -50%) scale(1, 1); }
  20% { transform: translate(-50%, -50%) scale(1.06, .92); }
  33% { transform: translate(-50%, -50%) scale(1.2, .72); }
  37% { transform: translate(-50%, -50%) scale(.86, 1.18) rotate(-4deg); }
  46% { transform: translate(-50%, -50%) scale(1, 1) rotate(8deg); }
  62% { transform: translate(-50%, -50%) scale(1, 1) rotate(16deg); }
  70% { transform: translate(-50%, -50%) scale(1.22, .74) rotate(0); }
  76% { transform: translate(-50%, -50%) scale(.93, 1.08); }
  81%, 88% { opacity: 1; transform: translate(-50%, -50%) scale(1, 1); }
  92%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1, 1); }
}
@keyframes land {
  0%, 69%, 100% { transform: translateY(0); }
  73% { transform: translateY(4%); }
  79% { transform: translateY(0); }
}
@keyframes pop {
  0%, 70% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  75% { opacity: 1; transform: translate(-50%, -10%) scale(1.15); }
  80% { opacity: 1; transform: translate(-50%, -20%) scale(1); }
  89% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  94%, 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}
@keyframes bob {
  from { transform: translateY(0) rotate(0); }
  to { transform: translateY(-6%) rotate(-2deg); }
}
@keyframes dash { to { stroke-dashoffset: -30; } }
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.6) rotate(0); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}
@keyframes logo-hop {
  0%, 70%, 100% { transform: translateY(0) scale(1, 1); }
  78% { transform: translateY(0) scale(1.15, .85); }
  86% { transform: translateY(-30%) scale(.92, 1.1); }
  94% { transform: translateY(0) scale(1.08, .92); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
