/* ============================================================
   首頁、劇場地圖、關卡介紹與結算畫面
   ============================================================ */

/* ---------- 首頁 ---------- */
.home-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: clamp(22px, 4.5vw, 58px);
  align-items: center;
  min-height: calc(100dvh - var(--header-h) - var(--footer-h) - 110px);
}
.home-copy { min-width: 0; padding: 6px 0; }
.home-title {
  margin: 12px 0 18px;
  font-family: var(--serif);
  font-size: clamp(48px, 7.6vw, 88px);
  font-weight: 900;
  line-height: .98;
  letter-spacing: .08em;
  color: #fff8ea;
  text-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
.home-title span { display: block; }
.home-title span:last-child {
  color: var(--gold-2);
  text-shadow: 0 0 34px rgba(233, 196, 106, .22), 0 12px 30px rgba(0, 0, 0, .3);
}
.home-lead {
  max-width: 47ch;
  color: #ded4ea;
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.9;
}
.home-lead strong { color: var(--gold-2); font-weight: 800; }
.home-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.home-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.home-note { margin-top: 12px; color: #b9aecb; font-size: 12px; letter-spacing: .04em; }
.home-art { min-width: 0; }
.art-frame {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(233, 196, 106, .55);
  border-radius: 28px;
  background: linear-gradient(150deg, rgba(246, 223, 166, .18), rgba(76, 47, 115, .24));
  box-shadow: var(--shadow);
}
.art-frame::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 27px;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 231, 170, .22), transparent 58%);
}
.art-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 19px;
  position: relative;
}
.art-badge {
  position: absolute;
  left: 22px;
  bottom: 22px;
  padding: 6px 12px;
  border: 1px solid rgba(233, 196, 106, .6);
  border-radius: 999px;
  background: rgba(26, 14, 39, .84);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  backdrop-filter: blur(8px);
}
.art-caption { margin-top: 11px; color: #cbbfe0; font-size: 12.5px; text-align: right; line-height: 1.5; }
.home-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: clamp(24px, 4vw, 42px);
  padding-top: 16px;
  border-top: 1px solid rgba(233, 196, 106, .22);
  color: #cdc2dd;
  font-size: 12.5px;
}
.home-zones span { display: inline-flex; align-items: center; gap: 8px; }
.home-zones b { color: var(--gold); font-size: 11px; letter-spacing: .08em; }

