/* MC Prompter shared styles. Colours come from common.js (derived per event); the values here are the default look. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #0c0c0e; --surface: #141417; --raised: #1e1e23;
  --line: #26262c; --line-strong: #3d3d47;
  --text: #ffffff; --muted: #9c9ca8; --faint: #6c6c78;
  --accent: #e8625c; --accent-hover: #d4534e; --accent-ink: #ffffff; --accent-text: #e8625c;
  --accent-soft: #2a1716; --accent-line: #6e3431;
  --go: #3ddc97; --go-soft: #12261f; --go-fill: #3ddc97;
  --warn: #ffb02e; --warn-soft: #2a2114; --warn-fill: #ffb02e;
  --stop: #ff5d5d; --stop-soft: #2c1616; --stop-fill: #ff5d5d;
  --gold: #ffc94a; --gold-soft: #2a2415; --gold-fill: #ffc94a;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --digits: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r-sm: 8px; --r: 10px; --r-lg: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.digits { font-family: var(--digits); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: transparent; color: var(--text);
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover:not(:disabled) { background: var(--raised); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--stop); border-color: var(--stop); background: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--stop-soft); border-color: var(--stop); }
.btn-gold { background: var(--gold-fill); border-color: var(--gold-fill); color: #1b1503; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--text); animation: spin .7s linear infinite;
}
.btn-primary.is-busy::after { border-color: transparent; border-top-color: var(--accent-ink); border-right-color: var(--accent-ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fields */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.input, .textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r);
  color: var(--text); font-size: 16px; line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 13px; color: var(--muted); }
.error-text { font-size: 14px; color: var(--stop); }

/* Surfaces */
/* No boxes: a section is separated from the one above by a single hairline */
.card { border-top: 1px solid var(--line); padding: 22px 0 6px; }
.card > h2, .card > h3 { margin-bottom: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--muted);
}
.tag-go { color: var(--go); }
.tag-gold { color: var(--gold); }
.tag-stop { color: var(--stop); }
.tag-accent { color: var(--accent-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-family: var(--display); font-size: 20px; margin-bottom: 4px; }

.seg { display: inline-flex; gap: 4px; border-bottom: 1px solid var(--line); }
.seg button {
  min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; transition: color .2s, border-color .2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 9000;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 520px); padding: 12px 18px; border-radius: var(--r);
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 15px; text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35); transition: transform .2s, opacity .2s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: var(--stop-fill); color: #1d0505; }

/* Connection banner */
.offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9500; padding: 8px 14px;
  background: var(--warn-fill); color: #231600; font-weight: 700; font-size: 14px; text-align: center;
}

.wordmark { font-weight: 700; font-size: 20px; letter-spacing: -0.03em; color: var(--text); text-decoration: none; }
.wordmark span { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
