/* のりかえ熟語 公開ページ。色はアプリ（Assets.xcassets）と同じ値を使う。 */
:root {
  color-scheme: light dark;
  --paper: #F4EFE6;
  --raised: #FFFDF8;
  --ink: #23262B;
  --sub: #6B6F76;
  --hairline: #DDD6C9;
  --station: #FFFFFF;
  --accent: #D8502D;
  --warn: #C23B22;
  --l1: #D8502D;
  --l2: #1F6FB5;
  --l3: #1E8F6A;
  --l4: #D9981E;
  --l5: #8A4FA3;
  --l6: #1596A8;
  --l7: #C9477A;
  --l8: #8A5A33;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15181D;
    --raised: #1E232A;
    --ink: #ECE7DD;
    --sub: #9AA0A8;
    --hairline: #2E343C;
    --station: #232931;
    --accent: #EE7250;
    --warn: #F0705A;
    --l1: #EE7250;
    --l2: #5BA3E0;
    --l3: #4FBF97;
    --l4: #EDB84A;
    --l5: #B285C9;
    --l6: #4FC0D0;
    --l7: #E57BA5;
    --l8: #BF8E62;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  /* メールアドレスや長い URL で、スマホの幅から横にはみ出さないように折り返す。 */
  overflow-wrap: anywhere;
}

/* 朱の字は紙の上で細い文字には薄いので、リンクは字を濃い色にして下線を朱にする。 */
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
a:hover { color: var(--accent); }

img, svg { max-width: 100%; height: auto; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left)) 48px max(20px, env(safe-area-inset-right));
}

h1, h2, h3 { line-height: 1.4; word-break: auto-phrase; }
h1 { font-size: 2rem; margin: 0.4em 0 0.3em; }
h3 { font-size: 1.08rem; margin: 0 0 0.3em; }

/* 見出しの頭に小さな駅の丸を置く（盤面の駅と同じ見た目）。 */
h2 {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1.35rem;
  margin: 2.4em 0 0.7em;
}
h2::before {
  content: "";
  flex: none;
  width: 0.8em;
  height: 0.8em;
  border: 0.2em solid var(--ink);
  border-radius: 50%;
  background: var(--station);
}

p { margin: 0.6em 0; }
ul, ol { padding-left: 1.4em; margin: 0.6em 0; }
li { margin: 0.3em 0; }

.sub { color: var(--sub); font-size: 0.92rem; }

/* 日本語の文を、<wbr> を置いた文節の切れ目だけで折り返す（Safari は word-break: auto-phrase を持たないため）。 */
.kp { word-break: keep-all; }

/* 上の帯（下層のページだけ）。 */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 4px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.top img { width: 36px; height: 36px; border-radius: 22.4%; }

/* トップの見出し。 */
.hero { text-align: center; padding: 40px 0 8px; }
.hero img { width: 112px; height: 112px; border-radius: 22.4%; box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); }
.lead { font-size: 1.1rem; margin: 0.4em auto 1em; max-width: 34em; word-break: auto-phrase; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0 0 20px; list-style: none; }
.chips li {
  margin: 0;
  padding: 2px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--raised);
  font-size: 0.9rem;
}

.store {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.card {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 18px 20px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid .card p { margin: 0; }

/* 遊びかたの 3 段。広い画面では横に並べる。 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.steps li { margin: 0; }
.steps .num { color: var(--accent); font-weight: 700; margin-right: 0.3em; }
.steps svg { display: block; width: 100%; max-width: 260px; margin: 0 auto 10px; }
.steps p { margin: 0.3em 0 0; }

/* 見本の盤面（SVG）。 */
.bd text {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", sans-serif;
  font-size: 38px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  fill: var(--ink);
}
.bd .st circle.ring { fill: var(--station); stroke: var(--ink); stroke-width: 4; }
.bd .st .dot { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.bd .st .dot.on { fill: var(--ink); }
.bd .st.done circle.ring { fill: var(--ink); }
.bd .st.done text { fill: var(--paper); }
.bd .st.short circle.ring { stroke: var(--warn); stroke-width: 6; }
.bd .ln { stroke-width: 12; stroke-linecap: round; }
.bd .ln.trap { stroke: var(--warn); stroke-dasharray: 2 9; stroke-width: 7; }
.bd .chev { fill: none; stroke: var(--paper); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.bd .chev.trap { stroke: var(--warn); }
.bd .l1 { stroke: var(--l1); }
.bd .l2 { stroke: var(--l2); }
.bd .l3 { stroke: var(--l3); }
.bd .l4 { stroke: var(--l4); }
.bd .l5 { stroke: var(--l5); }
.bd .l6 { stroke: var(--l6); }

/* 段の一覧。表を使わず、狭い幅では 1 列に流す。 */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.tiers li { margin: 0; }
.tier {
  display: inline-block;
  min-width: 4.5em;
  margin-right: 0.4em;
  padding: 0 10px;
  border: 2px solid var(--tier);
  border-radius: 999px;
  background: var(--raised);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}
.size { font-weight: 700; }

.checks { counter-reset: check; padding: 0; list-style: none; }
.checks li { counter-increment: check; position: relative; padding-left: 2.2em; margin: 0.5em 0; }
.checks li::before {
  content: counter(check);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.6em;
  height: 1.6em;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--station);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: calc(1.6em - 4px);
  text-align: center;
}

.share {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--hairline);
  font-size: 0.92rem;
}

/* よくある質問。開け閉めは HTML の details だけで行う（JS を使わない）。 */
details { border-bottom: 1px solid var(--hairline); padding: 4px 0; }
details:first-of-type { border-top: 1px solid var(--hairline); }
summary { cursor: pointer; font-weight: 700; padding: 8px 0; list-style-position: outside; margin-left: 1.1em; }
details p { margin: 0 0 12px; }

/* 規約やポリシーのページ。 */
.doc h2 { font-size: 1.15rem; margin-top: 2em; }
.doc h2::before { display: none; }
.doc h3 { margin-top: 1.4em; }
.mail { font-weight: 700; }

footer {
  border-top: 1px solid var(--hairline);
  padding: 24px 20px 40px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--sub);
}
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 8px; }

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  .hero { padding-top: 28px; }
  .card { padding: 16px; }
}
