/* Design tokens — patterns from Wingman, Ballast, Pumpel (MIT, GitHub) */
:root {
  --campfire-lit: 0.7;
  --bg: #0b0b11;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: #1a1a26;
  --surface-3: #12121a;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text-1: #f8f8ff;
  --text-2: #d4d4d8;
  --text-3: #71717a;
  --text-4: #52525b;
  --primary: #8b5cf6;
  --primary-dim: rgba(139, 92, 246, 0.14);
  --primary-glow: rgba(139, 92, 246, 0.35);
  --cyan: #22d3ee;
  --success: #10b981;
  --danger: #f43f5e;
  --campfire: #fb923c;
  --campfire-soft: #fdba74;
  --campfire-dim: rgba(251, 146, 60, 0.1);
  --campfire-border: rgba(251, 146, 60, 0.28);
  --campfire-surface: #120e0c;
  --campfire-frame: #2a1f14;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pixel: 4px;
  --nav-h: 64px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pixel-font: "VT323", var(--mono);
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
  --world-sky: #0e1220;
  --world-sky-gradient: linear-gradient(180deg, #0e1220 0%, #06080e 42%, #06080e 100%);
  --world-ground: #04050a;
  --world-dot: rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: #000;
  color-scheme: dark;
  transition: background-color 1.2s ease;
}

html[data-world-phase="day"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  line-height: 1.5;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: background-color 1.2s ease, color 1s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--world-sky-gradient, linear-gradient(180deg, #0e1220 0%, #06080e 100%));
  transition: background 1.4s ease;
}

html[data-world-phase="night"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 72% 12%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 44% 28%, rgba(255, 255, 255, 0.35), transparent);
}

body.ember-mode::before {
  animation: emberPulse 2.8s ease-in-out infinite;
}

@keyframes emberPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  font-size: 16px !important;
}

.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(10px, env(safe-area-inset-top)) 14px calc(var(--nav-h) + max(12px, env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background-image:
    var(--world-sky-gradient),
    radial-gradient(circle at 1px 1px, var(--world-dot) 1px, transparent 0);
  background-size: 100% 38vh, 20px 20px;
  background-repeat: no-repeat, repeat;
  transition: background-color 1.2s ease;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  animation: fadeIn 0.25s var(--ease-out);
}

.topbar__eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 600;
}

.topbar__title {
  margin: 2px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.topbar__subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-3);
}

.topbar__brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__logo {
  flex-shrink: 0;
}

.topbar__titles {
  min-width: 0;
}

.topbar__ring {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring__track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

.ring__fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s var(--ease-out);
}

.ring__text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-2);
}

/* ── Panels ── */
.panel {
  flex: 1;
  animation: fadeIn 0.22s var(--ease-out);
}

.panel[hidden] {
  display: none !important;
}

/* ── Session hero ── */
.session-hero {
  position: relative;
  border-radius: var(--radius-pixel);
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: background 0.35s var(--ease-out), border-color 0.35s, box-shadow 0.35s;
  box-shadow: 0 0 calc(8px + var(--campfire-lit, 0.5) * 24px)
    rgba(251, 146, 60, calc(var(--campfire-lit, 0.5) * 0.12));
}

.session-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 calc(12px + var(--campfire-lit, 0.5) * 20px)
    rgba(251, 146, 60, calc(var(--campfire-lit, 0.5) * 0.06));
}

.session-hero--night {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
}

