:root {
  --blue: #1B3FE0;
  --red: #E5252A;
  --white: #FFFFFF;
  --ink: #0B1020;
  --text-sub: #3E4660;
  --muted: #5A6278;
  --line: #D5DAE6;
  --map-bg: #F2F4F9;
  --f-ja: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --f-num: "Chakra Petch", "Zen Kaku Gothic New", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --split: linear-gradient(105deg, var(--blue) 0 50%, var(--red) 50% 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--f-ja); font-size: 16px; line-height: 1.75; }
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap {
  max-width: 1280px; margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.h2 { margin: 0; font-weight: 900; font-size: clamp(30px, 4vw, 52px); line-height: 1.15; text-wrap: balance; }
.muted { margin: 0; color: var(--text-sub); max-width: 30em; }
.eyebrow { font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.14em; }
.note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border: 0;
  font-family: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
}
.btn--sm { min-height: 44px; padding: 0 20px; font-size: 14px; }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--ink:hover { background: var(--blue); color: var(--white); }
.btn--white { background: var(--white); color: var(--ink); align-self: flex-start; }
.btn--white:hover { background: var(--ink); color: var(--white); }

/* Header */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__inner { display: flex; flex-wrap: nowrap; gap: 12px; align-items: center; justify-content: space-between; padding-block: 12px; }
.topbar__logo img { height: 44px; width: auto; }
.topbar__nav { display: flex; gap: 12px; align-items: center; }
.lang { display: flex; border: 1px solid var(--ink); }
.lang button {
  min-height: 44px; min-width: 52px; border: 0; background: transparent; color: var(--ink);
  font-family: var(--f-mono); font-weight: 500; font-size: 13px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

/* Hero */
.hero { background: var(--split); color: var(--white); overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px; align-items: center; padding-block: 56px 96px;
}
.hero__copy { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.hero__title { margin: 0; font-weight: 900; white-space: nowrap; font-size: clamp(40px, 5vw, 92px); line-height: 1.04; letter-spacing: -0.02em; }
.hero__lead { margin: 0; font-size: 18px; max-width: 24em; }

.phone { justify-self: center; width: 300px; max-width: 100%; height: 600px; background: var(--ink); border-radius: 44px; padding: 12px; }
.phone__screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--map-bg); color: var(--ink); }
.phone__screen .map { width: 100%; height: 100%; }
.phone__top {
  position: absolute; left: 12px; right: 12px; top: 16px; background: var(--white);
  padding: 10px 14px; display: flex; justify-content: space-between; gap: 8px;
  font-family: var(--f-mono); font-size: 12px; box-shadow: 0 1px 0 var(--line);
}
.phone__count { color: var(--blue); font-variant-numeric: tabular-nums; }
.phone__alert {
  position: absolute; left: 12px; right: 12px; bottom: 16px; background: var(--ink); color: var(--white);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px;
}
.phone__action { align-self: flex-start; background: var(--red); padding: 4px 12px; font-weight: 700; }

