/* ═══════════════════════════════════════════════════════════
   v2「爐火 Dither」— 訓練頁先行
   紙 #F4F0E6 · 卡 #FFFDF7 · 墨 #16131D · 火光 #FFD23F · 炭火 #FF6B35 · 月 #B8A6FF
   ═══════════════════════════════════════════════════════════ */
:root {
  --v2-paper: #f4f0e6;
  --v2-card: #fffdf7;
  --v2-ink: #16131d;
  --v2-flame: #ffd23f;
  --v2-ember: #ff6b35;
  --v2-moon: #b8a6ff;
  --v2-muted: #5e5566;
  --v2-font: "Noto Sans HK", system-ui, sans-serif;
  --v2-num: "Space Grotesk", "Noto Sans HK", sans-serif;
  --v2-mono: "Space Mono", "Noto Sans HK", monospace;
}

.v2-num { font-family: var(--v2-num); }
.v2-mono { font-family: var(--v2-mono); font-size: 12px; letter-spacing: 0.02em; }

/* ── 訓練 tab 時成個畫面轉紙底 ── */
body.v2[data-v2] { background: var(--v2-paper); color: var(--v2-ink); font-family: var(--v2-font); }
body.v2[data-v2]::before,
body.v2[data-v2]::after { display: none; }
html:has(body.v2[data-v2]) { background: var(--v2-paper); color-scheme: light; }
body.v2[data-v2] .shell { background: none; }

/* ── Top bar ── */
body.v2[data-v2] .topbar { align-items: center; margin-bottom: 12px; }
body.v2[data-v2] .topbar__eyebrow { font-family: var(--v2-mono); color: var(--v2-ink); text-transform: none; letter-spacing: 0.02em; font-size: 12px; font-weight: 700; }
body.v2[data-v2] .topbar__eyebrow::before { content: "// "; }
body.v2[data-v2] .topbar__title { font-family: var(--v2-font); font-weight: 900; font-size: 1.35rem; letter-spacing: 0; color: var(--v2-ink); }
body.v2[data-v2] .topbar__subtitle { color: var(--v2-muted); }
body.v2[data-v2] .topbar__logo {
  width: 50px; height: 50px; border-radius: 50%; border: 2.5px solid var(--v2-ink); background: var(--v2-card);
  position: relative; overflow: hidden; box-shadow: 3px 3px 0 var(--v2-ink);
}
body.v2[data-v2] .topbar__logo > * { display: none; }
body.v2[data-v2] .topbar__logo::after {
  content: ""; position: absolute; left: 50%; top: -32px; width: 58px; height: 92px; margin-left: -29px;
  background: url(./images/v2/mascot-idle.png) 0 0 / 800% 100% no-repeat; image-rendering: pixelated;
  animation: v2m8 1.2s steps(8) infinite;
}
body.v2[data-v2] .topbar__ring {
  width: auto; height: 42px; padding: 0 12px 0 6px; display: flex; align-items: center; gap: 6px;
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--v2-ink);
}
body.v2[data-v2] .topbar__ring .ring { display: none; }
body.v2[data-v2] .topbar__ring::before {
  content: ""; width: 26px; height: 26px; display: block;
  background: url(./images/v2/coin.png) 0 0 / 800% 100% no-repeat; image-rendering: pixelated; animation: v2m8 0.7s steps(8) infinite;
}
body.v2[data-v2] .ring__text { position: static; font-family: var(--v2-num); font-size: 16px; color: var(--v2-ink); }
.v2-bump { animation: v2bump 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }

/* ── 共用：粗框卡、按鈕、pill ── */
.v2-card { background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--v2-ink); color: var(--v2-ink); }
.v2-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--v2-ink); padding: 3px 10px; font-weight: 700; color: var(--v2-ink); }
.v2-btn {
  appearance: none; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 56px; padding: 0 16px; font: 900 17px/1.1 var(--v2-font); color: var(--v2-ink);
  background: var(--v2-ember); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--v2-ink);
  cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; -webkit-tap-highlight-color: transparent;
}
.v2-btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--v2-ink); }
.v2-btn:disabled { opacity: 0.5; }
.v2-btn--white { background: var(--v2-card); }
.v2-btn--ink { background: var(--v2-ink); color: var(--v2-card); }
.v2-btn--sm { min-height: 40px; width: auto; font-size: 13px; padding: 0 12px; box-shadow: 3px 3px 0 var(--v2-ink); }
.v2-btn:focus-visible, .v2-row:focus-visible { outline: 3px solid var(--v2-ink); outline-offset: 3px; }
.dith-e { background-color: var(--v2-ember); background-image: repeating-conic-gradient(var(--v2-ink) 0 25%, transparent 0 50%); background-size: 4px 4px; }