.session-hero--dawn {
  background: linear-gradient(160deg, rgba(255, 248, 235, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.session-hero--day {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.02));
  border: 1px solid var(--border);
}

.session-hero--dusk {
  background: linear-gradient(200deg, rgba(255, 220, 180, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.session-hero__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.session-hero__head .session-hero__title {
  margin: 0;
}

.session-hero__head .session-hero__label {
  margin: 0 0 2px;
}

.session-hero--day .session-hero__label,
.session-hero--dawn .session-hero__label {
  color: var(--text-3);
}

.session-hero--night .session-hero__label,
.session-hero--dusk .session-hero__label {
  color: var(--text-3);
}

.session-hero--day .session-hero__fill,
.session-hero--dawn .session-hero__fill,
.session-hero--dusk .session-hero__fill,
.session-hero--night .session-hero__fill {
  background: linear-gradient(90deg, #71717a, #d4d4d8);
}

html[data-world-phase="day"] .session-hero--day .session-hero__fill {
  background: linear-gradient(90deg, #52525b, #a1a1aa);
}

.session-hero--day .auto-chip {
  color: var(--text-2);
  border-color: var(--border);
}

.session-hero--night .auto-chip,
.session-hero--dawn .auto-chip,
.session-hero--dusk .auto-chip {
  color: var(--text-3);
  border-color: var(--border);
}

.auto-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}

.auto-chip svg {
  width: 12px;
  height: 12px;
}

.auto-chip--manual {
  cursor: pointer;
  font: inherit;
  color: var(--text-2);
  border-color: rgba(255, 255, 255, 0.12);
}

.auto-chip--manual:hover {
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--primary);
}

.world-phase-chip {
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.session-hero--dawn .world-phase-chip,
.session-hero--dusk .world-phase-chip {
  border-color: rgba(255, 255, 255, 0.14);
}

.session-hero--day .world-phase-chip {
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-2);
}

.shell[data-theme="day"] .ring__fill {
  stroke: #52525b;
}

.shell[data-theme="night"] .ring__fill {
  stroke: #a1a1aa;
}

html[data-world-phase="day"] .shell[data-theme="day"] .ring__fill {
  stroke: #3f3f46;
}

html[data-world-phase="night"] .shell[data-theme="night"] .ring__fill {
  stroke: #d4d4d8;
}

.session-hero__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin: 0 0 4px;
}

.session-hero__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
}

.session-hero__note {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: #fbbf24;
  line-height: 1.4;
}

.session-hero__note--ok {
  color: var(--success);
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}

.mode-toggle__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 10px;
  padding: 10px 8px 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.mode-toggle__btn:active {
  transform: scale(0.97);
}

.mode-toggle__text {
  line-height: 1.2;
}

.bottom-nav__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.bottom-nav__logo .dn-logo--xs {
  width: 20px;
  height: 20px;
}

/* ── 日／夜標誌 ── */
.dn-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.dn-logo__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.dn-logo--lg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 0 14px rgba(139, 92, 246, 0.35));
}

.dn-logo--day.dn-logo--lg {
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.45));
}

.dn-logo--md {
  width: 40px;
  height: 40px;
}

.dn-logo--sm {
  width: 28px;
  height: 28px;
}

.dn-logo--xs {
  width: 22px;
  height: 22px;
}

.dn-logo--day .dn-logo__rays {
  transform-origin: 24px 24px;
  animation: sunSpin 24s linear infinite;
}

.dn-logo--day.dn-logo--lg .dn-logo__disc {
  animation: sunPulse 3s ease-in-out infinite;
}

.dn-logo--night .dn-logo__moon {
  animation: moonFloat 4s ease-in-out infinite;
}

.dn-logo--night .dn-logo__star {
  animation: starTwinkle 2.5s ease-in-out infinite;
}

.dn-logo--night .dn-logo__star:nth-child(2) {
  animation-delay: 0.4s;
}

.dn-logo--night .dn-logo__star:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes sunSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sunPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.88;
  }
}

@keyframes moonFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5px);
  }
}