/* Map */
.map .road-minor { fill: none; stroke: #C9CFDC; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.map .road-major { fill: none; stroke: #A3ABBE; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.map .rail { fill: none; stroke: #7C849A; stroke-width: 4; stroke-dasharray: 14 10; }
.map .water { fill: none; stroke: #9DB4F5; stroke-width: 5; }
.map .hex { stroke: var(--white); stroke-width: 4; transition: fill 0.5s ease, fill-opacity 0.5s ease; }
.map .hex--b { fill: var(--blue); fill-opacity: 0.62; }
.map .hex--r { fill: var(--red); fill-opacity: 0.62; }
.map .hex--w { fill: var(--white); fill-opacity: 0.75; stroke: var(--ink); stroke-width: 3; }
.map .hex--n { fill: transparent; stroke: #DCE1EC; stroke-width: 2; }
.map .hex--flash { fill-opacity: 0.95; }
.map .route { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 14; }
.map .me { fill: var(--ink); stroke: var(--white); stroke-width: 5; }
.map .label { font-family: var(--f-mono); font-size: 30px; fill: var(--ink); paint-order: stroke; stroke: var(--white); stroke-width: 8; stroke-linejoin: round; }

/* Steps */
.section .wrap { padding-block: 96px; }
.section .stack { gap: 40px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.step { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.step__map { width: 100%; aspect-ratio: 2 / 1; height: auto; background: var(--map-bg); }
.step__head { display: flex; gap: 12px; align-items: baseline; }
.step__no { font-family: var(--f-num); font-weight: 700; font-size: 18px; color: var(--blue); }
.step__name { font-weight: 900; font-size: 30px; }
.step p { margin: 0; color: var(--text-sub); }

/* Gameplay video */
.play { background: var(--ink); color: var(--white); }
.play__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 64px; align-items: center; padding-block: 96px; }
.play .stack { gap: 20px; }
.play .eyebrow { color: #8FA6FF; }
.play__lead { margin: 0; color: #B9C1D9; max-width: 30em; }
.play__note { margin: 0; font-size: 12px; color: #8E96AB; }
.play__device { width: 320px; max-width: 100%; background: #000; border-radius: 44px; padding: 10px; box-shadow: 0 0 0 1px #2A3350; }
.play__video { display: block; width: 100%; height: auto; aspect-ratio: 432 / 840; border-radius: 34px; background: var(--map-bg); }

/* Versus */
.versus { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); color: var(--white); }
.versus__side { padding: 80px max(24px, 6vw); display: flex; flex-direction: column; gap: 12px; }
.versus__side--red { background: var(--red); }
.versus__side--blue { background: var(--blue); }
.versus__title { font-weight: 900; font-size: clamp(36px, 4.5vw, 60px); line-height: 1.1; }
.versus p { margin: 0; max-width: 24em; }

/* Clan */
.clan { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; align-items: start; }
.ranking { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ranking li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ranking__no { font-family: var(--f-num); font-weight: 700; font-size: 22px; }
.ranking__name { display: flex; gap: 10px; align-items: center; font-weight: 700; min-width: 0; }
.ranking__name i { width: 14px; height: 14px; flex: none; }
.ranking__val { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Signup */
.signup { background: var(--split); }
.signup__inner { padding-block: 96px; display: flex; justify-content: center; }
.signup__card { background: var(--white); padding: 40px; width: 640px; max-width: 100%; display: flex; flex-direction: column; gap: 18px; }
.signup__form { display: flex; flex-direction: column; gap: 16px; }
.signup__form input[type="email"], .reasons__other input {
  width: 100%; min-height: 56px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 0;
  font-size: 16px; font-family: var(--f-mono); background: var(--white); color: var(--ink);
}
.reasons__other input { min-height: 48px; font-family: var(--f-ja); }
.signup__form .btn { align-self: flex-start; }
.reasons { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.reasons legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.reasons__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 6px 16px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 36px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--blue); }
.signup__msg { margin: 0; min-height: 1.75em; font-weight: 700; }
.signup__msg[data-state="ok"] { color: var(--blue); }
.signup__msg[data-state="error"] { color: #C21C21; }

/* Footer */
.footer { background: var(--ink); color: #B9C1D9; }
.footer__inner { padding-block: 40px 56px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; font-size: 13px; }
.footer__inner img { height: 32px; width: auto; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a { color: #C3CFFF; }
.footer a:hover { color: var(--white); }

@media (max-width: 720px) {
  .hero { background: linear-gradient(180deg, var(--blue) 0 58%, var(--red) 58% 100%); }
  .hero__grid { grid-template-columns: minmax(0, 1fr); padding-block: 40px 64px; }
  .phone { justify-self: center; width: 280px; height: 540px; }
  .play__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 72px; }
  .play__device { justify-self: center; width: 280px; }
  .topbar__logo img { height: 30px; }
  .topbar__nav { gap: 8px; }
  .lang button { min-width: 44px; }
  .topbar__nav .btn--sm { padding: 0 14px; }
  .signup__card { padding: 28px 20px; }
  .section .wrap { padding-block: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .map .hex { transition: none; }
}
