/* 福岡浪漫スタンプ帖 — 樣式 */
@font-face {
  font-family: "Dela Gothic One";
  src: url("../fonts/dela-gothic-one.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif TC";
  src: url("../fonts/noto-serif-tc.woff2") format("woff2");
  font-weight: 500 900;
  font-display: swap;
}
/* 繁中字型沒有的日文漢字（焼、麺、緑…）用 Noto Serif JP 補上 */
@font-face {
  font-family: "Noto Serif JP";
  src: url("../fonts/noto-serif-jp.woff2") format("woff2");
  font-weight: 500 900;
  font-display: swap;
}

:root {
  --cream: #F4E7CC;
  --paper: #FBF3E2;
  --paper-dim: #EFE0C0;
  --ink: #2A1E14;
  --ink-soft: #5A4632;
  --ink-body: #3D2E20;
  --line: #A8916B;
  --line-soft: #C9B28A;
  --orange: #B8481B;
  --orange-dark: #9E3A12;
  --mustard: #E2AE35;
  --gold-ink: #A67A14;
  --teal: #1F6B66;
  --teal-dark: #174F4B;
  --teal-light: #CFE3DC;
  --display: "Dela Gothic One", "Noto Serif TC", "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --body: "Noto Serif TC", "Noto Serif JP", "PingFang TC", "Hiragino Mincho ProN", "Microsoft JhengHei", serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #E8D6B0;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--cream);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  box-shadow: 0 0 0 1px rgba(42, 30, 20, .08);
}
#app.no-nav { padding-bottom: calc(var(--safe-b) + 24px); }

.display { font-family: var(--display); font-weight: 400; }

/* ---------- 底部選單 ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-width: 480px; margin: 0 auto;
  display: flex; gap: 2px;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 4px 8px var(--safe-b);
  background: var(--ink);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--cream); text-decoration: none; font-size: 12px; font-weight: 700; min-height: 44px;
}
.nav a[aria-current="page"] { color: var(--mustard); }
.nav svg { width: 22px; height: 22px; }

/* ---------- 共用元件 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px;
  border: 2px solid var(--ink); border-radius: 10px;
  font-size: 16px; font-weight: 900; text-decoration: none; text-align: center;
  background: var(--paper); color: var(--ink);
}
.btn:hover { color: var(--ink); }
.btn-primary { background: var(--orange); color: var(--paper); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:hover { color: var(--paper); }
.btn-teal { background: var(--teal); color: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
.btn-teal:hover { color: var(--paper); }
.btn-mustard { background: var(--mustard); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: .45; box-shadow: none; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

.card {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px;
}
.shadow { box-shadow: 4px 4px 0 var(--ink); }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border: 1.5px solid var(--ink); border-radius: 14px; background: var(--paper);
}
.chip-teal { background: var(--teal); color: var(--paper); }
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border: 1.5px solid var(--ink); border-radius: 4px; background: var(--cream);
}
.tag-warn { background: var(--mustard); }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(var(--safe-t) + 14px) 16px 0;
}
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper);
  display: flex; align-items: center; justify-content: center; padding: 0; color: var(--ink);
}
.icon-btn svg { width: 18px; height: 18px; }
.pill-link {
  height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 22px;
  text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 700;
}
.pill-link svg { width: 18px; height: 18px; }
.page-title { margin: 0; font-size: 24px; font-weight: 900; line-height: 1.25; }

/* 天數分頁 */
.day-tabs { display: flex; gap: 6px; padding: 16px 16px 0; }
.day-tab {
  flex: 1; height: 52px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); color: var(--ink);
  text-decoration: none;
}
.day-tab .d { font-family: var(--display); font-size: 12px; }
.day-tab .t { font-size: 11px; }
.day-tab[aria-current="true"] { background: var(--teal); color: var(--paper); box-shadow: 2px 2px 0 var(--ink); }
.day-tab.today:not([aria-current="true"]) { border-color: var(--orange); color: var(--orange); }

