/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-danger {
  background: var(--color-accent);
  color: white;
  font-size: 1.2rem;
  min-width: 100px;
  min-height: 56px;
}

.btn-danger:active {
  background: var(--color-accent-hover);
}

.btn-preview {
  background: var(--color-primary);
  color: var(--color-text);
  width: 100%;
  margin-top: var(--space-sm);
}

.btn-preview:active {
  background: var(--color-surface-hover);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  background: transparent;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s;
}

.btn-icon:active {
  background: var(--color-surface);
}

/* === Cards === */
.card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  min-height: 88px;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, transform 0.1s;
  text-align: left;
  color: var(--color-text);
  font-family: var(--font-main);
}

.card:active {
  background: var(--color-surface-hover);
  transform: scale(0.98);
}

.card-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  width: 56px;
  text-align: center;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-title {
  margin-bottom: var(--space-xs);
}

.card-desc {
  font-size: 0.875rem;
}

/* === Timer Display === */
.timer-display {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  transition: color 0.3s;
}

.timer-display.timer-warning {
  color: var(--color-accent);
  animation: timer-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes timer-pulse {
  from { opacity: 1; }
  to { opacity: 0.5; }
}

/* === Command Display === */
.command-display {
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-text);
  user-select: none;
}

.command-display.command-flash {
  animation: command-pop 0.2s ease-out;
}

@keyframes command-pop {
  0% { transform: scale(1.15); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* === Countdown Overlay === */
.countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 46, 0.92);
  z-index: 100;
}

.countdown-overlay.hidden {
  display: none;
}

.countdown-number {
  font-size: clamp(6rem, 25vw, 12rem);
  font-weight: 900;
  color: var(--color-accent);
}

.countdown-number.countdown-animate {
  animation: countdown-pop 0.6s ease-out;
}

@keyframes countdown-pop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* === Form Controls === */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-bottom: var(--space-2xl);
}

.settings-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.settings-group legend {
  font-weight: 600;
  font-size: 1rem;
  padding: 0 var(--space-sm);
  color: var(--color-accent);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-field label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.form-field-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* Select */
select {
  appearance: none;
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.9375rem;
}

/* Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--color-primary);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* Checkbox (toggle style) */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 52px;
  height: 28px;
  background: var(--color-primary);
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

input[type="checkbox"]:checked {
  background: var(--color-accent);
}

input[type="checkbox"]:checked::after {
  transform: translateX(24px);
}
