:root {
  --bg: #120d16;
  --bg-2: #1d1524;
  --card: #231a2b;
  --line: #3a2c45;
  --text: #f3ece6;
  --muted: #a99bb3;
  --orange: #ff7a1a;
  --orange-2: #ffa24d;
  --green: #8fd694;
  --red: #ff6b6b;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, #3b1d4a 0%, transparent 60%),
    linear-gradient(var(--bg-2), var(--bg));
  background-color: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

header { text-align: center; margin-bottom: 24px; }

h1 {
  font-family: "Creepster", system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--orange);
  text-shadow: 0 0 24px rgba(255, 122, 26, 0.35);
  margin: 0 0 12px;
}

.where { margin: 0; font-size: 1.1rem; }
.when { margin: 4px 0 0; color: var(--orange-2); font-weight: 600; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  color: var(--orange-2);
}

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-weight: 600; margin-bottom: 4px; }
.field small { color: var(--muted); font-weight: 400; }

input[type=text], input[type=number] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
input::placeholder { color: #6f6378; }
input:focus-visible, button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

input[type=checkbox], input[type=radio] {
  accent-color: var(--orange);
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
}

.check { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; cursor: pointer; }

.choice {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  font-weight: 600;
}
.choice label:has(input:checked) {
  border-color: var(--orange);
  background: rgba(255, 122, 26, 0.12);
}

.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; transition: opacity .15s; }
.counts.disabled { opacity: .4; }

button {
  display: block;
  width: 100%;
  margin-top: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #1a1000;
  background: linear-gradient(var(--orange-2), var(--orange));
  border: 0;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: wait; }

.status { min-height: 1.5em; margin: 12px 0 0; text-align: center; }
.status.ok { color: var(--green); }
.status.error { color: var(--red); }

.note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 162, 77, 0.1);
  color: var(--orange-2);
  font-size: .95rem;
}

.totals { margin: 0 0 12px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.muted { color: var(--muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* admin */
.wide { max-width: 900px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
td.num, th.num { text-align: right; }
.yes { color: var(--green); }
.no { color: var(--red); }
.row-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.row-actions button { width: auto; margin: 0; padding: 10px 16px; font-size: .9rem; }
button.link {
  width: auto; margin: 0; padding: 4px 8px; background: none; color: var(--red);
  text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .9rem;
}
