:root {
  --paper: #f4efe4;
  --paper-deep: #e8decb;
  --ink: #1d2d29;
  --ink-soft: #58625e;
  --green: #173f35;
  --green-bright: #285b4d;
  --wine: #8d3e43;
  --wine-dark: #662b31;
  --gold: #b58a45;
  --line: rgba(29, 45, 41, 0.2);
  --white: #fffdf8;
  --shadow: 0 24px 70px rgba(49, 39, 25, 0.16);
  --radius: 6px;
  --serif: "Songti TC", "Noto Serif TC", "PMingLiU", serif;
  --sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 1024px;
  color: var(--ink);
  background:
    linear-gradient(rgba(29, 45, 41, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 45, 41, 0.02) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  font-family: var(--sans);
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.45;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
}

button,
input {
  font: inherit;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(181, 138, 69, 0.75);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--white);
  background: var(--green);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(32px, 5vw, 76px);
  border-bottom: 1px solid rgba(244, 239, 228, 0.14);
  color: var(--white);
  background: rgba(23, 63, 53, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 253, 248, 0.48);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 22px;
}

.brand small,
.brand strong {
  display: block;
}

.brand small {
  color: rgba(255, 253, 248, 0.66);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.brand strong {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.12em;
}

.route-status {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.route-status span:first-child {
  color: rgba(255, 253, 248, 0.72);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(460px, 0.9fr) minmax(520px, 1.1fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 76px clamp(52px, 7vw, 116px) 118px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  position: absolute;
  top: 0;
  right: 12%;
  width: 1px;
  height: 100%;
  content: "";
  background: rgba(29, 45, 41, 0.08);
}

.eyebrow,
.section-index {
  margin: 0 0 18px;
  color: var(--wine);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 6.5vw, 98px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero h1 em {
  display: block;
  color: var(--wine);
  font-size: 0.82em;
  font-style: normal;
  white-space: nowrap;
}

.hero-lead {
  max-width: 560px;
  margin: 34px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  gap: 0;
  margin-top: 36px;
  font-size: 13px;
}

.hero-meta span {
  padding: 0 20px;
  border-left: 1px solid var(--line);
}

.hero-meta span:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-meta b {
  margin-right: 5px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 22px;
}

.ticket-gate {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 460px;
  padding-top: 120px;
}

.gate-slot {
  position: absolute;
  top: 18px;
  display: grid;
  width: min(430px, 90%);
  height: 80px;
  place-items: center;
  color: rgba(255, 253, 248, 0.65);
  border: 10px solid var(--green);
  border-radius: 3px;
  background: #0d2c24;
  box-shadow: inset 0 10px 16px rgba(0, 0, 0, 0.34), 0 12px 30px rgba(29, 45, 41, 0.16);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.gate-slot.is-ready {
  color: var(--white);
  border-color: var(--gold);
}

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 112px 1fr;
  width: min(530px, 100%);
  min-height: 230px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 0;
  border-radius: 4px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: grab;
  text-align: left;
  transform: rotate(-2deg);
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 440ms ease;
}

.ticket::before,
.ticket::after {
  position: absolute;
  left: 99px;
  z-index: 3;
  width: 24px;
  height: 24px;
  content: "";
  border-radius: 50%;
  background: var(--paper);
  transform: translateX(-50%);
}

.ticket::before {
  top: -12px;
}

.ticket::after {
  bottom: -12px;
}

.ticket:hover {
  box-shadow: 0 30px 80px rgba(49, 39, 25, 0.23);
  transform: translateY(-6px) rotate(-1deg);
}

.ticket:active {
  cursor: grabbing;
}

.ticket.is-punched {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-150px) scale(0.92);
}

.ticket-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px 12px;
  color: var(--white);
  border-right: 1px dashed rgba(255, 255, 255, 0.4);
  background: var(--wine);
}

.ticket-side small {
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.ticket-side b {
  font-family: var(--serif);
  font-size: 34px;
}

.ticket-main {
  display: flex;
  flex-direction: column;
  padding: 28px 32px 24px;
}

.ticket-label {
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.ticket-main strong {
  max-width: 310px;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.35;
}

.ticket-route {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  font-size: 13px;
}

.ticket-route i {
  position: relative;
  display: block;
  width: 90px;
  height: 1px;
  background: var(--line);
}

.ticket-route i::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--gold);
}

.ticket-number {
  margin-top: auto;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.ticket-gate > p {
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.train-line {
  position: absolute;
  right: 0;
  bottom: 46px;
  left: 0;
  display: flex;
  align-items: center;
}

.train-engine {
  position: relative;
  z-index: 2;
  display: grid;
  width: 54px;
  height: 38px;
  margin-left: 7%;
  place-items: center;
  color: var(--white);
  border-radius: 4px 12px 3px 3px;
  background: var(--green);
  font-family: var(--serif);
  transition: transform 1.8s cubic-bezier(.2,.75,.15,1);
}

body:not(.is-locked) .train-engine {
  transform: translateX(78vw);
}

.track {
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  border-top: 1px dashed rgba(29, 45, 41, 0.42);
}

.intro-panel {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 80px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 120px 64px 110px;
  border-bottom: 1px solid var(--line);
}

.intro-panel h2,
.station-title h2,
.finale h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 4.2vw, 68px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.intro-copy {
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 17px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.button-primary {
  color: var(--white);
  background: var(--green);
}

.button-primary:hover {
  background: var(--green-bright);
}

.button-ghost {
  border-color: currentColor;
  background: transparent;
}

.station-nav {
  position: sticky;
  top: 72px;
  z-index: 15;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 228, 0.94);
  backdrop-filter: blur(8px);
}

.station-nav-track {
  display: flex;
  gap: 4px;
  align-items: stretch;
  overflow-x: auto;
  padding: 10px clamp(32px, 5vw, 72px);
  scrollbar-width: thin;
}

.station-link {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 8px 12px;
  color: var(--ink-soft);
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  cursor: default;
  text-align: left;
}

.station-link small,
.station-link strong {
  display: block;
}

.station-link small {
  font-size: 9px;
  letter-spacing: 0.12em;
}

.station-link strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-link.is-active {
  color: var(--wine);
}

.station-link.is-complete::after {
  display: none;
  content: none;
}

.station-nav-state {
  display: block;
  margin-top: 3px;
  color: rgba(31, 45, 40, 0.48);
  font-size: 9px;
  font-weight: 700;
}

.station-link.is-active .station-nav-state {
  color: var(--wine);
}

.station-link.is-complete .station-nav-state {
  color: var(--green);
}

.stations {
  opacity: 1;
  transition: opacity 380ms ease;
}

.is-locked .stations,
.is-locked .station-nav,
.is-locked .finale {
  opacity: 0.3;
  pointer-events: none;
}

.station {
  padding: 110px clamp(48px, 7vw, 116px) 120px;
  border-bottom: 1px solid var(--line);
}

.station:not(.is-current) {
  display: none;
}

.station-progress {
  display: flex;
  max-width: 1440px;
  justify-content: space-between;
  margin: 0 auto 38px;
  color: var(--wine);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding-bottom: 14px;
}

.station:nth-child(even) {
  background: rgba(255, 253, 248, 0.48);
}

.station-head {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 72px;
  max-width: 1440px;
  margin: 0 auto 64px;
}

.station-title {
  position: sticky;
  top: 166px;
  align-self: start;
}

.station-title .period {
  display: block;
  margin-top: 22px;
  color: var(--wine);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.station-story {
  color: var(--ink-soft);
  font-size: 17px;
}

.station-story .lead {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.55;
}

.location-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.location-list li {
  padding: 5px 11px;
  color: var(--green);
  border: 1px solid rgba(23, 63, 53, 0.25);
  border-radius: 999px;
  font-size: 12px;
}

.photo-wall {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  max-width: 1440px;
  margin: 0 auto;
}

.photo-card {
  position: relative;
  grid-column: span 3;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--paper-deep);
  cursor: zoom-in;
}

.photo-card:nth-child(7n + 1),
.photo-card.is-featured {
  grid-column: span 6;
  grid-row: span 2;
  aspect-ratio: auto;
}

.photo-card:nth-child(11n + 4) {
  grid-column: span 3;
  grid-row: span 2;
  aspect-ratio: auto;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 500ms ease, transform 600ms ease;
}

.photo-card img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.photo-card::after {
  position: absolute;
  inset: auto 0 0;
  padding: 36px 12px 10px;
  color: var(--white);
  content: attr(data-caption);
  opacity: 0;
  background: linear-gradient(transparent, rgba(13, 35, 29, 0.72));
  font-size: 11px;
  text-align: left;
  transition: opacity 200ms ease;
}

.photo-card:hover::after {
  opacity: 1;
}

.photo-note {
  position: absolute;
  right: 10px;
  bottom: 9px;
  left: 10px;
  z-index: 1;
  display: grid;
  gap: 2px;
  padding: 10px;
  color: var(--white);
  background: rgba(13, 35, 29, 0.68);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.photo-note b {
  color: #e5c581;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.station-interaction {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  max-width: 1060px;
  margin: 64px auto 0;
}

.game-card {
  grid-row: span 2;
  min-height: 360px;
  padding: 34px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.78);
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}

.station-interaction.is-ready .game-card {
  opacity: 1;
  pointer-events: auto;
}

.game-card small {
  color: var(--wine);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.game-card h3 {
  margin: 12px 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.38;
}

.game-card > p {
  max-width: 430px;
}

.drag-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 36px;
}

.memory-tag,
.memory-slot {
  min-height: 110px;
  padding: 18px;
  color: var(--green);
  border: 1px dashed rgba(23, 63, 53, 0.45);
  background: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
}

.memory-tag {
  cursor: grab;
  transform: rotate(-3deg);
}

.memory-slot {
  display: grid;
  place-items: center;
  color: var(--wine);
  text-align: center;
  transform: rotate(2deg);
}

.flip-row {
  display: flex;
  gap: 10px;
  margin-top: 34px;
}

.flip-card {
  display: grid;
  min-width: 110px;
  min-height: 140px;
  place-items: center;
  padding: 14px;
  color: var(--white);
  border: 0;
  background: var(--wine);
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease;
}

.flip-card:nth-child(2) { transform: translateY(12px); }
.flip-card:nth-child(3) { transform: translateY(3px); }
.flip-card b { display: none; color: var(--green); font-family: var(--serif); font-size: 16px; }
.flip-card.is-flipped { color: var(--green); background: var(--paper); transform: translateY(-5px) rotate(-2deg); }
.flip-card.is-flipped b { display: block; }
.flip-card.is-flipped span { display: none; }

.hold-ticket {
  position: relative;
  min-width: 270px;
  min-height: 84px;
  margin-top: 34px;
  overflow: hidden;
  color: var(--green);
  border: 1px solid var(--green);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 17px;
}

.hold-ticket i {
  position: absolute;
  inset: auto 0 0;
  display: block;
  width: 0;
  height: 7px;
  background: var(--wine);
}

.hold-ticket.is-holding i { width: 100%; transition: width 1100ms linear; }

.sequence-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 34px;
}

.sequence-row button {
  min-height: 46px;
  padding: 10px 15px;
  color: var(--green);
  border: 1px solid rgba(23, 63, 53, 0.36);
  background: transparent;
  cursor: pointer;
}

.sequence-row button.is-picked,
.game-card.is-complete .memory-slot {
  color: var(--white);
  background: var(--green);
}

.game-result {
  min-height: 28px;
  margin-top: 26px;
  color: var(--wine);
  font-family: var(--serif);
}

.photo-checkpoint {
  display: flex;
  max-width: 860px;
  gap: 16px;
  align-items: center;
  margin: 42px auto 0;
  padding: 20px 24px;
  color: var(--ink-soft);
  border: 1px dashed rgba(23, 63, 53, 0.35);
  background: rgba(255, 253, 248, 0.55);
}

.checkpoint-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--wine);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
}

.photo-checkpoint b,
.photo-checkpoint p { margin: 0; }
.photo-checkpoint p { margin-top: 4px; font-size: 13px; }
.photo-checkpoint.is-seen { color: var(--green); border-style: solid; }

/* 精選版互動：只留下少量、每站不同的小畫面。 */
body.is-unlocked .intro-panel { display: none; }

.micro-card {
  grid-row: span 2;
  min-height: 360px;
  padding: 34px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.78);
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease, background 250ms ease;
}