@keyframes starTwinkle {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* legacy session tint hooks — sky cycle drives page chrome */

.mode-toggle__btn--active {
  background: var(--primary-dim);
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.mode-toggle__btn[data-mode="lunch"].mode-toggle__btn--active {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}

.exercise--skip-hint {
  border-color: rgba(251, 191, 36, 0.25);
}

.exercise__skip {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: #fbbf24;
}

.bottom-nav__btn--lunch[aria-current="page"] {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.session-hero__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 8px;
}

.session-hero__count {
  font-family: var(--mono);
  color: var(--primary);
  font-weight: 700;
}

.session-hero__track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.session-hero__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #22d3ee);
  transition: width 0.35s var(--ease-out);
}

html[data-world-phase="day"] .session-hero__count {
  color: var(--text-1);
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Exercise cards (Ballast-style) ── */
.exercise {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  animation: setSlideIn 0.2s var(--ease-out) both;
}

.exercise:nth-child(1) {
  animation-delay: 0ms;
}
.exercise:nth-child(2) {
  animation-delay: 40ms;
}
.exercise:nth-child(3) {
  animation-delay: 80ms;
}
.exercise:nth-child(4) {
  animation-delay: 120ms;
}
.exercise:nth-child(5) {
  animation-delay: 160ms;
}
.exercise:nth-child(6) {
  animation-delay: 200ms;
}
.exercise:nth-child(7) {
  animation-delay: 240ms;
}

.exercise--complete {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.08);
}

.exercise--active {
  border-color: rgba(124, 58, 237, 0.55);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.12);
}

.exercise__media {
  margin: 10px 14px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  position: relative;
}

.exercise__media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exercise__media-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--text-3);
  position: absolute;
  inset: 0;
}

.exercise__media:has(.exercise__media-img) .exercise__media-fallback {
  display: none;
}

.exercise__media-fallback svg {
  width: 36px;
  height: 36px;
  opacity: 0.55;
}

.exercise__media--placeholder .exercise__media-fallback,
.exercise__media--fallback .exercise__media-fallback {
  display: grid;
}

.set-active {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.set-active__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.set-active__timer {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}

.set-active__ready {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--success);
}

.set-active__hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-3);
}

.exercise__actions .btn--primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.exercise__top {
  display: flex;
  gap: 12px;
  padding: 14px 14px 0;
}

.exercise__num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.exercise--complete .exercise__num {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
}

.exercise__head {
  flex: 1;
  min-width: 0;
}

.exercise__title {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
}

.exercise__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.tag svg {
  width: 11px;
  height: 11px;
}

.exercise__chip {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-3);
}

.exercise__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  grid-column: 1 / -1;
}

.exercise__body {
  padding: 12px 14px 14px;
}

/* Set pills — Pumpel / Wingman style */
.set-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.set-pill {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-4);
  transition: all 0.15s var(--ease-out);
}

.set-pill--done {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: var(--success);
}

.set-pill--next {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.sets__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sets__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
}

.sets__count {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
}

.sets__count span {
  color: var(--primary);
}

.sets__hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-3);
}

.exercise__details {
  margin: 0 14px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.exercise__details summary {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-3);
  list-style: none;
  user-select: none;
}

.exercise__details summary::-webkit-details-marker {
  display: none;
}

.exercise__details[open] summary {
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.exercise__block {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.84rem;
  color: var(--text-3);
}

.exercise__block strong {
  color: var(--text-2);
}

.exercise__actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 0 14px 14px;
  align-items: stretch;
}

.exercise__actions .btn--primary {
  grid-column: 1 / -1;
}

.exercise__actions .check {
  grid-column: 1 / -1;
  justify-content: center;
  padding-top: 4px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-3);
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary,
.btn--accent {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  color: #fff;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

.btn--ghost {
  background: transparent;
  color: var(--text-2);
}

.btn--timer {
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--cyan);
}

.btn--compact {
  padding: 8px 11px;
  font-size: 0.8rem;
}

.btn--block {
  width: 100%;
}

.btn--danger {
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn--file {
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ── Bottom nav (Wingman-style) ── */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  overflow: visible;
  transition: background-color 1s ease, border-color 1s ease;
}

.bottom-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: env(safe-area-inset-bottom, 0);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

.bottom-nav__inner {
  display: flex;
  width: min(480px, 100%);
  gap: 2px;
}

.bottom-nav__btn {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pixel);
  background: color-mix(in srgb, var(--surface-3) 82%, transparent);
  color: var(--text-3);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 65%, transparent);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.bottom-nav__btn svg {
  width: 20px;
  height: 20px;
}

