/* ============================================================
   首頁、關卡地圖、關卡介紹、結算畫面
   ============================================================ */
.screen--home { padding-top: 4px; }
.home {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: clamp(18px, 4vw, 54px); align-items: center; min-height: min(62vh, 600px);
}
.home__text { min-width: 0; }
.home__title {
  margin: 10px 0 14px; font-size: clamp(46px, 7.4vw, 86px); line-height: 1.02;
  letter-spacing: 0.03em; text-wrap: balance;
}
.home__title span { display: block; }
.home__title span:first-child {
  color: #fff; text-shadow: 0 0 34px rgba(255, 200, 87, 0.3);
}
.home__title span:last-child {
  color: transparent; background: linear-gradient(100deg, #ffe7a8 0%, #ffc857 35%, #ff8fbd 68%, #9a8cff 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 16px rgba(255, 95, 162, 0.22));
}
.home__lead { max-width: 34em; color: var(--ink-soft); font-size: clamp(15px, 1.5vw, 18px); }
.home__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.home__progress {
  display: inline-flex; margin-top: 14px; padding: 5px 12px; border-radius: 999px;
  border: 1px dashed rgba(255, 200, 87, 0.45); background: rgba(255, 200, 87, 0.08);
  color: var(--gold-2); font-size: 13px; font-weight: 800;
}
.home__art { position: relative; min-width: 0; }
.home__hero {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42), 0 0 0 7px rgba(255, 255, 255, 0.03);
  background: linear-gradient(145deg, #1b275c, #253573);
}
.hero-fallback {
  min-height: 280px; display: flex; align-items: center; justify-content: center; gap: 16px;
  border-radius: 24px; border: 1px dashed rgba(255, 255, 255, 0.3);
  background: radial-gradient(circle at 50% 30%, rgba(255, 200, 87, 0.18), transparent 60%), #1a2558;
}
.mascot { display: grid; place-items: center; gap: 4px; font-weight: 900; color: var(--ink); font-size: 14px; }
.mascot--pen {
  width: 110px; height: 150px; border-radius: 28px 28px 18px 18px;
  background: linear-gradient(160deg, #ff9ec6, #ff5fa2); border: 3px solid #1a1638;
  position: relative; box-shadow: 0 12px 28px rgba(255, 95, 162, 0.3);
}
.mascot--pen::after { content: ""; position: absolute; bottom: -22px; left: 36px; width: 0; height: 0; border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 24px solid #ffd9e8; }
.mascot--pen .mascot__eye { position: absolute; top: 38px; width: 12px; height: 16px; border-radius: 50%; background: #1a1638; }
.mascot--pen .mascot__eye:first-child { left: 25px; }
.mascot--pen .mascot__eye:nth-child(2) { right: 25px; }
.mascot--pen b { position: absolute; bottom: 18px; }
.mascot--star { font-size: 92px; color: var(--gold); line-height: 1; text-shadow: 0 0 28px rgba(255, 200, 87, 0.55); }
.mascot--star b { font-size: 14px; color: var(--ink); }
.home__ribbon {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.home__ribbon span {
  min-height: 34px; display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.055); border: 1px solid var(--line); color: var(--ink-soft); font-size: 12.5px; font-weight: 700;
}
.home__note {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-top: 18px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(10, 16, 42, 0.45);
}
.home__note p { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.home__note strong { color: var(--ink-soft); }

/* ---------- 共用頁首 ---------- */
.page-head {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 2px 0 10px;
}
.page-head__title { min-width: 0; }
.page-head__title h1 { font-size: clamp(24px, 3.8vw, 38px); line-height: 1.2; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.page-head__title .eyebrow { margin-bottom: 2px; }
.page-head > .pill { justify-self: end; }

/* ---------- 關卡地圖 ---------- */
.map-zones { display: grid; gap: 16px; }
.zone {
  border-radius: 18px; border: 1px solid var(--line); background:
    linear-gradient(135deg, color-mix(in srgb, var(--zone) 13%, transparent), transparent 48%),
    rgba(14, 21, 52, 0.72);
  padding: 14px; overflow: hidden;
}
.zone__head { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.zone__thumb { width: 92px; height: 58px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(135deg, var(--zone), var(--zone2)); }
.zone__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zone__text { min-width: 0; }
.zone__text h2 { font-size: clamp(19px, 2.5vw, 25px); line-height: 1.25; overflow-wrap: anywhere; }
.zone__text p { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-top: 2px; }
.zone__stars { color: var(--gold-2); border-color: color-mix(in srgb, var(--zone) 50%, transparent); }
.zone__levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.level-card {
  width: 100%; min-height: 72px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center; gap: 9px; padding: 8px 10px; text-align: left;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.055); color: var(--ink);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.level-card:hover { background: rgba(255, 255, 255, 0.11); border-color: color-mix(in srgb, var(--zone) 60%, var(--line)); }
.level-card:active { transform: scale(0.99); }
.level-card.is-locked { opacity: 0.56; background: rgba(0, 0, 0, 0.14); }
.level-card__num {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: color-mix(in srgb, var(--zone) 22%, transparent); border: 1px solid color-mix(in srgb, var(--zone) 45%, transparent);
  font-weight: 900; color: #fff; font-size: 14px;
}
.level-card.is-locked .level-card__num { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.level-card__body { min-width: 0; display: grid; gap: 1px; }
.level-card__body strong { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.level-card__body small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.level-card__stars { color: var(--gold); font-size: 12px; letter-spacing: 0.02em; white-space: nowrap; }
.map-actions { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- 關卡介紹 ---------- */
.intro-card {
  width: min(820px, 100%); margin: 4px auto 0; padding: clamp(16px, 3vw, 28px);
  border-radius: 20px; border: 1px solid var(--line); background: var(--panel-2); box-shadow: var(--shadow);
}
.intro-card__concept { font-size: clamp(15px, 1.6vw, 18px); color: var(--ink); line-height: 1.75; }
.story-box {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start;
  margin: 14px 0; padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 200, 87, 0.07); border: 1px solid rgba(255, 200, 87, 0.22);
}
.story-box__who { color: var(--gold-2); font-weight: 900; white-space: nowrap; }
.story-box p { color: var(--ink-soft); font-size: 14px; overflow-wrap: anywhere; }
.intro-card__subtitle { font-size: 13px; letter-spacing: 0.1em; color: var(--cyan); margin: 6px 0 8px; }
.tip-list { display: grid; gap: 7px; }
.tip-list li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; color: var(--ink-soft); font-size: 14px; }
.tip-list li span { color: var(--mint); }
.fact-line { margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 13px; line-height: 1.7; }
.intro-card__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- 結算 ---------- */
.screen--results { display: grid; place-items: center; }
.results-card {
  width: min(660px, 100%); padding: clamp(18px, 3.5vw, 32px); text-align: center;
  border-radius: 22px; border: 1px solid var(--line); background:
    radial-gradient(circle at 50% 0%, rgba(255, 200, 87, 0.16), transparent 55%), var(--panel-2);
  box-shadow: var(--shadow);
}
.results-card h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; margin: 4px 0 8px; letter-spacing: 0.04em; }
.result-stars { color: var(--gold); font-size: clamp(38px, 7vw, 62px); line-height: 1.1; letter-spacing: 0.04em; text-shadow: 0 0 24px rgba(255, 200, 87, 0.35); }
.result-stars--3 { animation: star-glow 1.4s ease-in-out infinite alternate; }
.result-score { font-size: clamp(28px, 4.5vw, 40px); font-weight: 900; color: #fff; margin: 6px 0 12px; }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.result-metrics div { padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }
.result-metrics span { display: block; font-size: 11.5px; color: var(--muted); }
.result-metrics b { display: block; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.result-note { color: var(--ink-soft); font-size: 14px; max-width: 42em; margin: 10px auto; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.result-finale { margin-top: 14px; padding: 10px; border-radius: 10px; background: rgba(255, 200, 87, 0.1); border: 1px solid rgba(255, 200, 87, 0.3); color: var(--gold-2); font-weight: 800; }

@media (max-width: 900px) {
  .home { grid-template-columns: 1fr; min-height: 0; }
  .home__art { order: 2; max-width: 560px; margin: 0 auto; width: 100%; }
  .home__hero { aspect-ratio: 16 / 10; max-height: 330px; }
  .home__note { grid-template-columns: 1fr; }
  .zone__levels { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .page-head { grid-template-columns: 44px minmax(0, 1fr); }
  .page-head > .pill { grid-column: 2; justify-self: start; }
  .zone { padding: 11px; }
  .zone__head { grid-template-columns: 66px minmax(0, 1fr); }
  .zone__thumb { width: 66px; height: 46px; }
  .zone__stars { grid-column: 2; justify-self: start; }
  .zone__text p { font-size: 12px; }
  .level-card { grid-template-columns: 40px minmax(0, 1fr); }
  .level-card__stars { grid-column: 2; }
  .story-box { grid-template-columns: 1fr auto; }
  .story-box__who { grid-column: 1 / -1; }
  .intro-card__actions .btn { flex: 1 1 140px; }
  .result-metrics { grid-template-columns: 1fr; }
  .result-metrics div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; }
  .result-metrics span, .result-metrics b { display: inline; }
  .result-actions .btn { flex: 1 1 140px; }
}
