/* UMAWALK LP。ページ全体を1本のレース（スタート → ハロン棒 → 最後の直線 → ゴール）にする（2026-10-10 ユーザー決定）。
   構成とキャラの見せ方はプラリー（prally.com）、色と競馬場の素材はアプリ（レース映像と同じ絵） */
:root {
  --ink: #4B3A33;        /* 本文（アプリと同じ） */
  --ink-sub: #7A675E;    /* 補助 */
  --cream: #FFF4E8;      /* アプリの地 */
  --card: #FDECDA;
  --pink: #F6A9C0;       /* 主ボタン */
  --pink-soft: #FBD3DF;
  --tea-deep: #E8C49C;
  --sky: #CFE6F4;
  --sky-deep: #A9D2EC;
  --turf: #A9D78C;       /* 芝の素材の地の色 */
  --white: #FFFFFF;
  --gutter: 16px;
  --display: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  --body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.85;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, p { margin: 0; }
a { color: inherit; }

/* 白い文字＋濃い縁取り（プラリーの見出しの迫力を、アプリの茶色で） */
.outline {
  font-family: var(--display);
  font-weight: 800;
  color: var(--white);
  letter-spacing: .04em;
  line-height: 1.35;
  text-shadow:
    3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink),
    0 7px 0 var(--ink);
}

/* 芝（アプリのレース映像と同じ刈り目の縞） */
.turf { background: var(--turf) url("/umawalk/assets/course/turf.webp") repeat; background-size: 160px 160px; }

/* ── ヘッダー ── */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  padding: calc(env(safe-area-inset-top) + 14px) var(--gutter) 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: 0 2px 0 rgba(75, 58, 51, .25); }
.brand span { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .06em; }

/* ── スタート（ヒーロー） ── */
.hero {
  position: relative; overflow: hidden;
  padding-top: 88px;
  background: linear-gradient(180deg, var(--sky) 0%, #E4F1F7 48%, #F4F7EC 78%);
}
.cloud { position: absolute; width: 170px; opacity: .95; animation: drift 46s linear infinite alternate; }
.cloud--a { top: 70px; left: -20px; }
.cloud--b { top: 260px; right: -40px; width: 130px; animation-duration: 60s; animation-direction: alternate-reverse; }
@keyframes drift { to { translate: 60px 0; } }

.hero__inner {
  position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; gap: 28px; justify-items: center; text-align: center;
}
.hero__lead {
  display: inline-block; background: var(--white); border-radius: 999px;
  padding: 4px 16px; font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 rgba(75, 58, 51, .15);
}
.hero__title { font-size: clamp(32px, 9vw, 60px); margin-top: 14px; }
.hero__title span { display: block; white-space: nowrap; }
.hero__sub { font-family: var(--display); font-weight: 800; font-size: clamp(17px, 4.6vw, 24px); margin-top: 12px; }
.hero__visual { position: relative; width: min(56vw, 250px); }
.promo {
  /* 高さが端数になると動画が枠より細くなり、背景がのぞいて線に見える。cover で枠いっぱいに広げ、背景は縁と同じ白にする */
  display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 24px;
  background: var(--white); border: 4px solid var(--white); box-shadow: 0 18px 40px rgba(75, 58, 51, .28);
}

/* 公式のバッジ。App Store を先に・同じ高さにする（Google は「ほかのバッジと同じか大きく」）。
   まわりの余白はバッジの高さの 1/4 以上（Apple・Google とも）。
   🔴 絵は改変・傾け・動かすのは禁止なので、.reveal（浮き上がる演出）の中に入れない */
.store { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 22px; }
.store__badge { display: block; border-radius: 8px; }
.store__badge img { display: block; height: 48px; width: auto; }

/* スマホの枠 */
.phone {
  position: relative; border-radius: 36px; padding: 9px; background: #2b2220;
  box-shadow: 0 18px 40px rgba(75, 58, 51, .28), inset 0 0 0 2px #4a3d38;
}
.phone img { border-radius: 28px; width: 100%; }
.phone::before {
  content: ""; position: absolute; top: 18px; left: 50%; translate: -50% 0;
  width: 30%; height: 18px; border-radius: 999px; background: #2b2220; z-index: 1;
}
.phone--sm { width: min(50vw, 220px); }

/* 丘・スタンド・桜（ヒーローの奥） */
.scenery {
  position: relative; z-index: 1; height: 150px; margin-top: -70px;
  background: url("/umawalk/assets/course/hills.webp") repeat-x left bottom / auto 96px;
}
.scenery__stands { position: absolute; right: -6%; bottom: 30px; width: min(78vw, 560px); }
.scenery__tree { position: absolute; bottom: 6px; width: 120px; }
.scenery__tree--l { left: -18px; }
.scenery__tree--r { right: -26px; width: 104px; }

/* スタートゲート（13頭がゲートの前に並ぶ）。ゲートの絵の柱は 72px ごと、最初の枠の中心は 80px（幅 1024 のとき） */
.start { position: relative; z-index: 3; margin-top: -40px; }
.start::before { /* ゲートの奥に続く芝生（丘のすそと同じ淡い緑） */
  content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 30%; z-index: -2;
  background: linear-gradient(180deg, #B6E2AE, #ACDA9E);
}
.start::after { /* ゲートが立つ芝 */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: -1;
  background: var(--turf) url("/umawalk/assets/course/turf.webp") repeat; background-size: 160px 160px;
}
.gate {
  position: relative; width: max(100%, 760px); max-width: 1180px; aspect-ratio: 1024 / 420;
  left: 50%; translate: -50% 0;
}
.gate__frame { position: absolute; inset: 0; width: 100%; z-index: 2; }
/* 🔴 馬はゲートの手前に立たせる（柵の後ろに入れると、檻に閉じ込められているように見えた。2026-10-10 ユーザー） */
.gate__horse {
  position: absolute; bottom: 2%; width: 10.5%; translate: -50% 0; z-index: 3;
  left: calc((80 + 72 * var(--i)) / 1024 * 100%);
  animation: fidget 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.23s);
}
@keyframes fidget { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-9%); } 90% { transform: translateY(-2%); } }

