/* ==========================================================================
   PFMT Trainer — "Embers" design system
   Muladhara (root chakra) diamond motif. Navy night base / pink accent / peach glow.
   Tokens are app-owned (NOT bound to --tg-theme-* runtime vars) so the look is
   consistent regardless of the host Telegram theme; body[data-theme] switches
   light/dark (driven by tg.js from tg.colorScheme or prefers-color-scheme).
   ========================================================================== */

:root {
  /* safe-area / Telegram viewport insets (set at runtime by tg.js) */
  --safe-top: 0px; --safe-bottom: 0px; --safe-left: 0px; --safe-right: 0px;
  --content-safe-top: 0px; --content-safe-bottom: 0px;

  /* Embers palette — light */
  --bg: #fafafc;
  --bg2: #efeef5;
  --text: #2b2c44;
  --hint: #7d809c;
  --accent: #e63a5c;
  --on-accent: #ffffff;
  --sep: rgba(65, 67, 106, 0.20);
  --root: #e2704f;
  --success: #4da154;
  --success-soft: rgba(77, 161, 84, 0.13);
  --warning: #d97a54;

  /* derived */
  --glow: color-mix(in srgb, var(--root) 78%, var(--accent));
  --accent-tint: color-mix(in srgb, var(--accent) 10%, var(--bg));
  --accent-tint-12: color-mix(in srgb, var(--accent) 12%, var(--bg));

  /* spacing / radii (4pt grid) */
  --radius-card-sm: 12px;
  --radius-card-lg: 16px;
  --screen-pad: 16px;
}

body[data-theme="dark"] {
  --bg: #171f33;
  --bg2: #262e4d;
  --text: #f4f2f7;
  --hint: #9aa3c0;
  --accent: #f64668;
  --on-accent: #ffffff;
  --sep: rgba(154, 163, 192, 0.28);
  --root: #fe9677;
  --success: #7fc981;
  --success-soft: rgba(127, 201, 129, 0.16);
  --warning: #fe9677;
}

* { box-sizing: border-box; }

/* Stop the page being dragged sideways: the particle canvas extends ~40px past
   each edge on narrow screens. The horizontal clip must be on BOTH html and body
   — clip on the root alone doesn't suppress the viewport's horizontal scroll
   (verified). `clip` is single-axis, so vertical scrolling stays intact for the
   scrollable screens. */
html, body { overflow-x: clip; }

body {
  margin: 0;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* no double-tap zoom (tap-to-pause on the stage invites double taps) */
  touch-action: manipulation;
  /* don't let a swipe rubber-band / drag the whole page (web + Telegram) */
  overscroll-behavior: none;
}

.app { min-height: 100vh; }

/* Reserved top strip: status-bar inset + Telegram content inset. Do NOT hardcode. */
#screen {
  padding: calc(var(--safe-top) + var(--content-safe-top) + 12px)
    calc(var(--safe-right) + var(--screen-pad))
    calc(var(--safe-bottom) + 96px)
    calc(var(--safe-left) + var(--screen-pad));
}

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; margin: 4px 0 14px; }
h2 { font-size: 20px; font-weight: 600; margin: 18px 0 8px; }

.hint, .status, .caption { color: var(--hint); font-size: 13px; }
.caption { text-align: center; }
.err { color: var(--warning); font-size: 13px; }

/* ==========================================================================
   Primitives — diamond (rotated rounded square) + glow-dot (blurred circle).
   Reused by Today (living ember, entry glyphs), Stats (calendar), Check-up
   (checklist markers), Onboarding (glyphs). Deep per-screen composition
   lands in Tasks 2–5; this is just the base shape.
   ========================================================================== */
.diamond {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: var(--root);
  flex: none;
}
.diamond.outline {
  background: none;
  border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.diamond.hollow {
  background: none;
  border: 1.5px solid var(--hint);
}
.diamond.success {
  background: var(--success);
}

.glow-dot {
  border-radius: 50%;
  background: var(--glow);
  filter: blur(18px);
}

/* ==========================================================================
   Buttons (in-content, e.g. link/toggle rows — NOT the bottom action bar)
   ========================================================================== */
.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  background: var(--bg2);
  color: var(--text);
  font-family: inherit;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: 0.5; }
.btn.link { background: none; color: var(--accent); padding: 8px; font-size: 15px; font-weight: 400; }
.fallback-back {
  position: fixed;
  top: calc(var(--safe-top) + var(--content-safe-top));
  left: var(--safe-left);
  z-index: 10;
}
.fallback-back[hidden] { display: none; }

/* ==========================================================================
   Bottom action bar — edge-to-edge, r0, 50px tall + home-indicator inset.
   Side-by-side: secondary fixed 128px + primary flex. Stacked (onboarding
   two-answer screens): secondary full-width ABOVE primary, 6px gap.
   ========================================================================== */
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 0;
  z-index: 5;
}
.action-bar[hidden] { display: none; }