/* ── Session hero（模式切換、進度） ── */
body.v2 #panelTrain .session-hero {
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--v2-ink);
  color: var(--v2-ink); padding: 12px; margin-bottom: 14px;
}
body.v2 #panelTrain .session-hero::before, body.v2 #panelTrain .session-hero::after { display: none; }
body.v2 #panelTrain .session-hero__title { font-family: var(--v2-font); font-weight: 900; color: var(--v2-ink); }
body.v2 #panelTrain .session-hero__count { font-family: var(--v2-num); color: var(--v2-ink); }
body.v2 #panelTrain .session-hero__track { height: 14px; border: 2.5px solid var(--v2-ink); border-radius: 6px; background: var(--v2-card); overflow: hidden; }
body.v2 #panelTrain .session-hero__fill { background-color: var(--v2-ember); background-image: repeating-conic-gradient(var(--v2-ink) 0 25%, transparent 0 50%); background-size: 4px 4px; border-right: 2.5px solid var(--v2-ink); }
body.v2 #panelTrain .session-hero__more summary { font-family: var(--v2-mono); font-size: 12px; color: var(--v2-muted); }
body.v2 #panelTrain .session-hero__note { color: var(--v2-muted); }
body.v2 #panelTrain .mode-toggle { background: transparent; border: 0; gap: 8px; padding: 0; }
body.v2 #panelTrain .mode-toggle__btn {
  background: var(--v2-card); color: var(--v2-ink); border: 2.5px solid var(--v2-ink); border-radius: 10px; box-shadow: none;
}
body.v2 #panelTrain .mode-toggle__btn--active { background: var(--v2-flame); box-shadow: 3px 3px 0 var(--v2-ink); }
body.v2 #panelTrain .mode-toggle__btn[data-tab-suit="moon"].mode-toggle__btn--active { background: var(--v2-moon); }
body.v2 #panelTrain .mode-toggle__text, body.v2 #panelTrain .mode-toggle__card, body.v2 #panelTrain .mode-toggle__prog { color: var(--v2-ink); }
body.v2 #panelTrain .mode-toggle__btn--pick { animation: v2wob 1s steps(2) infinite; }
body.v2 #panelTrain .auto-chip, body.v2 #panelTrain .world-phase-chip { background: var(--v2-card); color: var(--v2-ink); border: 2px solid var(--v2-ink); }
body.v2 #panelTrain .train-day-strip__cell { background: var(--v2-card); color: var(--v2-ink); border: 2px solid var(--v2-ink); border-radius: 8px; }
body.v2 #panelTrain .train-day-strip__cell--today { background: var(--v2-flame); box-shadow: 3px 3px 0 var(--v2-ink); }

