/* 旅のしおり風。丸い文字とシールのような影、路線図で進み具合を見せる */
:root {
  --sky: #e8f3fb;       /* 背景 */
  --paper: #ffffff;     /* カード */
  --ink: #2d3a5a;       /* 文字 */
  --muted: #6a7796;
  --edge: #c9d9ea;      /* 枠とシール影 */
  --pink: #ef5f86;      /* 主役：ボタン・選択 */
  --pink-soft: #ffe3eb;
  --mint: #33b38c;      /* 滞在 */
  --mint-soft: #d9f4ea;
  --sun: #f2b33d;       /* 見ごろ */
  --sun-soft: #fff1cf;
  --ride: #a8c4e6;      /* 移動 */
  --warn: #c2513f;
  --font-pop: "Mochiy Pop One", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #1b2240; --paper: #273055; --ink: #f1f3ff; --muted: #a7b0d4; --edge: #3b4675;
    --pink: #ff86a7; --pink-soft: #4a2e48; --mint: #5fd3ad; --mint-soft: #234a48;
    --sun: #ffcf66; --sun-soft: #4a3f2a; --ride: #5671a0; --warn: #ff9a88; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky: #1b2240; --paper: #273055; --ink: #f1f3ff; --muted: #a7b0d4; --edge: #3b4675;
  --pink: #ff86a7; --pink-soft: #4a2e48; --mint: #5fd3ad; --mint-soft: #234a48;
  --sun: #ffcf66; --sun-soft: #4a3f2a; --ride: #5671a0; --warn: #ff9a88; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.75;
}
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-block: 20px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 24px;
}
a { color: var(--pink); font-weight: 700; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
h1:focus { outline: none; }

.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.logo { margin: 0; font-family: var(--font-pop); font-size: 20px; color: var(--pink); }
.pr { margin: 0; font-size: 12px; color: var(--muted); }

/* 質問 */
.wizard {
  background: var(--paper);
  border: 2px solid var(--edge);
  border-radius: 28px;
  box-shadow: 0 6px 0 var(--edge);
  padding: 24px clamp(18px, 5vw, 40px) 28px;
  display: grid;
  gap: 24px;
}

/* 路線図の進み具合 */
.line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.line::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 9px; height: 6px;
  border-radius: 3px; background: var(--edge);
}
.line li { position: relative; display: grid; justify-items: center; gap: 4px; }
.stop {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--paper); border: 4px solid var(--edge);
  position: relative; z-index: 1;
}
.stop-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.line li.done .stop { background: var(--pink); border-color: var(--pink); }
.line li.now .stop { border-color: var(--pink); background: var(--pink-soft); transform: scale(1.25); }
.line li.now .stop-label { color: var(--pink); font-weight: 700; }

.step { display: grid; gap: 14px; }
.q-num { margin: 0; font-family: var(--font-pop); color: var(--pink); font-size: 14px; }
.step h1 {
  margin: 0;
  font-family: var(--font-pop);
  font-weight: 400;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.3;
  text-wrap: balance;
}
.hint { margin: 0; color: var(--muted); }

.station-box input {
  width: 100%;
  font: inherit; font-size: 22px; font-weight: 700;
  padding: 14px 18px;
  color: var(--ink); background: var(--sky);
  border: 2px solid var(--edge); border-radius: 18px;
}
.station-box input:focus { border-color: var(--pink); outline: none; box-shadow: 0 0 0 4px var(--pink-soft); }
.error { margin: 0; color: var(--warn); font-size: 14px; }

