/* Show checklist (pre-show, between groups or post-show). Colors/fonts follow Halloween 2026/index.html (Georgia, violet on near-black). */
:root {
  --bg: #0d0d17;
  --bg-grad: linear-gradient(135deg, #14061f 0%, #1a1a2e 50%, #0d0d17 100%);
  --surface: rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.08);
  --border: rgba(181,126,220,.28);
  --border-strong: rgba(181,126,220,.6);
  --text: #f0f0f0;
  --text-2: #cfc6dd;
  --muted: #a99cc0;
  --accent: #b57edc;
  --accent-ink: #14061f;
  --accent-deep: #8a2be2;
  --ok: #47c46b;
  --ok-bg: rgba(71,196,107,.13);
  --warn: #f0b04a;
  --warn-bg: rgba(240,176,74,.14);
  --danger: #ff7a7a;
  --focus: #ffd86b;
  --radius: 12px;
  --tap: 56px;
  font-size: 17px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  color: var(--text); line-height: 1.4;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- sticky header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13,13,23,.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.top-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.title-wrap { min-width: 0; }
h1 {
  margin: 0; font-size: 1.35rem; line-height: 1.15;
  background: linear-gradient(135deg, #d4b0f0, #b57edc 60%, #8a2be2);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.round-name { margin: 2px 0 0; color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  flex: none; min-height: 44px; max-width: 45%; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.chip-label { color: var(--muted); font-size: .8rem; }
.progress { margin: 10px 0 8px; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width .3s; }
.bar.complete > span { background: var(--ok); }
.progress-text { margin: 4px 0 0; font-size: .9rem; color: var(--text-2); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg-btn {
  min-height: 46px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text-2); cursor: pointer; font-size: .95rem;
}
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: bold; }
.pill { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.25); font-size: .85em; }

/* ---------- banner / toast ---------- */
.banner { margin: 12px 16px 0; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--warn); color: var(--text); }
.banner .btn { margin-top: 8px; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  padding: 14px 16px; border-radius: 10px; background: #2a1440; border: 1px solid var(--accent);
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}