/* ── 進度 ── */
.v2-prog { display: flex; justify-content: space-between; align-items: flex-end; margin: 4px 2px 12px; gap: 12px; }
.v2-prog__big { font-family: var(--v2-num); font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.v2-prog__dots { display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; max-width: 60%; }
.v2-prog__dots span { width: 10px; height: 10px; border: 2px solid var(--v2-ink); border-radius: 2px; background: var(--v2-card); }
.v2-prog__dots span.on { background: var(--v2-ember); }

/* ── 而家做 大卡 ── */
.v2-focus { overflow: hidden; margin-bottom: 26px; }
.v2-focus__art { position: relative; height: 196px; border-bottom: 2.5px solid var(--v2-ink); background: var(--v2-flame); }
.v2-tint--moon { background: var(--v2-moon); }
.v2-tint--flame { background: var(--v2-flame); }
.v2-tint--ember { background: var(--v2-ember); }
.v2-tint--paper { background: #e9e2d3; }
.v2-focus__art .v2-pill { position: absolute; top: 10px; font-size: 12px; }
.v2-focus__art .v2-pill--l { left: 10px; font-family: var(--v2-mono); }
.v2-focus__art .v2-pill--r { right: 10px; font-family: var(--v2-num); }
.v2-illo {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 314px; margin-left: -157px;
  background-repeat: no-repeat; background-size: 200% 100%; animation: v2boil 0.5s steps(2) infinite;
}
.v2-focus__art .exercise__media { position: absolute; inset: 0; margin: 0; border: 0; border-radius: 0; }
.v2-focus__body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.v2-focus__title { margin: 0; font: 900 25px/1.15 var(--v2-font); color: var(--v2-ink); }
.v2-focus__rx { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.v2-focus__rx .v2-num { font-size: 18px; font-weight: 700; }
.v2-focus__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.v2-pips { display: flex; gap: 5px; flex-wrap: wrap; }
.v2-pip { width: 22px; height: 22px; border: 2.5px solid var(--v2-ink); border-radius: 6px; background: var(--v2-card); display: inline-block; }
.v2-pip.done { background: var(--v2-ember); animation: v2pop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.v2-pip.now { background-image: repeating-conic-gradient(var(--v2-ink) 0 25%, transparent 0 50%); background-size: 4px 4px; }
.v2-focus__actions { display: flex; flex-direction: column; gap: 8px; }
.v2-focus__done { text-align: center; font-weight: 900; padding: 8px; border: 2.5px dashed var(--v2-ink); border-radius: 10px; }
.v2-details > summary {
  list-style: none; cursor: pointer; text-align: center; font-family: var(--v2-mono); font-size: 12px; font-weight: 700;
  min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--v2-ink);
}
.v2-details > summary::-webkit-details-marker { display: none; }
.v2-details > summary::after { content: "▾"; transition: transform 0.2s; }
.v2-details[open] > summary::after { transform: rotate(180deg); }
.v2-details__body { border-top: 2.5px solid var(--v2-ink); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.6; }
.v2-details__body p { margin: 0; }
.v2-details__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v2-details__tools .check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; min-height: 40px; }
.v2-details__body .exercise__xp { margin: 0; }

/* ── 成張卡列表 ── */
.v2-list__head { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 8px; }
.v2-list { display: flex; flex-direction: column; gap: 10px; }
.v2-row {
  appearance: none; width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left;
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 12px; color: var(--v2-ink); font: inherit; cursor: pointer;
}
.v2-row.is-cur { background: var(--v2-flame); box-shadow: 4px 4px 0 var(--v2-ink); }
.v2-row.is-done { opacity: 0.55; }
.v2-row.is-done .v2-row__name { text-decoration: line-through; text-decoration-thickness: 2px; }
.v2-row__n { width: 22px; font-weight: 700; }
.v2-row__main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.v2-row__name { font-weight: 900; font-size: 15px; }
.v2-row__sub { font-size: 11px; }
.v2-row__dots { display: flex; gap: 3px; flex-shrink: 0; }
.v2-row__dots span { width: 9px; height: 9px; border: 2px solid var(--v2-ink); border-radius: 2px; background: var(--v2-card); }
.v2-row__dots span.on { background: var(--v2-ember); }
.v2-clear { padding: 20px; background: var(--v2-flame); margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.v2-clear__title { font: 900 24px/1.2 var(--v2-font); }

/* ── 燃料幣飛入頂欄 ── */
.v2-coin-fly { position: fixed; z-index: 90; width: 30px; height: 30px; pointer-events: none;
  background: url(./images/v2/coin.png) 0 0 / 800% 100% no-repeat; image-rendering: pixelated; animation: v2m8 0.7s steps(8) infinite; }

/* ── 休息：月色全屏 ── */
body.v2 .modal--rest { place-items: stretch; padding: 0; }
body.v2 .modal--rest .modal__backdrop { display: none; }
body.v2 .modal__panel--rest {
  width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0;
  background: var(--v2-moon); color: var(--v2-ink); display: flex; flex-direction: column;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  animation: v2wipeIn 0.42s steps(7) both;
}
body.v2 .modal__panel--rest .modal__eyebrow { font-family: var(--v2-mono); color: var(--v2-ink); text-transform: none; font-size: 12px; font-weight: 700; }
body.v2 .modal__panel--rest .modal__eyebrow::before { content: "// "; }
body.v2 .modal__panel--rest .modal__title { font: 900 26px/1.2 var(--v2-font); margin: 4px 0; }
body.v2 .modal__panel--rest .modal__meta { color: var(--v2-ink); opacity: 0.7; }
body.v2 .rest-sheet { display: flex; flex-direction: column; align-items: stretch; gap: 18px; flex: 1; justify-content: center; margin: 0; }
body.v2 .timer-wrap--compact { width: auto; height: auto; }
body.v2 .timer-wrap--compact .timer-ring { display: none; }
body.v2 .timer-wrap--compact .timer,
body.v2 #timerDisplay {
  position: static; font-family: var(--v2-num); font-weight: 700; font-size: 120px; line-height: 0.9; letter-spacing: -0.04em; text-align: center;
  color: var(--v2-flame); -webkit-text-stroke: 3px var(--v2-ink); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--v2-ink);
}
.v2-restbar { height: 32px; border: 2.5px solid var(--v2-ink); border-radius: 10px; background: var(--v2-card); overflow: hidden; box-shadow: 4px 4px 0 var(--v2-ink); }
.v2-restbar__fill { height: 100%; width: 100%; border-right: 2.5px solid var(--v2-ink); transition: width 0.25s linear; }
body.v2 .rest-next { background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 12px; padding: 12px 14px; box-shadow: 4px 4px 0 var(--v2-ink); }
body.v2 .rest-next__label { font-family: var(--v2-mono); color: var(--v2-ink); text-transform: none; }
body.v2 .rest-next__name { color: var(--v2-ink); font-weight: 900; }
body.v2 .rest-next__cues { color: var(--v2-muted); }
.v2-rest-say { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 14px; }
.v2-rest-say__face { width: 60px; height: 60px; border-radius: 50%; border: 2.5px solid var(--v2-ink); background: var(--v2-card); overflow: hidden; position: relative; flex-shrink: 0; }
.v2-rest-say__face::after { content: ""; position: absolute; left: 4px; top: -14px; width: 50px; height: 80px; background: url(./images/v2/mascot-idle.png) 0 0 / 800% 100% no-repeat; image-rendering: pixelated; animation: v2m8 1.2s steps(8) infinite; }
.v2-rest-say__text { background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 14px 14px 14px 4px; box-shadow: 3px 3px 0 var(--v2-ink); padding: 8px 12px; font-weight: 700; font-size: 14px; animation: v2pop 0.4s 0.3s both; }
body.v2 .modal__panel--rest .btn {
  min-height: 50px; border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--v2-ink);
  background: var(--v2-card); color: var(--v2-ink); font-weight: 900; font-family: var(--v2-font);
}
body.v2 .modal__panel--rest .btn--primary { background: var(--v2-ember); min-height: 58px; font-size: 17px; }
body.v2 .modal__panel--rest [data-close="rest"].btn--block { background: var(--v2-ink); color: var(--v2-card); }
body.v2 .modal__panel--rest .modal__row { gap: 8px; margin: 10px 0; flex-wrap: nowrap; }
body.v2 .modal__panel--rest .modal__row .btn { flex: 1; }

