/* PUSHUP AI COACH - STYLESHEET */
:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(26, 35, 54, 0.85);

  --accent-green: #00f098;
  --accent-green-glow: rgba(0, 240, 152, 0.35);
  --accent-blue: #00b8ff;
  --accent-blue-glow: rgba(0, 184, 255, 0.35);
  --accent-purple: #9d4edd;
  --accent-danger: #ff4d6d;
  --accent-warning: #ffb703;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Roboto Mono', monospace;

  --nav-height: 68px;
  --header-height: 56px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 480px; /* Mobile viewport constraints */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* HEADER */
.app-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--bg-card-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.logo-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px var(--accent-green));
}

.logo-text .accent {
  color: var(--accent-green);
  text-shadow: 0 0 12px var(--accent-green-glow);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.12);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  padding: 12px 14px calc(var(--nav-height) + 16px) 14px;
  overflow-y: auto;
}

.tab-page {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-page.active {
  display: block;
}

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

/* WORKOUT MODE SELECTOR */
.mode-selector-card {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.mode-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 10px;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: rgba(0, 240, 152, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 240, 152, 0.3);
  box-shadow: 0 0 12px var(--accent-green-glow);
}

/* TEMPO TIMER CARD */
.tempo-timer-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: 0 0 15px var(--accent-blue-glow);
  transition: all 0.3s ease;
}

.tempo-timer-card.hidden {
  display: none;
}

.tempo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 6px;
}

.tempo-secs {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: #ffffff;
}

.tempo-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.tempo-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  transition: width 0.1s linear;
}

/* FEEDBACK BANNER */
.feedback-banner {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-ready .status-dot { background: var(--accent-blue); box-shadow: 0 0 8px var(--accent-blue); }
.status-good .status-dot { background: var(--accent-green); box-shadow: 0 0 10px var(--accent-green); }
.status-warn .status-dot { background: var(--accent-warning); box-shadow: 0 0 10px var(--accent-warning); }
.status-error .status-dot { background: var(--accent-danger); box-shadow: 0 0 10px var(--accent-danger); }

/* CAMERA CARD */
.camera-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--bg-card-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror camera feed */
}

#skeleton-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.camera-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ALIGNMENT GUIDE */
.alignment-guide {
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.alignment-guide span {
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.alignment-guide.hidden {
  display: none;
}

/* HUD OVERLAY BADGES */
.hud-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.hud-badge {
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 65px;
}

.badge-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.badge-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-green);
}

/* MAIN COUNTER CARD */
.counter-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.counter-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.rep-number {
  font-size: 4rem;
  font-weight: 900;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px var(--accent-green-glow));
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rep-number.bump {
  transform: scale(1.25);
}

.rep-unit {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* PROGRESS BAR */
.target-progress-bar {
  width: 100%;
  height: 22px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  border-radius: 12px;
  transition: width 0.3s ease;
}

.progress-text {
  position: relative;
  z-index: 2;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* MINI STATS GRID */
.workout-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  gap: 8px;
}

.mini-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-icon { font-size: 1rem; margin-bottom: 2px; }
.stat-val { font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem; }
.stat-lbl { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }

/* WORKOUT CONTROLS */
.workout-controls {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn {
  height: 48px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--accent-green) 0%, #00b87a 100%);
  color: #051a10;
}

.btn-glow {
  box-shadow: 0 0 20px var(--accent-green-glow);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.btn-secondary {
  width: 90px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.12);
}

/* PAGE HEADERS */
.page-header {
  margin-bottom: 16px;
}

.page-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* TIPS TAB */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
}

.tip-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 240, 152, 0.1);
  border: 1px solid rgba(0, 240, 152, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tip-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tip-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tip-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  background: rgba(0, 184, 255, 0.12);
  color: var(--accent-blue);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* STATS TAB */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-icon {
  font-size: 1.8rem;
}

.summary-data {
  display: flex;
  flex-direction: column;
}

.summary-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-green);
}

