.screen {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: white;
  border-radius: 1.25rem;
  padding: 2.75rem 2.25rem;
  box-shadow: 0 8px 30px rgba(30, 58, 66, 0.1), inset 0 5px 0 0 var(--brand);
  animation: screen-enter 0.45s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

.screen-disclaimer {
  text-align: left;
}

.screen-disclaimer h1 {
  text-align: center;
}

.screen-disclaimer-text {
  margin: 1rem 0;
}

.screen-disclaimer-text p {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.screen-disclaimer-text p:last-child {
  margin-bottom: 0;
}

.screen-password form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.screen-password input {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.8rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
}

.screen-password input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.exercise-goal { font-weight: 700; color: var(--accent); }

/* Joint-chain: the progress indicator, styled after the pose-tracking dots
   drawn on camera during the exercises themselves. */
.joint-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1.5rem;
}

.joint-chain-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}

.joint-chain-dot--done { background: var(--accent); }

.joint-chain-dot--active {
  background: var(--brand);
  width: 0.85rem;
  height: 0.85rem;
  box-shadow: 0 0 0 4px rgba(40, 120, 140, 0.18);
  animation: joint-pulse 1.8s ease-in-out infinite;
}

.joint-chain-link {
  width: 1.4rem;
  height: 1px;
  background: var(--line);
  flex-shrink: 0;
}

@keyframes joint-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(40, 120, 140, 0.18); }
  50%      { box-shadow: 0 0 0 7px rgba(40, 120, 140, 0.08); }
}

@media (prefers-reduced-motion: reduce) {
  .joint-chain-dot--active { animation: none; }
}

.instruction-video,
.instruction-video-placeholder {
  width: 100%;
  border-radius: 0.75rem;
  margin: 1rem 0;
}

.instruction-video-placeholder {
  aspect-ratio: 16 / 9;
  background: var(--paper-low);
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.instruction-video-wrap {
  position: relative;
  margin: 1rem 0;
}

.instruction-video-wrap .instruction-video {
  margin: 0;
  display: block;
}

.sound-toggle-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(30, 58, 66, 0.65);
  color: white;
  font-size: 1.1rem;
  line-height: 1;
}

.sound-toggle-btn:hover { background: rgba(30, 58, 66, 0.85); }

.instruction-video-label {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.25rem 0 0;
}

.exercise-phase-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin: 0.4rem 0 0;
}

.exercise-phase-warmup { background: var(--paper-low); color: var(--brand-dark); }
.exercise-phase-training { background: var(--brand); color: white; }
.exercise-phase-cooldown { background: var(--accent); color: white; }

.exercise-explainer {
  margin: 1rem 0;
  text-align: left;
}

.exercise-explainer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--paper-low);
  color: var(--ink);
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.exercise-explainer-arrow {
  transition: transform 0.2s ease;
}

.exercise-explainer.open .exercise-explainer-arrow {
  transform: rotate(180deg);
}

.exercise-explainer-body {
  display: none;
  padding: 0.85rem 0.25rem 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.exercise-explainer.open .exercise-explainer-body {
  display: block;
}

@media (min-width: 700px) {
  .screen { max-width: 640px; }
}

.camera-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.75rem;
  overflow: hidden;
  background: black;
  margin: 1rem 0;
  box-shadow: 0 0 0 4px var(--paper-low), 0 0 0 5px var(--line);
}

.camera-wrap video,
.camera-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.perform-metric {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.badge-list { list-style: none; padding: 0; margin: 1rem 0; }
.badge-list li.badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  margin: 0.25rem;
  font-weight: 700;
}

.summary-issue-note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 1rem 0;
}

.summary-issue-note a { color: var(--brand); font-weight: 700; }

.level-picker {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.level-picker-btn {
  background: var(--paper-low);
  color: var(--brand);
  border: 1px solid var(--line);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
}

.level-picker-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.level-picker-btn:hover {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.mode-choice {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.mode-choice-label {
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.mode-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--paper-low);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.85rem 1.25rem;
}

.mode-choice-btn:hover {
  background: var(--brand);
  color: white;
}

.mode-choice-btn:hover .mode-choice-desc { color: white; }

.mode-choice-title { font-weight: 800; font-size: 1.05rem; }

.mode-choice-desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.instruction-actions,
.final-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.app-promo {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper-low);
  border-radius: 1rem;
  text-align: center;
}

.app-promo-text {
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.app-promo-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.app-promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}

.app-promo-contact {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.app-promo-contact a {
  color: var(--brand);
  font-weight: 700;
}

.exercise-stats {
  margin: 1rem 0;
  text-align: left;
}

.exercise-stats-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.35rem 0;
}

.exercise-stats-row-label {
  flex: 0 0 9rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.exercise-stats-row .joint-chain {
  margin: 0;
  justify-content: flex-start;
}

.exercise-equipment {
  background: var(--paper-low);
  border-radius: 0.75rem;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  text-align: left;
}

.exercise-equipment-label {
  font-weight: 800;
  color: var(--brand);
  display: block;
  margin-bottom: 0.15rem;
}

.manual-reps-reminder {
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  margin: 1rem 0 0;
}

.manual-mode-info {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.perform-guidance {
  font-weight: 700;
  color: var(--brand);
  margin: 0.75rem 0 0;
  min-height: 1.3em;
}

.camera-permission-note,
.camera-privacy-note,
.camera-autoadvance-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.5rem 0;
}

.manual-count-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