/* ── 做組中（伸展計時）── */
body.v2 .modal__panel--focus { background: var(--v2-card); color: var(--v2-ink); border: 2.5px solid var(--v2-ink); box-shadow: 5px 5px 0 var(--v2-ink); }
body.v2 .modal__panel--focus .modal__eyebrow { font-family: var(--v2-mono); color: var(--v2-ink); text-transform: none; font-weight: 700; }
body.v2 .modal__panel--focus .modal__title { font: 900 24px/1.2 var(--v2-font); }
body.v2 .modal__panel--focus .focus-timer__value { font-family: var(--v2-num); font-weight: 700; font-size: 72px; color: var(--v2-flame); -webkit-text-stroke: 2.5px var(--v2-ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--v2-ink); }
body.v2 .modal__panel--focus .btn { border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--v2-ink); background: var(--v2-card); color: var(--v2-ink); font-weight: 900; }
body.v2 .modal__panel--focus .btn--primary { background: var(--v2-ember); min-height: 56px; }

/* ── motion ── */
@keyframes v2m8 { to { background-position: 114.2857% 0; } }
@keyframes v2boil { to { background-position: 200% 0; } }
@keyframes v2pop { 0% { transform: scale(0); } 55% { transform: scale(1.3); } 78% { transform: scale(0.92); } 100% { transform: scale(1); } }
@keyframes v2bump { 40% { transform: scale(1.25) rotate(-4deg); } }
@keyframes v2wob { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes v2wipeIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes v2up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.v2-up { animation: v2up 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
@media (prefers-reduced-motion: reduce) {
  body.v2 *, body.v2 *::before, body.v2 *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---- polish pass: chips, rest button ---- */
.v2-focus__meta .tag,
.v2-focus__meta .enchant-badge,
.v2-focus__meta .exercise__chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px;
  font: 700 12px/1 var(--v2-mono); color: var(--v2-ink); background: var(--v2-card);
  border: 2px solid var(--v2-ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--v2-ink);
  text-transform: none; letter-spacing: 0;
}
.v2-focus__meta .tag svg, .v2-focus__meta .tag i { width: 13px; height: 13px; color: var(--v2-ink); stroke: currentColor; }
.v2-focus__meta .tag { background: var(--v2-flame); }
.v2-focus__meta .enchant-badge { background: var(--v2-moon); }
.v2-focus__meta .enchant-badge--empty { background: var(--v2-card); border-style: dashed; box-shadow: none; }
.v2-details .exercise__xp { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; font: 700 12px/1.4 var(--v2-mono); color: var(--v2-ink); }
.v2-details .exercise__xp-per { background: var(--v2-flame); border: 2px solid var(--v2-ink); border-radius: 6px; padding: 2px 8px; }
.v2-details .exercise__xp-total { color: var(--v2-muted); }
.v2-details .exercise__skip { font: 400 12px/1.5 var(--v2-mono); color: var(--v2-muted); }

body.v2 .modal__panel--rest #btnRestNext {
  background: var(--v2-ember); color: var(--v2-ink); border: 2.5px solid var(--v2-ink);
  border-radius: 12px; box-shadow: 4px 4px 0 var(--v2-ink); font: 900 17px/1 var(--v2-font);
  min-height: 54px; text-shadow: none; background-image: none;
}
body.v2 .modal__panel--rest #btnRestNext:disabled {
  background: var(--v2-card); color: var(--v2-muted); opacity: .75; box-shadow: 2px 2px 0 var(--v2-ink);
}
body.v2 .modal__panel--rest #btnRestNext:not(:disabled):active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--v2-ink); }

/* progress dots = one per exercise */
.v2-prog__dots span.now { background: var(--v2-flame); }
.v2-prog__dots span.half { background: linear-gradient(90deg, var(--v2-ember) 50%, var(--v2-card) 50%); }

/* work (hold-timer) modal */
body.v2 .modal__panel--focus .focus-prescription { font: 700 16px/1.3 var(--v2-num); color: var(--v2-ink); }
body.v2 .modal__panel--focus .focus-modal__tags .tag { display: inline-flex; gap: 4px; align-items: center; padding: 3px 10px; font: 700 12px/1.2 var(--v2-mono); background: var(--v2-flame); color: var(--v2-ink); border: 2px solid var(--v2-ink); border-radius: 999px; }
body.v2 .v2-work-art { position: relative; height: 180px; margin: 10px 0; border: 2.5px solid var(--v2-ink); border-radius: 12px; overflow: hidden; display: flex; justify-content: center; }
body.v2 .v2-work-art .v2-illo { width: 288px; margin-left: -144px; }
body.v2 .modal__panel--focus .set-pill { background: var(--v2-card); color: var(--v2-ink); border: 2px solid var(--v2-ink); border-radius: 8px; box-shadow: none; font-family: var(--v2-num); }
body.v2 .modal__panel--focus .set-pill--next { background: var(--v2-flame); box-shadow: 2px 2px 0 var(--v2-ink); }
body.v2 .modal__panel--focus .set-pill--done { background: var(--v2-ember); }
body.v2 .modal__panel--focus .focus-modal__cues { background: var(--v2-paper); color: var(--v2-ink); border: 2px dashed var(--v2-ink); border-radius: 12px; }
body.v2 .modal__panel--focus .focus-modal__cues strong { color: var(--v2-ink); }
body.v2 .modal__panel--focus .focus-modal__cues p { color: var(--v2-ink); }
body.v2 .modal__panel--focus .focus-timer { background: var(--v2-moon); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--v2-ink); }
body.v2 .modal__panel--focus .focus-timer__label, body.v2 .modal__panel--focus .focus-timer__ready { font-family: var(--v2-mono); color: var(--v2-ink); font-weight: 700; }
body.v2 .modal__panel--focus .btn:disabled { background: var(--v2-card); color: var(--v2-muted); opacity: .7; box-shadow: 2px 2px 0 var(--v2-ink); }
body.v2 .modal__panel--focus .focus-modal__dismiss { box-shadow: 2px 2px 0 var(--v2-ink); }

