:root {
  --bg: #0f0f13;
  --card: #1a1a24;
  --accent: #7c6af7;
  --accent2: #f76a8a;
  --text: #e8e8f0;
  --muted: #6b6b80;
  --border: #2a2a38;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  padding-bottom: 32px;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  padding: 28px 0 16px;
  text-align: center;
}

header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
}

.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Chart */
.chart-wrap {
  position: relative;
  height: 200px;
}

#strengthChart {
  display: block;
}

.chart-wrap.hidden {
  display: none;
}

/* Group tabs */
.group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Exercise list */
.ex-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ex-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.ex-item.active {
  border-color: var(--accent);
}

.ex-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.ex-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.ex-record {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.ex-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* Goal card */
.goal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.goal-photo-wrap {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3/4;
  border-radius: 16px;
  border: 2px solid var(--accent);
  overflow: hidden;
  box-shadow: 0 0 24px var(--accent)44;
}

.goal-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.goal-text {
  text-align: center;
}

.goal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
}

.goal-desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Empty state */
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 24px 0;
}