/* buttons run to the very bottom edge: 50px content + the home-indicator
   inset as internal bottom padding, so the fill covers the whole strip
   (native MainButton look) while the label stays centered in the top 50px */
.ab-primary,
.ab-secondary {
  border: none;
  border-radius: 0;
  height: calc(50px + max(var(--safe-bottom), 0px));
  padding-bottom: max(var(--safe-bottom), 0px);
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
}
.ab-primary {
  flex: 1;
  background: var(--accent);
  color: var(--on-accent);
}
.ab-secondary {
  flex: 0 0 128px;
  background: var(--bg2);
  color: var(--text);
}
.ab-secondary[hidden] { display: none; }
.ab-primary:disabled { opacity: 0.5; }

/* stacked mode: secondary full-width above primary, 6px gap; only the
   primary (bottom) button carries the home-indicator extension */
.action-bar.stacked {
  flex-direction: column;
  gap: 6px;
}
.action-bar.stacked .ab-secondary,
.action-bar.stacked .ab-primary {
  flex: 1 1 auto;
  width: 100%;
}
.action-bar.stacked .ab-secondary {
  height: 50px;
  padding-bottom: 0;
}

/* ==========================================================================
   Chips + segmented control
   ========================================================================== */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }

/* selectable chip: h38 r19 */
.chip {
  height: 38px;
  padding: 0 16px;
  border-radius: 19px;
  border: 1px solid var(--sep);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.chip.selected {
  background: var(--accent-tint-12);
  border-color: var(--accent);
  color: var(--accent);
}
/* pain chip: visually separated from the rating chips — warning-tinted so it
   reads as a distinct, non-rating action rather than a fourth rating option */
.chip--pain {
  border-color: color-mix(in srgb, var(--warning) 55%, transparent);
  color: var(--warning);
}
.chip--pain.selected {
  background: color-mix(in srgb, var(--warning) 14%, var(--bg));
  border-color: var(--warning);
  color: var(--warning);
}
.zone-select {
  max-width: 60%;
  height: 38px;
  padding: 0 12px;
  border-radius: 19px;
  border: 1px solid var(--sep);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.chip.reminder-auto { margin-left: 8px; font-size: 13px; }
/* "+ add" chip doubles as the picker trigger: the time input covers it invisibly */
.chip.add-time, .chip.reminder-chip { position: relative; cursor: pointer; }
.add-time-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 16px; /* prevents iOS zoom-on-focus */
}

/* segmented control: track bg2 r11 p3, active seg = text-14%mix r8 */
.segmented {
  display: flex;
  padding: 3px;
  border-radius: 11px;
  background: var(--bg2);
}
.segmented .seg {
  flex: 1;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--hint);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}
.segmented .seg.active {
  background: color-mix(in srgb, var(--text) 14%, var(--bg2));
  color: var(--text);
}

/* switch: 46x28, on = accent, off = text-14%mix, white knob 24 */
.switch {
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 14%, var(--bg2));
  position: relative;
  border: none;
  flex: none;
  padding: 0;
}
.switch[data-on="1"] { background: var(--accent); }
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.2s ease;
}
.switch[data-on="1"]::after { left: 20px; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  border: none;
  border-radius: var(--radius-card-sm);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--bg2);
}
.card.hero { border-radius: var(--radius-card-lg); padding: 20px 18px; }
.card .card-title { font-size: 22px; font-weight: 700; }
.card .card-meta { color: var(--hint); font-size: 13px; margin-top: 2px; }
.card .card-line { color: var(--text); font-size: 15px; margin-top: 8px; }

/* banner: accent-10% fill r12 + chevron */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
}
.banner::after {
  content: "\203A";
  margin-left: auto;
  font-size: 18px;
  line-height: 1;
}

/* quiet row + chevron (e.g. "Retake safety check") */
.quiet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.quiet-row::after {
  content: "\203A";
  margin-left: auto;
  color: var(--hint);
  font-size: 18px;
  line-height: 1;
}

/* status row + entry row (Today): superseded by "=== today ===" section below */

/* ==========================================================================
   Metrics + calendar (stats)
   ========================================================================== */
.metric-row { display: flex; gap: 8px; margin-bottom: 14px; }
.metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 14px 14px 12px;
  border-radius: var(--radius-card-sm);
  background: var(--bg2);
}
.metric b { display: block; font-size: 28px; font-weight: 700; }
.metric span { color: var(--hint); font-size: 13px; }

.cal-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 6px 0; justify-items: center; }
.cal-cell {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  transform: rotate(45deg);
  background: none;
}
.cal-cell[data-state="full"] { background: var(--root); }
.cal-cell[data-state="partial"] { background: color-mix(in srgb, var(--root) 40%, transparent); }
.cal-cell[data-state="rest"] { background: none; border: 1.5px dashed var(--hint); }
.cal-cell[data-state="missed"] { background: none; border: 1px solid var(--sep); }
.cal-cell[data-today="1"] {
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 40%, transparent);
}
.legend { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; font-size: 11px; color: var(--hint); }