/* ═══════════ 營火 tab ═══════════ */
@font-face { font-family: "FusionPixel"; src: url(./fonts/fusion-pixel-12-sub.woff2) format("woff2"); font-display: block; }

body.v2[data-v2] #panelCampfire { color: var(--v2-ink); font-family: var(--v2-font); }
body.v2[data-v2] #campfireRoot { display: flex; flex-direction: column; gap: 16px; padding-bottom: 12px; }

/* status banner */
body.v2[data-v2] .campfire-urgency {
  margin: 0; padding: 10px 14px; font: 700 14px/1.45 var(--v2-font); color: var(--v2-ink);
  background: var(--v2-flame); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--v2-ink); animation: none;
}
body.v2[data-v2] .campfire-urgency--critical { background: var(--v2-ember); }

/* hero card + scene */
body.v2[data-v2] .campfire-hero {
  margin: 0; padding: 0; text-align: left; background: var(--v2-card);
  border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--v2-ink); overflow: hidden;
}
.v2-camp { position: relative; height: 214px; overflow: hidden; background: var(--v2-paper); border-bottom: 2.5px solid var(--v2-ink); transition: background-color .5s; }
.v2-camp[data-phase="dawn"] { background: var(--v2-flame); }
.v2-camp[data-phase="day"] { background: var(--v2-paper); }
.v2-camp[data-phase="dusk"] { background: var(--v2-ember); }
.v2-camp[data-phase="night"] { background: var(--v2-moon); }
.v2-camp__scene {
  position: absolute; left: 50%; top: 0; height: 100%; aspect-ratio: 768 / 468; transform: translateX(-50%);
  background: url(./images/v2/camp.png) 0 0 / 400% 400% no-repeat; image-rendering: pixelated;
  animation: v2camp4 .5s steps(4) infinite;
}
.v2-camp__me {
  position: absolute; left: 51.5%; top: 44px; width: 103px; height: 150px; margin-left: -51px; padding: 0;
  border: 0; background: none; cursor: pointer; animation: v2bob 1.6s steps(4) infinite; -webkit-tap-highlight-color: transparent;
}
.v2-camp__hop { position: absolute; inset: 0; display: block; transform-origin: 50% 90%; }
.v2-camp__sprite {
  position: absolute; inset: 0; display: block;
  background: url(./images/v2/camp-fire.png) 0 0 / 400% 400% no-repeat; image-rendering: pixelated;
  animation: v2camp4 .5s steps(4) infinite;
}
.v2-camp__scene, .v2-camp__sprite { background-position-y: 66.6667%; }
.v2-camp[data-ft="0"] .v2-camp__scene, .v2-camp[data-ft="0"] .v2-camp__sprite { background-position-y: 0%; }
.v2-camp[data-ft="1"] .v2-camp__scene, .v2-camp[data-ft="1"] .v2-camp__sprite { background-position-y: 33.3333%; }
.v2-camp[data-ft="2"] .v2-camp__scene, .v2-camp[data-ft="2"] .v2-camp__sprite { background-position-y: 66.6667%; }
.v2-camp[data-ft="3"] .v2-camp__scene, .v2-camp[data-ft="3"] .v2-camp__sprite { background-position-y: 100%; }
.v2-camp__zz { display: none; }
.v2-camp[data-ft="0"] .v2-camp__zz { display: block; }
.v2-camp__zz i { position: absolute; font: 700 13px/1 var(--v2-mono); font-style: normal; color: var(--v2-ink); animation: v2zz 2s steps(8) infinite; left: 76px; top: 46px; }
.v2-camp__zz i + i { left: 84px; top: 32px; font-size: 17px; animation-delay: .7s; }

