*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --fg: #fff;
  --bg: #000;
  --muted: #a3a3a3;
  --hairline: #fff;
  --hairline-soft: #3a3a3a;
  --ring: #fff;
  --danger: #fff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --radius-sm: 6px;
}

html { color-scheme: dark; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

input, textarea {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 0.6rem 0.75rem;
  width: 100%;
  border-radius: var(--radius-sm);
}
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- shared ---------- */

.page-center {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--fg);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

.brand {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 2rem;
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  font-weight: 700;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.tagline {
  margin: 0;
  font-style: italic;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-align: center;
}

.lede { margin: 0; color: var(--muted); text-align: center; }
.status { color: var(--muted); text-align: center; }
.err { color: var(--fg); border: 1px solid var(--fg); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.stack { display: flex; flex-direction: column; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  padding: 0.7rem 1rem;
  min-height: 44px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-danger  { background: var(--fg); color: var(--bg); }

/* Cut-off state: BAC over the threshold, drink can't be added. */
.btn-blocked {
  background: #c00;
  border-color: #c00;
  color: #fff;
}
.btn-blocked:disabled { opacity: 1; cursor: not-allowed; }

select {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 0.6rem 0.75rem;
  width: 100%;
  border-radius: var(--radius-sm);
}
select:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Entry form: tighter spacing so the bouncer flow fits on one screen. */
#entry-section .card { gap: 0.5rem; padding: 1rem 1.25rem; }
#entry-section #patron-form { gap: 0.45rem; }
#entry-section #patron-form .stack { gap: 0.2rem; }
#entry-section input,
#entry-section select { padding: 0.45rem 0.6rem; }
#entry-section label { font-size: 0.85rem; color: var(--muted); }

/* Hide the native calendar picker button on the DOB input — bouncers type
   the date directly. */
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
input[type="date"]::-webkit-inner-spin-button { display: none; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* ---------- waveform page ---------- */

.waveform-card { max-width: 720px; }

#drop-zone {
  border: 2px dashed var(--hairline-soft);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  transition: border-color 120ms, color 120ms;
}
#drop-zone:hover,
#drop-zone.dragover {
  border-color: var(--fg);
  color: var(--fg);
}
#drop-zone p { margin: 0; }
#drop-zone #drop-filename { margin-top: 0.4rem; }

#waveform-canvas {
  width: 100%;
  height: 220px;
  background: #000;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-sm);
  display: block;
}

input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 0;
  border: 1px solid var(--fg);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.btn-row { display: flex; gap: 0.5rem; }
.btn-row .btn { flex: 1; }

/* ---------- QR ---------- */

.qr-box {
  background: #fff;
  border: 1px solid var(--fg);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: grid;
  place-items: center;
}
.qr-box svg { width: 100%; height: auto; display: block; max-width: 280px; }

/* ---------- activity table ---------- */

.activity-table {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 0.9rem;
}
.activity-row:last-child { border-bottom: none; }

code {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--hairline-soft);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* ---------- desktop tweaks ---------- */

@media (min-width: 720px) {
  #app {
    width: 100%;
    max-width: 512px;
    align-self: center;
    border-left: 1px solid var(--fg);
    border-right: 1px solid var(--fg);
  }
}