/* history: rows h46, 0.5px separators */
.history { list-style: none; padding: 0; margin: 0; border-radius: var(--radius-card-sm); background: var(--bg2); overflow: hidden; }
.history li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 8px 14px;
  margin: 0;
  background: none;
  border-bottom: 0.5px solid var(--sep);
  font-size: 15px;
}
.history li:last-child { border-bottom: none; }

/* ==========================================================================
   Session player (base) — see "=== session ===" section near the end of this
   file for the full diamond stage (Task 2).
   ========================================================================== */
/* 11b session player (design_handoff_session_track): header + progress at the
   top, the signature diamond as a flex:1 hero, the sliding set track + bottom
   pause below. Fills the screen height minus the reserved action-bar space. */
.player {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding-top: 0;
  position: relative; /* positioning context for the centered diamond stage */
  min-height: calc(100vh - var(--safe-top) - var(--content-safe-top)
    - var(--safe-bottom) - 108px);
}

/* ==========================================================================
   Completion (base) — see "=== session ===" section for the diamond
   centerpiece + milestone rings (Task 2).
   ========================================================================== */
/* The completion diamond reuses the running session's .stage-wrap / .stage
   (see "=== session ===") and the same absolute-center mechanism, so the
   session and completion diamonds share one plane, size, and look. */
.done-view {
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative; /* positioning context for the centered diamond stage */
  min-height: calc(100vh - var(--safe-top) - var(--content-safe-top)
    - var(--safe-bottom) - 108px);
}
.done-title { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -0.4px; }
.done-sub { color: var(--hint); margin-top: 4px; font-size: 15px; }
.feedback-row { display: flex; gap: 8px; justify-content: center; margin-top: 22px; }

/* ==========================================================================
   Finish-screen RPG progression: XP bar + perk cards (replaces the slider)
   ========================================================================== */
.progress-panel { width: 100%; max-width: 320px; margin: 22px auto 0; }
.xp-panel { width: 100%; }
.xp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.xp-level { font-size: 16px; font-weight: 700; color: var(--text); }
.xp-count { font-size: 13px; color: var(--hint); font-variant-numeric: tabular-nums; }
.xp-bar {
  width: 100%; height: 10px; border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg2));
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, var(--bg2)), var(--accent));
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.xp-combo { margin-top: 8px; font-size: 13px; color: var(--hint); text-align: center; }
.progress-note { margin-top: 14px; font-size: 14px; color: var(--hint); text-align: center; }

.levelup-banner {
  margin-top: 20px; text-align: center;
  font-size: 17px; font-weight: 700; color: var(--accent);
  letter-spacing: -0.2px;
}
.perk-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.perk-cards.picking .perk-card:not(.chosen) { opacity: 0.4; }
.perk-card {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: var(--radius-card-lg);
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.3s ease, transform 0.15s ease;
}
.perk-card:active { transform: scale(0.985); }
.perk-card.chosen { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.perk-name-row { display: flex; align-items: center; gap: 8px; }
.perk-name { font-size: 16px; font-weight: 700; }
.perk-tier {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--on-accent); background: var(--accent);
  padding: 1px 7px; border-radius: 999px;
}
.perk-method { font-size: 13px; color: var(--hint); margin-top: 2px; }
.perk-lean { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.perk-lean-row { display: flex; align-items: center; gap: 8px; }
.perk-lean-label { flex: 0 0 74px; font-size: 12px; color: var(--hint); }
.perk-lean-track {
  flex: 1; height: 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg2)); overflow: hidden;
}
.perk-lean-fill {
  height: 100%; border-radius: 3px; background: var(--accent);
  transition: width 0.5s ease;
}
.perk-tip { margin-top: 10px; font-size: 13px; color: var(--text); line-height: 1.4; opacity: 0.85; }

/* ==========================================================================
   Check-up
   ========================================================================== */
.measure { text-align: center; }
.measure .result { font-size: 44px; font-weight: 200; color: var(--accent); min-height: 1.1em; font-variant-numeric: tabular-nums; }
.tap-target {
  width: 100%;
  padding: 26px 0;
  border-radius: var(--radius-card-lg);
  border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--bg);
  color: var(--accent);
  font-size: 17px;
  font-weight: 600;
}
.checklist { margin: 12px 0; border-radius: var(--radius-card-sm); background: var(--bg2); padding: 2px 14px; }
.checklist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 15px;
  color: var(--text);
  border-bottom: 0.5px solid var(--sep);
}
.checklist-row:last-child { border-bottom: none; }
.checklist-row .card-meta { margin-left: auto; margin-top: 0; }

/* ==========================================================================
   Forms / onboarding
   ========================================================================== */