/* pixel speech bubble */
.v2-camp__say {
  position: absolute; left: calc(51.5% + 30px); top: 26px; z-index: 3; pointer-events: none;
  filter: drop-shadow(0 -2px 0 var(--v2-ink)) drop-shadow(0 2px 0 var(--v2-ink)) drop-shadow(-2px 0 0 var(--v2-ink)) drop-shadow(2px 0 0 var(--v2-ink)) drop-shadow(3px 3px 0 var(--v2-ink));
}
.v2-pxbub {
  max-width: 112px; padding: 6px 8px 5px; background: var(--v2-card); color: var(--v2-ink);
  font-family: "FusionPixel", monospace; font-size: 12px; line-height: 14px; -webkit-font-smoothing: none;
  display: flex; flex-wrap: wrap; gap: 1px;
  clip-path: polygon(4px 0,calc(100% - 4px) 0,calc(100% - 4px) 2px,calc(100% - 2px) 2px,calc(100% - 2px) 4px,100% 4px,100% calc(100% - 4px),calc(100% - 2px) calc(100% - 4px),calc(100% - 2px) calc(100% - 2px),calc(100% - 4px) calc(100% - 2px),calc(100% - 4px) 100%,4px 100%,4px calc(100% - 2px),2px calc(100% - 2px),2px calc(100% - 4px),0 calc(100% - 4px),0 4px,2px 4px,2px 2px,4px 2px);
}
.v2-pxtail { width: 10px; height: 8px; margin: -1px 0 0 6px; background: var(--v2-card); clip-path: polygon(0 0,100% 0,100% 25%,75% 25%,75% 50%,50% 50%,50% 75%,25% 75%,25% 100%,0 100%); }
.v2-sayA { transform-origin: 0 100%; animation: v2pxpopA .32s steps(4) both; }
.v2-sayB { transform-origin: 0 100%; animation: v2pxpopB .32s steps(4) both; }
.v2-cw { display: inline-block; animation: v2cw .24s steps(3) both; }
.v2-hopA { animation: v2hopA .55s cubic-bezier(.3,1.3,.5,1); }
.v2-hopB { animation: v2hopB .55s cubic-bezier(.3,1.3,.5,1); }

body.v2[data-v2] .campfire-hero__copy { padding: 12px 16px 14px; background: var(--v2-card); border-top: 0; }
body.v2[data-v2] .campfire-hero__title { margin: 0; font: 900 20px/1.2 var(--v2-font); color: var(--v2-ink); letter-spacing: 0; text-shadow: none; }
body.v2[data-v2] .campfire-hero__subtitle { margin: 4px 0 0; font-size: 14px; color: var(--v2-muted); }

/* fuel */
body.v2[data-v2] .campfire-fuel--pixel { margin: 0; padding: 0 4px; background: none; border: 0; box-shadow: none; }
.v2-fuel__head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; }
.v2-fuel__lead { display: flex; flex-direction: column; font-weight: 700; }
body.v2[data-v2] .v2-fuel__num {
  font: 700 88px/.9 var(--v2-num); color: var(--v2-flame); letter-spacing: -0.04em;
  -webkit-text-stroke: 3px var(--v2-ink); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--v2-ink); margin-top: 6px;
}
.v2-fuel__tier {
  margin-bottom: 10px; padding: 8px 14px; font: 900 18px/1 var(--v2-font); background: var(--v2-ember);
  border: 2.5px solid var(--v2-ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--v2-ink); transform: rotate(-4deg);
}
body.v2[data-v2] .v2-fuel__bar {
  position: relative; display: block; height: 30px; padding: 0; gap: 0; background: var(--v2-card);
  border: 2.5px solid var(--v2-ink); border-radius: 8px; box-shadow: 4px 4px 0 var(--v2-ink); overflow: hidden;
}
.v2-fuel__fill { height: 100%; border-right: 2.5px solid var(--v2-ink); transition: width .5s cubic-bezier(.3,1.4,.5,1); }
.v2-fuel__bar i { position: absolute; top: -2px; bottom: -2px; width: 2.5px; background: var(--v2-ink); }
.v2-fuel__labels { display: flex; justify-content: space-between; margin-top: 6px; padding: 0 2px; font-size: 10px; }
body.v2[data-v2] .campfire-fuel__hint { margin: 10px 0 0; font: 400 12px/1.5 var(--v2-mono); color: var(--v2-muted); }
body.v2[data-v2] .campfire-fuel__hint strong, body.v2[data-v2] .campfire-countdown { color: var(--v2-ink); font-family: var(--v2-mono); }
body.v2[data-v2] .campfire-fuel--critical .v2-fuel__fill { animation: v2blink 1s steps(2) infinite; }