.station-interaction.is-ready .micro-card {
  opacity: 1;
  pointer-events: auto;
}

.micro-card small {
  color: var(--wine);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.micro-card h3 {
  margin: 12px 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.38;
}

.micro-card > p { max-width: 430px; }

.micro-result {
  min-height: 26px;
  margin-top: 24px;
  color: var(--wine);
  font-family: var(--serif);
}

.puzzle-board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  max-width: 380px;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--green);
  background: var(--green);
}

.puzzle-board button {
  min-height: 110px;
  border: 0;
  color: var(--green);
  background: var(--paper);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 20px;
  transition: transform 260ms ease, color 260ms ease, background 260ms ease;
}

.puzzle-board button:first-child { transform: translateX(-18px); }
.puzzle-board button:last-of-type { transform: translateX(18px); }
.puzzle-board button.is-placed { color: var(--white); background: var(--wine); transform: translateX(0); }
.puzzle-board span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  opacity: 0;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.2em;
  pointer-events: none;
  transition: opacity 260ms ease;
}
.micro-card.is-complete .puzzle-board span { opacity: 1; }

.love-button,
.peel-photo,
.signal-button,
.window-button {
  position: relative;
  display: grid;
  min-width: 270px;
  min-height: 104px;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--green);
  background: var(--paper);
  cursor: pointer;
}