/* ---------- groups ---------- */
main { padding: 8px 16px 0; max-width: 760px; margin: 0 auto; outline: none; }
.group { margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.group > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; min-height: var(--tap);
  display: flex; align-items: center; gap: 10px;
}
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before { content: '▸'; color: var(--accent); transition: transform .2s; }
.group[open] > summary::before { transform: rotate(90deg); }
.g-text { flex: 1; min-width: 0; }
.g-name { display: block; font-weight: bold; color: #e6d9f7; font-size: 1.02rem; }
.g-room { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.g-count { flex: none; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: .95rem; }
.group.complete .g-count { color: var(--ok); font-weight: bold; }
.g-bar { height: 4px; background: var(--surface-2); }
.g-bar > span { display: block; height: 100%; background: var(--accent); }
.group.complete .g-bar > span { background: var(--ok); }
.items { list-style: none; margin: 0; padding: 0; }

/* ---------- items ---------- */
.item { border-top: 1px solid rgba(181,126,220,.14); }
.item.done { background: var(--ok-bg); }
.item.short { background: var(--warn-bg); }
.tap {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  min-height: 64px; padding: 12px 14px; background: none; border: 0; cursor: pointer;
}
.tap:disabled { cursor: default; }
.box {
  flex: none; width: 30px; height: 30px; margin-top: 1px; border-radius: 8px;
  border: 2px solid var(--accent); display: grid; place-items: center; font-size: 20px; line-height: 1;
}
.item.done .box { background: var(--ok); border-color: var(--ok); color: #08210f; }
.item.done .box::after { content: '✓'; font-weight: bold; }
.txt { flex: 1; min-width: 0; display: block; }
.name { display: block; font-size: 1.02rem; }
.item.done .name { color: var(--text-2); }
.where { display: block; color: var(--muted); font-size: .84rem; margin-top: 2px; }
.who { display: block; font-size: .88rem; margin-top: 4px; color: var(--ok); font-weight: bold; }
.item.short .who { color: var(--warn); }
.who:empty { display: none; }
.cnote { display: block; font-size: .85rem; color: var(--text-2); font-style: italic; margin-top: 2px; }
.cnote:empty { display: none; }

.crow { display: flex; gap: 12px; padding: 12px 14px 4px; align-items: flex-start; }
.tally { flex: none; text-align: right; font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: bold; color: var(--text-2); }
.item.done .tally { color: var(--ok); }
.item.short .tally { color: var(--warn); }
.tally small { display: block; font-size: .72rem; font-weight: normal; color: var(--muted); }
.counter { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 12px; align-items: center; }
.stepper { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.stepper button { width: 48px; min-height: 52px; border: 0; background: var(--surface-2); font-size: 1.5rem; cursor: pointer; }
.stepper input {
  width: 3.3em; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  background: rgba(0,0,0,.3); text-align: center; font-size: 1.25rem; min-height: 52px;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn {
  min-height: 48px; padding: 10px 13px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: bold; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255,122,122,.6); color: #ffd0d0; background: rgba(255,122,122,.08); }
.btn.big { min-height: 56px; width: 100%; font-size: 1.05rem; }

.more { padding: 0 14px 10px 56px; }
.more > summary { cursor: pointer; color: var(--accent); font-size: .88rem; min-height: 36px; display: inline-flex; align-items: center; }
.more p { margin: 4px 0 8px; color: var(--text-2); font-size: .9rem; }
.more label { display: block; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.more input[type=text] {
  width: 100%; min-height: 44px; margin-top: 4px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(0,0,0,.3);
}
.counted .more { padding-left: 14px; }

.alldone { text-align: center; padding: 30px 16px; color: var(--ok); font-size: 1.15rem; }
.readonly .tap, .readonly .counter { pointer-events: none; }

/* ---------- empty / footer ---------- */
.empty { max-width: 520px; margin: 30px auto; padding: 0 16px; text-align: center; color: var(--text-2); }
.empty h2 { color: #e6d9f7; }
.actions { max-width: 760px; margin: 26px auto 0; padding: 16px 16px 40px; display: grid; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.meta { color: var(--muted); font-size: .8rem; margin: 6px 0 0; }
.back { color: #9a86c4; text-decoration: none; padding: 10px 0; }
.back:hover { color: #d4c4f0; }

/* ---------- dialogs ---------- */
dialog {
  width: min(92vw, 460px); max-height: 85vh; border: 1px solid var(--accent); border-radius: 14px;
  background: #1a1028; color: var(--text); padding: 18px;
}
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog h2 { margin: 0 0 6px; color: #e6d9f7; font-size: 1.2rem; }
dialog label { display: block; margin-top: 10px; color: var(--text-2); }
dialog input {
  width: 100%; min-height: 52px; margin-top: 6px; padding: 10px 12px; font-size: 1.15rem;
  border-radius: 10px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35);
}
.hint { color: var(--muted); font-size: .88rem; margin: 0; }
.dlg-actions { margin-top: 14px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.hist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hist button {
  width: 100%; text-align: left; min-height: 60px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.hist .h-name { display: block; font-weight: bold; }
.hist .h-meta { display: block; color: var(--muted); font-size: .85rem; }
.hist .h-cur { color: var(--ok); }

.gate { position: fixed; inset: 0; z-index: 60; background: var(--bg); background-image: var(--bg-grad); display: grid; place-items: center; padding: 16px; }
.gate-box { width: min(100%, 380px); display: grid; gap: 10px; }
.gate-box h2 { margin: 0; color: #e6d9f7; }
.gate-box input { min-height: 56px; font-size: 1.3rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: rgba(0,0,0,.35); }
.gate-err { color: var(--danger); min-height: 1.2em; margin: 0; }

@media (min-width: 700px) {
  :root { font-size: 18px; }
  .top { padding-left: max(16px, calc(50vw - 364px)); padding-right: max(16px, calc(50vw - 364px)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