.bottom-nav__btn--train[aria-current="page"] {
  border-color: rgba(139, 92, 246, 0.42);
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.bottom-nav__btn--plan[aria-current="page"] {
  border-color: var(--campfire-border);
  background: var(--campfire-dim);
  color: var(--campfire-soft);
  box-shadow: 0 0 14px rgba(251, 146, 60, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.bottom-nav__inner--3 {
  gap: 4px;
  align-items: stretch;
}

.bottom-nav__btn--campfire {
  position: relative;
  flex: 1;
  border-color: color-mix(in srgb, var(--campfire-border) 70%, var(--border));
  background: color-mix(in srgb, var(--campfire-dim) 65%, var(--surface-3));
  color: var(--campfire-soft);
}

.bottom-nav__campfire-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  line-height: 0;
}

.bottom-nav__campfire-label {
  position: relative;
  z-index: 1;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.1;
}

.bottom-nav__btn--campfire .bottom-nav__countdown {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.1;
  color: var(--text-3);
}

.bottom-nav__btn--campfire[aria-current="page"] {
  border-color: var(--campfire-border);
  background: color-mix(in srgb, var(--campfire-dim) 90%, transparent);
  color: #fed7aa;
  box-shadow:
    inset 0 2px 0 #fb923c,
    0 0 16px rgba(251, 146, 60, calc(0.1 + var(--campfire-lit, 0.7) * 0.15));
}

.bottom-nav__btn--campfire[aria-current="page"] .bottom-nav__countdown {
  color: var(--campfire-soft);
}

.bottom-nav__btn--campfire.bottom-nav__btn--ember {
  animation: emberPulse 2.8s ease-in-out infinite;
}

body[data-campfire-tier="high"] {
  --geom-speed: 1.25;
}

body[data-campfire-tier="mid"] {
  --geom-speed: 1;
}

body[data-campfire-tier="low"] {
  --geom-speed: 0.78;
}

body[data-campfire-tier="ember"] {
  --geom-speed: 0.55;
}

.bottom-nav__countdown {
  font-family: var(--pixel-font);
  font-size: 0.5rem;
  opacity: 0.72;
  letter-spacing: 0.02em;
}

/* ── Plan panel (warm survival accents) ── */
.panel--warm .focus-card {
  border-radius: var(--radius-pixel);
  border: 2px solid var(--campfire-frame);
  background: var(--campfire-surface);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.panel--warm .focus-card__icon {
  border-radius: var(--radius-pixel);
  background: var(--campfire-dim);
  color: var(--campfire);
  border: 1px solid var(--campfire-border);
}

.panel--warm .motivation__input {
  border-radius: var(--radius-pixel);
  border: 2px solid var(--campfire-frame);
  background: var(--campfire-surface);
}

.panel--warm .motivation__input:focus-visible {
  border-color: var(--campfire-border);
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.25);
}

.panel--warm .account-bar {
  border-radius: var(--radius-pixel);
  border: 2px solid var(--campfire-frame);
  background: var(--campfire-surface);
}

.panel--warm .account-bar__avatar {
  border-radius: var(--radius-pixel);
  border: 2px solid var(--campfire-frame);
}

.focus-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: var(--primary-dim);
}

.focus-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(139, 92, 246, 0.2);
  color: var(--primary);
  flex-shrink: 0;
}

.focus-card__icon svg {
  width: 20px;
  height: 20px;
}

.focus-card__title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
}

.focus-card__body {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-3);
  line-height: 1.5;
}

.motivation {
  display: block;
  margin-bottom: 14px;
}

.motivation__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-3);
  margin-bottom: 6px;
}

.motivation__label svg {
  width: 14px;
  height: 14px;
  color: #f59e0b;
}

.motivation__input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-1);
  border-radius: var(--radius-md);
  padding: 12px;
}

