/* Puwolf 限時情報
   版面：深藍頁首帶 + 淺色內容區；卡片是「掉寶清單」，狀態用小標籤、倒數用等寬數字。
   緊急（剩不到 24 小時）才用朱橘色，其他地方保持安靜。 */
:root {
  --bg: #EEF1F6;
  --surface: #FFFFFF;
  --ink: #151B2E;
  --muted: #5A6378;
  --line: #D5DBE6;
  --band: #11182B;
  --band-ink: #F2F4FA;
  --band-muted: #A5AEC4;
  --accent: #D9481F;
  --accent-soft: #FBE3DA;
  --ok: #1D7349;
  --ok-soft: #DCF1E4;
  --info: #2552B0;
  --info-soft: #E1E9FA;
  --off: #6D7486;
  --off-soft: #E7E9EF;
  --warn: #8A5A00;
  --warn-soft: #FBEFD2;
  --focus: #2552B0;
  --radius: 12px;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-num: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1220; --surface: #161D30; --ink: #E7EBF5; --muted: #9BA4BA; --line: #2A3350;
    --band: #080C17; --band-ink: #F2F4FA; --band-muted: #8E97AE;
    --accent: #FF7A4F; --accent-soft: #3A1E16; --ok: #6FD39C; --ok-soft: #133224;
    --info: #86A8F5; --info-soft: #1A2748; --off: #8E95A6; --off-soft: #232A3D;
    --warn: #F0C064; --warn-soft: #3A2E12; --focus: #86A8F5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1220; --surface: #161D30; --ink: #E7EBF5; --muted: #9BA4BA; --line: #2A3350;
  --band: #080C17; --band-ink: #F2F4FA; --band-muted: #8E97AE;
  --accent: #FF7A4F; --accent-soft: #3A1E16; --ok: #6FD39C; --ok-soft: #133224;
  --info: #86A8F5; --info-soft: #1A2748; --off: #8E95A6; --off-soft: #232A3D;
  --warn: #F0C064; --warn-soft: #3A2E12; --focus: #86A8F5;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--font-body); }
img { max-width: 100%; }
a { color: var(--info); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { max-width: 1040px; margin-inline: auto; padding-inline: 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 6px 10px; }

/* ---------- 頁首 ---------- */
.site-head { background: var(--band); color: var(--band-ink); padding-top: env(safe-area-inset-top, 0px); }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; background: url("/static/img/icon.svg") center/contain no-repeat; }
.brand-name { font-weight: 900; font-size: 19px; letter-spacing: .04em; white-space: nowrap; }
.pet-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--band-ink); text-decoration: none; font-size: 13px; }
.pet-chip:hover { background: rgba(255,255,255,.14); }
.pet-mini { width: 30px; height: 30px; display: block; }
.pet-mini svg { width: 100%; height: 100%; display: block; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; color: var(--band-muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px; }
.nav a:hover { color: var(--band-ink); }
.nav a[aria-current="page"] { background: var(--band-ink); color: var(--band); }

/* ---------- 主體 ---------- */
main { padding-block: 24px 40px; }
.hero { padding-block: 12px 4px; }
.hero h1 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 900; line-height: 1.3; text-wrap: balance; }
.hero-sub { margin: 10px 0 0; color: var(--muted); max-width: 40em; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.hero-stats b { font-family: var(--font-num); color: var(--ink); font-size: 20px; margin-right: 4px; }
.page-head h1 { margin: 0; font-size: clamp(1.5rem, 4.5vw, 2rem); font-weight: 900; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 42em; }
.block { margin-top: 32px; }
.block h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; }
.block.past { opacity: .88; }
.empty { color: var(--muted); margin: 0; padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.subscribe { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.subscribe h2 { margin-bottom: 4px; }
.subscribe p { margin: 6px 0 0; color: var(--muted); }

/* ---------- 卡片 ---------- */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card.game, .card.ev { padding: 0; overflow: hidden; }
.card.ev { flex-direction: row; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.thumb { aspect-ratio: 16 / 9; background: var(--off-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-title { margin: 2px 0 0; font-size: 17px; line-height: 1.45; font-weight: 700; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-sum { margin: 0; color: var(--muted); font-size: 14.5px; }
.card-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; color: var(--muted); }
.card-note { margin: 0; font-size: 13px; color: var(--muted); }
.plat { font-weight: 700; color: var(--ink); }
.price { color: var(--muted); }
.free { color: var(--ok); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.ev-date { flex: none; width: 76px; display: grid; place-content: center; text-align: center; background: var(--off-soft);
  border-right: 1px solid var(--line); }
.ev-date span { font-size: 13px; color: var(--muted); }
.ev-date b { font-family: var(--font-num); font-size: 28px; line-height: 1.1; }

.chip { font-size: 12.5px; font-weight: 700; padding: 1px 10px; border-radius: 999px; white-space: nowrap; }
.st-active { background: var(--ok-soft); color: var(--ok); }
.st-upcoming { background: var(--info-soft); color: var(--info); }
.st-ended { background: var(--off-soft); color: var(--off); }
.st-permanent { background: var(--off-soft); color: var(--ink); }
.countdown { font-family: var(--font-num); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.countdown.urgent { color: var(--accent); font-weight: 700; }
.is-ended .countdown { display: none; }
.warn { margin: 4px 0 0; padding: 8px 12px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; font-size: 13.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px var(--font-body);
  text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.claim { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px dashed var(--line); background: transparent; color: var(--muted); font: 500 14px var(--font-body); }
.claim:hover { border-color: var(--ok); color: var(--ok); }
.claim-box { width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 4px; display: inline-grid; place-content: center; }
.claim[aria-pressed="true"] { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.claim[aria-pressed="true"] .claim-box::after { content: ""; width: 8px; height: 4px; border: solid currentColor;
  border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.card.is-claimed { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }

/* ---------- 詳細頁 ---------- */
.detail { max-width: 720px; }
.crumb { margin: 0 0 8px; font-size: 14px; }
.detail h1 { margin: 10px 0 6px; font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 900; line-height: 1.3; }
.lead { margin: 0; font-size: 17px; color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 18px 0 0; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-weight: 500; }
.note-line { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.detail h2 { font-size: 19px; margin: 26px 0 8px; }
.steps { margin: 0; padding-left: 1.4em; }
.steps li { margin: 6px 0; }
.sources { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.sources h3 { font-size: 14px; margin: 0 0 6px; color: var(--muted); }
.sources ul { margin: 0; padding: 0; list-style: none; }
.sources li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src-tag { font-size: 12px; padding: 0 8px; border-radius: 999px; background: var(--off-soft); color: var(--off); }
.src-tag.off { background: var(--ok-soft); color: var(--ok); }
.verified { margin: 6px 0 0; color: var(--muted); }
.prose { max-width: 720px; }
.prose h2 { font-size: 19px; margin-top: 28px; }
.prose p, .prose li { color: var(--ink); }

/* ---------- 收集冊與寵物 ---------- */
.me-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 780px) { .me-grid { grid-template-columns: 340px minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h2 { margin: 0 0 10px; font-size: 18px; }
.pet-stage { display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; }
.pet-stage svg { width: 180px; height: 180px; }
.pet-name { font-weight: 900; font-size: 20px; margin: 0; }
.pet-mood { margin: 0; color: var(--muted); font-size: 14px; text-align: center; }
.meter { height: 10px; background: var(--off-soft); border-radius: 999px; overflow: hidden; width: 100%; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .4s; }
.meter-label { display: flex; justify-content: space-between; width: 100%; font-size: 13px; color: var(--muted); }
.pet-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.stamps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-content: center;
  font-family: var(--font-num); font-size: 12px; color: var(--muted); }
.stamp.on { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.stamp.today { outline: 2px solid var(--info); outline-offset: 2px; }
.progress-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.progress-list li { display: grid; gap: 4px; }
.collection { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-top: 10px; }
.col-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; min-width: 0; }
.col-item .dot { width: 12px; height: 12px; border-radius: 3px; flex: none; background: var(--off-soft); border: 1px solid var(--line); }
.col-item.got .dot { background: var(--ok); border-color: var(--ok); }
.col-item span { overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20;
  box-shadow: 0 6px 24px rgba(0,0,0,.2); }

/* ---------- 工具 ---------- */
.tool { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .tool { grid-template-columns: 360px minmax(0, 1fr); } }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label, .field .label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="time"], select, textarea {
  font: 15px var(--font-body); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
input[type="color"] { width: 48px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 2px; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--info); color: var(--info); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg label { padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { font-weight: 700; }
.seg label:has(input:checked) { background: var(--ink); color: var(--surface); }
.outs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.out { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; justify-items: center; }
.out canvas { image-rendering: auto; max-width: 100%; }
.out .size { font-family: var(--font-num); font-size: 12px; color: var(--muted); }
.chat { border-radius: 10px; padding: 12px 14px; font-size: 13px; display: grid; gap: 8px; }
.chat.light { background: #FFFFFF; color: #0E0E10; border: 1px solid #E5E5EA; }
.chat.dark { background: #18181B; color: #EFEFF1; }
.chat p { margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.chat img { width: 28px; height: 28px; vertical-align: middle; }
.chat img.badge { width: 18px; height: 18px; }
.chat b { color: #9147FF; }
.days { display: grid; gap: 8px; }
.day-row { display: grid; grid-template-columns: 3.2em 1fr; gap: 8px; align-items: center; }
.day-row .d { font-weight: 700; }
.day-row .inputs { display: grid; grid-template-columns: 9em minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.day-row .off { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.tz-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.preview-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.preview-wrap canvas { width: 100%; height: auto; display: block; border-radius: 6px; }
.faq h2 { font-size: 18px; margin-top: 32px; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.tool-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

/* ---------- 廣告與頁尾 ---------- */
.ad-slot { margin: 28px 0 0; min-height: 90px; }
.site-foot { border-top: 1px solid var(--line); padding-block: 22px calc(28px + env(safe-area-inset-bottom, 0px));
  font-size: 13.5px; color: var(--muted); }
.site-foot p { margin: 6px 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.mc-note { font-size: 12.5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.fine { font-size: 12px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- 主題切換、服裝、成就 ---------- */
.head-tools { display: flex; align-items: center; gap: 8px; }
.theme-btn { width: 36px; height: 36px; border-radius: 999px; border: 0; background: rgba(255,255,255,.08); color: var(--band-ink);
  font-size: 17px; cursor: pointer; display: grid; place-content: center; }
.theme-btn:hover { background: rgba(255,255,255,.16); }
.outfit-tag { align-self: center; font-size: 12.5px; color: var(--muted); padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; }
.outfit-swatch { width: 44px; height: 44px; flex: none; border-radius: 10px 10px 18px 18px;
  background: linear-gradient(180deg, var(--c1), var(--c2)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.outfit-swatch.none { background: repeating-linear-gradient(45deg, var(--off-soft) 0 6px, transparent 6px 12px); }
.outfit-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.outfit-box > div { flex: 1; min-width: 12em; }
.outfit-box h2 { margin: 0; font-size: 17px; }
.outfit-box p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.wardrobe { display: flex; flex-wrap: wrap; gap: 8px; }
.ward { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px var(--font-body); }
.ward .outfit-swatch { width: 32px; height: 32px; border-radius: 8px 8px 14px 14px; }
.ward.on { border-color: var(--ok); background: var(--ok-soft); }
.achievements { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.achievements li { display: flex; gap: 10px; align-items: center; }
.achievements .badges { flex-wrap: wrap; gap: 6px; }
.badge-pill { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
