/* Buttons, fields, pop-up windows (<dialog>) and toasts — shared by every component. Colours: theme.css */
.btn {
  background: var(--btn-dark);
  border: 1px solid var(--btn-dark-edge);
  border-radius: var(--radius);
  padding: 8px 16px;
  color: var(--text);
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.btn-primary {   /* gold leaf, like "ฆ่าแล้ว" on the cards */
  background: var(--gold-fill);
  border-color: var(--gold-edge);
  color: var(--on-gold);
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 234, 163, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 239, 166, 0.36), inset 0 1px 2px rgba(255, 246, 198, 0.9);
}
.btn-danger { color: var(--up); border-color: color-mix(in srgb, var(--up) 45%, var(--btn-dark-edge)); }   /* leave, remove */
.btn-small { padding: 5px 12px; font-size: 13px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

.field {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius);
  padding: 9px 12px;
  box-shadow: var(--field-inset);
}
.field::placeholder { color: var(--text-3); }
.field:focus { border-color: var(--accent); outline: none; }
select.field { padding-right: 28px; }
select option { background: var(--surface); color: var(--text); }

.dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-card);
  box-shadow: var(--dialog-frame), var(--shadow-pop);
}
.dialog::backdrop { background: var(--backdrop); }
.dialog-body { display: flex; flex-direction: column; gap: 12px; padding: 24px; margin: 0; }
.dialog-title { margin: 0; font: 600 19px/1.3 var(--font-display); letter-spacing: 0.01em; color: var(--gold-light); }
.dialog-error { margin: 0; min-height: 1.4em; color: var(--up); font-size: 14px; }
.dialog-text { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface-hi);
  border: 1px solid var(--line-hi);
  border-left: 3px solid var(--text-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
.toast.is-ok { border-left-color: var(--window); }
.toast.is-bad { border-left-color: var(--up); }
.toast-actions { display: flex; flex: none; gap: 6px; }
.toast-action { background: none; border: 1px solid var(--line-hi); border-radius: var(--radius); padding: 4px 12px; color: var(--accent-text); }