/* 營火見聞錄 = 收據 */
body.v2[data-v2] .campfire-rpg {
  position: relative; margin: 4px 6px 18px; background: var(--v2-card); border: 0; border-radius: 0;
  box-shadow: none; filter: drop-shadow(5px 5px 0 var(--v2-ink)); transform: rotate(0.6deg);
}
body.v2[data-v2] .campfire-rpg::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 12px;
  background: linear-gradient(135deg, var(--v2-card) 50%, transparent 50%) 0 0 / 16px 16px, linear-gradient(-135deg, var(--v2-card) 50%, transparent 50%) 0 0 / 16px 16px;
}
body.v2[data-v2] .campfire-rpg__head { padding: 14px 16px 6px; border: 0; background: none; }
body.v2[data-v2] .campfire-rpg__icon { display: none; }
body.v2[data-v2] .campfire-rpg__title { font: 900 16px/1.2 var(--v2-font); color: var(--v2-ink); letter-spacing: 0; }
body.v2[data-v2] .campfire-rpg__title::after { content: " // log"; font: 700 12px var(--v2-mono); color: var(--v2-muted); }
body.v2[data-v2] .campfire-rpg__body { padding: 4px 16px 18px; max-height: 260px; }
body.v2[data-v2] .campfire-rpg__log { gap: 0; }
body.v2[data-v2] .campfire-rpg__line { padding: 9px 0; border-bottom: 2px dashed rgba(22, 19, 29, 0.25); }
body.v2[data-v2] .campfire-rpg__line:last-child { border-bottom: 0; }
body.v2[data-v2] .campfire-rpg__avatar { border: 2px solid var(--v2-ink); border-radius: 50%; }
body.v2[data-v2] .campfire-rpg__avatar--ph { background: var(--v2-flame); color: var(--v2-ink); }
body.v2[data-v2] .campfire-rpg__bubble { padding: 0; border: 0; background: none; box-shadow: none; }
body.v2[data-v2] .campfire-rpg__bubble::before { display: none; }
body.v2[data-v2] .campfire-rpg__time { font: 400 11px/1.2 var(--v2-mono); color: var(--v2-muted); }
body.v2[data-v2] .campfire-rpg__text { font-size: 14px; line-height: 1.55; color: var(--v2-ink); }
body.v2[data-v2] .campfire-rpg__text strong { color: var(--v2-ink); font-weight: 900; }
body.v2[data-v2] .campfire-rpg__gain {
  display: inline-block; margin-left: 6px; padding: 1px 7px; font: 700 11px/1.4 var(--v2-num); color: var(--v2-ink);
  background: var(--v2-flame); border: 2px solid var(--v2-ink); border-radius: 999px;
}
body.v2[data-v2] .campfire-rpg__empty { color: var(--v2-muted); font-size: 13px; text-align: left; padding: 4px 0; }

/* 隊友 */
body.v2[data-v2] .campfire-crew { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
body.v2[data-v2] .campfire-crew__title { margin: 0 4px 10px; font: 700 12px/1.2 var(--v2-mono); color: var(--v2-ink); display: flex; align-items: center; gap: 6px; }
body.v2[data-v2] .campfire-crew__title svg { width: 14px; height: 14px; }
body.v2[data-v2] .campfire-crew__title::before { content: "//"; }
body.v2[data-v2] .campfire-crew__list { gap: 10px; }
body.v2[data-v2] .campfire-member {
  padding: 10px 12px; background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--v2-ink);
}
body.v2[data-v2] .campfire-member__avatar { border: 2px solid var(--v2-ink); border-radius: 50%; }
body.v2[data-v2] .campfire-member__avatar--placeholder { background: var(--v2-moon); color: var(--v2-ink); }
body.v2[data-v2] .campfire-member__name { color: var(--v2-ink); font-weight: 900; font-size: 15px; }
body.v2[data-v2] .campfire-member__chip {
  font: 700 11px/1.3 var(--v2-mono); color: var(--v2-ink); background: var(--v2-card); border: 2px solid var(--v2-ink); border-radius: 999px; padding: 2px 8px;
}
body.v2[data-v2] .campfire-member__chip--in { background: var(--v2-flame); }
body.v2[data-v2] .campfire-member__chip--idle { border-style: dashed; color: var(--v2-muted); }
body.v2[data-v2] .campfire-member .card-chip {
  background: var(--v2-paper); color: var(--v2-ink); border: 2px solid var(--v2-ink); border-radius: 8px; box-shadow: 2px 2px 0 var(--v2-ink);
}
body.v2[data-v2] .campfire-member .card-chip--empty { border-style: dashed; box-shadow: none; opacity: .7; }
body.v2[data-v2] .campfire-member .card-chip * { color: var(--v2-ink); }
body.v2[data-v2] .campfire-tip { margin: 0 4px; font: 400 12px/1.6 var(--v2-mono); color: var(--v2-muted); }
body.v2[data-v2] .campfire-empty { background: var(--v2-card); color: var(--v2-ink); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--v2-ink); padding: 20px; }
body.v2[data-v2] .campfire-empty__title { color: var(--v2-ink); font-weight: 900; }
body.v2[data-v2] .campfire-empty__body { color: var(--v2-muted); }