/* ---------- 首頁 ---------- */
.poster {
  padding: calc(var(--safe-t) + 36px) 18px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: repeating-conic-gradient(from 0deg at 50% 125%, var(--orange) 0deg 6deg, var(--orange-dark) 6deg 12deg);
  border-bottom: 3px solid var(--ink);
}
.poster .en { font-family: var(--display); font-size: 11px; letter-spacing: 4px; color: var(--cream); }
.poster h1 {
  margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 8.4vw, 36px); line-height: 1.15;
  color: var(--paper); text-shadow: 3px 3px 0 var(--ink); letter-spacing: 1px; text-align: center;
}
.poster .sub { font-size: 12px; font-weight: 700; color: var(--cream); letter-spacing: 2px; }
.progress-card {
  margin-top: 14px; width: 100%; padding: 12px 14px;
  display: flex; align-items: center; gap: 14px;
}
.progress-card .count {
  display: flex; flex-direction: column; align-items: center; min-width: 76px;
  border-right: 2px dashed var(--line); padding-right: 12px;
}
.progress-card .big { font-family: var(--display); font-size: 32px; line-height: 1; color: var(--orange); }
.progress-card .big small { font-size: 14px; color: var(--ink-soft); }
.progress-card .detail { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bar { height: 12px; background: #E8D6B0; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--mustard); border-right: 1.5px solid var(--ink); }
.bar > span.zero { border-right: 0; }

.countdown {
  margin: 16px 16px 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  background: var(--mustard); border: 2px solid var(--ink); border-radius: 10px; text-decoration: none; color: var(--ink);
}
.countdown:hover { color: var(--ink); }
.countdown .n { font-family: var(--display); font-size: 26px; line-height: 1; }
.countdown svg { width: 18px; height: 18px; flex-shrink: 0; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 18px 18px 10px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 900; }
.section-head .eyebrow { font-size: 12px; font-weight: 700; color: var(--orange); }
.section-head .score { font-family: var(--display); font-size: 18px; white-space: nowrap; }
.section-head .score small { font-size: 12px; color: var(--ink-soft); }

.stamp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; padding: 0 16px; }
.slot {
  min-height: 142px; padding: 8px 4px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--ink); text-align: center;
  background: var(--paper); border: 1.5px solid var(--line-soft);
}
.slot:hover { color: var(--ink); }
.slot.empty { background: var(--paper-dim); border: 1.5px dashed var(--line); }
.slot.bonus { border-style: dotted; }
.slot .nm { font-size: 12px; font-weight: 700; line-height: 1.3; padding: 0 2px; }
.slot .st { font-size: 10px; color: var(--ink-soft); }
.slot .st.next { color: var(--orange); font-weight: 700; }
.slot.hidden-stamp { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.slot.hidden-stamp .st { color: #E8D6B0; }
.slot.hidden-stamp.open { background: var(--paper); color: var(--ink); border: 2px solid var(--mustard); }
.slot.hidden-stamp.open .st { color: var(--ink-soft); }

.next-strip {
  margin: 12px 16px 0; min-height: 52px; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--mustard); text-decoration: none; color: var(--ink);
}
.next-strip:hover { color: var(--ink); }
.next-strip .lab { font-family: var(--display); font-size: 11px; background: var(--ink); color: var(--mustard); padding: 3px 6px; border-radius: 4px; }
.next-strip .txt { flex: 1; font-size: 13px; font-weight: 700; }
.next-strip svg { width: 18px; height: 18px; }

/* ---------- 地點頁 ---------- */
.hero {
  position: relative; height: 260px; overflow: hidden;
  background: repeating-conic-gradient(from 0deg at 50% 62%, var(--mustard) 0deg 7deg, #D49C22 7deg 14deg);
  border-bottom: 3px solid var(--ink);
}
.hero .hero-stamp { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); }
.hero .hero-disc {
  width: 176px; height: 176px; border-radius: 50%; background: var(--paper);
  border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center;
}
.hero .ground { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: var(--ink); }
.hero .ground::after { content: ""; position: absolute; left: 0; right: 0; top: 8px; border-top: 2px dashed var(--mustard); }
.hero .back { position: absolute; left: 14px; top: calc(var(--safe-t) + 14px); }
.hero .when {
  position: absolute; right: 14px; top: calc(var(--safe-t) + 14px); height: 44px; padding: 0 14px;
  display: flex; align-items: center; background: var(--ink); border-radius: 22px; color: var(--mustard);
  font-family: var(--display); font-size: 12px;
}
.hero .badge {
  position: absolute; right: 20px; top: calc(var(--safe-t) + 78px); width: 78px; height: 78px; border-radius: 50%;
  background: var(--orange); border: 3px solid var(--ink); color: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(10deg);
}
.hero .badge span { font-size: 11px; font-weight: 700; }
.hero .badge b { font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.1; }

.place-head { padding: 22px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.place-head .ruby { font-family: var(--display); font-size: 13px; letter-spacing: 3px; color: var(--ink-soft); }
.place-head h1 { margin: -4px 0 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 8.6vw, 36px); line-height: 1.2; }
.place-head .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.place-head .lead { margin: 4px 0 0; font-size: 16px; line-height: 1.75; }

.info-card { margin: 18px 16px 0; overflow: hidden; }
.info-card dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-card .cell { padding: 12px 14px; border-bottom: 1.5px dashed var(--line); border-right: 1.5px dashed var(--line); }
.info-card .cell:nth-child(2n) { border-right: 0; }
.info-card .cell.wide { grid-column: 1 / -1; border-right: 0; }
.info-card dt { font-size: 11px; color: var(--ink-soft); }
.info-card dd { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.45; }
.info-card .cell.last { border-bottom: 0; }

.cta {
  margin: 20px 16px 0; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: var(--teal); border: 2px solid var(--ink); border-radius: 12px; color: var(--paper);
}
.cta .row { display: flex; align-items: center; gap: 12px; }
.cta b { font-size: 16px; font-weight: 900; }
.cta p { margin: 2px 0 0; font-size: 13px; line-height: 1.6; }
.cta.done { background: var(--paper); color: var(--ink); }

.sec { padding: 30px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.sec h2 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; }
.sec h2 .num {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--orange); color: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 15px; border: 2px solid var(--ink);
}
.sec h2 .aside { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-left: auto; }
.sec p { margin: 0; font-size: 15px; line-height: 1.8; }
.sec h3 { margin: 6px 0 0; font-size: 16px; font-weight: 900; }