.field { display: block; margin-bottom: 14px; }
.screen-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--sep);
}
.screen-q { font-size: 15px; }
.btn.toggle { padding: 8px 18px; border-radius: 16px; font-size: 15px; font-weight: 600; }
.btn.toggle.yes { background: var(--accent); color: var(--on-accent); }

.option-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-card-sm);
  border: 1px solid var(--sep);
  background: var(--bg);
  color: var(--text);
}
.option-card.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.option-card .opt-name { font-weight: 600; font-size: 15px; }
.option-card .opt-desc { color: var(--hint); font-size: 13px; }

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--sep);
  font-size: 15px;
}
input[type="time"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--sep);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
/* .all-done base rule superseded by "=== today ===" section below */

/* ==========================================================================
   === session ===
   Diamond stage (Task 2): top indicator (rep diamonds + countdown), the
   300x300 breathing diamond, phase strip icons, lead-in, and the Completion /
   Milestone diamond. Ease matches the design spec throughout.
   ========================================================================== */
:root { --ease-session: cubic-bezier(0.37, 0, 0.63, 1); }

/* --- progress row: per-set bars (width ∝ set duration) + session countdown --- */
.sess-bars-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}
.sess-setbars { flex: 1; display: flex; align-items: center; gap: 5px; min-width: 0; }
.sess-setbar {
  /* flex-sized ∝ set duration; track = the set's action-type tint @22%
     (barColor() in session.js — every type gets its own color, see
     actionVisuals.js TYPE_COLOR). */
  height: 7px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--bucket) 22%, transparent);
  overflow: hidden;
}
.sess-setbar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--bucket);
  transition: width 0.3s linear;
}
.sess-time {
  flex: none;
  font-size: 14px;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --- diamond stage: pinned to the player's vertical center ---
   The diamond is the fixed anchor: absolutely centered in the player so it
   holds its plane/size regardless of the rows around it (progress above, the
   action name + card strip + cue flex around it — the strip is pulled to the
   bottom via margin-top:auto). Below ~780px tall there isn't room to center a
   300px diamond without colliding the action name, so short screens fall back
   to the in-flow flex layout that reserves the strip's space (diamond rides a
   little higher, no overlap). */
.player .stage-wrap,
.done-view .stage-wrap {
  /* Pinned above center (mockup: diamond center ≈ 39% from frame top), the same
     value for running and done so the shape never jumps between states. The
     rail + cue dock to the bottom (margin-top:auto below), leaving the diamond
     the fixed anchor of the screen. */
  position: absolute;
  top: 42%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: auto;
  min-height: 0;
  margin: 0;
}
/* the row that follows the diamond gets pulled to the bottom, so the diamond
   holds the true center with the other content flexing below it. */
.player .sess-stack,
.done-view .done-title { margin-top: auto; }
/* Bottom cluster: action name -> cards -> set description -> pause controls,
   docked as one unit (auto-margin above). */
.sess-stack { display: flex; flex-direction: column; }
/* Paused: drop the cards + set description, leaving "Paused" + pause controls. */
.sess-stack[data-paused="1"] .sess-astrip,
.sess-stack[data-paused="1"] .sess-cue { display: none; }
.stage-wrap { display: flex; justify-content: center; align-items: center; height: 46vh; min-height: 260px; }
@media (max-height: 780px) {
  .player .stage-wrap,
  .done-view .stage-wrap { position: static; transform: none; flex: 1; height: auto; min-height: 240px; }
  .player .sess-stack,
  .done-view .done-title { margin-top: 0; }
}
.stage {
  width: 300px;
  height: 300px;
  position: relative;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.stage[data-paused="1"] { opacity: 0.45; }

.stage-bloom {
  /* radial-gradient halo instead of a blurred solid: a blurred square
     plateaus and then dies within ~2x the blur radius, which reads as a
     hard ring around the diamond. A gradient fades all the way out. */
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    color-mix(in srgb, var(--glow) 68%, transparent) 0%,
    color-mix(in srgb, var(--glow) 48%, transparent) 40%,
    color-mix(in srgb, var(--glow) 18%, transparent) 65%,
    transparent 92%);
  opacity: 0;
  transform: scale(1);
  transition: opacity 0.8s var(--ease-session), transform 0.8s var(--ease-session);
}
.stage-outline {
  position: absolute;
  inset: 56px;
  border-radius: 46px;
  border: 1.5px solid color-mix(in srgb, var(--bucket, var(--accent)) 50%, transparent);
  transform: rotate(45deg);
  transition: border-color 0.3s ease;
}
.stage[data-bucket="rest"] .stage-outline {
  border-color: color-mix(in srgb, var(--bucket) 45%, transparent);
}
.stage-clip {
  position: absolute;
  inset: 56px;
  border-radius: 46px;
  transform: rotate(45deg);
  overflow: hidden;
}
.stage-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--glow);
  filter: blur(18px);
  opacity: 0.12;
  transform: scale(0.1);
  transition: opacity 0.6s var(--ease-session), transform 0.6s var(--ease-session),
    filter 1.8s var(--ease-session);
}
/* the core heats WITH the fill: brightness/saturation ramp over the effort
   attack (inline transition-duration syncs it to the fill), continue
   seamlessly into the hold, where a slow shimmer keeps it alive. Gated on the
   glow-profile heat (data-heat), not the raw phase kind. */