.love-button { place-items: center; color: var(--wine); font-family: var(--serif); }
.love-button b { position: absolute; color: var(--green); opacity: 0; font-size: 27px; letter-spacing: 0.05em; }
.love-button.is-written span { opacity: 0; }
.love-button.is-written b { opacity: 1; animation: love-write 900ms steps(7, end); }
@keyframes love-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.peel-photo {
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--wine), #bc7c68);
  font-family: var(--serif);
}
.peel-photo::after { position: absolute; top: -1px; right: -1px; width: 92px; height: 92px; content: ""; background: var(--paper); clip-path: polygon(100% 0, 0 0, 100% 100%); transition: transform 500ms ease; }
.peel-photo b { position: absolute; opacity: 0; font-size: 21px; transition: opacity 250ms ease 260ms; }
.peel-photo.is-peeled span { opacity: 0; }
.peel-photo.is-peeled::after { transform: translate(95px, -95px); }
.peel-photo.is-peeled b { opacity: 1; }

.signal-button { grid-template-columns: 74px 1fr; align-items: center; padding: 14px 20px; color: var(--green); text-align: left; }
.signal-button i { width: 42px; height: 42px; border: 8px solid var(--ink-soft); border-radius: 50%; background: var(--wine); box-shadow: 0 0 0 rgba(90, 184, 110, 0); transition: background 250ms ease, box-shadow 250ms ease; }
.signal-button.is-green i { background: #54ad67; box-shadow: 0 0 26px rgba(84, 173, 103, 0.8); }

.window-button { place-items: center; color: var(--white); background: linear-gradient(130deg, #86bfca, #26586a); font-family: var(--serif); }
.window-button::before,
.window-button::after { position: absolute; top: 0; bottom: 0; width: 51%; content: ""; background: var(--green); transition: transform 650ms cubic-bezier(.2,.8,.2,1); }
.window-button::before { left: 0; border-right: 1px solid rgba(255,255,255,.3); }
.window-button::after { right: 0; border-left: 1px solid rgba(255,255,255,.3); }
.window-button b { position: relative; z-index: 1; opacity: 0; font-size: 24px; transition: opacity 250ms ease 350ms; }
.window-button.is-open span { opacity: 0; }
.window-button.is-open::before { transform: translateX(-102%); }
.window-button.is-open::after { transform: translateX(102%); }
.window-button.is-open b { opacity: 1; }

.auto-motion {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 390px;
  margin-top: 42px;
  padding: 14px 0;
  border-bottom: 1px dashed rgba(23, 63, 53, 0.45);
  color: var(--wine);
}
.auto-motion span { width: 28px; height: 18px; border-radius: 10px 3px 3px 10px; background: var(--wine); }
.auto-motion i { font-style: normal; }
.micro-card.is-playing .auto-motion span { animation: train-roll 850ms ease-in-out both; }
.micro-card.is-playing .auto-motion i { animation: fade-in 400ms ease both; }
@keyframes train-roll { 0% { transform: translateX(0); } 70% { transform: translateX(300px); opacity: 1; } 100% { transform: translateX(330px); opacity: 0; } }
@keyframes fade-in { from { opacity: .2; } to { opacity: 1; } }

.stamp-status {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 10px;
  color: var(--ink-soft);
  border: 1px dashed currentColor;
  font-size: 12px;
}
.stamp-card.is-stamping .stamp-status { color: var(--wine); animation: stamp-pulse 850ms ease-in-out infinite; }
.stamp-card.is-stamping { opacity: 1; }
.stamp-card.is-stamped .stamp-status { color: var(--white); border-style: solid; background: var(--green); }
.stamp-card.is-stamped .stamp-status::after { content: "・已蓋章"; }
.stamp-card.is-stamped::after { content: "已抵達"; color: rgba(23, 63, 53, 0.5); }
@keyframes stamp-pulse { 50% { transform: scale(1.05); } }

.prompt-card,
.stamp-card {
  min-height: 230px;
  padding: 32px;
  border: 1px solid var(--line);
  background: var(--white);
}

.prompt-card,
.stamp-card {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.prompt-card.is-ready,
.stamp-card.is-stamped,
.stamp-card:has(.stamp-button:not(:disabled)) {
  opacity: 1;
  pointer-events: auto;
}

.stamp-help {
  min-height: 40px;
  margin: -10px 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
}

.stamp-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.station-complete {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 760px;
  margin: 58px auto 0;
  padding: 42px;
  color: var(--white);
  background: var(--green);
  text-align: center;
}

.station-complete[hidden] { display: none !important; }

.station-complete p {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
}

.station-complete .button-primary {
  color: var(--green);
  background: var(--paper);
}

.prompt-card small,
.stamp-card small {
  color: var(--wine);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.prompt-card h3,
.stamp-card h3 {
  margin: 12px 0 24px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.4;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-button {
  min-height: 42px;
  padding: 9px 14px;
  color: var(--green);
  border: 1px solid rgba(23, 63, 53, 0.3);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.choice-button:hover,
.choice-button.is-selected {
  color: var(--white);
  background: var(--green);
}

.response-line {
  min-height: 26px;
  margin: 18px 0 0;
  color: var(--wine);
  font-family: var(--serif);
  font-size: 15px;
}

.stamp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.stamp-card::after {
  position: absolute;
  right: 24px;
  bottom: 20px;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  content: "未完成";
  color: rgba(141, 62, 67, 0.46);
  border: 3px double currentColor;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  transform: rotate(-12deg);
}

.stamp-card.is-stamped::after {
  content: "到此一遊";
  color: var(--wine);
}

.stamp-button {
  align-self: flex-start;
}

.finale {
  display: grid;
  grid-template-columns: minmax(520px, 1.1fr) minmax(420px, 0.9fr);
  gap: 80px;
  align-items: start;
  padding: 130px clamp(64px, 8vw, 140px);
  color: var(--white);
  background: var(--green);
}

#finale[hidden] {
  display: none !important;
}

.finale-card {
  max-width: 700px;
}

.finale .section-index {
  color: #d8b977;
}

.finale-card > p:not(.section-index) {
  max-width: 650px;
  color: rgba(255, 253, 248, 0.74);
  font-size: 18px;
}

.finale-turn {
  color: var(--white) !important;
  font-family: var(--serif);
  font-size: 22px !important;
}

.future-choice {
  display: grid;
  gap: 10px;
  margin: 34px 0 0;
  padding: 22px;
  border: 1px solid rgba(255, 253, 248, 0.25);
}

.future-choice legend {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.future-choice label {
  display: flex;
  gap: 9px;
  align-items: center;
  color: rgba(255, 253, 248, 0.82);
}

.final-note {
  display: grid;
  gap: 7px;
  margin: 24px 0;
}

.final-note span {
  font-size: 13px;
  font-weight: 700;
}

.final-note input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--white);
  border: 1px solid rgba(255, 253, 248, 0.35);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.06);
}

.final-note input::placeholder {
  color: rgba(255, 253, 248, 0.42);
}

.finale .button-primary {
  color: var(--green);
  background: var(--paper);
}

.future-ticket {
  position: sticky;
  top: 120px;
  padding: 46px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
  transform: rotate(1.2deg);
}

.future-ticket::before {
  position: absolute;
  inset: 14px;
  content: "";
  pointer-events: none;
  border: 1px dashed rgba(29, 45, 41, 0.25);
}

.future-ticket p {
  margin: 0;
  color: var(--wine);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.future-ticket h3 {
  margin: 18px 0 28px;
  font-family: var(--serif);
  font-size: 38px;
}

.future-ticket dl {
  display: grid;
  gap: 14px;
}

.future-ticket dl div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.future-ticket dt {
  color: var(--ink-soft);
  font-size: 12px;
}

.future-ticket dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
}

.lightbox {
  width: min(1120px, calc(100vw - 100px));
  max-width: none;
  height: min(820px, calc(100vh - 70px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  color: var(--white);
  border: 0;
  background: #101b18;
}

.lightbox-effect {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.lightbox-effect i {
  position: absolute;
  left: var(--x);
  bottom: -45px;
  width: 12px;
  height: 12px;
  color: #ead7a6;
  opacity: 0;
  animation: memory-particle 2.2s calc(var(--delay) + .05s) ease-out both;
}

@keyframes memory-particle {
  0% { opacity: 0; transform: translateY(0) scale(.7) rotate(0); }
  25% { opacity: .75; }
  100% { opacity: 0; transform: translateY(-720px) scale(1.25) rotate(28deg); }
}

.effect-paws .lightbox-effect i::before { content: '•'; font-size: 28px; }
.effect-paws .lightbox-effect i:nth-child(3n)::before { content: '🐾'; font-size: 18px; }
.effect-sparkles .lightbox-effect i::before { content: '✦'; font-size: 22px; }
.effect-route .lightbox-effect i { width: 8px; height: 8px; border-radius: 50%; background: #ead7a6; }
.effect-route .lightbox-effect i:nth-child(3n) { width: 28px; height: 14px; border: 1px solid #ead7a6; border-radius: 2px; background: transparent; }
.effect-tickets .lightbox-effect i { width: 27px; height: 14px; border: 1px solid #ead7a6; background: #ead7a61c; transform: rotate(calc(var(--i) * 9deg)); }
.effect-wind .lightbox-effect i,
.effect-waves .lightbox-effect i,
.effect-water .lightbox-effect i { width: 54px; height: 14px; border-top: 2px solid #c9e5dcaa; border-radius: 50%; }

.lightbox::backdrop {
  background: rgba(8, 14, 12, 0.84);
  backdrop-filter: blur(5px);
}

.lightbox figure {
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px 82px 20px;
  position: relative;
  z-index: 1;
}

.lightbox.has-moment figure {
  width: calc(100% - 350px);
  padding-right: 34px;
}

.lightbox img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox figcaption {
  min-height: 34px;
  padding-top: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  text-align: center;
}

.lightbox-moment {
  position: absolute;
  z-index: 3;
  top: 120px;
  right: 55px;
  width: 270px;
  padding: 28px 25px 25px;
  color: #f7f0df;
  border-top: 1px solid #d5b977;
  border-bottom: 1px solid #ffffff29;
  background: #193129e8;
  box-shadow: 0 18px 45px #0004;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .45s ease, transform .45s ease;
}

.lightbox-moment.is-visible { opacity: 1; transform: none; }
.lightbox-moment small { display: block; margin-bottom: 14px; color: #d8bc7d; font: 700 11px/1.4 var(--sans); letter-spacing: .16em; }
.lightbox-moment h3 { margin: 0 0 16px; color: #fffaf0; font: 600 28px/1.25 var(--serif); }
.lightbox-moment p { margin: 0; color: #f7f0dfcc; font: 16px/1.9 var(--serif); }
.lightbox.has-moment .lightbox-next { right: 14px; }

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.lightbox-close {
  top: 18px;
  right: 18px;
  font-size: 24px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-effect i { animation: none; }
  .lightbox-moment { transition: none; }
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  max-width: 360px;
  padding: 13px 18px;
  color: var(--white);
  background: var(--wine-dark);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  padding: 12px 16px;
  color: var(--white);
  background: var(--wine);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
