body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f5f5f5;
  padding: 0;
  color: #333;
  margin: 0;
  display: block;
}


.page-wrap {
  max-width: 700px;
  width: 100%;
  margin: 20px auto;
  /* spacing below navbar */
  padding: 20px;
  box-sizing: border-box;
}


h1 {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  color: #0066cc;
  margin: 10px 0 20px;
  letter-spacing: -0.5px;
}

h3 {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: left;
  color: #333;
  margin: 10px 0 20px;
}

.add-form h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-top: 0;
  margin-bottom: 15px;
}

.add-form p {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.add-form,
.exercise-list,
.current-box,
.preset-box {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #333;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin: 10px 0;
}

.add-form {
  padding: 10px 20px 20px 20px;
}

.exercise {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.exercise-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #e0e0e0;
}

.exercise-item:last-child {
  border-bottom: none;
}

.exercise-item button {
  height: 28px;
  line-height: 28px;
  padding: 0 10px;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.exercise:last-child {
  border-bottom: none;
}

.controls {
  text-align: center;
  margin-top: 20px;
}

button {
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin: 5px;
  background: #0066cc;
  border: 2px solid #0066cc;
  color: #ffffff;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: 'Segoe UI', Arial, sans-serif;
}

button:hover {
  background: #0052a3;
  border-color: #0052a3;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

button:active {
  transform: scale(0.98);
}

input,
select {
  padding: 8px;
  font-size: 1rem;
  margin-right: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #ffffff;
  color: #333;
  font-family: 'Segoe UI', Arial, sans-serif;
}

input:focus,
select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.big-timer {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: clamp(8rem, 22vw, 20rem);
  text-align: center;
  margin-top: 10px;
  margin-bottom: 10px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
  padding: 0 10px;
  box-sizing: border-box;
}

.exercise-timer {
  color: #0066cc;
}

.cooldown {
  color: #666;
}

.label {
  text-align: center;
  font-size: 2rem;
  margin-top: 20px;
  margin-bottom: 10px;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #0066cc;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

.exercise-buttons {
  display: flex;
  gap: 6px;
}

.edit-btn,
.delete-btn {
  margin-left: 8px;
  height: 28px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-btn:hover {
  background: #0052a3;
}

.delete-btn:hover {
  background: #cc0000;
}

.exercise-list {
  transition: max-height 0.4s ease, opacity 0.3s ease;
  overflow: hidden;
}

.exercise-list.hidden {
  display: none;
}


.next-label {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 1rem;
  margin-top: 4px;
  color: #666;
  opacity: 0.9;
  font-family: 'Segoe UI', Arial, sans-serif;
}

#fullscreenBtn {
  background: #0066cc !important;
  border: 2px solid #0066cc !important;
  color: #ffffff !important;
}

#fullscreenBtn:hover {
  background: #0052a3 !important;
  border-color: #0052a3 !important;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3) !important;
}

.page-wrap:fullscreen {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* instead of center */
}

.page-wrap:fullscreen h1 {
  margin-bottom: 30px;
}


/* Normal behavior: allow wrapping and scaling */
.page-wrap h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  white-space: normal;
  flex-shrink: 1;
  text-align: center;
  margin-bottom: 30px;
}

/* Fullscreen behavior: prevent wrapping */
.page-wrap:fullscreen h1 {
  white-space: nowrap;
  flex-shrink: 0;
}

.current-box {
  margin-top: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day {
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  color: #333;
}

.day.done {
  background: #0066cc;
  color: #ffffff;
  font-weight: bold;
  border-color: #0066cc;
}

.day.selected {
  border: 2px solid #0052a3;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.3);
}

.day.today {
  background: #f0f0f0;
  color: #333;
  font-weight: bold;
  border-color: #0066cc;
  border-width: 2px;
}

.day.today.done {
  background: #0052a3;
  color: #ffffff;
}

#modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#modalBox {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 20px;
  border-radius: 8px;
  width: 280px;
  text-align: center;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#modalClose {
  margin-top: 15px;
  padding: 8px 16px;
  background: #0066cc;
  color: #ffffff;
  border: 2px solid #0066cc;
  border-radius: 6px;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 500;
  transition: 0.2s;
  font-family: 'Segoe UI', Arial, sans-serif;
  cursor: pointer;
}

#modalClose:hover {
  background: #0052a3;
  border-color: #0052a3;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.exercise-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exercise-inputs input,
.exercise-inputs select,
.exercise-inputs button {
  margin: 0;
}

.input-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}

.input-row input {
  flex: 1;
  min-width: 150px;
}

.input-row select {
  flex: 0 0 auto;
}

.input-row button {
  flex: 0 0 auto;
  margin-left: auto;
}

.preset-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  width: 100%;
}