.stage[data-heat="warm"] .stage-glow,
.stage[data-heat="shimmer"] .stage-glow {
  filter: blur(18px) brightness(1.3) saturate(1.2);
}
/* Shimmer pulses OPACITY over a static filter (thermal fix 2026-07-13):
   animating the filter itself re-rasterized the 18px blur on every frame.
   The static filter is set to the old peak; the opacity trough lands the
   same perceived low, and the compositor animates opacity for free. */
.stage[data-heat="shimmer"] .stage-glow {
  filter: blur(18px) brightness(1.45) saturate(1.3);
  animation: pfmt-heat 2.6s ease-in-out 0.4s infinite alternate;
}
@keyframes pfmt-heat {
  from { opacity: 0.82; }
  to { opacity: 1; }
}
/* Particle-engine canvas: overlays the diamond. The engine draws in a 480px
   logical space where the diamond is 198px; scale by 188/198 so it aligns with
   the 188px .stage-outline (300 - 2*56). Centered on .stage, above the glow
   and outline, below the word/count overlay. */
.stage-particles {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 480px;
  height: 480px;
  transform: translate(-50%, -50%) scale(0.9495);
  pointer-events: none;
  z-index: 1;
}
/* When the engine is active, the CSS glow/bloom must not double-render —
   and the shimmer keyframes must not keep ticking on the invisible layer. */
.stage[data-particles="1"] .stage-glow,
.stage[data-particles="1"] .stage-bloom { opacity: 0 !important; animation: none; }
.stage-word-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Sit above the particle canvas (z-index:1) so the word/count overlay reads. */
  z-index: 2;
}
.stage-word {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--bucket, var(--hint));
  transition: color 0.3s ease;
}
/* paused: neutral word (don't carry the last phase's bucket tint) */
.stage[data-paused="1"] .stage-word { color: var(--hint); }
.stage-count-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.stage-count {
  font-size: 58px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stage-count-s { font-size: 20px; font-weight: 500; color: var(--hint); }
.stage-count-s[hidden] { display: none; }
.stage-lead-label { font-size: 17px; font-weight: 600; color: var(--hint); }
.stage-lead-num {
  font-size: 44px;
  font-weight: 200;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* --- action-card strip: one card per PHASE, centered on the active card.
   The band clips + edge-fades; the row is a single flex line translated on X
   (JS sets the transform) so the active card stays centered as phases advance. --- */
.sess-astrip {
  flex: none;
  position: relative;
  height: 110px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 82%, transparent 100%);
}
.sess-astrip-row {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateX(0);
  margin-top: -46px;
  display: flex;
  align-items: center;
  gap: 13px;
  will-change: transform;
}
.sess-acard {
  flex: none;
  width: 74px;
  height: 92px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  transition: all 0.45s cubic-bezier(0.4, 0, 0.15, 1);
}
.sess-acard-icon { display: flex; align-items: center; justify-content: center; color: var(--hint); }
.sess-acard-icon svg { width: 24px; height: 24px; }
.sess-acard-secs {
  font-size: 22px;
  font-weight: 600;
  color: var(--hint);
  font-variant-numeric: tabular-nums;
}
.sess-acard.active {
  opacity: 1;
  transform: scale(1.08);
  background: color-mix(in srgb, var(--bucket) 15%, var(--bg2));
  border: 1.5px solid var(--bucket);
}
.sess-acard.active .sess-acard-icon { color: var(--bucket); }
.sess-acard.active .sess-acard-secs { color: var(--text); }
.sess-acard.past { opacity: 0.26; }
.sess-acard.upcoming {
  transform: scale(0.9);
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}

/* --- cue line (current phase's cue, hidden when empty) --- */
.sess-cue {
  flex: none;
  text-align: center;
  padding: 6px 34px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hint);
  text-wrap: pretty;
}
.sess-cue[hidden] { display: none; }

/* Pause controls in the stack (below the cue): Resume primary + Skip secondary.
   Shown only while running && paused; replaces the bottom action bar for pause. */
.sess-pause-controls {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 34px 4px;
}
.sess-pause-controls[hidden] { display: none; }
.sess-pause-btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
}
.sess-pause-btn.primary {
  min-width: 168px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 700;
}
.sess-pause-btn.secondary {
  background: none;
  color: var(--hint);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 12px;
}

/* --- completion / milestone diamond --- */
/* Completion diamond = the running .stage frozen in a celebratory lit state:
   full accent glow + bloom (no phase animation), a big centered mark, and the
   milestone rings pulsing around the outline. Geometry/size come entirely from
   the shared .stage / .stage-outline / .stage-clip rules, so it matches the
   session diamond exactly. */