.guide { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.guide li { display: flex; gap: 12px; padding-bottom: 16px; }
.guide li[hidden] { display: none; }
.guide .n {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 13px;
}
.guide .n.hot { background: var(--mustard); }
.guide .t { font-size: 15px; font-weight: 900; line-height: 1.5; }
.guide .d { font-size: 14px; line-height: 1.7; color: var(--ink-body); }
.guide .qtag { font-size: 11px; font-weight: 700; margin-left: 6px; padding: 2px 6px; background: var(--ink); color: var(--mustard); border-radius: 4px; white-space: nowrap; }

.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.55; }
th, td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1.5px dashed var(--line); }
th { background: var(--paper-dim); font-weight: 900; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; white-space: nowrap; }

.must { display: flex; flex-direction: column; gap: 8px; }
.must .item { padding: 12px 14px; }
.must .item b { display: block; font-size: 15px; font-weight: 900; }
.must .item span { font-size: 14px; line-height: 1.65; color: var(--ink-body); }

.flip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flip {
  position: relative; min-height: 200px; padding: 0; border: 0; background: none; text-align: left; perspective: 900px;
}
.flip .inner { position: relative; width: 100%; height: 100%; min-height: 200px; transition: transform .5s ease; transform-style: preserve-3d; }
.flip.on .inner { transform: rotateY(180deg); }
.flip .face {
  position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
  -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden;
}
.flip .back {
  padding: 12px; display: flex;
  background: repeating-linear-gradient(45deg, var(--orange) 0 10px, #A63F16 10px 20px);
}
.flip .back > span {
  flex: 1; border: 2px solid var(--paper); border-radius: 8px; background: var(--orange); color: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.flip .back .k { font-family: var(--display); font-size: 13px; }
.flip .back .w { font-size: 22px; font-weight: 900; }
.flip .back .h { font-size: 12px; font-weight: 700; }
.flip .front {
  transform: rotateY(180deg); background: var(--paper); padding: 14px;
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.flip .front .k { font-family: var(--display); font-size: 12px; color: var(--orange); }
.flip .front b { font-size: 15px; font-weight: 900; line-height: 1.4; }
.flip .front span { font-size: 13px; line-height: 1.65; color: var(--ink-body); }
@media (prefers-reduced-motion: reduce) { .flip .inner { transition: none; } }

.tips { display: flex; flex-direction: column; gap: 10px; }
.tip { padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 2px solid var(--mustard); border-radius: 10px; }
.tip svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 3px; color: var(--orange); }
.tip div { font-size: 14px; line-height: 1.7; }
.alt { padding: 14px 16px; border: 2px dashed var(--ink); border-radius: 10px; background: var(--paper); }
.alt b { display: block; font-size: 15px; font-weight: 900; margin-bottom: 4px; }
.alt span { font-size: 14px; line-height: 1.7; }
.sources { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.8; }

/* ---------- 蓋章流程 ---------- */
.flow { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 24px); }
.flow-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flow-head .ttl { font-size: 15px; font-weight: 900; text-align: center; }
.steps { margin: 18px 0 0; padding: 0; list-style: none; display: flex; gap: 6px; }
.steps li {
  flex: 1; display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border: 2px solid var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700;
}
.steps li .d { font-family: var(--display); }
.steps li.done { border-color: var(--teal); background: var(--teal-light); color: var(--teal); }
.steps li.now { border-color: var(--ink); background: var(--teal); color: var(--paper); }
.steps li.bad { border-color: var(--ink); background: var(--orange); color: var(--paper); }
.steps svg { width: 14px; height: 14px; }
.flow .center { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.flow .center h1 { margin: 0; font-size: 26px; font-weight: 900; line-height: 1.3; }
.flow .center h1.ok { font-family: var(--display); font-weight: 400; color: var(--teal); font-size: 30px; }
.flow .center h1.bad { color: var(--orange); }
.flow .center p { margin: 0; font-size: 15px; line-height: 1.7; }
.flow .grow { flex: 1; min-height: 20px; }
.flow .foot-note { margin-top: 12px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.radar { margin-top: 22px; display: flex; justify-content: center; }
.radar svg { width: min(290px, 78vw); height: auto; }
.pulse { transform-origin: center; transform-box: fill-box; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.spin { transform-origin: 145px 145px; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pulse, .spin { animation: none; } }
.fail-list { margin: 18px 0 0; padding: 14px 16px; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.fail-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.6; }
.fail-list svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: var(--teal); }

.quiz-card { margin-top: 30px; position: relative; padding: 30px 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.quiz-card .lab {
  position: absolute; top: -15px; left: 18px; background: var(--mustard); border: 2px solid var(--ink); border-radius: 6px;
  padding: 3px 10px; font-family: var(--display); font-size: 13px;
}
.quiz-card h1 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.5; }
.quiz-card .hint { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--teal); font-weight: 700; }
.quiz-card .hint svg { width: 16px; height: 16px; }
.options { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; border: 0; padding: 0; }
.opt {
  min-height: 64px; padding: 10px 16px; display: flex; align-items: center; gap: 14px; text-align: left;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); box-shadow: 3px 3px 0 var(--ink);
  font-size: 17px; font-weight: 700;
}
.opt .l {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--mustard); border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 400; font-size: 15px;
}
.opt[aria-checked="true"] { background: var(--teal); color: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
.opt[aria-checked="true"] .l { background: var(--paper); color: var(--ink); }
.legend-row { display: flex; gap: 10px; margin-top: 18px; }
.legend-row > div { flex: 1; border: 2px solid var(--gold-ink); border-radius: 10px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; background: var(--paper); font-size: 13px; font-weight: 700; }
.legend-row > div.n { border-color: var(--teal); }
.legend-row .m { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; }

.result { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(var(--safe-b) + 24px); }
.result .stage {
  padding: calc(var(--safe-t) + 40px) 16px 26px; display: flex; flex-direction: column; align-items: center;
  border-bottom: 3px solid var(--ink);
}
.result .stage.gold { background: repeating-conic-gradient(from 0deg at 50% 56%, var(--mustard) 0deg 8deg, #F0C766 8deg 16deg); }
.result .stage.normal { background: var(--teal-light); }
.result .stage .en { font-family: var(--display); font-size: 12px; letter-spacing: 4px; }
.result .disc {
  margin-top: 20px; width: 250px; height: 250px; border-radius: 50%; background: var(--paper);
  border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); display: flex; align-items: center; justify-content: center;
}
.result .disc .stamp-svg { animation: thump .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes thump { 0% { transform: scale(1.8) rotate(-20deg); opacity: 0; } 60% { opacity: 1; } 100% { } }
@media (prefers-reduced-motion: reduce) { .result .disc .stamp-svg { animation: none; } }
.ribbon { margin-top: 24px; padding: 7px 30px; border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-family: var(--display); font-size: 24px; color: var(--paper); letter-spacing: 2px; }
.ribbon.gold { background: var(--orange); }
.ribbon.normal { background: var(--teal); }
.result .body { padding: 22px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.result .body h1 { margin: 0; text-align: center; font-size: 22px; font-weight: 900; }
.result .body .when { text-align: center; font-size: 12px; color: var(--ink-soft); }
.result .answer { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.result .answer .c { font-size: 13px; font-weight: 700; color: var(--orange); }
.result .answer .e { font-size: 14px; line-height: 1.7; }
.dots { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 2px dashed var(--line); }
.dot.g { background: var(--mustard); border: 2px solid var(--ink); }
.dot.n { background: var(--teal); border: 2px solid var(--ink); }
.unlock { margin: 6px 20px 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--cream); border-radius: 10px; }
.unlock b { color: var(--mustard); }
.result .actions { margin-top: auto; padding: 24px 16px 0; }

/* ---------- 地圖 ---------- */
.chips-row { display: flex; gap: 6px; padding: 12px 16px 0; }
.chips-row button {
  flex: 1; height: 44px; padding: 0; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper);
  font-family: var(--display); font-size: 13px;
}
.chips-row button.all { font-family: var(--body); font-weight: 900; }
.chips-row button[aria-pressed="true"] { background: var(--teal); color: var(--paper); box-shadow: 2px 2px 0 var(--ink); }
.map-box { position: relative; margin: 12px 12px 0; border: 2.5px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); background: var(--teal-light); }
.map-box svg { width: 100%; height: auto; }
.map-box .area { cursor: pointer; }
.map-box .area:focus { outline: none; }
.map-box .area:focus-visible .ring-base { stroke: var(--mustard); stroke-width: 4; }
.map-box .area.dim { opacity: .35; }
.map-legend {
  position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 4px;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 6px; padding: 6px 8px; font-size: 10px; font-weight: 700;
}
.map-legend div { display: flex; align-items: center; gap: 6px; }
.map-note { position: absolute; left: 10px; top: 64px; font-size: 10px; color: var(--ink-soft); }
.sheet { margin: 12px 12px 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.sheet .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sheet h2 { margin: 0; font-size: 17px; font-weight: 900; }
.sheet .list { display: flex; flex-direction: column; }
.sheet .row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0; min-height: 48px;
  border-top: 1.5px dashed var(--line); text-decoration: none; color: var(--ink);
}
.sheet .row:hover { color: var(--ink); }
.sheet .row .nm { flex: 1; font-size: 14px; font-weight: 700; line-height: 1.4; }
.sheet .row .dd { font-family: var(--display); font-size: 11px; color: var(--ink-soft); }
.mini {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900;
}
.mini.g { background: var(--mustard); border: 2.5px solid var(--ink); }
.mini.n { background: var(--teal-light); border: 2.5px solid var(--teal); color: var(--teal); }
.mini.e { border: 2px dashed var(--line); color: #8C7453; }

/* ---------- 時間軸 ---------- */
.day-banner {
  margin: 16px 16px 0; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--orange); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 var(--ink); color: var(--paper);
}
.day-banner .dl { font-family: var(--display); font-size: 12px; letter-spacing: 2px; }
.day-banner h2 { margin: 0; font-size: 20px; font-weight: 900; }
.day-banner .sc { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 6px 10px; text-align: center; }
.day-banner .sc b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.1; }
.day-banner .sc span { font-size: 10px; font-weight: 700; }
.tl { position: relative; padding: 22px 16px 0; }
.tl::before {
  content: ""; position: absolute; left: 77px; top: 30px; bottom: 0; width: 6px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 10px, var(--cream) 10px 14px);
  border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink);
}
.tl-row { position: relative; display: flex; align-items: flex-start; }
.tl-row .time { width: 48px; flex-shrink: 0; text-align: right; padding-top: 14px; font-family: var(--display); font-size: 13px; line-height: 1.3; }
.tl-row .time small { display: block; font-family: var(--body); font-size: 10px; color: var(--ink-soft); }
.tl-row .time.word { font-family: var(--body); font-weight: 900; font-size: 12px; }
.tl-row .node { width: 32px; flex-shrink: 0; display: flex; justify-content: center; padding-top: 15px; }
.tl-row .body { flex: 1; min-width: 0; }
.node .dia { width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); margin-top: 2px; }
.node .ok { width: 20px; height: 20px; border-radius: 50%; background: var(--teal); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.node .ok svg { width: 11px; height: 11px; }
.node .fut { width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--ink); margin-top: 2px; }
.node .nx { width: 24px; height: 24px; border-radius: 50%; background: var(--paper); border: 3px solid var(--orange); display: flex; align-items: center; justify-content: center; margin-top: -2px; }
.node .nx::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.tl-stop { background: var(--paper-dim); border-radius: 8px; padding: 8px 12px; margin-top: 6px; font-size: 14px; font-weight: 700; }
.tl-stop .s { display: block; font-size: 12px; font-weight: 500; color: var(--ink-soft); }
.tl-card {
  display: flex; gap: 10px; align-items: center; padding: 12px 12px 12px 14px; margin-top: 4px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; text-decoration: none; color: var(--ink);
}
.tl-card:hover { color: var(--ink); }
.tl-card .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tl-card .k { font-size: 11px; font-weight: 700; color: var(--teal); }
.tl-card .n { font-size: 16px; font-weight: 900; line-height: 1.35; }
.tl-card .s { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.tl-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tl-card.next { border: 2.5px solid var(--orange); box-shadow: 4px 4px 0 var(--orange); position: relative; margin-top: 16px; padding-top: 18px; }
.tl-card.next .k { color: var(--orange); }
.tl-card .flag { position: absolute; top: -13px; left: 12px; background: var(--orange); color: var(--paper); border: 2px solid var(--ink); border-radius: 4px; padding: 1px 8px; font-family: var(--display); font-size: 11px; }
.tl-card.opt { border-style: dashed; }
.tl-move { position: relative; display: flex; align-items: center; padding: 10px 0 10px 80px; }
.tl-move .mv {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; line-height: 1.45;
  border: 1.5px dashed #8C7453; border-radius: 14px; background: var(--cream); font-size: 12px; color: var(--ink-soft); font-weight: 700;
}
.tl-move svg { width: 14px; height: 14px; flex-shrink: 0; }
.tl-note { position: relative; margin: 12px 0 0 80px; padding: 10px 12px; border: 2px dashed var(--ink); border-radius: 10px; background: var(--paper); font-size: 13px; line-height: 1.6; }
.tl-now { position: relative; display: flex; align-items: center; margin: 14px 0 4px; }
.tl-now .time { width: 48px; text-align: right; font-family: var(--display); font-size: 11px; color: var(--orange); }
.tl-now .node { width: 32px; display: flex; justify-content: center; }
.tl-now .node span { width: 16px; height: 16px; border-radius: 50%; background: var(--orange); border: 2.5px solid var(--ink); }
.tl-now .line { flex: 1; position: relative; border-top: 3px solid var(--orange); }
.tl-now .line span { position: absolute; right: 0; top: -14px; background: var(--orange); color: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.tl-end { height: 20px; }

/* ---------- 說明頁 ---------- */
.help { padding: 0 16px; display: flex; flex-direction: column; gap: 14px; }
.help .card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.help h2 { margin: 0; font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.help p, .help li { margin: 0; font-size: 14px; line-height: 1.75; }
.help ol, .help ul { margin: 0; padding-left: 20px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.status .led { width: 12px; height: 12px; border-radius: 50%; background: var(--line); border: 2px solid var(--ink); flex-shrink: 0; }
.status.ok .led { background: #3F9A5A; }
.status.warn .led { background: var(--mustard); }
.os-tabs { display: flex; gap: 6px; }
.os-tabs button { flex: 1; height: 44px; border: 2px solid var(--ink); border-radius: 8px; background: var(--paper); font-weight: 900; }
.os-tabs button[aria-pressed="true"] { background: var(--teal); color: var(--paper); }
.practice-out { display: flex; align-items: center; gap: 12px; }

/* ---------- 提示訊息 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%); z-index: 30;
  width: min(440px, calc(100% - 32px)); padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--cream); border-radius: 10px; font-size: 14px; font-weight: 700;
}
.toast button { margin-left: auto; min-height: 40px; padding: 0 12px; border: 2px solid var(--mustard); border-radius: 8px; background: var(--mustard); color: var(--ink); font-weight: 900; }

.empty-state { padding: 60px 24px; text-align: center; }

/* ---------- 補充樣式 ---------- */
#view:focus { outline: none; }
/* iPhone 瀏海／狀態列：用深色底讓白字看得清楚 */
.sb-fill { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--ink); z-index: 40; }
.nav[hidden] { display: none; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--orange); }
.poster .egg { background: none; border: 0; padding: 2px 8px; min-height: 28px; cursor: pointer; }

.final-card { margin: 16px 16px 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: var(--paper); border-color: var(--orange); }
.final-card b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--orange); }
.final-card p { margin: 2px 0 0; font-size: 13px; line-height: 1.6; }
.final-card .eyebrow { font-family: var(--display); font-weight: 400; letter-spacing: 2px; }

/* 翻牌卡：兩面疊在同一格，高度跟著內容長 */
.flip { display: block; min-height: 0; color: var(--ink); font: inherit; }
.flip .inner { display: grid; min-height: 200px; height: auto; }
.flip .face { position: relative; inset: auto; grid-area: 1 / 1; min-height: 200px; }
.flip .front { overflow: visible; }
.flip .back > span { min-height: 172px; }

.cta .cta-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--paper); color: var(--teal); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.cta .cta-ico svg { width: 24px; height: 24px; }
.cta.done .stamp-svg { flex-shrink: 0; }
.link-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 28px 20px 0; }
.sec .btn-ghost { min-height: 44px; font-size: 14px; }