.preset-row button:first-child {
  flex: 0 0 auto;
}

.preset-row select {
  flex: 0 0 auto;
}

.preset-row button:last-child {
  flex: 0 0 auto;
  margin-left: auto;
}

.preset-loading-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0 10px;
}

.preset-loading-container.hidden {
  display: none;
}

.preset-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-box select {
  flex: 0 0 auto;
}

.preset-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-box select {
  flex: 0 0 auto;
}

.preset-box p {
  flex: 1;
  margin: 0;
  padding-left: 10px;
}

.preset-loading-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  padding: 10px;
}

.preset-loading-container.hidden {
  display: none;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 102, 204, 0.2);
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

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

/* Tracker controls row - all on one line, aligned with webcam */
.tracker-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 15px;
  width: 100%;
}

.tracker-dropdowns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.tracker-controls-row select {
  flex: 0 0 auto;
}

.tracker-controls-row #addToSequence {
  flex: 0 0 auto;
  padding: 8px 30px;
  min-width: 100px;
}

.tracker-controls-row select {
  padding: 8px 12px;
  font-size: 0.95rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #ffffff;
  color: #333;
  min-width: 150px;
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.tracker-controls-row select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.tracker-controls-row #repTarget {
  min-width: 80px;
  width: 80px;
}

.tracker-controls-row button {
  padding: 8px 20px;
  margin: 0;
  white-space: nowrap;
}

.auth-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.auth-box input,
.auth-box button {
  margin: 0;
}

#authStatus {
  flex-basis: 100%;
  margin-top: 5px;
}

.auth-user {
  color: #fff;
  font-weight: bold;
  margin-left: 10px;
}

#currentBox {
  position: relative;
  /* Reduce min-height significantly - buttons are absolutely positioned */
  /* Button bottom is at 50% + 12.5vw of box height */
  /* For responsive sizing, use a smaller fixed min-height */
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 40px;
  /* Add padding-bottom to ensure buttons fit: button bottom at 50% + 12.5vw */
  /* With min-height 400px: button bottom = 200px + 12.5vw, need padding for that */
  padding-bottom: calc(12.5vw + 20px);
}

/* Container to hold the number and webcam side by side */
#currentBox .big-timer-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 20px;
}

#weightsWebcamContainer {
  position: absolute;
  right: 20px;
  width: 180px;
  height: 135px;
  z-index: 5;
  /* Position webcam bottom edge to align with number bottom edge */
  /* Number center is at 50% vertically, font-size is 25vw tall */
  /* Number bottom edge = 50% (center) + 12.5vw (half of font-size) */
  /* Webcam bottom should align: top = (50% + 12.5vw) - webcam height (135px) */
  top: calc(50% + 12.5vw - 135px);
}

#weightsWebcamCanvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  display: block;
  background: #000;
}

#stopTrackerInBox {
  position: absolute;
  left: 20px;
  z-index: 5;
  /* Override inline bottom style - use top positioning instead */
  bottom: auto !important;
  /* Position Stop button bottom to align with webcam bottom edge */
  /* Webcam bottom is at: 50% + 12.5vw (same as number bottom) */
  /* Button bottom aligns: top = (50% + 12.5vw) - button height (~40px) */
  top: calc(50% + 12.5vw - 40px) !important;
  /* Prevent button from stretching - use auto sizing, not 100% width */
  width: auto !important;
  height: auto !important;
  min-width: auto !important;
  max-width: none !important;
  /* Ensure padding doesn't stretch the button */
  box-sizing: border-box;
}

/* ============================================
   RESPONSIVE STYLES FOR MOBILE DEVICES
   ============================================ */