.done-stage {
  --bucket: var(--accent);
  --glow: var(--accent);
  cursor: default;
}
.done-stage .stage-bloom { opacity: 1; transform: scale(1); }
.done-stage .stage-glow { opacity: 0.85; transform: scale(1.6); filter: blur(18px) brightness(1.15); }
.done-mark {
  color: var(--on-accent);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-ring {
  position: absolute;
  inset: 56px;
  border-radius: 46px;
  border: 1.5px solid var(--root);
  opacity: 0;
  animation: pfmt-pulse-d 1.1s ease-out 1;
}
.stage-ring.r2 { animation-delay: 0.4s; }
@keyframes pfmt-pulse-d {
  0% { transform: rotate(45deg) scale(0.9); opacity: 0.45; }
  100% { transform: rotate(45deg) scale(1.4); opacity: 0; }
}

/* ==========================================================================
   === today ===
   Status row (streak chip + AM/PM text), contextual banner (accent-10% +
   chevron), hero card with the living ember (breathing diamond glow),
   entry row tiles, all-done lit diamond, and the quiet offline row.
   ========================================================================== */

/* --- status row: streak chip (ember diamond + glow) + AM/PM text --- */
.status-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 12px;
  border-radius: 18px;
  background: var(--bg2);
  font-size: 15px;
  font-weight: 600;
}
.streak-chip .ember-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: var(--root);
  box-shadow: 0 0 10px color-mix(in srgb, var(--root) 60%, transparent);
  flex: none;
}
.slot-status { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.slot-status .slot-sep { color: var(--sep); }
.slot-status .slot-part { color: var(--hint); }
.slot-status .slot-part[data-done="1"] { color: var(--success); font-weight: 600; }

/* --- offline quiet row (sits in the banner slot) --- */
.offline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--bg2);
}
.offline-row .hollow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--hint);
  flex: none;
}
.offline-row span { font-size: 13px; color: var(--hint); }

/* --- hero card: living ember + title/meta/exercises --- */
.hero-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 18px;
  border-radius: var(--radius-card-lg);
  background: var(--bg2);
  margin-bottom: 12px;
}
.hero-card .hero-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hero-card .hero-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.hero-card .hero-meta { font-size: 13px; color: var(--hint); }
.hero-card .hero-line { font-size: 15px; margin-top: 4px; }

.ember {
  width: 68px;
  height: 68px;
  position: relative;
  flex: none;
}
.ember .ember-outline {
  position: absolute;
  inset: 10px;
  border-radius: 9px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
  transform: rotate(45deg);
}
.ember .ember-clip {
  position: absolute;
  inset: 10px;
  border-radius: 9px;
  transform: rotate(45deg);
  overflow: hidden;
}
.ember .ember-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--glow);
  filter: blur(7px);
  animation: pfmt-ember-breathe 4s ease-in-out infinite;
}
@keyframes pfmt-ember-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1.2); }
  50% { opacity: 0.9; transform: scale(1.7); }
}

/* --- entry row: three equal tiles --- */
.entry-row { display: flex; gap: 8px; margin-top: 18px; }
.entry {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 14px 4px 12px;
  border-radius: var(--radius-card-sm);
  border: none;
  background: var(--bg2);
  color: var(--hint);
  font-size: 13px;
  font-family: inherit;
}
.entry svg { width: 20px; height: 20px; }

/* --- all-done: centered lit diamond --- */
.all-done { text-align: center; padding-top: 14vh; }
.all-done .done-diamond { width: 96px; height: 96px; }
.all-done .dd-outline { inset: 16px; border-radius: 11px; }
.all-done .dd-clip { inset: 16px; border-radius: 11px; }
.all-done .dd-glow { filter: blur(10px); opacity: 0.85; transform: scale(1.6); }
.all-done .dd-mark svg { width: 28px; height: 28px; }
.all-done .done-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-top: 10px; }
.all-done .done-sub { color: var(--hint); font-size: 15px; margin-top: 2px; }
.all-done .btn.link { margin-top: 10px; }

/* === today-plan === */
/* Session list replacing the hero card once a plan exists: one row per
   plan session, phase-tinted diamond dot, next-incomplete highlighted like
   .option-card.selected. Rows are informational only (no click-to-start);
   the action bar starts the next incomplete session. */
.plan-list { margin-bottom: 4px; }
.plan-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-card-sm);
  border: 1px solid var(--sep);
  background: var(--bg2);
}
.plan-row.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg2)); }
.plan-row .plan-dot { flex: none; }
.plan-row .plan-row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.plan-row .plan-row-label { font-size: 15px; font-weight: 600; }
.plan-row .plan-row-meta { font-size: 13px; color: var(--hint); }
.plan-row .plan-row-check { color: var(--success); font-size: 18px; font-weight: 700; flex: none; }