.motivation__input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4);
  border-color: rgba(139, 92, 246, 0.5);
}

.streak-wrap {
  margin-bottom: 14px;
}

.streak-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-pixel);
  background: var(--campfire-surface);
  border: 2px solid var(--campfire-frame);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.streak-card__main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.streak-card__flame {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(251, 146, 60, calc(var(--campfire-lit, 0.5) * 0.5)));
}

.streak-card__label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.streak-card__value {
  margin: 2px 0 0;
  font-family: var(--pixel-font);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--campfire);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.streak-card__unit {
  margin-left: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-3);
}

.streak-card__split {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pixel);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--campfire-frame);
}

.streak-chip--on {
  color: var(--campfire-soft);
  border-color: var(--campfire-border);
  background: var(--campfire-dim);
}

.cal {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius-pixel);
  background: var(--campfire-surface);
  border: 2px solid var(--campfire-frame);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.cal__title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cal__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
}

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal__pad {
  aspect-ratio: 1;
}

.cal__day {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid transparent;
}

.cal__day--today {
  border-color: var(--campfire-border);
  color: var(--campfire-soft);
  box-shadow: 0 0 8px rgba(251, 146, 60, calc(var(--campfire-lit, 0.5) * 0.15));
}

.cal__day--done {
  background: var(--campfire-dim);
  border-color: var(--campfire-border);
}

.cal__num {
  font-family: var(--pixel-font);
  font-weight: 700;
}

.cal__marks {
  font-size: 0.55rem;
  line-height: 1;
}

.cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: var(--text-3);
}

.cycle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.cycle__cell {
  background: var(--campfire-surface);
  border: 2px solid var(--campfire-frame);
  border-radius: var(--radius-pixel);
  padding: 10px 8px;
  text-align: center;
}

.cycle__cell--suggested {
  border-color: var(--campfire-border);
  box-shadow: 0 0 12px rgba(251, 146, 60, calc(var(--campfire-lit, 0.5) * 0.15));
}

.cycle__progress {
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  color: var(--campfire);
}

.cycle__label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-3);
}

.cycle__name {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 3px 0;
  line-height: 1.25;
}

.anchor-details {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.anchor-details summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.anchor-details summary svg {
  width: 16px;
  height: 16px;
}

.anchor__input {
  margin-top: 10px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 10px 12px;
  font-family: var(--mono);
}

.summary {
  padding-top: 4px;
}

.summary__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.summary__title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.summary__list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-3);
  font-size: 0.84rem;
}

.summary__list li {
  margin-bottom: 8px;
}

.summary__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.disclaimer {
  margin: 14px 0 0;
  font-size: 0.72rem;
  color: var(--text-4);
  line-height: 1.45;
}

.credit {
  margin: 10px 0 0;
  font-size: 0.68rem;
  color: var(--text-4);
}

.credit a {
  color: var(--text-3);
}

/* ── Timer modal ── */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

.modal__panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-lg) var(--radius-lg);
  padding: 20px 18px 16px;
  animation: slideUp 0.28s var(--ease-out);
}

.modal__eyebrow {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  font-weight: 600;
}

.modal__title {
  margin: 4px 0 6px;
  font-size: 1.05rem;
}

.modal__meta {
  margin: 0 0 8px;
  color: var(--text-3);
  font-size: 0.86rem;
}

.modal__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.timer-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring__track {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.timer-ring__fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear;
}

.timer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + max(12px, env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text-1);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  opacity: 0;
  transition: transform 0.22s var(--ease-out), opacity 0.22s;
  z-index: 60;
  max-width: calc(100% - 32px);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  animation: toastSlideUp 0.2s var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes setSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (min-width: 520px) {
  .modal {
    place-items: center;
  }
  .modal__panel {
    border-radius: var(--radius-xl);
  }
}

/* ── Focus workout overlay ── */
body.work-modal-open {
  overflow: hidden;
}

