:root {
  --cream: #fff6ea;
  --paper: #fffdf8;
  --peach: #ffd2bc;
  --blush: #f7b7a3;
  --coral: #e56b5d;
  --gold: #f0c14b;
  --sage: #7eb89a;
  --mint: #c9ead8;
  --sky: #b9e4e2;
  --sky-deep: #7eb8c9;
  --lavender: #e6d4f2;
  --ink: #4a372c;
  --muted: #7a6558;
  --line: #ead7c4;
  --shadow: 0 12px 32px rgba(90, 55, 40, 0.12);
  --display: "Huninn", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --body: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 8%, #ffe8c8 0 120px, transparent 160px),
    radial-gradient(circle at 90% 12%, #cfeee6 0 140px, transparent 190px),
    radial-gradient(circle at 80% 88%, #ffd9cc 0 160px, transparent 210px),
    radial-gradient(circle at 8% 78%, #dce8ff 0 130px, transparent 180px);
}

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 20px 168px; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* header illustration */
.hero {
  position: relative;
  padding: 28px 0 8px;
  text-align: center;
}
.sky-art {
  width: 100%;
  height: 220px;
  display: block;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 6vw, 52px);
  letter-spacing: 2px;
  margin-top: -36px;
  color: #5b3a2e;
  text-shadow: 2px 3px 0 #ffe1c4;
}
.hero .sub {
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 8px;
}
.chip {
  background: var(--paper);
  border: 2px solid #f0dcc8;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  box-shadow: 0 4px 0 #f0dcc8;
}
.chip strong { color: var(--coral); font-weight: 700; }
.chip-link {
  text-decoration: none;
  color: var(--ink);
  background: #d7f0ea;
  border-color: #7eb89a;
  box-shadow: 0 4px 0 #7eb89a;
}
.hero-compact { padding: 36px 0 12px; }
.hero-compact h1 { margin-top: 0; }
.extras-page .footer a { color: var(--coral); }
.footer a { color: var(--coral); font-weight: 700; }

.nav {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px 0 24px;
}
.nav a {
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid #efd8c2;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 0 #efd8c2;
}
.nav a:hover { transform: translateY(-1px); }

.section-title {
  font-family: var(--display);
  font-size: 28px;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title span.dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 3px 3px 0 #f7b7a3;
}

.day-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, #ffe3c4, #fff6ea);
  border-radius: 22px;
  padding: 14px 18px;
  margin: 22px 0 14px;
  border: 2px dashed #f0c14b;
}
.day-banner.two {
  background: linear-gradient(90deg, #d7f0ea, #fff6ea);
  border-color: #7eb89a;
}
.day-banner h2 {
  font-family: var(--display);
  font-size: 24px;
}
.day-banner p { color: var(--muted); font-size: 13px; }

.timeline { position: relative; padding-left: 8px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 35px;
  top: 20px;
  bottom: 20px;
  width: 4px;
  background: repeating-linear-gradient(#f0c14b, #f0c14b 8px, transparent 8px, transparent 14px);
  border-radius: 4px;
}

.card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px 18px 16px 78px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
  border: 2px solid #f3e2d0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  scroll-margin-bottom: 110px;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(90,55,40,.16); }
.badge {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #ffe8c8;
}
.card h3 { font-size: 20px; line-height: 1.3; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pill {
  font-size: 12px;
  background: #fff3e4;
  color: #8a4b32;
  border-radius: 999px;
  padding: 3px 10px;
}
.pill.time { background: #ffe0d4; }
.pill.role { background: #d9f3ea; color: #2d6a55; }
.addr { font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 4px 0 #c44d42;
}
.btn.sage { background: var(--sage); box-shadow: 0 4px 0 #5c9278; }
.btn.sky { background: var(--sky-deep); box-shadow: 0 4px 0 #5d93a3; }
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 2px solid #efd8c2;
  box-shadow: 0 3px 0 #efd8c2;
}
.btn:active { transform: translateY(2px); box-shadow: none; }

.preview { font-size: 14px; color: #5c463a; margin-top: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters button {
  font-family: inherit;
  border: 2px solid #efd8c2;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.filters button.on { background: #ffe3c4; border-color: #f0c14b; font-weight: 700; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.mini {
  background: var(--paper);
  border: 2px solid #f3e2d0;
  border-radius: 22px;
  padding: 14px;
  cursor: pointer;
  min-height: 140px;
}
.mini .cat { font-size: 12px; color: var(--coral); font-weight: 700; }
.mini h4 { font-size: 16px; margin: 4px 0 6px; }
.mini p { font-size: 12px; color: var(--muted); }

.notes {
  background: #fff8e6;
  border: 2px dashed #f0c14b;
  border-radius: 22px;
  padding: 18px 20px;
}
.notes li { margin: 6px 0 6px 18px; }
.inn-rules {
  margin: 8px 0 0 4px;
  padding-left: 22px;
}
.inn-rules li { margin: 4px 0; }

dialog {
  position: relative;
  border: none;
  border-radius: 28px;
  max-width: 640px;
  width: calc(100% - 24px);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(74, 55, 44, .4); }
.dlg { padding: 22px 22px 20px; }
.dlg .illu { width: 100%; height: 140px; border-radius: 18px; overflow: hidden; margin-bottom: 12px; }
.dlg .illu svg { display: block; }
.dlg h3 { font-family: var(--display); font-size: 26px; }
.dlg .row { margin: 10px 0; font-size: 14px; }
.dlg .label { font-weight: 700; color: #8a4b32; display: block; font-size: 12px; letter-spacing: 1px; }
.close {
  position: absolute;
  right: 12px; top: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: #ffe3c4;
  cursor: pointer;
  font-size: 18px;
}

.footer {
  text-align: center;
  color: var(--muted);
  margin-top: 40px;
  font-size: 13px;
}

.lead { color: var(--muted); margin-bottom: 12px; }

.sun { transform-origin: 590px 48px; animation: sunPulse 5s ease-in-out infinite; }
.map-sun { transform-origin: 720px 50px; animation: sunPulse 5s ease-in-out infinite; }
.cloud-a { animation: drift 22s ease-in-out infinite alternate; }
.cloud-b { animation: drift 28s ease-in-out infinite alternate-reverse; }
.smoke { animation: smokeUp 4.5s ease-in-out infinite; }
@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(28px); }
}
@keyframes smokeUp {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(-8px); opacity: .45; }
}

.map-frame {
  background: #1a2744;
  border: 3px solid #2e4266;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-frame svg { display: block; width: 100%; height: auto; }
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 12px 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.lg {
  display: inline-block;
  width: 22px; height: 4px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.lg.d1 { background: #e56b5d; }
.lg.d2 { background: #7eb89a; }

.highway {
  fill: none;
  stroke: #f0c14b;
  stroke-width: 7;
  stroke-linecap: round;
  opacity: .92;
}
.highway.thin { stroke-width: 4; }

.route {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 7 9;
  stroke-dashoffset: 720;
}
.route.d1 { stroke: #e56b5d; }
.route.d2 { stroke: #5c9278; }
.map-frame.is-in .route { animation: drawRoute 2.4s ease forwards; }
@keyframes drawRoute { to { stroke-dashoffset: 0; } }

.pin { cursor: pointer; }
.pin text.num-text {
  font-family: var(--display);
  font-size: 11px;
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
}
.pin text.pin-name {
  font-family: var(--display);
  font-size: 13px;
  fill: #4a372c;
  text-anchor: middle;
  paint-order: stroke fill;
  stroke: #fffdf8;
  stroke-width: 5px;
  stroke-linejoin: round;
  pointer-events: none;
}
.pin.on .bob { animation: pinPop .7s ease; }
.pin.on .num { filter: drop-shadow(0 0 6px #ffd56a); }
@keyframes pinPop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

.xpin { cursor: pointer; transition: opacity .25s ease; }
.xpin.dim { opacity: .22; }
.xpin.on .bob { animation: pinPop .7s ease; }
.xpin text.num-text {
  font-family: var(--display);
  font-size: 9px;
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
}
.xpin text.pin-name {
  font-family: var(--display);
  font-size: 12px;
  fill: #4a372c;
  text-anchor: middle;
  paint-order: stroke fill;
  stroke: #fffdf8;
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}
.xleg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 4px;
}
.xleg i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.moon .face { animation: moonWink 6s ease-in-out infinite; transform-origin: 0px 0px; }
@keyframes moonWink {
  0%, 90%, 100% { transform: scale(1); }
  95% { transform: scale(1.05); }
}

.card {
  opacity: 0;
  transform: translateY(14px);
}
.card.in {
  opacity: 1;
  transform: none;
  transition: opacity .5s ease, transform .5s ease, box-shadow .15s ease;
}

.nextbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(640px, calc(100% - 20px));
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fffdf8;
  border: 2px solid #efd8c2;
  border-radius: 22px;
  padding: 10px 12px 10px 10px;
  box-shadow: 0 14px 30px rgba(74, 55, 44, .18);
}
.next-icon {
  width: 48px; height: 48px;
  border-radius: 16px;
  background: #ffe8c8;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.next-copy { flex: 1; min-width: 0; line-height: 1.25; }
.next-copy small { display: block; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.next-copy strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-copy span { font-size: 12px; color: #8a4b32; }
.nextbar.done .btn { background: #cbb7a8; box-shadow: none; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .sun, .map-sun, .moon .face, .cloud-a, .cloud-b, .smoke, .pin.on .bob, .xpin.on .bob, .map-frame.is-in .route { animation: none; }
  .card { opacity: 1; transform: none; }
  .route { stroke-dashoffset: 0; }
}

@media (max-width: 640px) {
  .card { padding: 16px 14px 14px 70px; }
  .timeline::before { left: 31px; }
  .hero h1 { margin-top: -20px; }
  .nextbar { bottom: 10px; }
}