/* 駅の候補リスト */
.station-box { position: relative; }
.options {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 5;
  list-style: none; margin: 0; padding: 8px;
  background: var(--paper);
  border: 2px solid var(--edge); border-radius: 20px;
  box-shadow: 0 6px 0 var(--edge);
  max-height: 300px; overflow-y: auto;
  display: grid; gap: 2px;
}
.options li {
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 14px;
  font-size: 17px; font-weight: 700;
}
.options li::before {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid var(--pink); background: var(--paper);
}
.options li[aria-selected="true"], .options li:hover { background: var(--pink-soft); }
.options li[aria-selected="true"]::before { background: var(--pink); }
.options .op { font-size: 12px; font-weight: 500; color: var(--muted); }
.options mark { background: none; color: var(--pink); }
.options .none { cursor: default; font-size: 14px; font-weight: 500; color: var(--muted); }
.options .none::before { display: none; }
.options .head { cursor: default; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 14px 2px; }
.options .head::before { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .options:not([hidden]) { animation: drop .16s ease-out; }
  @keyframes drop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--edge); background: var(--paper);
  box-shadow: 0 3px 0 var(--edge);
  font-weight: 700;
}
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.chip[aria-pressed="true"] {
  background: var(--pink); border-color: var(--pink); color: var(--paper);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--pink) 60%, var(--ink));
}
.big-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.big-chips .chip { padding: 14px 10px; border-radius: 18px; font-size: 18px; display: grid; gap: 0; text-align: center; }
.big-chips .chip small { font-size: 12px; font-weight: 500; opacity: .8; }

.big-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.big {
  cursor: pointer;
  display: grid; justify-items: center; gap: 6px;
  padding: 18px 8px 16px;
  border-radius: 24px; border: 2px solid var(--edge);
  background: var(--paper); box-shadow: 0 5px 0 var(--edge);
  font-family: var(--font-pop); font-size: 22px;
}
.big svg { width: 76px; height: 76px; }
.big:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--edge); }
.big[aria-pressed="true"] { border-color: var(--pink); background: var(--pink-soft); box-shadow: 0 5px 0 var(--pink); }
.fill-a { fill: var(--mint); }
.fill-b { fill: var(--pink); }
.fill-w { fill: var(--paper); }
.fill-ink { fill: var(--ink); }
.stroke { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; fill: none; }

.nav { display: flex; justify-content: space-between; gap: 12px; }
.btn {
  cursor: pointer; border-radius: 999px; padding: 12px 28px; font-weight: 700; font-size: 17px;
  border: 2px solid var(--edge); background: var(--paper); box-shadow: 0 4px 0 var(--edge);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn.main {
  margin-left: auto;
  background: var(--pink); border-color: var(--pink); color: var(--paper);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--pink) 60%, var(--ink));
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.small { padding: 6px 16px; font-size: 14px; }

/* 結果 */
.result { display: grid; gap: 18px; }
.result-head { display: grid; gap: 8px; }
.result-head h1 { margin: 0; font-family: var(--font-pop); font-weight: 400; font-size: clamp(24px, 6vw, 34px); line-height: 1.35; text-wrap: balance; }
.result-head h1 b { color: var(--pink); font-weight: 400; }
.conds { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cond { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--edge); }
.result-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.sort { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sort select { font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--edge); border-radius: 12px; padding: 4px 8px; }
.note { margin: 0; font-size: 12px; color: var(--muted); }