/* ── コース（芝の区間） ── */
.lap {
  position: relative; overflow: hidden;
  padding: 120px var(--gutter) 150px;
  background: var(--turf) url("/umawalk/assets/course/turf.webp") repeat; background-size: 160px 160px;
}
/* 区間ごとに刈り目の明るさを変える（実際の芝コースの縞のように） */
.lap--alt { background-image: linear-gradient(rgba(255, 255, 255, .2), rgba(255, 255, 255, .2)), url("/umawalk/assets/course/turf.webp"); }
/* 区間の境目は白い柵 */
.rail {
  position: absolute; left: 0; right: 0; top: 0; height: 52px; z-index: 3;
  background: url("/umawalk/assets/course/rail.webp") repeat-x left bottom / auto 52px;
}
.lap__inner {
  position: relative; z-index: 2; max-width: 1080px; margin: 0 auto;
  display: grid; gap: 44px; align-items: center;
}

/* 掲示板のカード（芝の上に直接文字を置かない） */
.board {
  position: relative; margin-top: 70px;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 28px;
  padding: 28px 22px 26px; box-shadow: 0 8px 0 rgba(75, 58, 51, .28);
}
.board__num {
  font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .1em;
  display: inline-block; background: var(--ink); color: var(--white); border-radius: 999px; padding: 2px 14px;
}
.board__title {
  font-family: var(--display); font-weight: 800; color: var(--ink);
  font-size: clamp(25px, 6.8vw, 38px); line-height: 1.4; margin: 12px 0 16px;
}
.board__title em { font-style: normal; background: linear-gradient(transparent 60%, var(--pink-soft) 60%); }
.board p:not(.board__num) { font-weight: 700; }
.board p + p { margin-top: 10px; }
.board .board__note { font-weight: 500; font-size: 13px; color: var(--ink-sub); }

/* ハロン棒（残りの距離）。札と柱の上だけを掲示板の上に出し、柱の下は掲示板の裏に隠れて見える */
.post {
  position: absolute; top: -101px; right: 22px; width: 100px; height: 104px;
  background: url("/umawalk/assets/course/post.webp") no-repeat center top / 100% auto;
  display: flex; flex-direction: column; align-items: center; padding-top: 14px;
  font-family: var(--display); font-weight: 800; line-height: 1.15; color: var(--ink);
}
.post span { font-size: 11px; }
.post b { font-size: 18px; letter-spacing: .02em; }

