

:root {
  --ink:#1a1f2e; --paper:#f5f3ef; --card:#fff;
  --purple:#5b3a8e; --purple-dark:#432a6b; --warm:#b85527;
  --good:#1f7a4d; --bad:#a8321f; --line:#d6d2ca; --muted:#5c6472;
  --blk:#cbb8e6;
}

* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body {
  margin:0; padding:0; background:var(--paper); color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  font-size:17px; line-height:1.45; min-height:100%;
}

.screen { display:none; }
.screen.on { display:block; }

[hidden] { display:none !important; }

.pad { padding:18px 16px calc(28px + env(safe-area-inset-bottom)); max-width:820px; margin:0 auto; }

h1 { font-size:2.1rem; margin:0 0 6px; letter-spacing:-0.5px; color:var(--purple-dark); }
h2 { font-size:1.5rem; margin:0 0 10px; color:var(--purple-dark); }
h3 { font-size:1.05rem; margin:22px 0 8px; }
.lead { font-size:1.12rem; margin:0 0 20px; }
.muted { color:var(--muted); } .small { font-size:0.92rem; }
.prompt { font-size:1.25rem; font-weight:600; margin:4px 0 12px; }

ul.how { margin:0 0 18px; padding-left:20px; }
ul.how li { margin:0 0 10px; }

button { font:inherit; }
.big {
  display:block; width:100%; min-height:52px; margin:0 0 10px; padding:13px 16px;
  border:none; border-radius:11px; background:var(--purple); color:#fff;
  font-weight:600; font-size:1.05rem; cursor:pointer;
}
.big:hover, .big:focus-visible { background:var(--warm); }
.big:disabled { background:var(--line); color:var(--muted); cursor:default; }
.plain {
  display:block; width:100%; min-height:48px; margin:14px 0 0; padding:11px;
  border:none; background:none; color:var(--purple); text-decoration:underline;
  font-size:1rem; cursor:pointer;
}
.link { border:none; background:none; color:var(--purple); text-decoration:underline;
  cursor:pointer; padding:10px 4px; min-height:44px; }

.modes { margin:22px 0 10px; }
.mode { text-align:left; }
.mode-name { display:block; font-size:1.08rem; }
.mode-blurb { display:block; font-weight:400; font-size:0.92rem; opacity:0.88; margin-top:3px; }

.levels { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 6px; }
.level { flex:1 1 44%; min-height:48px; padding:11px; border:2px solid var(--line);
  border-radius:10px; background:var(--card); color:var(--ink); font-weight:600; cursor:pointer; }
.level.picked { border-color:var(--purple); background:var(--purple); color:#fff; }

.bar { display:flex; align-items:center; justify-content:space-between;
  padding:6px 12px calc(6px + env(safe-area-inset-top)); border-bottom:1px solid var(--line); }


.beat { display:flex; gap:7px; margin:10px 0 14px; }
.beat i { flex:1 1 0; height:14px; border-radius:4px; background:var(--line); transition:none; }
.beat i.on { background:var(--purple); }
.beat i.on.count { background:var(--warm); }


.bar-strip {
  display:flex; gap:4px; align-items:stretch;
  background:var(--card); border:1px solid var(--line); border-radius:10px;
  padding:8px; min-height:62px; margin:0 0 12px;
}
.bar-strip.empty::after {
  content:'Nothing yet'; color:var(--muted); font-size:0.92rem; align-self:center; padding:0 6px;
}
.blk {
  
  background:var(--blk);
  outline:2px solid #9a86b8; outline-offset:-2px;
  border:none; padding:0; border-radius:7px;
  min-height:44px; display:flex; align-items:center; justify-content:center;
  font-size:0.76rem; font-weight:700; color:#2c1f45; overflow:hidden; white-space:nowrap;
  
  min-width:0;
}

.blk.n-eighth { background:repeating-linear-gradient(45deg,var(--blk),var(--blk) 5px,#bda6dd 5px,#bda6dd 10px); }
.blk.n-sixteenth { background:repeating-linear-gradient(45deg,var(--blk),var(--blk) 3px,#ab92d0 3px,#ab92d0 6px); }

.blk.lit { box-shadow:0 0 0 3px var(--warm); }

.choice-row {
  display:block; width:100%; text-align:left; border:2px solid var(--line);
  border-radius:12px; background:var(--card); padding:8px; margin:0 0 10px; cursor:pointer;
}
.choice-row:hover, .choice-row:focus-visible { border-color:var(--purple); }
.choice-row .bar-strip { border:none; margin:0; background:none; padding:0; min-height:52px; }

.tiles { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 10px; }

.tile { cursor:pointer; min-height:52px; padding:0 10px; outline-offset:-2px; }

#pad {
  width:100%; height:30vh; min-height:170px; border:none; border-radius:16px;
  background:var(--purple); color:#fff; font-size:1.5rem; font-weight:700;
  touch-action:manipulation; margin:0 0 8px;
}
#pad:active { background:var(--warm); }
#pad:disabled { opacity:0.4; }

.tally { margin:8px 0 12px; font-weight:600; min-height:1.4em; }
.tally.short { color:var(--muted); }
.tally.ready { color:var(--good); }

.verdict { min-height:1.5em; margin:12px 0 6px; font-size:1.06rem; font-weight:600; }
.verdict.good { color:var(--good); }
.verdict.bad { color:var(--bad); }
.verdict.soft { color:var(--muted); font-weight:500; }

@media (min-width:700px) {
  html, body { font-size:18px; }
  .modes { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .modes .big { margin:0; }
  .bar-strip { min-height:76px; }
  .blk { font-size:0.84rem; }
}
