/* ═══════════ 專注訓練模式（app.js「專注訓練模式」嗰段） ═══════════
   z-index 45：蓋住底部導航（40），但喺休息／計時 modal（50+）同 cutscene 下面 */
.gf {
  position: fixed; inset: 0; z-index: 45; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; background: var(--v2-paper); color: var(--v2-ink); font-family: var(--v2-font);
  padding-bottom: env(safe-area-inset-bottom);
}
.gf[hidden] { display: none; }
.gf--in { animation: gfIn .45s steps(6) both; }
@keyframes gfIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
body.gym-focus-on { overflow: hidden; }
/* 換站休息：用返休息計時，但唔出休息 modal */
body.gym-focus-travel #restModal { display: none !important; }

/* 頂部 */
.gf-top { position: relative; z-index: 4; display: flex; align-items: center; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 14px 10px; }
.gf-round {
  width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--v2-ink);
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--v2-ink);
}
.gf-chip {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 11px; font-weight: 700;
  background: var(--v2-card); border: 2px solid var(--v2-ink); border-radius: 999px;
}
.gf-chip--sm { flex-shrink: 0; font-size: 10px; padding: 3px 8px; }
.gf-chip[hidden] { display: none; }
.gf-grow { flex: 1; }

/* 做緊一個動作 */
.gf-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 12px; min-height: 0; }
.gf-work { overflow: hidden; flex-shrink: 0; }
.gf-art { position: relative; height: clamp(180px, 34dvh, 300px); border-bottom: 2.5px solid var(--v2-ink); overflow: hidden; }
.gf-art .v2-illo { width: auto; left: 50%; right: auto; aspect-ratio: 1.8; height: 100%; transform: translateX(-50%); margin: 0; }
.gf-art .exercise__media { position: absolute; inset: 0; margin: 0; border: 0; border-radius: 0; }
.gf-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.gf-name { margin: 0; font: 900 clamp(22px, 6.4vw, 28px)/1.15 var(--v2-font); }
.gf-rx { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.gf-rx .v2-num { font-size: 17px; font-weight: 700; }
.gf-buddy .v2-buddy__say { font-size: 14px; }
.gf-foot { position: sticky; bottom: 0; padding: 10px 16px max(22px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--v2-paper) 30%); }
.gf-main { width: 100%; min-height: 64px; font-size: 19px; background: var(--v2-ember); }
.gf-main[disabled] { opacity: .5; cursor: default; }
.gf-main--ready { animation: v2wob 1s steps(2) infinite; }
.gf .v2-btn--white { background: var(--v2-card); }

/* 訓練頁入口 */
.gf-enter { width: 100%; min-height: 58px; margin-top: 12px; font-size: 18px; background: var(--v2-ember); }

