/* Reusable pieces: buttons, inputs, badges, notes, the dialog, the confetti canvas. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--action);
  color: var(--action-text);
}

.btn-primary:hover:not(:disabled) {
  background: var(--action-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  min-height: 40px;
}

.btn-ghost:hover {
  color: var(--error);
}

.btn-wide {
  width: 100%;
}

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}

.textarea {
  min-height: 96px;
  resize: vertical;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--fs-small);
  word-break: break-all;
}

.badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: var(--radius);
  font-size: var(--fs-small);
  font-weight: 600;
}

.badge-wrong {
  background: var(--error-bg);
  color: var(--error);
}

.empty {
  padding: calc(var(--gutter) * 1.5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.note {
  font-size: var(--fs-small);
  color: var(--muted);
}

.note-ok {
  color: var(--ok);
}

.note-error {
  color: var(--error);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 26, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  z-index: 10;
}

.dialog {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--gutter);
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

.dialog-actions {
  display: flex;
  gap: var(--gap);
  justify-content: flex-end;
  flex-wrap: wrap;
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  z-index: 8;
}

.confetti-on {
  display: block;
}