/* quiet FUNCTIONAL guidance card: no start action, just cues woven into the day */
.plan-guidance-card .card-meta { margin-top: 0; }
.plan-guidance-card .card-line:first-of-type { margin-top: 8px; }

/* ==========================================================================
   === stats ===
   Display-only: three metric cards, the 14-day diamond calendar strip inside
   a card (today gets the accent ring + glow), and a quiet history card.
   No action bar on this screen.
   ========================================================================== */
.cal-card, .history-card { padding: 16px 14px; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 0; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--hint); }
.legend-cell { width: 8px; height: 8px; border-radius: 2px; }
.legend-cell[data-state="rest"] { border-width: 1.5px; }
.legend-cell[data-state="missed"] { border-width: 1px; }

.history-card { display: flex; flex-direction: column; padding: 2px 14px; }
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--sep);
}
.history-row:last-child { border-bottom: none; }
.history-left { font-size: 15px; }
.history-right { font-size: 13px; color: var(--hint); }

/* ==========================================================================
   === checkup ===
   The diamond stage doubles as both measurements' display: max-hold shows a
   steadily lit glow with the live seconds inside; quick flicks uses the same
   stage as the tap target with a live count + countdown inside. Requirements
   checklist rows get mini diamond markers (success fill+check / hollow+×).
   ========================================================================== */
.measure-card { text-align: center; }
.measure-card .card-title { text-align: left; }
.measure-card .card-meta { text-align: left; margin-bottom: 4px; }

.checkup-stage {
  width: 220px;
  height: 220px;
  margin: 14px auto 4px;
  cursor: default;
}
.checkup-stage .stage-outline { inset: 40px; }
.checkup-stage .stage-clip { inset: 40px; }
.checkup-stage.is-tap-target { cursor: pointer; }

.checkup-stage-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--on-accent);
}
.stage-live-num, .stage-result-num {
  font-size: 44px;
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stage-result-num { color: var(--accent); }
.stage-live-label {
  font-size: 15px;
  opacity: 0.8;
}
.stage-hint { min-height: 1.2em; margin: 2px 0 8px; }

.measure-btn { width: 100%; margin-top: 4px; }

.checklist-row { gap: 12px; }
.checklist-row::before, .checklist-row::after { content: none; }
.checklist-marker { flex: none; }
.checklist-body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.checklist-title { font-size: 15px; }
.checklist-meta { font-size: 13px; color: var(--hint); margin: 0; text-align: left; }
.checklist-mark { display: flex; align-items: center; flex: none; }

/* ==========================================================================
   === settings ===
   Section label + goal chips, level segmented control + caption, reminders
   card (switch row + time chips + dashed add), retake-safety quiet row.
   ========================================================================== */
.settings-section { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.settings-label { font-size: 13px; color: var(--hint); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 0.5px solid var(--sep);
  font-size: 15px;
}
.switch-row:last-child { border-bottom: none; }

.reminders-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card-sm);
  background: var(--bg2);
  padding: 2px 14px;
}
.reminders-card .chip-row { padding: 12px 0; margin: 0; }

/* ==========================================================================
   === onboarding ===
   Wizard glyphs (welcome dim diamond, red-flag warning diamond, ember-diamond
   coaching bullets, hollow-diamond mix-up bullets) + goal/summary rows.
   ========================================================================== */
.wiz-glyph {
  width: 96px;
  height: 96px;
  position: relative;
  margin: 0 auto 6px;
}
.wiz-glyph .wg-outline {
  position: absolute;
  inset: 16px;
  border-radius: 11px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
  transform: rotate(45deg);
}
.wiz-glyph .wg-clip {
  position: absolute;
  inset: 16px;
  border-radius: 11px;
  transform: rotate(45deg);
  overflow: hidden;
}
.wiz-glyph .wg-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--glow);
  filter: blur(10px);
  opacity: 0.6;
  transform: scale(0.9);
}
.wiz-glyph.warning .wg-outline {
  border-color: color-mix(in srgb, var(--warning) 55%, transparent);
}
.wiz-glyph.warning .wg-glow {
  background: var(--warning);
  opacity: 0.4;
  transform: scale(0.8);
}

.wiz-lead {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 0 4px 20px;
}
.wiz-lead h1 { margin: 0; }
.wiz-lead .hint { font-size: 15px; line-height: 1.5; }

.wiz-caption { font-size: 13px; color: var(--hint); margin: -8px 0 4px; }

.coach-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px;
  border-radius: var(--radius-card-lg);
  background: var(--bg2);
  margin-bottom: 12px;
}
.coach-card.tight { gap: 3px; }
.coach-card .coach-title { font-size: 15px; font-weight: 600; }
.coach-card .coach-body { font-size: 15px; line-height: 1.45; color: var(--hint); }