/* 引いた行き先：きっぷ */
.ticket {
  background: var(--paper);
  border: 2px solid var(--edge);
  border-radius: 28px;
  box-shadow: 0 6px 0 var(--edge);
  overflow: hidden;
  display: grid;
}
.ticket.in-season { border-color: var(--sun); box-shadow: 0 6px 0 var(--sun); }
.ticket-top {
  background: var(--pink-soft);
  padding: 20px clamp(18px, 5vw, 32px) 18px;
  display: grid; gap: 6px;
  border-bottom: 3px dashed var(--edge);
}
.ticket-route { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ticket-route .arrow { color: var(--pink); }
.dest-name {
  margin: 0; font-family: var(--font-pop); font-weight: 400;
  font-size: clamp(34px, 10vw, 54px); line-height: 1.2; text-wrap: balance;
}
.dest-name.spinning { color: var(--muted); }
.ticket-body { padding: 18px clamp(18px, 5vw, 32px) 24px; display: grid; gap: 16px; }
.pref { font-family: var(--font-body); font-size: 15px; color: var(--muted); margin-left: 10px; }
.time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.time b { color: var(--ink); font-size: 18px; }
.desc { margin: 0; font-size: 17px; }

.course-title { margin: 0; font-family: var(--font-pop); font-weight: 400; font-size: 18px; }
.course { list-style: none; margin: 0; padding: 0; display: grid; }
.course li {
  display: grid; grid-template-columns: 4.2em 20px 1fr; gap: 0 10px;
  position: relative; padding-bottom: 14px;
}
.course .clock { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; padding-top: 1px; }
.course .dot {
  width: 16px; height: 16px; margin-top: 6px; border-radius: 50%;
  background: var(--mint); border: 3px solid var(--mint-soft); position: relative; z-index: 1;
}
.course li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(4.2em + 10px + 7px); top: 22px; bottom: -6px;
  width: 3px; border-radius: 2px; background: var(--mint-soft);
}
.course .what { min-width: 0; }
.course .what strong { display: block; font-size: 17px; line-height: 1.5; }
.course .what span { font-size: 14px; color: var(--muted); }
.course li.extra .dot { background: var(--paper); border-color: var(--edge); }
.course li.extra .clock { color: var(--muted); font-weight: 500; font-size: 12px; padding-top: 4px; }
.course li.home .dot { background: var(--pink); border-color: var(--pink-soft); }

.draw-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.draw-actions .btn.main { margin-left: 0; }

.all { background: var(--paper); border: 2px solid var(--edge); border-radius: 20px; padding: 14px 18px; }
.all summary { cursor: pointer; font-weight: 700; }
.all[open] summary { margin-bottom: 10px; }
.mini-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.mini-list li { border-top: 1px solid var(--edge); }
.mini-list button {
  width: 100%; text-align: left; cursor: pointer; background: none; border: 0;
  padding: 10px 4px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
}
.mini-list button:hover strong { color: var(--pink); }
.mini-list small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.mini-list .time { font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--sky); }
.badge.season { background: var(--sun-soft); color: color-mix(in srgb, var(--sun) 55%, var(--ink)); font-weight: 700; }
.badge.tight { background: var(--pink-soft); color: var(--warn); font-weight: 700; }

/* 一日の帯 */
.day { display: grid; gap: 2px; background: var(--sky); border-radius: 16px; padding: 12px 14px 8px; }
.bar { position: relative; height: 18px; border-radius: 9px; background: var(--paper); overflow: hidden; }
.seg-move, .seg-stay { position: absolute; top: 0; bottom: 0; border-radius: 9px; }
.seg-move { background: var(--ride); }
.seg-stay { background: var(--mint); }
.ticks { position: relative; height: 18px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; white-space: nowrap; }
.ticks .t-end { transform: translateX(-100%); }
.legend { margin: 0; font-size: 14px; }
.legend b { color: color-mix(in srgb, var(--mint) 70%, var(--ink)); }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  text-decoration: none; font-size: 14px;
  padding: 6px 14px; border-radius: 999px;
  border: 2px solid var(--pink); color: var(--pink); background: var(--paper);
}
.links a.primary { background: var(--pink); color: var(--paper); }
.empty {
  background: var(--paper); border: 2px dashed var(--edge); border-radius: 24px;
  padding: 28px 20px; text-align: center;
}
footer { font-size: 12px; color: var(--muted); }
footer p { margin: 4px 0; }

@media (max-width: 420px) {
  .stop-label { font-size: 10px; }
  .btn { padding: 12px 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .step:not([hidden]) { animation: pop .28s ease-out; }
  .line li .stop { transition: transform .2s, background .2s, border-color .2s; }
  @keyframes pop { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
  .ticket.landed { animation: land .45s cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes land { from { transform: translateY(-10px) rotate(-1.5deg); } to { transform: none; } }
}
