.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 200ms ease-out;
}

.modal {
  background: rgba(20,20,22,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px;
  width: fit-content;
  min-width: 300px;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: modalSlideIn 250ms ease-out;
}

.modal h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
  text-align: center;
}

.modal-field {
  margin-bottom: 14px;
}

.modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}

.modal-field input,
.modal-field select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 150ms ease;
}

.modal-field input:focus {
  border-color: var(--accent);
}

.modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.modal-row span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  inset: 0;
  background: #1a1a1e;
  border-radius: 4px;
  cursor: pointer;
  transition: all 150ms ease;
  border: 1px solid rgba(255,255,255,0.05);
}

.toggle .slider:before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--muted);
  border-radius: 3px;
  transition: all 150ms ease;
}

.toggle input:checked + .slider {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.3);
}

.toggle input:checked + .slider:before {
  transform: translateX(18px);
  background: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .btn {
  flex: 1;
  padding: 12px;
  font-size: 13px;
}

/* Speed buttons - filter tab style */

.speed-group {
  display: flex;
  gap: 4px;
}

.speed-btn {
  flex: 1;
  padding: 7px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  background: var(--input-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 150ms ease;
}

.speed-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
}

.speed-btn.active {
  background: rgba(59,130,246,0.1);
  color: var(--accent);
  border-color: rgba(59,130,246,0.25);
}

/* Skin picker grid */

.skin-grid-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
}

.skin-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.05);
  background: #1a1a1e;
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
}

.skin-item:hover {
  border-color: rgba(255,255,255,0.15);
}

.skin-item.active {
  border-color: var(--accent);
}

.skin-item.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.skin-item canvas {
  display: block;
  width: 36px;
  height: 36px;
}

.skin-item .skin-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}

.skin-item.active .skin-label {
  color: var(--accent);
}
