.runner-screen {
  display: none;
}

.runner-screen.active {
  display: block;
}

.touch-manipulation {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button, a {
  touch-action: manipulation;
}

@media (hover: none) {
  button:hover {
    filter: none;
  }
}

.big-timer {
  font-size: 4.5rem;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* TV / cast-friendly: huge timer, less chrome for AirPlay screen mirror */
body.tv-mode .big-timer {
  font-size: clamp(5rem, 18vw, 9rem);
}
body.tv-mode #exerciseName {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
}
body.tv-mode .demo-panel {
  max-height: 28vh;
}
body.tv-mode .bottom-nav,
body.tv-mode #backToPlanner {
  display: none !important;
}
body.tv-mode .runner-toolbar #userLabel {
  display: none;
}
body.tv-mode #activeScreen,
body.tv-mode #restScreen {
  min-height: 70vh;
}

.rep-display {
  font-size: 3.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
  text-align: center;
}

.pulse {
  animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
}

.sensor-active {
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

.rest-bg {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* Phone-first: even larger controls */
@media (max-width: 640px) {
  .big-timer {
    font-size: 5rem;
  }

  .rep-display {
    font-size: 4rem;
    min-width: 5rem;
  }

  .rep-btn {
    width: 4.5rem !important;
    height: 4.5rem !important;
    font-size: 2rem !important;
  }

  .cta-start {
    min-height: 3.75rem;
    font-size: 1.15rem;
  }

  .complete-set-btn {
    min-height: 4rem;
    font-size: 1.1rem;
  }
}

/* Keep planner link readable on dark mode (utility may be remapped already). */
body.high-contrast #backToPlanner {
  color: #93c5fd !important;
}

/* High contrast / dark theme rules live in styles.css (site-wide). */

.sensor-help {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
}

.runner-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ex-thumb {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #e5e7eb;
}

.ex-thumb--lg {
  width: 7rem;
  height: 7rem;
  border-radius: 0.85rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* ---------- In-runner exercise demo ---------- */
.demo-panel {
  width: 100%;
}

.demo-frame {
  position: relative;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  overflow: hidden;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

.demo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.demo-frame img.demo-frame__visible {
  opacity: 1;
}

/* Single animated WebP (prebuilt from 0/1 stills) — no JS flip needed */
.demo-frame--anim {
  background: #111827;
}

.demo-frame--anim img.demo-frame__anim,
.demo-frame--anim img.demo-frame__visible {
  opacity: 1 !important;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-frame--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.demo-caption {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.35;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.demo-actions a {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: underline;
  touch-action: manipulation;
}

.demo-panel--rest .demo-frame {
  max-width: 14rem;
  aspect-ratio: 1 / 1;
}

body.high-contrast .demo-frame {
  background: #1c2430 !important;
  border-color: #3d4a5c !important;
  box-shadow: none;
}

body.high-contrast .demo-frame--placeholder {
  background: #1c2430 !important;
}

body.high-contrast .demo-caption {
  color: #c5ccd6 !important;
}

body.high-contrast .demo-actions a {
  color: #93c5fd !important;
}

@media (max-width: 640px) {
  .demo-frame {
    max-width: min(100%, 18rem);
  }
}


