:root {
  --brand: #1f5c4a;
  --brand-light: #e9f3ef;
  --accent: #c9a227;
  --ink: #1c2a26;
  --muted: #6b7a75;
  --danger: #b3462c;
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f6f8f7; color: var(--ink); padding-bottom: 76px;
}
.topbar {
  background: var(--brand); color: #fff; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; }
.brand span { font-weight: 400; opacity: .85; }
.wrap { max-width: 480px; margin: 0 auto; padding: 18px 16px 30px; }

h1, h2, h3 { color: var(--brand); }
h1 { font-size: 22px; margin: 6px 0 14px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
p.lead { color: var(--muted); margin-top: -6px; }

.card {
  background: #fff; border-radius: var(--radius); padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 14px;
}
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=number], input[type=tel], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid #d9e2de;
  font-size: 15px; background: #fbfdfc;
}
textarea { min-height: 70px; resize: vertical; }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
  display: flex; align-items: center; gap: 10px; border: 1px solid #d9e2de;
  border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fbfdfc;
}
.radio-option input { accent-color: var(--brand); width: 18px; height: 18px; }
.radio-option:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }

.btn {
  display: inline-block; background: var(--brand); color: #fff; border: none;
  padding: 13px 20px; border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: center; text-decoration: none; width: 100%;
}
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; }

.streak-badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent);
  color: #fff; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
}

.exercise-list { display: flex; flex-direction: column; gap: 10px; }
.exercise-row {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px;
  padding: 10px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); text-decoration: none; color: var(--ink);
}
.exercise-row .thumb {
  width: 52px; height: 52px; border-radius: 10px; background: var(--brand-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.exercise-row .meta { flex: 1; }
.exercise-row .name { font-weight: 700; font-size: 14px; }
.exercise-row .sub { font-size: 12px; color: var(--muted); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfd8d4; flex-shrink: 0; }
.check.done { background: var(--brand); border-color: var(--brand); position: relative; }
.check.done::after { content: '✓'; color: #fff; font-size: 13px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

.anim-stage {
  background: var(--brand-light); border-radius: var(--radius); padding: 20px;
  display: flex; justify-content: center; margin-bottom: 14px;
}
.caution { background: #fbe9e3; color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }

.chat-bubble { border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; line-height: 1.5; }
.chat-bubble.q { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.chat-bubble.a { background: #fff; border: 1px solid #e3ebe8; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #e3ebe8;
  display: flex; justify-content: space-around; padding: 8px 0 10px; z-index: 20;
}
.bottomnav a { text-decoration: none; color: var(--muted); font-size: 11px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.bottomnav a span { display: block; }
.bottomnav a.active { color: var(--brand); font-weight: 700; }

table.leaderboard { width: 100%; border-collapse: collapse; font-size: 13px; }
table.leaderboard th, table.leaderboard td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eef2f0; }
table.leaderboard th { color: var(--muted); font-weight: 600; }

/* Exercise animations (CSS-driven, lightweight, no video hosting) */
.knee-figure { width: 140px; height: 160px; }
.leg { transform-origin: 70px 40px; }
.knee-joint { transform-box: fill-box; transform-origin: center; }

@keyframes quadSet { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.06); } }
.anim-quad_set .thigh { animation: quadSet 2s ease-in-out infinite; transform-origin: bottom center; }

@keyframes heelSlide { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(55deg); } }
.anim-heel_slide .shin { animation: heelSlide 3s ease-in-out infinite; transform-origin: 70px 85px; }

@keyframes legRaise { 0%,100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(-25deg); } }
.anim-leg_raise .full-leg { animation: legRaise 2.6s ease-in-out infinite; transform-origin: 70px 40px; }

@keyframes anklePump { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(20deg); } }
.anim-ankle_pump .foot { animation: anklePump 1.6s ease-in-out infinite; transform-origin: 62px 148px; }

@keyframes kneeExt { 0%,100% { transform: rotate(70deg); } 50% { transform: rotate(0deg); } }
.anim-knee_extension .shin { animation: kneeExt 3s ease-in-out infinite; transform-origin: 70px 85px; }

@keyframes miniSquat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(14px); } }
.anim-mini_squat .whole-body { animation: miniSquat 2.4s ease-in-out infinite; }

@keyframes stepUp { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-20px) rotate(-15deg); } }
.anim-step_up .front-leg { animation: stepUp 2.4s ease-in-out infinite; transform-origin: 70px 40px; }

@keyframes balanceWobble { 0%,50%,100% { transform: rotate(0deg); } 25% { transform: rotate(3deg); } 75% { transform: rotate(-3deg); } }
.anim-balance .whole-body { animation: balanceWobble 3s ease-in-out infinite; transform-origin: bottom center; }
