:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --card: #ffffff;
  --label: #1d1d1f;
  --secondary: #6e6e73;
  --separator: #d2d2d7;
  --link: #0066cc;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --fill: #e8e8ed;
  --nav: rgba(255, 255, 255, 0.72);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #161617;
    --card: #1c1c1e;
    --label: #f5f5f7;
    --secondary: #a1a1a6;
    --separator: #424245;
    --link: #2997ff;
    --fill: #2c2c2e;
    --nav: rgba(22, 22, 23, 0.72);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px; }

/* Navigation */
nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--separator) 50%, transparent);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 48px; gap: 16px; }
nav .brand { font-weight: 600; font-size: 19px; color: var(--label); }
nav .brand:hover { text-decoration: none; }
nav .links { display: flex; align-items: center; gap: 22px; font-size: 13px; }
nav .links a { color: var(--label); opacity: 0.8; }
nav .links a:hover { opacity: 1; text-decoration: none; }
nav .links a.pill { opacity: 1; }

/* Buttons */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px; border-radius: 980px;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 500;
}
.pill:hover { background: var(--accent-hover); text-decoration: none; }
.pill.small { min-height: 28px; padding: 0 12px; font-size: 12px; color: #fff; }
.pill.ghost { background: transparent; color: var(--link); border: 1px solid var(--link); }
.pill.ghost:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }

/* Hero */
.hero { text-align: center; padding: 88px 0 24px; }
.hero h1 { font-size: clamp(40px, 7vw, 80px); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.hero p.lead { font-size: clamp(19px, 2.4vw, 24px); color: var(--secondary); max-width: 640px; margin: 18px auto 0; line-height: 1.35; }
.hero .actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 28px; margin-top: 30px; }
.hero .note { font-size: 13px; color: var(--secondary); margin-top: 14px; }
.shot { margin: 40px auto 0; max-width: 1040px; }

/* Sections */
section.band { padding: 96px 0; }
section.band.alt { background: var(--bg-alt); }
h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -0.025em; margin: 0; text-align: center; }
.sub { font-size: 21px; color: var(--secondary); text-align: center; max-width: 680px; margin: 14px auto 0; line-height: 1.38; }

/* Feature grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 56px; }
.tile { background: var(--card); border-radius: 18px; padding: 30px 28px; }
section.band:not(.alt) .tile { background: var(--bg-alt); }
.tile svg { width: 32px; height: 32px; color: var(--accent); }
.tile h3 { font-size: 21px; margin: 16px 0 6px; letter-spacing: -0.015em; }
.tile p { margin: 0; color: var(--secondary); font-size: 16px; }

/* Games */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 56px; }
.game { display: flex; gap: 22px; align-items: center; background: var(--card); border-radius: 18px; padding: 26px; }
.game img { width: 96px; height: 96px; border-radius: 22px; flex: none; box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.game h3 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.game p { margin: 4px 0 0; color: var(--secondary); font-size: 16px; }
.game .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 980px; background: var(--fill); color: var(--label); }

/* Showcase */
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin-top: 48px; align-items: start; }
.duo figure { margin: 0; }
.duo figcaption { text-align: center; font-size: 14px; color: var(--secondary); margin-top: 6px; }

/* Download */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 56px; }
.platform { background: var(--card); border-radius: 18px; padding: 34px 30px; display: flex; flex-direction: column; gap: 6px; }
.platform.recommended { box-shadow: 0 0 0 2px var(--accent); }
.platform .os { display: flex; align-items: center; gap: 12px; }
.platform .os svg { width: 30px; height: 30px; }
.platform h3 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.platform .req { color: var(--secondary); font-size: 15px; margin: 0 0 18px; }
.platform .badge { display: none; font-size: 12px; font-weight: 600; color: var(--accent); }
.platform.recommended .badge { display: inline; }
.platform .pill { align-self: flex-start; }
.platform ul { list-style: none; padding: 0; margin: 20px 0 0; border-top: 1px solid var(--separator); }
.platform li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--separator); font-size: 15px; }
.platform li span { color: var(--secondary); }
.sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.source { background: var(--card); border-radius: 18px; padding: 26px 28px; }
.source h4 { margin: 0 0 6px; font-size: 19px; }
.source p { margin: 0; color: var(--secondary); font-size: 15px; }
.source code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; background: var(--fill); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
.first-run { max-width: 760px; margin: 40px auto 0; font-size: 15px; color: var(--secondary); }
.first-run h4 { color: var(--label); font-size: 17px; margin: 0 0 8px; }
.first-run p { margin: 0 0 6px; }
.first-run ul { margin: 0; padding-left: 20px; }

footer { padding: 28px 0 40px; font-size: 12px; color: var(--secondary); border-top: 1px solid var(--separator); background: var(--bg-alt); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
footer a { color: var(--label); }

@media (max-width: 640px) {
  nav .links > a:not(.pill) { display: none; }
  nav .links { gap: 12px; }
  .hero { padding-top: 56px; }
  section.band { padding: 64px 0; }
  .game { flex-direction: column; align-items: flex-start; }
}

/* Language switcher */
.langs { display: flex; gap: 10px; font-size: 12px; white-space: nowrap; }
nav .pill { white-space: nowrap; }
.langs a { color: var(--secondary); }
.langs a[aria-current="true"] { color: var(--label); font-weight: 600; }

/* Keep headings and leads from breaking mid-word, especially in Japanese. */
h1, h2, .lead, .sub { text-wrap: balance; }
:lang(ja) :is(h1, h2, h3, .lead, .sub, figcaption) { word-break: auto-phrase; }

/* Floating language ball: options fan out around it */
.lang-fab { position: fixed; right: 24px; bottom: 24px; z-index: 20; width: 56px; height: 56px; }
.lang-ball {
  position: relative; z-index: 1;
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--separator) 60%, transparent);
  display: grid; place-items: center; cursor: pointer;
  color: var(--label); background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.lang-ball:hover { transform: scale(1.06); }
.lang-ball[aria-expanded="true"] { background: var(--accent); color: #fff; border-color: transparent; }
.lang-ball:focus-visible, .lang-options a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lang-options a {
  position: absolute; left: 4px; top: 4px; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--label); background: var(--card); text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  opacity: 0; pointer-events: none; transform: translate(0, 0) scale(0.4);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.18s ease;
  transition-delay: calc(var(--i) * 30ms);
}
.lang-options a[aria-current="true"] { background: var(--accent); color: #fff; }
.lang-options a:hover { text-decoration: none; }
.lang-fab.open .lang-options a { opacity: 1; pointer-events: auto; transform: translate(var(--x), var(--y)) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .lang-ball, .lang-options a { transition: none; }
}
@media (max-width: 640px) {
  .lang-fab { right: 16px; bottom: 16px; }
}

/* Screenshots are captured without the window shadow; draw one here so every image matches. */
.shot img, .duo img {
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.18)) drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.35));
}
.duo img { margin: 12px 0 4px; }
@media (prefers-color-scheme: dark) {
  .shot img, .duo img {
    filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.45));
  }
}