/* 地圖（淨係換動作嗰陣出） */
.gf-map {
  position: relative; flex-shrink: 0; margin-top: calc(-1 * (max(14px, env(safe-area-inset-top)) + 50px)); overflow: hidden;
  background: var(--v2-moon); border-bottom: 2.5px solid var(--v2-ink); animation: gfFade .5s steps(5) both;
}
.gf--day .gf-map { background: var(--v2-flame); }
@keyframes gfFade { from { opacity: 0; } to { opacity: 1; } }
.gf-map::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; opacity: .2; pointer-events: none;
  background-image: repeating-conic-gradient(var(--v2-ink) 0 25%, transparent 0 50%); background-size: 4px 4px;
}
.gf-stars { position: absolute; left: 14%; top: 70px; width: 4px; height: 4px; background: var(--v2-card); box-shadow: 90px -8px 0 var(--v2-card), 200px 14px 0 var(--v2-card), 150px 40px 0 var(--v2-card), 260px -2px 0 var(--v2-card); }
.gf--day .gf-stars { display: none; }
.gf-path { position: absolute; inset: 0; width: 100%; height: 100%; }
.gf-path polyline { fill: none; stroke: var(--v2-ink); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.gf-path__all { stroke-width: 3; stroke-dasharray: 2 8; }
.gf-path__done { stroke-width: 4; }
.gf-node {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: flex; align-items: center; justify-content: center; color: var(--v2-ink);
  background: #e4dcff; border: 2.5px dashed var(--v2-ink); border-radius: 50%;
}
.gf--day .gf-node { background: #fff1b8; }
.gf-node--done { background: var(--v2-ember) !important; border-style: solid; }
.gf-node--cur { background: var(--v2-flame) !important; border-style: solid; box-shadow: 0 0 0 3px var(--v2-card), 0 0 0 5.5px var(--v2-ink); }
.gf-node--flag { width: 52px; height: 52px; margin: -26px 0 0 -26px; background: var(--v2-card) !important; border-style: solid; box-shadow: 3px 3px 0 var(--v2-ink); }
.gf-node--flag.gf-node--cur { background: var(--v2-flame) !important; box-shadow: 0 0 0 3px var(--v2-card), 0 0 0 5.5px var(--v2-ink); }
.gf-nlbl { position: absolute; width: 64px; margin-left: -32px; text-align: center; font-size: 10px; font-weight: 700; }
.gf-walker { position: absolute; z-index: 3; width: 44px; height: 70px; margin: -86px 0 0 -22px; pointer-events: none; }
.gf-walker__me {
  position: absolute; inset: 0; background: url(./images/v2/mascot-idle.png) 0 0 / 800% 100% no-repeat; image-rendering: pixelated;
  animation: v2m8 1.2s steps(8) infinite;
}
.gf-walker.is-walking .gf-walker__me { animation-duration: .5s; }
.gf-say {
  position: absolute; z-index: 5; padding: 4px 9px; font: 900 13px/1.3 var(--v2-font); white-space: nowrap;
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 10px; box-shadow: 2px 2px 0 var(--v2-ink);
}

/* 地圖下面：長休息 */
.gf-lower { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px max(22px, env(safe-area-inset-bottom)); }
.gf-lower[hidden] { display: none; }
.gf-clockrow { display: flex; align-items: center; gap: 12px; }
.gf-clock { font-size: 60px; font-weight: 700; line-height: 1; color: var(--v2-flame); -webkit-text-stroke: 2.5px var(--v2-ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--v2-ink); }
.gf-clockside { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gf-bar { display: block; height: 20px; overflow: hidden; background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 7px; box-shadow: 3px 3px 0 var(--v2-ink); }
.gf-bar span { display: block; height: 100%; width: 100%; border-right: 2.5px solid var(--v2-ink); transition: width .25s linear; }
.gf-next { display: flex; overflow: hidden; }
.gf-next__art { position: relative; width: 112px; min-height: 96px; flex-shrink: 0; overflow: hidden; border-right: 2.5px solid var(--v2-ink); }
.gf-next__art .v2-illo { width: 180px; left: 50%; margin-left: -90px; }
.gf-next__txt { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-width: 0; }
.gf-next__name { font-size: 19px; font-weight: 900; line-height: 1.2; }
.gf-btns { margin-top: auto; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.gf-btns .v2-btn { min-height: 56px; font-size: 16px; }

/* 火仔教練：地圖度記重量 + 感覺；營火度問成堂（coach.js） */
.gf-lower--check .gf-clock { font-size: 40px; -webkit-text-stroke-width: 2px; text-shadow: 3px 3px 0 var(--v2-ink); }
.gf-lower--check .gf-bar { height: 14px; box-shadow: none; }
.gf-lower--check .gf-next__art { width: 80px; min-height: 64px; }
.gf-lower--check .gf-next__art .v2-illo { width: 130px; margin-left: -65px; }
.gf-lower--check .gf-next__txt { padding: 8px 12px; gap: 2px; }
.gf-lower--check .gf-next__name { font-size: 16px; }
.gf-check { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 14px; }
.gf-check__say { display: flex; align-items: flex-end; gap: 8px; }
.gf-check__me { position: relative; width: 40px; height: 40px; flex-shrink: 0; overflow: hidden; background: var(--v2-flame); border: 2.5px solid var(--v2-ink); border-radius: 50%; }
.gf-check__me .gf-walker__me { inset: auto; left: 2px; top: -12px; width: 36px; height: 58px; }
.gf-check__bub {
  flex: 1; min-width: 0; margin: 0; padding: 8px 11px; font-size: 14px; font-weight: 700; line-height: 1.5;
  background: var(--v2-card); border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--v2-ink);
}
.gf-check__bub b { padding: 0 3px; font-weight: 900; background: var(--v2-flame); border-radius: 2px; }
.gf-check__load { display: flex; align-items: center; gap: 10px; }
.gf-step {
  width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--v2-ink);
  font: 700 26px/1 var(--v2-num, "Space Grotesk"), sans-serif; background: var(--v2-card);
  border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--v2-ink); -webkit-tap-highlight-color: transparent;
}
.gf-step:active { transform: translate(3px, 3px); box-shadow: none; }
.gf-check__kg { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.gf-check__kg b { font-size: 34px; line-height: 1; }
.gf-check__kg small { font-size: 16px; }
.gf-check__kg .v2-mono { font-size: 11px; color: var(--v2-muted); }
.gf-feels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gf-feel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; padding: 4px; cursor: pointer;
  text-align: center; color: var(--v2-ink); font-family: inherit; background: var(--v2-card);
  border: 2.5px solid var(--v2-ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--v2-ink); -webkit-tap-highlight-color: transparent;
}
.gf-feel b { font-size: 16px; font-weight: 900; line-height: 1.1; }
.gf-feel span { font-size: 10px; font-weight: 700; line-height: 1.25; color: var(--v2-muted); }
.gf-feel:active, .gf-feel.is-on { transform: translate(3px, 3px); box-shadow: none; }
.gf-feel.is-on { background: var(--v2-flame); }
.gf-check__stamp {
  position: absolute; right: 12px; top: -14px; padding: 2px 10px; transform: rotate(-8deg);
  font: 900 15px/1.3 var(--v2-font); color: #e0341a; border: 3px solid #e0341a; border-radius: 8px; background: rgba(255, 253, 247, .92);
  animation: fcStamp .5s cubic-bezier(.2, 1.2, .4, 1) both;
}
/* 做動作畫面：今次用幾重 */
.gf-load { align-self: flex-start; padding: 4px 10px; font-size: 13px; font-weight: 700; background: var(--v2-card); border: 2px solid var(--v2-ink); border-radius: 999px; }
.gf-load b { font-size: 15px; }
.gf-load--up { background: var(--v2-flame); }
.gf-load--empty { color: var(--v2-muted); border-style: dashed; }

/* 返到營火 */
.gf-done { position: relative; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.gf-done__title { font-size: 28px; font-weight: 900; line-height: 1.15; }
.gf-done__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; border-top: 2px dashed rgba(22, 19, 29, .3); }
.gf-done__stats span { display: flex; flex-direction: column; }
.gf-done__stats b { font-size: 26px; font-weight: 700; }
.gf-done__stamp {
  position: absolute; right: 16px; top: 20px; padding: 4px 12px; transform: rotate(-10deg);
  font: 900 22px/1.2 var(--v2-font); color: #e0341a; border: 3px solid #e0341a; border-radius: 8px; background: rgba(255, 253, 247, .85);
  animation: fcStamp .5s cubic-bezier(.2, 1.2, .4, 1) .2s both;
}
.gf-lower[data-gf-camp] .gf-main { margin-top: auto; }
/* 營火要問嘢：收工卡細返啲，少啲捲 */
.gf-lower[data-gf-camp] .gf-done { padding: 14px 16px; gap: 8px; }
.gf-lower[data-gf-camp] .gf-done__title { font-size: 22px; }
.gf-lower[data-gf-camp] .gf-done__stats b { font-size: 20px; }
.gf-lower[data-gf-camp] .gf-done__stamp { font-size: 18px; top: 14px; }

/* 暫停 */
.gf-veil { position: fixed; inset: 0; z-index: 6; background: rgba(22, 19, 29, .55); }
.gf-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; flex-direction: column; gap: 10px;
  padding: 20px 16px max(28px, env(safe-area-inset-bottom)); background: var(--v2-paper);
  border-top: 2.5px solid var(--v2-ink); border-radius: 20px 20px 0 0;
}
.gf-sheet__title { font-size: 22px; font-weight: 900; }
.gf-sheet__txt { margin: 0; font-size: 13px; line-height: 1.55; color: var(--v2-muted); }
.gf-sheet .v2-btn { min-height: 54px; }

@media (min-width: 560px) {
  .gf-body, .gf-lower, .gf-foot { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .gf--in, .gf-map, .gf-walker__me, .gf-main--ready, .gf-check__stamp { animation: none !important; }
}