.modal--focus {
  z-index: 55;
  place-items: stretch center;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.modal__panel--focus {
  width: min(480px, 100%);
  max-height: 100%;
  overflow-y: auto;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 12px 16px max(20px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 520px) {
  .modal--focus {
    place-items: center;
    padding: 16px;
  }
  .modal__panel--focus {
    max-height: min(92vh, 820px);
    border-radius: var(--radius-xl);
  }
}

.focus-modal__dismiss {
  display: flex;
  margin: 0 auto 4px;
  opacity: 0.7;
}

.focus-modal__title {
  font-size: 1.2rem;
  text-align: center;
}

.sets__prescription {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.focus-prescription {
  margin: 0 0 10px;
  text-align: center;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.02em;
}

.focus-modal__tags {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.exercise__media--focus {
  margin: 0 auto 12px;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(40vh, 260px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #14141c;
  border-color: rgba(124, 58, 237, 0.2);
}

.exercise__media--focus .exercise__media-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.exercise__media-img--unified {
  filter: saturate(0.92) contrast(1.04);
}

.focus-modal__cues {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface-3);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-3);
  line-height: 1.5;
}

.focus-modal__cues p {
  margin: 0;
}

.focus-modal__cues strong {
  color: var(--text-2);
}

.focus-timer {
  text-align: center;
  margin: 16px 0 12px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.28);
}

.focus-timer__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.focus-timer__value {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-1);
}

.focus-timer__ready {
  margin: 8px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--success);
}

.focus-rep-hint {
  text-align: center;
  margin: 14px 0 4px;
  font-size: 0.9rem;
  color: var(--text-3);
}

.focus-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.modal__panel--focus .set-pills {
  justify-content: center;
  margin-bottom: 4px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 20px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 92, 246, 0.22), transparent),
    var(--bg);
}

.auth-gate[hidden] {
  display: none !important;
}

.auth-gate__card {
  width: min(100%, 360px);
  padding: 28px 24px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface-3);
  text-align: center;
}

.auth-gate__logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: url("./icons/logo-night.svg") center / contain no-repeat;
}

.auth-gate__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}

.auth-gate__lead {
  margin: 0 0 20px;
  color: var(--text-3);
  font-size: 0.92rem;
}

.auth-gate__error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.btn--google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  cursor: pointer;
}

.btn--google__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.account-bar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.account-bar__meta {
  flex: 1;
  min-width: 0;
}

.account-bar__name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-bar__email {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Train day strip ── */
.train-day-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.train-day-strip__btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: var(--radius-pixel);
  border: 2px solid var(--campfire-frame);
  background: var(--campfire-surface);
  color: var(--text-3);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.train-day-strip__btn--active {
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
}

.train-day-strip__btn--suggested:not(.train-day-strip__btn--active) {
  border-color: var(--campfire-border);
  box-shadow: 0 0 10px rgba(251, 146, 60, calc(var(--campfire-lit, 0.5) * 0.12));
}

.train-day-strip__prog {
  font-family: var(--pixel-font);
  font-size: 0.62rem;
  opacity: 0.9;
  color: var(--campfire-soft);
}

/* ── Campfire panel (survival pixel) ── */
.panel--pixel .campfire-hero__title,
.panel--pixel .campfire-fuel__value,
.panel--pixel .campfire-countdown {
  font-family: var(--pixel-font);
  letter-spacing: 0.02em;
}

.campfire-hero {
  position: relative;
  text-align: center;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-radius: 4px;
  border: 3px solid #2a2220;
  background: var(--world-ground, #080608);
  box-shadow: inset 0 0 0 1px #000;
  overflow: hidden;
}

.campfire-scene {
  position: relative;
  height: 212px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
  overflow: hidden;
  background: var(--world-sky-gradient, linear-gradient(180deg, #0c1022, #1c2648));
}

.campfire-scene .rogue-campfire--hero {
  position: relative;
  z-index: 1;
  width: 300px;
  height: 200px;
  max-width: none;
  margin: 0 auto;
  flex-shrink: 0;
  transform: scale(0.78);
  transform-origin: center top;
}

.campfire-scene__sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(251, 146, 60, 0.14), transparent 60%),
    var(--world-sky-gradient);
  pointer-events: none;
}

.campfire-hero--ember .campfire-scene__sky {
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(220, 38, 38, 0.12), transparent 60%),
    var(--world-sky-gradient);
}

.campfire-hero__copy {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 10px 12px 0;
  border-top: 1px solid rgba(42, 31, 20, 0.8);
  background: var(--world-ground, #080608);
}

.campfire-hero__title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  color: #fed7aa;
  text-shadow: 0 2px 0 #000;
}

.campfire-hero__subtitle {
  margin: 0;
  color: #a8a29e;
  font-size: 0.88rem;
}

.campfire-urgency {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 2px solid transparent;
}

.campfire-urgency--idle {
  color: #d6d3d1;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.campfire-urgency--warn {
  color: #fed7aa;
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.35);
}

