.screen {
  display: none;
}
.screen.active {
  display: block;
}

#camera-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

#camera-preview {
  width: 100%;
  height: auto;
  display: block;
}

#teleprompter-overlay {
  position: absolute;
  inset: 0;
  padding: 24px 20px;
  pointer-events: none;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
}

#teleprompter-viewport {
  height: 100%;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.teleprompter-text {
  color: #fff;
  font-family: Impact, Tahoma, Arial, sans-serif;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: opacity 0.3s;
}
#countdown-overlay.hidden {
  display: none;
}

#countdown-number {
  font-size: 120px;
  font-weight: 700;
  color: #fff;
  animation: pop 0.8s ease-out;
  font-family: sans-serif;
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.recording-active #camera-container {
  box-shadow: 0 0 0 3px #ef4444;
}

.btn-record {
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-record:hover {
  background: #dc2626;
}
.btn-record:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-record.active {
  background: #6b7280;
  border-radius: 6px;
  width: 56px;
  height: 56px;
}

.btn-stop {
  background: #6b7280;
  color: #fff;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-stop:hover {
  background: #4b5563;
}
.btn-stop:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#recording-timer {
  font-family: 'Courier New', Courier, monospace;
  font-size: 22px;
  font-weight: 700;
  color: #ef4444;
  min-width: 70px;
  text-align: center;
}

.takes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.take-card {
  background: #1f2937;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #374151;
}

.take-card video {
  width: 100%;
  display: block;
  background: #000;
  max-height: 70vh;
}

.take-info {
  padding: 12px;
}

.textarea-custom {
  background: #1f2937;
  border: 1px solid #374151;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  width: 100%;
  min-height: 200px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
}
.textarea-custom:focus {
  outline: none;
  border-color: #6366f1;
}

.input-range-custom {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #374151;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.input-range-custom::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: 2px solid #fff;
}
.input-range-custom::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  border: 2px solid #fff;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #374151;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: #6366f1;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1f2937;
  color: #e5e7eb;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid #374151;
  font-size: 14px;
  z-index: 50;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  #teleprompter-overlay {
    padding: 16px 12px;
  }
  .teleprompter-text {
    font-size: 16px;
  }
  #countdown-number {
    font-size: 80px;
  }
  .controls-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .takes-grid {
    grid-template-columns: 1fr;
  }

  #screen-recorder.active {
    min-height: 100dvh;
  }
  #screen-recorder.active > .max-w-4xl {
    padding: 6px 8px;
    max-width: none;
    margin: 0;
  }
  #screen-recorder.active #camera-container {
    border-radius: 8px;
  }
  #screen-recorder.active .controls {
    margin-top: 6px;
  }
}

@media (min-width: 641px) {
  #camera-container {
    max-width: 500px;
  }
}


