/* twodate — Tier A only (gold standard § 5.1).
   Mobile-first; desktop is additive inside a min-width query and never costs
   the phone anything. Token names are Devowt's on purpose, so anyone who has
   read one stylesheet on this machine has read the other. */

:root {
  --bg: #14110f;
  --surface: #1e1a17;
  --surface-2: #262019;
  --text: #f2ede7;
  --text-muted: #a89e93;
  --border: #332b24;
  --primary: #e0a33c;
  --primary-dim: #8a6521;
  --danger: #d1584f;
  --radius: 14px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf7f2;
    --surface: #ffffff;
    --surface-2: #f2ece2;
    --text: #1d1913;
    --text-muted: #6d6459;
    --border: #e2d9cb;
    --primary: #a86d10;
    --primary-dim: #d8b678;
    --danger: #b4362d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main { max-width: 46rem; margin: 0 auto; padding: 0 1rem 3rem; }

/* --- chrome --- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; max-width: 46rem; margin: 0 auto; padding: 0.75rem 1rem;
}
.brand {
  font-weight: 650; letter-spacing: -0.01em; font-size: 1.2rem;
  color: var(--text); text-decoration: none;
}
.iconlink {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;      /* Tier A: touch targets ≥ 44px */
  color: var(--text-muted); border-radius: var(--radius-sm);
}
.iconlink:hover, .iconlink:focus-visible { color: var(--primary); }

.foot { max-width: 46rem; margin: 0 auto; padding: 0 1rem 2rem; color: var(--text-muted); font-size: 0.85rem; }

/* --- run bar --- */

.runbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem; margin-bottom: 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.status { margin: 0; color: var(--text-muted); font-size: 0.9rem; flex: 1 1 12rem; }
.status.live { color: var(--primary); }

/* --- buttons --- */

.btn, .btn-quiet, .btn-danger {
  font: inherit; font-size: 1rem;          /* ≥16px: iOS zooms below this */
  min-height: 44px; padding: 0 1rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent;
}
.btn { background: var(--primary); color: #14110f; border-color: var(--primary); font-weight: 600; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-quiet { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-quiet:hover { color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --- events --- */

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }

.event {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.event-head { display: flex; gap: 0.7rem; align-items: baseline; }
.event h2 { margin: 0; font-size: 1.05rem; line-height: 1.35; font-weight: 620; }
.event h2 a { color: var(--text); text-decoration: none; }
.event h2 a:hover { color: var(--primary); text-decoration: underline; }

.score {
  flex: 0 0 auto; min-width: 2.4rem; text-align: center;
  background: var(--surface-2); color: var(--primary);
  border-radius: var(--radius-sm); padding: 0.15rem 0.4rem;
  font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums;
}

.meta { margin: 0.5rem 0 0; color: var(--text-muted); font-size: 0.88rem; }
.dot { margin: 0 0.4rem; opacity: 0.5; }
.src { text-transform: lowercase; }

.reason { margin: 0.6rem 0 0; color: var(--text); font-size: 0.92rem; font-style: italic; }
.desc { margin: 0.5rem 0 0; color: var(--text-muted); font-size: 0.9rem; }

.dismiss { margin-top: 0.85rem; }

.empty { color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
         border-radius: var(--radius); padding: 1rem; }
.empty a { color: var(--primary); }

/* --- forms --- */

.stack { display: grid; gap: 1.4rem; }
.field { display: grid; gap: 0.35rem; }
.label { font-weight: 600; }
.hint { color: var(--text-muted); font-size: 0.88rem; }

textarea, input[type="number"] {
  font: inherit; font-size: 1rem;          /* ≥16px, again for iOS */
  width: 100%; padding: 0.65rem 0.75rem; min-height: 44px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
textarea { line-height: 1.5; resize: vertical; }

.notice {
  background: var(--surface-2); border: 1px solid var(--primary-dim);
  border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin: 0 0 1rem;
}

.danger-zone { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.danger-zone h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.danger-zone p { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1rem; }

.back { margin-top: 2rem; }
.back a { color: var(--primary); }

/* --- desktop is additive only --- */

@media (min-width: 769px) {
  main { padding-top: 0.5rem; }
  .event { padding: 1.25rem; }
}