/* Tablet and Mobile (max-width: 768px) */
@media (max-width: 768px) {
  /* Page wrap adjustments */
  .page-wrap {
    max-width: 100%;
    padding: 10px;
    margin: 10px auto;
  }

  /* Typography */
  h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    padding: 0 10px;
  }

  h3 {
    font-size: 1.2rem;
    margin: 10px 0 15px;
  }

  .add-form h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }

  .label {
    font-size: 1.5rem;
    margin-top: 15px;
    margin-bottom: 8px;
  }

  .next-label {
    font-size: 0.9rem;
    margin-top: 4px;
  }

  /* Forms and inputs */
  .add-form,
  .exercise-list,
  .current-box,
  .preset-box {
    padding: 15px;
    margin: 8px 0;
  }

  .add-form {
    padding: 10px 15px 15px 15px;
  }

  /* Input rows - stack vertically on mobile */
  .input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .input-row input,
  .input-row select,
  .input-row button {
    width: 100%;
    margin: 0;
    font-size: 16px; /* Prevent iOS zoom */
  }

  .input-row input {
    min-width: 100%;
    flex: 1;
  }

  .input-row select {
    flex: 1;
  }

  .input-row button {
    flex: 1;
    margin-left: 0;
  }

  /* Exercise inputs */
  .exercise-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .exercise-inputs input,
  .exercise-inputs select,
  .exercise-inputs button {
    width: 100%;
    margin: 5px 0;
  }

  /* Preset row */
  .preset-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
  }

  .preset-row button,
  .preset-row select {
    width: 100%;
    margin: 0;
  }

  .preset-row button:last-child {
    margin-left: 0;
  }

  /* Preset box */
  .preset-box {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .preset-box select {
    width: 100%;
  }

  .preset-box p {
    padding-left: 0;
    text-align: center;
  }

  /* Tracker controls */
  .tracker-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .tracker-dropdowns {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .tracker-controls-row select {
    width: 100%;
    min-width: 100%;
    margin: 0;
  }

  .tracker-controls-row #repTarget {
    width: 100%;
    min-width: 100%;
  }

  .tracker-controls-row #addToSequence {
    width: 100%;
    min-width: 100%;
    margin-top: 10px;
  }

  /* Tracker header */
  .tracker-header {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .tracker-header > div {
    padding-right: 0;
    flex: 1;
  }

  #miniCam {
    width: 180px; /* Fixed width to match canvas */
    height: 135px; /* Fixed height to match canvas */
    margin: 0 auto;
    margin-left: 0;
    overflow: hidden; /* Prevent any overflow */
  }

  #miniCanvas {
    width: 180px;
    height: 135px;
    display: block;
    object-fit: contain; /* Preserve aspect ratio */
  }

  #toggleTracker {
    width: 100%;
    margin: 0;
  }

  /* Buttons */
  button {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    margin: 8px 0;
    box-sizing: border-box;
  }

  .controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
  }

  .controls button {
    width: 100%;
    margin: 0;
  }

  /* Exercise list */
  .exercise-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 0;
  }

  .exercise-item > div:first-child {
    width: 100%;
  }

  .exercise-buttons {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .exercise-item button {
    flex: 1;
    margin: 0;
  }

  /* Current box - full screen camera view on mobile */
  /* Only apply full screen styles when currentBox is actually displayed */
  /* Use a class-based approach - JavaScript will add 'mobile-fullscreen' class when showing */
  #currentBox.mobile-fullscreen-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: #000000 !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
  }
  
  /* CRITICAL: Ensure currentBox stays hidden when display:none is set */
  #currentBox[style*="display: none"],
  #currentBox[style*="display:none"] {
    display: none !important;
  }

  /* Full screen camera video/canvas */
  #weightsWebcamContainer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1 !important;
    transform: none !important;
  }

  #weightsWebcamCanvas {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important; /* Changed from cover to contain to preserve aspect ratio */
    border: none !important;
    border-radius: 0 !important;
  }

  /* Exercise name overlay at top */
  #currentLabel {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10001 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    white-space: nowrap !important;
    max-width: 90vw !important;
    box-sizing: border-box !important;
  }

  /* Next exercise label - hide on mobile */
  #nextLabel {
    display: none !important;
  }

  /* Counter overlay - fill screen */
  .big-timer {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10002 !important;
    font-size: clamp(8rem, 30vw, 20rem) !important;
    color: #0066cc !important;
    text-shadow: 0 0 20px rgba(0, 102, 204, 0.5), 0 0 40px rgba(0, 102, 204, 0.3) !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
  }

  /* Stop button - above footer, centered */
  #stopTrackerInBox {
    position: fixed !important;
    bottom: 80px !important; /* Above footer (60px footer + 20px spacing) */
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 10003 !important;
    width: auto !important;
    min-width: 120px !important;
    padding: 12px 32px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    background: #0066cc !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    top: auto !important;
  }

  /* Hide lottie container on mobile */
  #lottie-container {
    display: none !important;
  }

  /* Hide page content when tracker is active on mobile */
  body.tracker-active-mobile {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.tracker-active-mobile .page-wrap {
    display: none !important;
  }

  body.tracker-active-mobile .navbar {
    display: none !important;
  }

  body.tracker-active-mobile .main-footer {
    display: none !important;
  }

  /* Modals */
  #modalBox,
  #editExerciseModalBox,
  #editRepsModalBox {
    width: 95%;
    max-width: 95%;
    padding: 20px;
    margin: 10px;
  }

  #editExerciseModalOverlay,
  #editRepsModalOverlay {
    padding: 10px;
  }

  /* Canvas and video */
  #canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  #videoWrapper {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  /* Sequence list */
  #sequenceList {
    padding: 15px;
  }

  .sequence-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 0;
  }

  .sequence-item > div:first-child {
    width: 100%;
  }

  .remove-btn,
  .edit-btn {
    width: 100%;
    margin: 5px 0;
  }

  /* Loading containers */
  .preset-loading-container {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  /* About tracker box */
  #aboutTrackerBox p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  #aboutTrackerBox h4 {
    font-size: 1rem;
    margin: 15px 0 8px;
  }

  /* Weights page button containers */
  #trackerContainer > div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #trackerContainer > div[style*="display: flex"] button {
    width: 100%;
    margin: 5px 0;
  }

  #trackerContainer > div[style*="display: flex"] .preset-row {
    width: 100%;
  }

  #trackerContainer > div[style*="display: flex"] .preset-row select,
  #trackerContainer > div[style*="display: flex"] .preset-row button {
    width: 100%;
    margin: 5px 0;
  }

  #stopTracker {
    width: 100%;
    margin: 10px 0;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .page-wrap {
    padding: 8px;
    margin: 5px auto;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 1.1rem;
  }

  .add-form h3 {
    font-size: 1.1rem;
  }

  .label {
    font-size: 1.3rem;
  }

  .big-timer {
    font-size: clamp(3rem, 12vw, 6rem);
  }

  .add-form,
  .exercise-list,
  .current-box,
  .preset-box {
    padding: 12px;
  }

  button {
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  input,
  select {
    font-size: 16px; /* Prevent iOS zoom */
    padding: 10px;
  }

  #weightsWebcamContainer {
    width: 100px;
    height: 75px;
    top: 15px;
    right: 15px;
  }

  #stopTrackerInBox {
    top: 15px;
    left: 15px;
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  #miniCam {
    max-width: 150px;
  }
}

#lottie-container {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 120px;
  height: 120px;
  pointer-events: none;
  display: none;
  /* hidden until timer starts */
  z-index: 10;
}

#video {
  display: none;
  /* hide raw video, use canvas only */
}

#canvas {
  width: 640px;
  height: 480px;
  display: block;
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  width: 100%;
}

#videoWrapper {
  display: none !important;
}

.tracker-header h3 {
  margin: 0;
}

#miniCam {
  width: 180px;
  height: 135px;
  border: 1px solid #e0e0e0;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  margin-left: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#miniCam canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain; /* Preserve aspect ratio without scaling */
}

#miniCanvas {
  width: 180px;
  height: 135px;
}

#trackerInfo {
  display: none !important;
}

#chooseLabel {
  display: none !important;
}

#videoWrapper {
  position: relative;
  width: 640px;
  height: 480px;
  display: none;
  /* ⭐ HIDE BY DEFAULT — prevents the giant black flash */
}

/* Loading spinner */
.spinner {
  border: 4px solid rgba(0, 102, 204, 0.2);
  border-top: 4px solid #0066cc;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#chooseLabel,
#trackerExercise {
  display: none;
}