.ember-bullet {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ember-bullet .diamond { margin-top: 5px; }
.ember-bullet span { font-size: 15px; line-height: 1.45; }

.hollow-bullet {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hollow-bullet span { font-size: 15px; color: var(--hint); }

.mixups-list { display: flex; flex-direction: column; gap: 6px; }

.summary-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card-sm);
  background: var(--bg2);
  padding: 2px 14px;
  margin-bottom: 4px;
}
.summary-card .summary-row { border-bottom: 0.5px solid var(--sep); }
.summary-card .summary-row:last-child { border-bottom: none; }
.summary-row .summary-value { display: flex; align-items: center; gap: 10px; }
.summary-row .summary-label { color: var(--hint); font-size: 15px; }
.summary-row .summary-name { font-weight: 600; font-size: 15px; }

/* === schedule === */
.schedule-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 10px 0 4px;
  border-radius: 2px;
  background: var(--bg2);
}
.schedule-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.schedule-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.schedule-preview { margin-top: 8px; }
.banner.warning {
  background: color-mix(in srgb, var(--warning) 14%, var(--bg));
  color: var(--warning);
}
.banner.warning::after { content: none; }
.schedule-session-list { margin-top: 4px; border-top: 0.5px solid var(--sep); }
.schedule-session-list .screen-row:last-child { border-bottom: none; }
.schedule-backup-list { margin-top: 2px; }
.schedule-backup-list .screen-row { padding: 8px 0; }
.schedule-backup-list .screen-row:last-child { border-bottom: none; }

/* Particle engine owns the interior: the phase word moves out to the rail. */
.stage[data-particles="1"] .stage-word { display: none; }

/* §5.2 action label just above the card rail. */
.sess-action-label {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--bucket, var(--accent));
  margin-bottom: 10px;
  min-height: 1em;
}

/* §5.3 optional center seconds over the particle fill: a soft radial scrim
   keeps the number legible without killing the particles behind it. */
.stage[data-particles="1"][data-seconds="1"] .stage-count-row {
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--bg, #171f32) 72%, transparent) 0%,
    color-mix(in srgb, var(--bg, #171f32) 40%, transparent) 60%,
    transparent 100%);
  border-radius: 50%;
  padding: 18px 22px;
}

/* --- developer panel (settings, DEV_IDS-gated) --- */
.dev-panel .field { margin: 4px 0; }
.dev-level-input {
  width: 72px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: transparent; color: var(--text); font-size: 15px;
}
.dev-apply, .dev-reset { align-self: flex-start; margin-top: 8px; }
.dev-reset { border-color: color-mix(in srgb, #e5484d 55%, transparent); color: #e5484d; }

/* --- character sheet (stats, v3) --- */
.char-card, .mastery-card, .quest-card, .records-card { display: flex; flex-direction: column; gap: 8px; }
.char-head { display: flex; align-items: baseline; justify-content: space-between; }
.char-level { font-size: 20px; }
.xp-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.xp-bar-fill {
  height: 100%; border-radius: 999px; background: var(--accent);
  transition: width 0.6s var(--ease-session, ease);
}
.xp-caption { margin-top: -2px; }
.stat-row { display: flex; flex-direction: column; gap: 3px; }
.stat-label { display: flex; justify-content: space-between; font-size: 14px; }
.stat-rung {
  font-size: 12px; opacity: 0.75; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 8px; padding: 0 6px;
}
.stat-bar { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.stat-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); opacity: 0.85; }
.perk-stars { letter-spacing: 2px; color: var(--accent); }
.mastery-bar { margin-top: 2px; }
.quest-pips { display: flex; gap: 8px; }
.quest-pip {
  width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.quest-pip[data-done="1"] { background: var(--accent); }
.quest-done { color: var(--accent); }

/* --- hero-day offer (today, v3) --- */
.hero-offer-card { border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }

/* --- cosmetic level-tier palettes (session stage, v3) ---
   Every 5 XP levels shifts the stage accent; the particle engine samples the
   live accent per frame, so embers recolor with the tier. Tier 1 = default. */
.stage[data-tier="2"] { --accent: #f6a13c; }   /* forge gold   (levels 5-9)   */
.stage[data-tier="3"] { --accent: #3ecf8e; }   /* jade         (levels 10-14) */
.stage[data-tier="4"] { --accent: #7c6cff; }   /* violet storm (levels 15+)   */

/* --- class picker (Settings): Goal + Focus as one classic-RPG archetype --- */
.class-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.class-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 12px; border-radius: var(--radius-card-sm);
  background: var(--bg2); border: 1.5px solid transparent;
  color: var(--text); font: inherit; cursor: pointer;
}
.class-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg2));
}
.class-head { display: flex; align-items: center; gap: 7px; }
.class-icon { font-size: 18px; line-height: 1; }
.class-name { font-weight: 650; }
.class-flavor { font-size: 12px; color: var(--hint); font-style: italic; line-height: 1.35; }
.class-detail { font-size: 12px; color: var(--hint); line-height: 1.35; }
.char-class { color: var(--hint); font-size: 14px; }