.campfire-urgency--critical {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  animation: emberPulse 2.2s ease-in-out infinite;
}

.campfire-fuel--low .pixel-fuel__seg--on {
  filter: saturate(0.75);
}

.campfire-fuel--critical .pixel-fuel__seg--on {
  filter: saturate(0.5) brightness(0.85);
}

.campfire-fuel--pixel {
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 4px;
  border: 3px solid #3d2818;
  background: #120e0c;
  box-shadow: inset 0 0 0 1px #000;
}

.campfire-fuel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #d6d3d1;
}

.campfire-fuel__value {
  font-size: 1.65rem;
  color: #fb923c;
  text-shadow: 0 2px 0 #000;
}

.campfire-fuel__value span {
  font-size: 1rem;
  color: #78716c;
}

.pixel-fuel {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  padding: 4px;
  border: 2px solid #2a1c12;
  background: #0a0706;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.6);
}

.pixel-fuel__seg {
  height: 18px;
  background: #1c1410;
  border: 1px solid #2f2118;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

.pixel-fuel__seg--on {
  background: linear-gradient(180deg, #fbbf24 0%, #ea580c 100%);
  border-color: #c2410c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 8px rgba(251, 146, 60, 0.35);
}

.pixel-fuel__seg--hot {
  background: linear-gradient(180deg, #fef08a 0%, #f97316 100%);
}

.campfire-fuel__hint {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #78716c;
}

.campfire-crew--pixel {
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 4px;
  border: 3px solid #3d2818;
  background: #120e0c;
  box-shadow: inset 0 0 0 1px #000;
}

.campfire-crew__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #e7e5e4;
}

.campfire-crew__title svg {
  width: 18px;
  height: 18px;
  color: #fb923c;
}

.campfire-crew__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.campfire-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 2px solid #2a1c12;
  background: #0d0a08;
}

.campfire-member__avatar {
  width: 36px;
  height: 36px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #3d2818;
  image-rendering: pixelated;
}

.campfire-member__avatar--placeholder {
  display: grid;
  place-items: center;
  background: #1c1410;
  color: #d6d3d1;
  font-weight: 700;
  border-radius: 2px;
}

.campfire-member__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.campfire-member__chips {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.campfire-member__chip {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 2px;
  background: #1c1410;
  border: 1px solid #3d2818;
  color: #a8a29e;
}

.campfire-member__chip--in {
  background: #14532d;
  border-color: #166534;
  color: #86efac;
}

.campfire-member__chip--idle {
  opacity: 0.85;
}

.campfire-tip {
  margin: 0;
  font-size: 0.78rem;
  color: #57534e;
  line-height: 1.45;
}

.campfire-empty {
  padding: 32px 16px;
  text-align: center;
  border-radius: 4px;
  border: 3px dashed #3d2818;
  background: #120e0c;
}

.campfire-empty__title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-family: var(--pixel-font, var(--mono));
}

.campfire-empty__body {
  margin: 0;
  color: #78716c;
  font-size: 0.9rem;
}
