/* Heaven 11 Registry: gold on black, built for one hand on a phone. */
:root {
  --bg: #0b0b0b;
  --panel: #161616;
  --line: #2a2a2a;
  --gold: #c9a54a;
  --gold-soft: rgba(201, 165, 74, 0.15);
  --text: #f2efe8;
  --muted: #9a958a;
  --ok: #6fbf73;
  --alert: #e06666;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--text); }

body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--gold); }

h1, h2 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: 0.02em; }
.brand span { color: var(--gold); letter-spacing: 0.12em; margin-right: 4px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 0; }
.nav a[aria-current="page"] { color: var(--gold); }
.logout { margin: 0; }
.linklike { background: none; border: 0; color: var(--muted); font: inherit; padding: 6px 0; cursor: pointer; }

.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

.button {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--gold); color: #111; }
.button.big { width: 100%; min-height: 64px; font-size: 1.1rem; margin-bottom: 12px; }
.button small { font-weight: 400; font-size: 0.8rem; opacity: 0.8; }
.button.disabled { border-color: var(--line); color: var(--muted); cursor: default; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modes .button.big { margin-bottom: 0; }

.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 0.95rem; }
input {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #0f0f0f; color: var(--text); font: inherit;
}
select {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #0f0f0f; color: var(--text); font: inherit;
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.alert { color: var(--alert); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 12px;
}
.badge.ok { background: rgba(111, 191, 115, 0.15); color: var(--ok); }
.badge.muted { background: #222; color: var(--muted); }

.fields { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 16px; }
.fields dt { color: var(--muted); }
.fields dd { margin: 0; font-weight: 600; }

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.events li { display: grid; gap: 2px; border-left: 2px solid var(--gold-soft); padding-left: 12px; }
.events time, .events small { color: var(--muted); font-size: 0.85rem; }

.scanner { display: grid; gap: 12px; }
.viewfinder {
  position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius);
  overflow: hidden; background: #000; border: 1px solid var(--line);
}
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame {
  position: absolute; inset: 18%; border: 2px solid var(--gold); border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}
.status { margin: 0; color: var(--muted); text-align: center; min-height: 1.5em; }
.result .button { margin: 4px 8px 0 0; }
.manual .row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; color: var(--muted); font-weight: 400; font-size: 0.85rem; padding: 6px 0; }
.list td { padding: 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.list td + td, .list th + th { padding-left: 12px; }
.list .num { text-align: right; white-space: nowrap; font-weight: 600; }
.list .num.muted { font-weight: 400; }
.list a { color: var(--text); text-decoration: none; }
.notice { background: rgba(111, 191, 115, 0.12); color: var(--ok); border-radius: 10px; padding: 10px 14px; }
p.alert { background: rgba(224, 102, 102, 0.12); border-radius: 10px; padding: 10px 14px; }
.big-number { font-size: 1.6rem; font-weight: 700; color: var(--gold); margin: 4px 0 8px; }
textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0f0f0f; color: var(--text); font: inherit; resize: vertical;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
div.alert { background: rgba(224, 102, 102, 0.12); border-radius: 10px; padding: 4px 14px; margin-bottom: 12px; }
.choice { display: flex; gap: 20px; }
.button.back { width: 100%; margin-top: 12px; }
.choice label { display: flex; align-items: center; gap: 8px; color: var(--text); }
.choice input { width: auto; min-height: 0; }

.flash { animation: flash-gold 0.7s ease-out; }
.flash-miss { animation: flash-red 0.7s ease-out; }
@keyframes flash-gold { from { box-shadow: 0 0 0 4px var(--gold); } to { box-shadow: 0 0 0 0 transparent; } }
@keyframes flash-red { from { box-shadow: 0 0 0 4px var(--alert); } to { box-shadow: 0 0 0 0 transparent; } }

@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
}