/* ---------- 地圖 ---------- */
.map-shell { max-width: 1180px; margin: 0 auto; }
.map-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.map-head > div:first-child { min-width: 0; }
.map-head h1,
.intro-body h1,
.result-card h1 {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.2;
}
.map-head h1 { margin: 6px 0 6px; font-size: clamp(34px, 4.6vw, 54px); color: #fff8ea; }
.map-lead { max-width: 58ch; color: #cdc2dd; font-size: 13.5px; line-height: 1.7; }
.map-stars {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex: none;
  padding: 10px 15px;
  border: 1px solid rgba(233, 196, 106, .36);
  border-radius: 16px;
  background: rgba(251, 246, 236, .07);
  color: var(--gold-2);
}
.map-stars strong { font-family: var(--serif); font-size: 29px; line-height: 1; }
.map-stars span { font-size: 11.5px; }
.zone-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.zone-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(233, 196, 106, .3);
  border-top: 5px solid var(--zone-color);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 44px rgba(10, 5, 18, .24);
}
.zone-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  background: linear-gradient(115deg, color-mix(in srgb, var(--zone-color) 18%, #fffdf8), #fffdf8 72%);
  border-bottom: 1px solid #eadfce;
}
.zone-emoji {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--zone-color) 36%, #fffdf8);
  border-radius: 13px;
  background: #fffdf8;
  font-size: 23px;
  line-height: 1;
}
.zone-head h2 { font-family: var(--serif); font-size: 20px; line-height: 1.3; letter-spacing: .03em; }
.zone-head p { color: var(--ink-2); font-size: 11px; line-height: 1.4; }
.zone-count {
  margin-left: auto;
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--zone-color) 12%, #fffdf8);
  color: color-mix(in srgb, var(--zone-color) 68%, #2a2433);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.level-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 13px; }
.level-node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 124px;
  padding: 10px 11px;
  border: 1px solid #e6dac7;
  border-radius: 13px;
  background: #fffdf8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.level-node:hover {
  transform: translateY(-2px);
  border-color: var(--zone-color);
  box-shadow: 0 8px 20px rgba(43, 28, 77, .13);
}
.level-node__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
.level-node__num { color: var(--ink-3); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }
.level-node__stars { color: #d4c7b4; font-size: 11.5px; letter-spacing: 1px; line-height: 1; white-space: nowrap; }
.level-node.is-complete .level-node__stars { color: #c9972f; }
.level-node__emoji { margin: 5px 0 2px; font-size: 23px; line-height: 1.15; }
.level-node__name {
  display: block;
  width: 100%;
  color: #322a3b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.42;
  overflow-wrap: anywhere;
}
.level-node__flag { display: block; margin-top: auto; padding-top: 4px; color: var(--ink-3); font-size: 10px; line-height: 1.4; }
.level-node.is-complete { background: #fffaee; border-color: #e2c47f; }
.level-node.is-complete .level-node__flag { color: #96702e; }
.level-node.is-locked { background: #f3efe7; border-style: dashed; opacity: .68; }
.level-node.is-locked:hover { transform: none; border-color: #d2c6b4; box-shadow: none; }
.level-node.is-locked .level-node__emoji { filter: grayscale(1); opacity: .6; }
.level-node.is-locked .level-node__flag { color: #857b88; }
.map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 13px;
  border-top: 1px solid rgba(233, 196, 106, .2);
}
.map-foot p { color: #b9aecb; font-size: 12px; line-height: 1.5; }

/* ---------- 關卡介紹 ---------- */
.intro-shell { max-width: 1020px; margin: 0 auto; }
.intro-card {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(233, 196, 106, .62);
  border-radius: 26px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.intro-art { position: relative; min-height: 100%; background: var(--plum-2); }
.intro-art img { display: block; width: 100%; height: 100%; min-height: 100%; object-fit: cover; }
.intro-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 58%, rgba(255, 253, 248, .16));
}
.intro-num {
  position: absolute;
  left: 15px;
  top: 15px;
  z-index: 1;
  padding: 6px 11px;
  border: 1px solid rgba(233, 196, 106, .65);
  border-radius: 999px;
  background: rgba(26, 14, 39, .84);
  color: var(--gold-2);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
}
.intro-body { min-width: 0; padding: clamp(20px, 3.6vw, 38px); }
.intro-body .eyebrow { color: #9a6b2f; letter-spacing: .12em; }
.intro-body h1 { margin: 5px 0 12px; font-size: clamp(30px, 4vw, 43px); color: var(--plum); overflow-wrap: anywhere; }
.intro-concept {
  padding-left: 12px;
  border-left: 3px solid var(--gold);
  color: #4b4255;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.75;
}
.intro-story {
  margin-top: 15px;
  padding: 13px 15px;
  border: 1px solid #e8d9be;
  border-radius: 14px;
  background: #faf1df;
  color: #5a4b3d;
  font-size: 13.5px;
  line-height: 1.85;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid #e2d5c1;
  border-radius: 999px;
  background: #f8f2e7;
  color: #6a5b4b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.intro-tips { margin-top: 17px; }
.intro-tips h2 { color: var(--plum); font-size: 13px; letter-spacing: .06em; }
.intro-tips ul { margin-top: 4px; list-style: none; }
.intro-tips li {
  position: relative;
  padding: 3px 0 3px 19px;
  color: #4f4559;
  font-size: 13.5px;
  line-height: 1.65;
}
.intro-tips li::before { content: "✦"; position: absolute; left: 1px; top: 3px; color: #b8862e; font-size: 11px; }
.intro-fact {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #cfe2d2;
  border-radius: 11px;
  background: #eff7f0;
  color: #41664c;
  font-size: 12.5px;
  line-height: 1.7;
}
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.intro-actions .btn--ghost { border-color: #d7c8b1; background: #fff; color: var(--ink); }
.intro-actions .btn--ghost:hover { background: #f6eddd; }

/* ---------- 結算 ---------- */
.result-shell { max-width: 800px; margin: 0 auto; }
.result-card {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid rgba(233, 196, 106, .7);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(246, 223, 166, .5), transparent 45%),
    var(--paper);
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow);
}
.result-card .eyebrow { color: #9a6b2f; }
.stars--big { display: flex; justify-content: center; gap: 6px; margin: 12px 0 6px; font-size: clamp(46px, 8vw, 66px); line-height: 1.1; color: #ddd2c0; }
.star { display: inline-block; }
.star.is-on { color: #d7a63b; text-shadow: 0 4px 0 #b98523, 0 8px 20px rgba(215, 166, 59, .28); animation: star-pop .55s cubic-bezier(.2, .9, .3, 1.4) both; }
.star:nth-child(2) { animation-delay: .12s; }
.star:nth-child(3) { animation-delay: .24s; }
.result-card h1 { margin: 4px 0 8px; font-size: clamp(32px, 5vw, 48px); color: var(--plum); }
.result-message { max-width: 54ch; margin: 0 auto; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 22px 0 16px; }
.result-stats div { padding: 10px 8px; border: 1px solid #e8dccb; border-radius: 13px; background: #faf4e9; }
.result-stats span { display: block; color: var(--ink-2); font-size: 10.5px; line-height: 1.4; }
.result-stats strong { display: block; margin-top: 2px; color: var(--plum); font-size: 20px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.fact-box { padding: 12px 14px; border: 1px solid #e4d7c2; border-radius: 13px; background: #f3eadb; text-align: left; }
.fact-box strong { color: #8a5c2b; font-size: 11px; letter-spacing: .08em; }
.fact-box p { margin-top: 2px; color: #584b3e; font-size: 12.5px; line-height: 1.7; }
.finale-note { margin-top: 12px; padding: 10px 13px; border: 1px solid #c9dfcc; border-radius: 12px; background: #ecf7ed; color: #356544; font-size: 13px; font-weight: 700; line-height: 1.65; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 20px; }
.result-actions .btn--ghost { border-color: #d7c8b1; background: #fff; color: var(--ink); }
.result-actions .btn--ghost:hover { background: #f6eddd; }

/* ---------- 平板與手機 ---------- */
@media (max-width: 1080px) {
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .home-wrap { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
  .home-copy { padding-top: 4px; }
  .home-title { font-size: clamp(44px, 10vw, 68px); }
  .home-art { max-width: 620px; width: 100%; margin: 0 auto; }
  .zone-list { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .intro-card { grid-template-columns: 1fr; }
  .intro-art { min-height: 0; }
  .intro-art img { height: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .intro-art::after { background: linear-gradient(180deg, transparent 60%, rgba(255, 253, 248, .18)); }
  .map-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .map-stars { align-self: flex-start; }
}
@media (max-width: 640px) {
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px; }
  .zone-head { padding: 11px 12px; }
  .zone-head h2 { font-size: 18px; }
  .zone-emoji { width: 38px; height: 38px; font-size: 20px; }
  .level-node { min-height: 120px; padding: 9px 10px; }
  .level-node__name { font-size: 12.5px; }
  .map-foot { justify-content: flex-start; }
  .home-actions .btn { flex: 1 1 auto; }
  .home-zones { gap: 6px 14px; font-size: 11.5px; }
  .result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-actions .btn { flex: 1 1 100%; }
}
@media (max-width: 380px) {
  .home-title { font-size: 42px; letter-spacing: .04em; }
  .home-lead { font-size: 14px; }
  .home-actions { gap: 8px; }
  .home-actions .btn { flex-basis: 100%; }
  .art-badge { left: 15px; bottom: 15px; font-size: 10.5px; }
  .intro-body { padding: 18px; }
  .intro-body h1 { font-size: 28px; }
  .result-card { padding: 20px 15px; }
  .result-stats strong { font-size: 18px; }
  .level-node__stars { font-size: 10px; }
}