.tl-card .s { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-card .tx .k, .tl-card .tx .n { display: block; }
.tl-card .mini { align-self: flex-start; }

.legend-row .m.g { background: var(--mustard); border: 2px solid var(--ink); }
.legend-row .m.n { background: var(--teal-light); border: 2px solid var(--teal); color: var(--teal); }
.result .body p { margin: 0; text-align: center; font-size: 15px; line-height: 1.75; }
.result .dots { margin-top: 16px; padding: 0 16px; }
.result .unlock .stamp-svg { flex-shrink: 0; }
.flow .center strong { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--orange); }
.fail-list.card { background: var(--paper); }
.flow .btn-row .btn { min-width: 0; }

.topbar .locate-btn { color: var(--orange); box-shadow: 2px 2px 0 var(--ink); }
.nearest { margin: 12px 12px 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; border-color: var(--orange); }
.nearest .row { display: flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none; color: var(--ink); }
.nearest .row .nm { flex: 1; font-size: 15px; font-weight: 900; }
.nearest svg { width: 18px; height: 18px; flex-shrink: 0; }
.sheet .row .mini { width: 30px; height: 30px; font-size: 12px; }

.help .card h2 svg { flex-shrink: 0; color: var(--orange); }
.help ul.small li { font-size: 12px; line-height: 1.7; color: var(--ink-soft); }
.help textarea { width: 100%; margin-top: 6px; padding: 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--cream); font: 12px/1.5 ui-monospace, Menlo, monospace; resize: vertical; }
#backup-box:not(:empty) { display: flex; flex-direction: column; gap: 8px; }
.help .btn svg { width: 18px; height: 18px; }
.practice-out:empty { display: none; }