.summary-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-danger);
  font-size: 0.8rem;
  cursor: pointer;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-history {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.history-date { color: var(--text-secondary); font-size: 0.75rem; }
.history-count { font-family: var(--font-mono); font-weight: 700; color: var(--accent-green); }

/* SETTINGS TAB */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-info label {
  font-weight: 600;
  font-size: 0.9rem;
}

.setting-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.setting-input, .setting-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.9rem;
}

.setting-input {
  width: 70px;
  text-align: center;
}

/* TOGGLE SWITCH */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-green);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* BOTTOM NAVIGATION BAR */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 12px;
  transition: all 0.2s ease;
}

.nav-icon {
  font-size: 1.3rem;
  transition: transform 0.2s ease;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 600;
}

.nav-item.active {
  color: var(--accent-green);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.15);
  filter: drop-shadow(0 0 6px var(--accent-green));
}

/* ACHIEVEMENT TOAST NOTIFICATIONS */
.achievement-toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.achievement-toast {
  pointer-events: auto;
  position: relative;
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 240, 152, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 152, 0.2);
  animation: toastSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  overflow: hidden;
}

.achievement-toast.dismissed {
  animation: toastSlideOut 0.4s ease forwards;
}

.toast-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 240, 152, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.toast-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 152, 0.2), rgba(0, 184, 255, 0.2));
  border: 1px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--accent-green-glow);
}

.toast-icon {
  font-size: 1.6rem;
  animation: pulseIcon 1.5s infinite ease-in-out;
}

.toast-body {
  flex-grow: 1;
}

.toast-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-green);
  font-weight: 700;
  display: block;
}

.toast-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 2px 0 1px 0;
}

.toast-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ACHIEVEMENTS GALLERY CARD */
.badge-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(0, 240, 152, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 240, 152, 0.3);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.achievement-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achievement-card.unlocked {
  background: linear-gradient(145deg, rgba(20, 28, 45, 0.9), rgba(15, 22, 36, 0.95));
  border-color: rgba(0, 240, 152, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(0, 240, 152, 0.05);
}

.achievement-card.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 152, 0.2);
}

.badge-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 8px;
  position: relative;
}

.achievement-card.locked .badge-icon-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--text-muted);
}

.achievement-card.unlocked .badge-icon-box {
  background: linear-gradient(135deg, rgba(0, 240, 152, 0.2), rgba(0, 184, 255, 0.2));
  border: 1px solid var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.lock-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.75rem;
}

.badge-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.achievement-card.locked .badge-title {
  color: var(--text-secondary);
}

.badge-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.25;
}

.badge-date {
  font-size: 0.65rem;
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 6px;
}

/* PROGRESS CHART STYLES */
.chart-card {
  margin-bottom: 20px;
}

.chart-header-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

@media (min-width: 360px) {
  .chart-header-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-btn-group {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.chart-metric-btn,
.chart-range-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-metric-btn.active,
.chart-range-btn.active {
  background: rgba(0, 240, 152, 0.18);
  color: var(--accent-green);
  box-shadow: 0 0 8px rgba(0, 240, 152, 0.2);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  margin-top: 12px;
}

#progress-chart-canvas {
  width: 100% !important;
  height: 100% !important;
}

/* AMRAP 60s OVERLAY & LEADERBOARD STYLES */
.amrap-timer-card {
  border-color: rgba(255, 77, 109, 0.4);
  background: linear-gradient(135deg, rgba(35, 15, 25, 0.85), rgba(18, 24, 38, 0.85));
}

.amrap-secs {
  color: var(--accent-danger) !important;
  text-shadow: 0 0 12px rgba(255, 77, 109, 0.5);
}

.amrap-fill {
  background: linear-gradient(90deg, var(--accent-danger), var(--accent-warning)) !important;
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.5);
}

.amrap-leaderboard-card {
  margin-bottom: 20px;
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rank-2 {
  background: linear-gradient(135deg, #e0e0e0, #9e9e9e);
  color: #000;
  box-shadow: 0 0 8px rgba(220, 220, 220, 0.4);
}

.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #8b4513);
  color: #fff;
  box-shadow: 0 0 8px rgba(205, 127, 50, 0.4);
}

.rank-other {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

