/* ── Sub Stat Bar ─────────────────────────────────────────────────────────── */

.sub-stat-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0.4rem 0 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 8px;
}

.stat-block {
  flex: 1;
  position: relative;
  text-align: center;
  padding: 0.5rem 0.25rem 0.4rem;
  border-radius: 6px;
  overflow: hidden;
  min-width: 0;
}

/* Fill bar — visualises 0-100 range behind the number */
.stat-fill-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stat-fill-bar {
  height: 100%;
  opacity: 0.08;
  transition: width 0.7s ease;
  border-radius: 6px;
}

/* Stat colours */
.stat-block--discipline .stat-fill-bar { background: #7eb8d4; } /* steel blue  */
.stat-block--devotion   .stat-fill-bar { background: #d4a07e; } /* warm amber  */
.stat-block--obedience  .stat-fill-bar { background: #9b7ed4; } /* deep purple */

.stat-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.4);
  position: relative;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  position: relative;
  line-height: 1.1;
}

.stat-delta {
  font-size: 0.68rem;
  font-weight: 600;
  position: relative;
  line-height: 1.3;
  transition: opacity 0.3s;
  min-height: 1em;
}
.stat-delta.positive { color: #6dbb7a; }
.stat-delta.negative { color: #d96060; }
.stat-delta.neutral  { color: rgba(255, 255, 255, 0.25); }

/* Flash animation when a stat value updates */
@keyframes stat-flash {
  0%   { background: rgba(201, 168, 76, 0.18); }
  100% { background: transparent; }
}
.stat-block.stat-flash {
  animation: stat-flash 0.8s ease-out forwards;
}

/* ── Task stat pill (in command center task cards) ────────────────────────── */

.cc-stat-pill {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  margin-left: 0.35em;
  vertical-align: middle;
  opacity: 0.75;
  flex-shrink: 0;
}
.cc-stat-pill--dis { background: rgba(126, 184, 212, 0.14); color: #7eb8d4; }
.cc-stat-pill--dev { background: rgba(212, 160, 126, 0.14); color: #d4a07e; }
.cc-stat-pill--obe { background: rgba(155, 126, 212, 0.14); color: #9b7ed4; }

/* Office mode overrides */
[data-theme="office"] .sub-stat-bar {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(74, 111, 165, 0.2);
}
[data-theme="office"] .stat-label   { color: rgba(0, 0, 0, 0.45); }
[data-theme="office"] .stat-value   { color: rgba(0, 0, 0, 0.75); }
[data-theme="office"] .stat-block--discipline .stat-fill-bar { background: #4a6fa5; }
[data-theme="office"] .stat-block--devotion   .stat-fill-bar { background: #a5784a; }
[data-theme="office"] .stat-block--obedience  .stat-fill-bar { background: #7a4aa5; }

/* Responsive: tighter on very small screens */
@media (max-width: 380px) {
  .stat-value  { font-size: 1.1rem; }
  .stat-label  { font-size: 0.53rem; }
  .stat-delta  { font-size: 0.6rem; }
}

/* ── Phase Badge ──────────────────────────────────────────────────────────── */

.phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  margin: 0.2rem 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 20px;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.22);
  color: var(--accent);
  transition: background 0.2s;
}
.phase-badge[data-phase="ownership"] {
  background: rgba(201, 168, 76, 0.18);
  border-color: rgba(201, 168, 76, 0.4);
}
.phase-badge[data-phase="assessment"] {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

/* ── Dev Override Banner ──────────────────────────────────────────────────── */

.dev-override-banner {
  display: block;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 165, 0, 0.15);
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 6px;
  color: #f5a623;
  text-align: center;
}

/* ── Challenge Me Widget ──────────────────────────────────────────────────── */

.challenge-me-widget {
  margin: 0.75rem 0;
}
.challenge-me-card {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201, 168, 76, 0.12);
}
.challenge-me-idle .challenge-me-prompt {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.challenge-me-active .challenge-me-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.challenge-timer {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.challenge-me-desc {
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}
.challenge-me-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.challenge-me-done .challenge-me-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4caf86;
  margin-bottom: 0.4rem;
  display: block;
}
.challenge-me-done .challenge-me-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
}