/* ═══════════ 底部導航（全部 tab） ═══════════ */
body.v2 .bottom-nav {
  background: var(--v2-card); backdrop-filter: none; border-top: 2.5px solid var(--v2-ink); padding-top: 8px;
}
body.v2 .bottom-nav::after { background: var(--v2-card); }
body.v2 .bottom-nav__inner--5 { gap: 4px; align-items: start; }
body.v2 .bottom-nav__btn,
body.v2 .bottom-nav__btn--campfire {
  min-height: 54px; padding: 6px 2px; background: transparent; color: var(--v2-ink);
  border: 2.5px solid transparent; border-radius: 12px; box-shadow: none;
  font: 700 11px/1.1 var(--v2-font); overflow: visible; animation: none;
}
body.v2 .bottom-nav__btn svg { width: 22px; height: 22px; stroke-width: 2.4; }
body.v2 .bottom-nav__btn[aria-current="page"] {
  background: var(--v2-flame); color: var(--v2-ink); border-color: var(--v2-ink); box-shadow: 3px 3px 0 var(--v2-ink);
}
body.v2 .bottom-nav__btn--campfire .bottom-nav__campfire-icon,
body.v2 .bottom-nav__btn--campfire .bottom-nav__countdown { display: none; }
body.v2 .bottom-nav__campfire-label { font: 700 11px/1.1 var(--v2-font); color: var(--v2-ink); }
body.v2 .bottom-nav__btn--campfire { margin-top: -24px; background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
.v2-nav-fire { display: none; }
body.v2 .v2-nav-fire {
  display: block; position: relative; width: 56px; height: 56px; margin-bottom: 2px; border-radius: 50%; overflow: hidden;
  background: var(--v2-paper); border: 2.5px solid var(--v2-ink); box-shadow: 3px 3px 0 var(--v2-ink);
}
body.v2 .bottom-nav__btn--campfire[aria-current="page"] .v2-nav-fire { background: var(--v2-flame); }
body.v2 .bottom-nav__btn--ember .v2-nav-fire { background: var(--v2-moon); }
.v2-nav-fire__me {
  position: absolute; left: 50%; top: -24px; width: 60px; height: 95px; margin-left: -30px;
  background: url(./images/v2/mascot-idle.png) 0 0 / 800% 100% no-repeat; image-rendering: pixelated; animation: v2m8 1.2s steps(8) infinite;
}
body.v2 .bottom-nav__badge {
  background: var(--v2-ember); color: var(--v2-ink); border: 2px solid var(--v2-ink); border-radius: 6px; box-shadow: none; font-family: var(--v2-num);
}

@keyframes v2camp4 { to { background-position-x: 133.333%; } }
@keyframes v2bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes v2zz { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(14px, -30px); opacity: 0; } }
@keyframes v2pxpopA { 0% { transform: scale(0); } 40% { transform: scale(1.15); } 60% { transform: scale(.95); } 100% { transform: scale(1); } }
@keyframes v2pxpopB { 0% { transform: scale(0); } 40% { transform: scale(1.15); } 60% { transform: scale(.95); } 100% { transform: scale(1); } }
@keyframes v2cw { 0% { transform: translateY(4px); opacity: 0; } 50% { transform: translateY(-2px); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes v2hopA { 0%, 100% { transform: translateY(0) scale(1); } 25% { transform: translateY(2px) scale(1.12, .86); } 55% { transform: translateY(-18px) scale(.92, 1.1); } 80% { transform: translateY(0) scale(1.06, .94); } }
@keyframes v2hopB { 0%, 100% { transform: translateY(0) scale(1); } 25% { transform: translateY(2px) scale(1.12, .86); } 55% { transform: translateY(-18px) scale(.92, 1.1); } 80% { transform: translateY(0) scale(1.06, .94); } }
@keyframes v2blink { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .v2-camp__scene, .v2-camp__sprite, .v2-camp__me, .v2-camp__zz i, .v2-nav-fire__me, .v2-cw, .v2-sayA, .v2-sayB, .v2-hopA, .v2-hopB { animation: none !important; }
}

/* ═══════════ 見聞錄 recap（火仔版） ═══════════ */
body.v2 .chronicle-cutscene__veil { background: rgba(22, 19, 29, 0.55); backdrop-filter: none; }
body.v2 .chronicle-cutscene__stage {
  background: var(--v2-flame); color: var(--v2-ink); border: 2.5px solid var(--v2-ink); border-radius: 16px;
  box-shadow: 6px 6px 0 var(--v2-ink); padding: 18px 18px 20px; text-align: left; font-family: var(--v2-font);
}
body.v2 .chronicle-cutscene__wizard-wrap { display: flex; justify-content: center; height: 118px; margin: -4px 0 4px; }
.v2-chron-me {
  display: block; width: 75px; height: 118px;
  background: url(./images/v2/mascot-cheer.png) 0 0 / 400% 100% no-repeat; image-rendering: pixelated; animation: v2m4 .5s steps(4) infinite;
}
@keyframes v2m4 { to { background-position: 133.333% 0; } }
body.v2 .chronicle-cutscene__eyebrow { font: 700 12px/1.2 var(--v2-mono); color: var(--v2-ink); letter-spacing: 0.02em; text-transform: none; }
body.v2 .chronicle-cutscene__title { font: 900 22px/1.25 var(--v2-font); color: var(--v2-ink); margin: 4px 0 12px; }
body.v2 .chronicle-cutscene__scroll {
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--v2-ink); padding: 4px 12px;
}
body.v2 .chronicle-cutscene__line { color: var(--v2-ink); font-size: 14px; line-height: 1.5; padding: 8px 0; border-bottom: 2px dashed rgba(22, 19, 29, 0.25); margin: 0; }
body.v2 .chronicle-cutscene__line:last-child { border-bottom: 0; }
body.v2 .chronicle-cutscene__line--more { color: var(--v2-muted); font-family: var(--v2-mono); font-size: 12px; }
body.v2 .chronicle-cutscene__narrative { color: var(--v2-ink); font-size: 14px; margin: 12px 0 0; text-align: left; }
body.v2 .chronicle-cutscene__continue {
  width: 100%; min-height: 50px; margin-top: 14px; background: var(--v2-ink); color: var(--v2-card);
  border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 3px 3px 0 rgba(22,19,29,.35); font: 900 16px/1 var(--v2-font);
}
@media (prefers-reduced-motion: reduce) { .v2-chron-me { animation: none; } }
