/*
  旅程島介面樣式：奶油紙、朱紅編號、深藍文字，帶一點車票感。
  手機直式優先；寬螢幕（≥ 900px）時，主選單和卡片移到右側。
*/
@font-face {
  font-family: "TripRound";
  src: url("../assets/fonts/trip-round.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f6efdc;
  --paper-2: #fbf7ec;
  --paper-deep: #ece1c4;
  --ink: #1f3d6b;
  --ink-soft: #4a5d78;
  --forest: #3f7a4a;
  --forest-soft: #e3eedc;
  --mustard: #e8ae2e;
  --vermilion: #c9482f;
  --vermilion-soft: #fbe3d9;
  --line: rgba(31, 61, 107, .16);
  --shadow: 0 6px 18px rgba(60, 45, 20, .16), 0 1px 2px rgba(60, 45, 20, .12);
  --font: "TripRound", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

/* ---------- 3D 畫面 ---------- */
#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  opacity: 0;
  transition: opacity .8s ease;
}
body.ready #scene { opacity: 1; }
.paper-grain {
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .33 0 0 0 0 .2 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: .18;
}
body[data-mood="night"] .paper-grain { opacity: .1; }

/* ---------- 島名標籤 ---------- */
.labels { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s ease .3s; }
body.ready .labels { opacity: 1; }
.island-label {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center;
  padding: 0; border: 0; background: none;
  pointer-events: auto;
  filter: drop-shadow(0 3px 6px rgba(60, 45, 20, .22));
  will-change: transform;
  transition: opacity .3s;
}
.island-label::after {
  content: ""; position: absolute; left: 50%; bottom: -5px;
  width: 10px; height: 10px; background: var(--paper);
  transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1;
}
.island-no {
  padding: 6px 8px 6px 11px;
  font-size: 13px; font-weight: 700;
  color: #fff; background: var(--vermilion);
  border-radius: 99px 0 0 99px;
}
.island-name {
  padding: 6px 13px 6px 9px;
  font-size: 14px; font-weight: 600;
  background: var(--paper);
  border-radius: 0 99px 99px 0;
  white-space: nowrap;
}
.island-name small { margin-left: 4px; font-size: .82em; font-weight: 400; color: var(--ink-soft); }
.island-label.is-active .island-no { background: var(--forest); }
.island-label.is-dim { opacity: .35; }
/* 卡片打開時，卡片上已經有站名，這座島的標籤就先藏起來，免得擋到上方 */
body.sheet-open .island-label.is-active { visibility: hidden !important; }
/* 手機鳥瞰時島很小，標籤只留編號 */
@media (max-width: 899px) {
  body.overview .island-name { display: none; }
  body.overview .island-no { border-radius: 99px; padding: 6px 10px; font-size: 14px; }
  body.overview .island-label::after { background: var(--vermilion); }
}

/* ---------- 上方 ---------- */
.topbar {
  position: fixed; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: calc(var(--safe-t) + 12px) 12px 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.ticket {
  position: relative;
  flex: none;
  white-space: nowrap;
  padding: 8px 16px 8px 14px;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: var(--shadow);
  -webkit-mask: radial-gradient(circle 8px at 100% 50%, transparent 98%, #000);
          mask: radial-gradient(circle 8px at 100% 50%, transparent 98%, #000);
}
.ticket::before { content: ""; position: absolute; inset: 4px; border: 1.5px dashed var(--line); border-radius: 7px; pointer-events: none; }
.ticket-kicker { margin: 0; font-size: 12px; color: var(--vermilion); font-weight: 600; letter-spacing: .06em; }
.ticket-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.top-actions { display: flex; gap: 8px; align-items: center; min-width: 0; }
.icon-btn {
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); box-shadow: var(--shadow); color: var(--ink);
}
.icon-btn { position: relative; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
/* 只看某一天時，日曆圖示右上角標示 D1／D2 */
.icon-badge { position: absolute; right: -2px; top: -2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; background: var(--vermilion); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.status-chips {
  position: fixed; left: 12px; right: 12px;
  top: calc(var(--safe-t) + 80px);
  display: flex; pointer-events: none;
}
.status-chips > * { pointer-events: auto; }
.now-chip {
  display: flex; align-items: center; gap: 6px;
  min-height: 40px; max-width: 100%;
  padding: 0 14px;
  border: 0; border-radius: 99px;
  background: var(--vermilion-soft); color: #7a2412;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.count-chip { background: var(--forest-soft); color: #234d2c; }
.now-chip.flash { animation: flash 1s ease-in-out 3; }
@keyframes flash { 50% { transform: scale(1.08); box-shadow: 0 0 0 4px var(--mustard), var(--shadow); } }
.now-chip .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--vermilion); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.mood-pop {
  position: fixed; right: 12px; top: calc(var(--safe-t) + 68px);
  padding: 10px 12px 12px;
  background: var(--paper); border-radius: 14px; box-shadow: var(--shadow);
  z-index: 5;
}
.mood-pop p { margin: 0 0 6px; font-size: 13px; color: var(--ink-soft); }

/* 分段按鈕（天數、天色、清單分頁） */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--paper); border-radius: 99px; box-shadow: var(--shadow); }
.seg button {
  min-height: 40px; padding: 0 14px;
  border: 0; border-radius: 99px; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap;
}
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--ink); color: #fff; }
.seg.wide { box-shadow: none; background: var(--paper-deep); }
.seg.wide button { flex: 1; }

.back-all {
  position: fixed; left: 12px;
  bottom: calc(var(--safe-b) + var(--tabbar-h) + 16px);
  display: flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 16px 0 10px;
  border: 0; border-radius: 99px;
  background: var(--ink); color: #fff;
  font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow);
}
/* 卡片打開時不需要這顆：關掉卡片就會回到全部的島 */
body.sheet-open .back-all { display: none; }

/* ---------- 下方主選單 ---------- */
.tabbar {
  position: fixed; left: 8px; right: 8px;
  bottom: calc(var(--safe-b) + 8px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  background: var(--paper); border-radius: 20px; box-shadow: var(--shadow);
  z-index: 20;
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border: 0; border-radius: 14px; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.on { background: var(--ink); color: #fff; }

/* ---------- 站點卡片 ---------- */
.sheet {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--safe-b) + var(--tabbar-h) + 16px);
  max-height: 46vh;
  display: flex; flex-direction: column; overflow: hidden;
  margin: 0 8px;
  padding: 10px 18px 16px;
  background: var(--paper-2);
  border-radius: 20px;
  box-shadow: 0 -4px 24px rgba(60, 45, 20, .18);
  transform: translateY(calc(100% + 120px));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  z-index: 15;
}
.sheet[aria-hidden="false"] { transform: none; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet-grip { width: 48px; height: 6px; border-radius: 6px; background: var(--paper-deep); margin: 0 auto 8px; flex: none; }
/* 把手和站名那一帶可以上下拖拉，調整卡片高度 */
@media (max-width: 899px) {
  .sheet-grip { width: 100%; height: 22px; margin: -10px 0 0; background: none; position: relative; cursor: grab; touch-action: none; }
  .sheet-grip::before { content: ""; position: absolute; left: 50%; top: 8px; width: 48px; height: 6px; margin-left: -24px; border-radius: 6px; background: var(--paper-deep); }
  #sheet-head { touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
  .sheet { transition: transform .35s cubic-bezier(.2, .8, .2, 1), max-height .3s ease; }
  .sheet.dragging { transition: none; }
}
.close-btn {
  position: absolute; right: 10px; top: 10px;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--paper-deep); color: var(--ink);
}
.close-btn svg { width: 20px; height: 20px; }
.sheet-kicker { margin: 0 0 4px; display: flex; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--forest-soft); color: #2c5a35; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin: 0 52px 6px 0; }
.sheet-title { margin: 0; min-width: 0; font-size: 21px; line-height: 1.35; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
/* 導航：站名旁邊的圓形按鈕（圖示＋小字），一眼就看得到又不佔空間 */
.nav-btn {
  flex: none; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--vermilion); color: #fff;
}
.nav-btn svg { width: 24px; height: 24px; }
.sheet-title .no { font-size: 14px; color: #fff; background: var(--vermilion); border-radius: 99px; padding: 2px 10px; }
.sheet-title small { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.sheet-blurb { margin: 0 0 10px; color: var(--ink-soft); }
.tag {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: 99px;
  color: #6e4b06; background: #f8e6b8;
}
.times { list-style: none; margin: 0 0 12px; padding: 0; }
.times li { padding: 8px 0; border-top: 1px dashed var(--line); }
.times p { margin: 0; }
/* 時間放在標題上面一行，窄螢幕也不會把標題擠成好幾行 */
.times .time { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--vermilion); font-size: 14px; }
.times .what strong { display: block; font-weight: 600; }
.times .what span { display: block; font-size: 14px; color: var(--ink-soft); }
.times li.is-now { background: var(--vermilion-soft); margin: 0 -10px; padding: 10px; border-radius: 12px; border-top-color: transparent; }
.now-tag { font-size: 12px; font-weight: 700; color: #fff; background: var(--vermilion); border-radius: 99px; padding: 2px 8px; }
.sheet-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.sheet-actions .ghost-btn { min-height: 44px; padding: 0 14px; font-size: 15px; }
.sheet-actions > :first-child { justify-self: start; }
.sheet-actions > :last-child { justify-self: end; }
.muted { font-size: 13px; color: var(--ink-soft); text-align: center; }

.lantern-form { margin: 4px 0 14px; padding: 12px; border-radius: 14px; background: #fff3d6; }
.lantern-form label, .lookup-form label { display: block; font-weight: 600; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
.row input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 17px;
}
.row input:focus { border-color: var(--ink); outline: none; }

/* 按鈕 */
.primary-btn, .ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 48px; padding: 0 20px;
  border-radius: 99px; text-decoration: none;
  font-size: 16px; font-weight: 700; white-space: nowrap;
}
.primary-btn { border: 0; background: var(--vermilion); color: #fff; }
.primary-btn.small { min-height: 48px; padding: 0 18px; }
.ghost-btn { border: 1.5px solid var(--line); background: transparent; color: var(--ink); }

/* ---------- 面板 ---------- */
.scrim { position: fixed; inset: 0; background: rgba(31, 40, 60, .32); z-index: 25; }
.panel {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-height: 88vh; height: 88vh;
  display: flex; flex-direction: column;
  background: var(--paper-2);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(60, 45, 20, .2);
  transform: translateY(105%);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  z-index: 30;
}
.panel[aria-hidden="false"] { transform: none; }
.panel-head { position: relative; padding: 18px 64px 10px 20px; border-bottom: 1px dashed var(--line); }
.panel-head h2 { margin: 0; font-size: 21px; }
.panel-head .close-btn { top: 10px; }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px calc(var(--safe-b) + 24px); }
.flag { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: #f8e6b8; color: #5c3f06; font-size: 14px; }
.hint { color: var(--ink-soft); font-size: 14px; text-align: center; margin: 12px 0 0; }
.list-theme { margin: 12px 0 4px; font-weight: 600; color: var(--forest); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline .row {
  width: 100%; text-align: left; display: block;
  padding: 10px 6px; border: 0; border-top: 1px dashed var(--line); background: transparent;
}
.timeline .row:hover { background: var(--paper); }
.timeline .time { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--vermilion); font-size: 14px; }
.timeline .what strong { display: block; font-weight: 600; }
.timeline .what span { display: block; font-size: 14px; color: var(--ink-soft); }
.timeline .where { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--paper-deep); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.timeline .row.is-now { background: var(--vermilion-soft); border-radius: 12px; }

.note { margin: 0 0 10px; border-radius: 14px; background: var(--paper); }
.note summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; font-weight: 700; font-size: 17px; cursor: pointer; }
.note summary::-webkit-details-marker { display: none; }
.note summary::after { content: "＋"; margin-left: auto; color: var(--ink-soft); }
.note[open] summary::after { content: "－"; }
.note-icon { font-size: 20px; }
.note ul { margin: 0; padding: 0 16px 14px 34px; }
.note li { margin: 6px 0; }

.empty { text-align: center; padding: 40px 10px; }
.empty-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.lookup-form { margin-bottom: 16px; }
.error { color: #a3271a; font-size: 14px; margin: 6px 0; }
.result { margin: 10px 0; padding: 14px; border-radius: 14px; background: var(--paper); }
.result .who { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.stubs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stub { padding: 10px 12px; border-radius: 12px; background: #fff; border: 1.5px dashed var(--line); }
.stub span { display: block; font-size: 13px; color: var(--ink-soft); }
.stub strong { font-size: 20px; }
.none { color: var(--ink-soft); }

/* ---------- 箴言卡：牛皮紙信封＋信紙 ---------- */
.letter-stage { display: grid; justify-items: center; padding: 6px 0; }
.envelope2 {
  position: relative; width: min(82vw, 320px); aspect-ratio: 4 / 3;
  margin-top: 70px; border: 0; padding: 0; background: none;
}
.env2-back, .env2-front, .env2-flap, .env2-letter { position: absolute; left: 0; right: 0; }
.env2-back { inset: 0; border-radius: 10px; background: #c9a875; }
/* 信紙：打開時往上探出頭 */
.env2-letter {
  left: 7%; right: 7%; top: 8%; height: 84%;
  border-radius: 6px; background: var(--paper-2) repeating-linear-gradient(transparent 0 26px, rgba(31,61,107,.12) 26px 28px);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1) .25s;
}
.env2-front {
  left: 0; right: 0; bottom: 0; height: 64%;
  border-radius: 0 0 10px 10px; background: #dcc195;
  clip-path: polygon(0 0, 50% 42%, 100% 0, 100% 100%, 0 100%);
  z-index: 3;
}
.env2-to { position: absolute; left: 14%; bottom: 18%; font-size: 17px; font-weight: 700; color: #6b4a22; }
/* 前面的小郵票（水彩風景）和紅郵戳 */
.env2-stamp {
  position: absolute; right: 9%; bottom: 14%; width: 46px; height: 56px;
  border: 4px solid #fff; outline: 2px dotted #fff; outline-offset: 2px;
  background: url("../assets/journey-landscape.webp") 80% 70% / 380% auto;
}
.env2-postmark {
  position: absolute; right: 22%; bottom: 10%; width: 62px; height: 62px;
  display: grid; place-content: center; text-align: center;
  border: 3px solid rgba(217,72,59,.7); border-radius: 50%;
  color: rgba(217,72,59,.85); font-size: 13px; font-weight: 700; line-height: 1.1;
  transform: rotate(-14deg);
}
.env2-postmark small { display: block; font-size: 8px; }
.env2-flap {
  top: 0; height: 56%; background: #d2b483;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .45s ease; z-index: 4;
}
.env2-seal {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--vermilion); color: #fff; font-size: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  z-index: 5; transition: opacity .3s;
}
.letter-stage.open .env2-flap { transform: rotateX(180deg); z-index: 1; }
.letter-stage.open .env2-seal { opacity: 0; }
.letter-stage.open .env2-letter { transform: translateY(-48%); z-index: 2; }
/* 整張信紙跳出來（就是存成圖片的那一張） */
.letter-card { margin: 0; width: min(86vw, 340px); }
.letter-card img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 10px 28px rgba(60,45,20,.25); }
.letter-stage.reveal .letter-card { animation: letter-pop .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes letter-pop { from { opacity: 0; transform: translateY(40px) scale(.92); } }
.verse-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

/* ---------- 進場畫面 ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: var(--paper);
  transition: opacity .6s ease, transform .6s ease;
}
.splash.leaving { opacity: 0; transform: scale(1.03); pointer-events: none; }
.splash-art {
  flex: 1; min-height: 0;
  background: url("../assets/journey-landscape.webp") 72% 100% / cover no-repeat;
  -webkit-mask: linear-gradient(to bottom, #000 70%, transparent);
          mask: linear-gradient(to bottom, #000 70%, transparent);
}
.splash-card { padding: 4px 22px calc(var(--safe-b) + 22px); max-width: 520px; width: 100%; margin: 0 auto; }
.splash-kicker { margin: 0; color: var(--vermilion); font-weight: 700; letter-spacing: .08em; }
.splash h1 { margin: 0; font-size: 40px; line-height: 1.2; letter-spacing: .06em; }
.splash-sub { margin: 4px 0 14px; color: var(--ink-soft); }
.splash-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fact { display: flex; flex-direction: column; justify-content: center; min-height: 72px; padding: 10px 14px; border-radius: 14px; background: var(--paper-2); border: 1.5px dashed var(--line); text-decoration: none; color: inherit; }
.fact strong { font-size: 26px; line-height: 1.2; }
.fact span { font-size: 14px; color: var(--ink-soft); }
.fact-link strong { font-size: 20px; }
.fact-link > span { color: #185fa5; }
.splash-status { margin: 0 0 8px; font-weight: 600; color: var(--ink-soft); }
.enter-bar { display: block; height: 8px; width: 100%; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.enter-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--vermilion); transition: width .3s; }

/* ---------- 首次導覽 ---------- */
.tour {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  /* 卡片放在下方主選單上面，被標示的地方（標籤、上方切換）才不會被擋住 */
  padding: 16px 16px calc(var(--safe-b) + var(--tabbar-h) + 28px);
  background: rgba(31, 40, 60, .3);
}
.tour-card { width: min(420px, 100%); padding: 22px; border-radius: 20px; background: var(--paper-2); box-shadow: var(--shadow); }
.tour-step { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--vermilion); }
.tour-card h2 { margin: 4px 0 6px; font-size: 22px; }
.tour-card p { margin: 0; }
.tour-actions { display: flex; justify-content: space-between; margin-top: 18px; }
.tour-focus { position: relative; z-index: 45 !important; box-shadow: 0 0 0 4px var(--mustard), var(--shadow) !important; border-radius: 20px; }

/* ---------- 提示訊息 ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 128px);
  transform: translate(-50%, -20px);
  max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: 99px;
  background: var(--ink); color: #fff; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.credits { position: fixed; right: 10px; bottom: 2px; margin: 0; font-size: 10px; color: var(--ink-soft); opacity: .7; pointer-events: none; }
@media (max-width: 899px) { .credits { display: none; } }
.fps-box { position: fixed; left: 50%; top: calc(var(--safe-t) + 4px); transform: translateX(-50%); padding: 3px 10px; font-size: 12px; color: #fff; background: rgba(31, 61, 107, .85); border-radius: 99px; pointer-events: none; z-index: 70; }

/* ---------- 清單模式（不支援 3D） ---------- */
body.no-3d { overflow: auto; }
body.no-3d #scene, body.no-3d .labels, body.no-3d #day-btn, body.no-3d #mood-btn { display: none; }
.list-mode { position: relative; padding: calc(var(--safe-t) + 84px) 12px calc(var(--safe-b) + 110px); max-width: 640px; margin: 0 auto; }
.list-intro { color: var(--ink-soft); margin: 0 4px 12px; }
.stop-card {
  width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left;
  margin-bottom: 10px; padding: 14px; border: 0; border-radius: 16px;
  background: var(--paper-2); box-shadow: var(--shadow);
}
.stop-card .no { flex: none; font-size: 14px; font-weight: 700; color: #fff; background: var(--vermilion); border-radius: 99px; padding: 2px 10px; }
.stop-card .what strong { display: block; font-size: 18px; }
.stop-card .what span { display: block; font-size: 14px; color: var(--ink-soft); }
body.no-3d .sheet { position: fixed; }

/* 夜晚：介面維持亮色紙卡，只把上方標題換深一點 */
body[data-mood="night"] .credits { color: #c9d2ea; }

/* ---------- 寬螢幕：主選單和卡片移到右側 ---------- */
@media (min-width: 900px) {
  :root { --tabbar-h: 0px; }
  .tabbar {
    left: auto; right: 16px; bottom: auto; top: calc(var(--safe-t) + 80px);
    width: 96px; grid-template-columns: 1fr; gap: 4px;
  }
  .tabbar button { min-height: 72px; }
  .sheet {
    left: auto; right: 128px; bottom: auto; top: calc(var(--safe-t) + 80px);
    width: 380px; max-height: calc(100vh - 110px); margin: 0;
    transform: translateX(calc(100% + 160px));
  }
  .panel {
    left: auto; right: 128px; top: calc(var(--safe-t) + 80px); bottom: 24px;
    width: 440px; height: auto; max-height: none;
    border-radius: 22px;
    transform: translateX(calc(100% + 160px));
  }
  .scrim { background: transparent; }
  .back-all { bottom: 24px; }
  body.sheet-open .back-all { top: auto; bottom: 24px; }
  .splash { flex-direction: row; }
  .splash-art { -webkit-mask: linear-gradient(to right, #000 75%, transparent); mask: linear-gradient(to right, #000 75%, transparent); }
  .splash-card { align-self: center; flex: 0 0 460px; padding: 40px; }
}
/* ---------- 許願天燈 ---------- */
/* 農場天燈台上方的「許願」標籤：會輕輕浮動，提醒可以點 */
.wish-pin {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: center; gap: 4px;
  min-height: 40px; padding: 0 14px 0 10px;
  border: 2px solid #fff; border-radius: 99px;
  background: var(--mustard); color: #5c3a05;
  font: 700 15px/1 var(--font);
  box-shadow: 0 4px 14px rgba(232, 174, 46, .45);
  pointer-events: auto; cursor: pointer;
  will-change: transform;
}
.wish-pin span { font-size: 18px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }
/* 鳥瞰時島太小，許願標籤會擋到站名，等拉近農場再出現 */
body.overview .wish-pin { visibility: hidden !important; }
body.panel-open .wish-pin { visibility: hidden !important; }

/* 農場卡片裡的「去許願」 */
.wish-cta {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  margin: 4px 0 12px; padding: 12px 14px;
  border: 2px dashed #e8b65a; border-radius: 16px;
  background: #fff3d6; color: #5c3a05;
}
.wish-cta-icon { font-size: 28px; }
.wish-cta strong { display: block; font-size: 16px; }
.wish-cta small { display: block; font-size: 13px; color: #8a6420; }

.wish-intro { margin: 0 0 12px; color: var(--ink-soft); }
.wish-form { padding: 14px; border-radius: 16px; background: #fff3d6; margin-bottom: 18px; }
.wish-form label { display: block; font-weight: 700; margin: 0 0 6px; }
.wish-form textarea, .wish-form input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font: 400 17px/1.5 var(--font); color: var(--ink); resize: none;
}
.wish-form input { min-height: 48px; }
.wish-form textarea:focus, .wish-form input:focus { border-color: var(--ink); outline: none; }
.wish-form .counter { margin: 4px 2px 10px; text-align: right; font-size: 13px; color: var(--ink-soft); }
.wish-form .error { min-height: 1.2em; }
.wish-form .primary-btn { width: 100%; }
.wish-form .primary-btn:disabled { opacity: .7; }
.wall-title { margin: 0 0 10px; font-size: 18px; }
.wall-title span { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
/* 願望卡：像一盞小天燈，上窄下寬，帶一點暖光 */
.wish-card {
  position: relative; padding: 16px 12px 12px;
  border-radius: 14px 14px 18px 18px;
  background: linear-gradient(#fff6e2, #ffe7bd);
  box-shadow: 0 4px 12px rgba(232, 150, 46, .22);
}
.wish-card::before { content: ""; position: absolute; left: 50%; top: -5px; width: 28px; height: 8px; margin-left: -14px; border-radius: 4px; background: #d58c3a; }
/* 使用者寫的願望用系統字體，避免粉圓沒有的字混在一起 */
.wish-text { margin: 0; font: 600 16px/1.5 "PingFang TC", "Noto Sans TC", sans-serif; color: #5c3a05; word-break: break-word; }
.wish-name { margin: 8px 0 0; font-size: 13px; color: #8a6420; text-align: right; }

.wish-bubble {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 32px));
  padding: 22px 20px 16px; border-radius: 22px;
  background: linear-gradient(#fff6e2, #ffe7bd);
  box-shadow: 0 0 0 6px rgba(255, 196, 107, .35), var(--shadow);
  z-index: 35; text-align: center;
}
.wish-bubble .wish-text { font-size: 19px; }
.wish-bubble .wish-name { text-align: center; margin-bottom: 14px; }
.wish-bubble .row { justify-content: center; }

/* 彩蛋 */
.egg-bubble { z-index: 36; }
.egg-kicker { margin: 0 0 8px; font-weight: 700; color: var(--vermilion); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 37; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105%; transform: rotate(540deg) translateX(40px); } }

/* 窄螢幕（360 左右）：字小一點、留白少一點，資訊才放得下 */
@media (max-width: 400px) {
  .sheet { padding: 10px 14px 14px; max-height: 50vh; }
  .sheet-title { font-size: 19px; }
  .sheet-title small { font-size: 13px; }
  .sheet-head { gap: 8px; margin-right: 48px; }
  .panel-body { padding-left: 16px; padding-right: 16px; }
  .seg button { padding: 0 10px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
/* 卡片打開時，上方的天數切換先收起來，讓出看島的空間 */

.hint.left { text-align: left; margin: 6px 2px 0; }
.mates { margin: 10px 0 0; font-size: 15px; color: var(--ink-soft); }