.lap__visual { position: relative; justify-self: center; }
/* 丸に斜めのストライプ（プラリーの画面の背景） */
.disc {
  width: min(80vw, 360px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  border: 8px solid var(--white);
  background: repeating-linear-gradient(-45deg, var(--disc) 0 22px, color-mix(in srgb, var(--disc) 72%, #fff) 22px 44px);
  box-shadow: 0 10px 0 rgba(75, 58, 51, .14);
}
.disc .phone { transform: translateY(26%); }
.lap__horse { position: absolute; width: 56%; left: -20%; bottom: -16%; z-index: 2; }
.lap--flip .lap__horse { left: auto; right: -20%; }

/* 植え込み・花・木（コースの脇） */
.deco { position: absolute; bottom: -4px; width: 120px; z-index: 1; pointer-events: none; }
.deco--flower { width: 92px; bottom: 8px; }
.deco--l { left: -16px; }
.deco--r { right: -16px; }

/* ── 最後の直線 ── */
.stretch {
  position: relative; overflow: hidden; padding-top: 40px;
  background: linear-gradient(180deg, var(--sky) 0%, #E4F1F7 60%);
}
.stretch__label { text-align: center; font-size: clamp(28px, 8vw, 46px); }
.stretch__course { position: relative; height: 290px; margin-top: 8px; }
.stretch__far { /* 奥: 丘と向こう側の柵 */
  position: absolute; inset: 0 0 auto 0; height: 120px;
  background:
    url("/umawalk/assets/course/rail.webp") repeat-x left bottom / auto 40px,
    url("/umawalk/assets/course/hills-meadow.webp") repeat-x left 22px / auto 84px;
}
.stretch__course::before { /* 芝のコース */
  content: ""; position: absolute; left: 0; right: 0; top: 112px; bottom: 0;
  background: var(--turf) url("/umawalk/assets/course/turf.webp") repeat; background-size: 160px 160px;
}
.stretch__track { position: absolute; inset: 0; }
.stretch__near { /* 手前の柵（馬の足元にかかって奥行きが出る） */
  position: absolute; left: 0; right: 0; bottom: -6px; height: 64px; z-index: 20;
  background: url("/umawalk/assets/course/rail.webp") repeat-x left bottom / auto 64px;
}
.runner {
  --size: 96px;
  position: absolute; left: 0; bottom: calc(26px + var(--lane) * 36px);
  width: var(--size); height: var(--size);
  background-image: var(--id); background-repeat: no-repeat;
  background-size: calc(var(--size) * 12) var(--size);
  animation: gallop .6s steps(12) infinite, cross 12s linear infinite;
  animation-delay: 0s, var(--d);
  z-index: calc(10 - var(--lane));
}
@keyframes gallop { to { background-position: calc(var(--size) * -12) 0; } }
@keyframes cross { from { transform: translateX(100vw); } to { transform: translateX(calc(-1 * var(--size) - 20px)); } }

/* ── ゴール ── */
.goal {
  position: relative; overflow: hidden; padding: 64px var(--gutter) 84px;
  background: linear-gradient(180deg, #E4F1F7 0%, var(--cream) 46%);
}
.goal__post { position: absolute; right: -52px; top: 24px; height: 300px; width: auto; opacity: .95; } /* スマホでは右端に寄せる（月桂冠に重ならないように） */
.goal__inner {
  position: relative; z-index: 1; max-width: 1080px; margin: 0 auto;
  display: grid; gap: 22px; justify-items: center; text-align: center;
}
.winner { position: relative; width: min(66vw, 300px); aspect-ratio: 1; }
.winner__laurel { position: absolute; inset: 0; width: 100%; }
.winner__horse { position: absolute; width: 64%; left: 18%; top: 10%; }
.goal__badge { font-size: clamp(44px, 12vw, 78px); }
.goal__title { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 6vw, 32px); margin-top: 6px; }
.goal__copy > p:not(.goal__badge) { margin-top: 14px; font-weight: 700; max-width: 30em; }

/* ── 出走表（パドック） ── */
.paddock {
  position: relative; padding: 72px var(--gutter) 80px; text-align: center;
  background: var(--card);
  border-top: 10px solid var(--turf);
}
.paddock__tag {
  display: inline-block; font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .2em;
  background: var(--ink); color: var(--white); border-radius: 6px; padding: 2px 14px; margin-bottom: 12px;
}
.paddock__title { font-size: clamp(26px, 7vw, 42px); }
.paddock__lead { margin: 16px auto 0; max-width: 34em; font-weight: 700; }
/* 最後の段も中央にそろえる（13頭は割り切れない） */
.cards {
  --cols: 2; --gap: 14px;
  list-style: none; padding: 0; margin: 36px auto 0; max-width: 1080px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px var(--gap);
}
.card { display: grid; justify-items: center; width: calc((100% - var(--gap) * (var(--cols) - 1)) / var(--cols)); }
.card__face {
  width: 86%; aspect-ratio: 1; border-radius: 50%; background: var(--white);
  border: 5px solid var(--pink); outline: 2px dashed var(--pink); outline-offset: -12px;
  display: grid; place-items: center; overflow: hidden; position: relative; z-index: 1;
}
.card__face img { height: 84%; width: auto; max-width: 84%; object-fit: contain; translate: 0 4%; transition: transform .25s; }
.card:hover .card__face img { transform: translateY(-6px) rotate(-3deg); }
.card__label {
  width: 100%; margin-top: -22px; padding: 30px 10px 14px; border-radius: 18px;
  background: var(--cream); box-shadow: 0 5px 0 var(--tea-deep);
}
/* ゼッケン（レースの絵と同じ色） */
.card__bib {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 7px;
  background: var(--bib); color: var(--white); font-family: var(--display); font-weight: 800; font-size: 15px;
  border: 2px solid var(--ink);
}
.card__name { font-family: var(--display); font-weight: 800; font-size: clamp(14px, 3.9vw, 18px); line-height: 1.4; margin-top: 4px; }
.card__type {
  display: inline-block; margin-top: 6px; border-radius: 999px; padding: 1px 10px;
  font-size: 12px; font-weight: 700; background: var(--white);
}
.card[data-type="speed"] .card__face { border-color: #F28DA9; outline-color: #F28DA9; }
.card[data-type="stamina"] .card__face { border-color: #8FC9A0; outline-color: #8FC9A0; }
.card[data-type="balanced"] .card__face { border-color: #E3B47E; outline-color: #E3B47E; }

.trust { padding: 44px var(--gutter); text-align: center; background: var(--cream); }
.trust > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.trust__title { font-family: var(--display); font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.trust p { font-size: 14px; color: var(--ink-sub); }

/* ── フッター ── */
.site-footer {
  background: var(--ink); color: #F6EDE6; text-align: center; font-size: 13px;
  padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom));
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-bottom: 14px; }
.site-footer nav a { display: inline-block; padding: 10px 2px; font-weight: 700; }
.site-footer p + p { margin-top: 6px; }
.site-footer__tm { opacity: .8; font-size: 12px; }

/* ── スクロールで現れる ── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1.2); }
.reveal.is-in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }
.hero .reveal:nth-child(4) { transition-delay: .24s; }
.no-js .reveal { opacity: 1; transform: none; }

/* ── 広い画面 ── */
@media (min-width: 760px) {
  :root { --gutter: 32px; }
  .hero { padding-top: 110px; }
  .hero__inner { grid-template-columns: 1fr 1.1fr; text-align: left; justify-items: start; align-items: center; }
  .hero__visual { order: -1; justify-self: center; width: 300px; }
  .hero__title { font-size: clamp(36px, 4.4vw, 58px); }
  .store { justify-content: flex-start; }
  .scenery { height: 200px; margin-top: -60px; background-size: auto 130px; }
  .scenery__stands { width: 480px; right: 4%; bottom: 40px; }
  .scenery__tree { width: 190px; }
  .scenery__tree--r { width: 160px; right: -10px; }
  .start { margin-top: -70px; }
  .cloud { width: 240px; }
  .cloud--b { width: 180px; top: 150px; }
  .lap { padding: 130px var(--gutter) 140px; }
  .lap__inner { grid-template-columns: 1.05fr 1fr; }
  .lap--flip .lap__visual { order: -1; }
  .board { padding: 36px 34px 32px; }
  .post { width: 120px; height: 124px; top: -121px; right: 30px; padding-top: 17px; }
  .post span { font-size: 13px; }
  .post b { font-size: 22px; }
  .phone--sm { width: 220px; }
  .deco { width: 200px; }
  .deco--flower { width: 140px; }
  .runner { --size: 120px; }
  .stretch__course { height: 340px; }
  .goal__inner { grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; gap: 48px; }
  .goal .store { justify-content: flex-start; }
  .goal__post { right: 6vw; top: auto; bottom: 0; height: 78%; }
  .cards { --cols: 4; --gap: 22px; row-gap: 28px; }
}
@media (min-width: 1100px) {
  .cards { --cols: 5; }
}

/* 「動きを減らす」（アプリと同じく動きを任意に。Apple HIG Motion） */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cloud, .gate__horse, .runner { animation: none; }
  .runner { transform: translateX(calc(var(--n) * 7.4vw)); }
  .reveal { opacity: 1; transform: none; transition: none; }
}
