:root {
  color-scheme: dark;
  --bg: #07090d;
  --card: #11151c;
  --card-2: #171c25;
  --line: #262d39;
  --text: #f3f1ea;
  --muted: #9aa3b2;
  --gold: #f5c451;
  --gold-ink: #241a02;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
.wrap {
  max-width: 560px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; }
.brand { font-weight: 700; letter-spacing: .01em; color: var(--gold); font-size: 15px; }
.brand span { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.sync {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: 15px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sync .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.sync.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sync.ok { color: #d6f9e2; }
.sync.warn .dot { background: var(--amber); }
.sync.bad .dot { background: var(--red); }

.debug {
  margin-top: 10px; background: #0d1016; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted);
}
.debug dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 14px; }
.debug dt { color: #6b7483; }
.debug dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* gate */
.gate { text-align: center; padding: 18vh 8px 0; }
.gate-icon { font-size: 44px; color: var(--gold); }
.gate h1 { font-size: 32px; line-height: 1.15; margin: 12px 0 10px; }
.gate p { font-size: 19px; color: var(--muted); margin: 0 auto; max-width: 22em; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 14px; }
.card h2 { font-size: 21px; margin: 0 0 4px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; }

.now h1 { font-size: 32px; line-height: 1.12; margin: 6px 0 4px; overflow-wrap: anywhere; }
.artist { font-size: 19px; color: var(--muted); min-height: 1.4em; }
.progress { margin-top: 16px; }
.bar { height: 8px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; width: 0; background: linear-gradient(90deg, #d49a1e, var(--gold)); border-radius: 99px; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 15px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.upnext { margin-top: 14px; font-size: 17px; color: var(--muted); font-variant-numeric: tabular-nums; }
.upnext b { color: var(--text); font-weight: 600; }
.notice { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #2a2107; color: #fde7a8; font-size: 16px; }

/* the big button */
.tap {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%; min-height: 104px; margin-top: 14px; border: 0; border-radius: var(--radius);
  background: var(--gold); color: var(--gold-ink); box-shadow: 0 0 0 6px rgba(245, 196, 81, .14);
}
.tap:active { transform: scale(.985); }
.tap-main { font-size: 30px; font-weight: 800; }
.tap-sub { font-size: 16px; font-weight: 600; opacity: .75; }

/* timing */
.offset-row { display: grid; grid-template-columns: 84px 1fr 84px; align-items: center; gap: 10px; margin-top: 4px; }
.step {
  height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2);
  font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.step:active { background: #222937; }
output { text-align: center; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin: 18px 0 2px; height: 36px; accent-color: var(--gold); background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--card-2); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 32px; height: 32px; margin-top: -12px;
  border-radius: 50%; background: var(--gold); border: 3px solid var(--bg);
}
input[type=range] { -webkit-appearance: none; appearance: none; }
input[type=range]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--card-2); }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); border: 3px solid var(--bg); }
.scale { display: flex; justify-content: space-between; color: #6b7483; font-size: 13px; }
.presets { display: grid; gap: 8px; margin-top: 14px; }
.presets button {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); font-size: 16px;
}
.presets button b { font-variant-numeric: tabular-nums; color: var(--muted); }
.presets button.on { border-color: var(--gold); background: #231c0a; }
.presets button.on b { color: var(--gold); }
.secondary {
  width: 100%; min-height: 56px; margin-top: 14px; border-radius: 14px; border: 1px solid var(--gold);
  background: transparent; color: var(--gold); font-size: 18px; font-weight: 700;
}
.secondary:disabled { opacity: .4; }
#flashHint { margin: 10px 0 0; }
.flash-box {
  margin-top: 14px; height: 150px; border-radius: 14px; background: #000; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: #333; font-size: 14px; letter-spacing: .2em; text-transform: uppercase;
}
.flash-box.lit { background: #fff; color: #000; }

/* requests */
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.req {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; text-align: left;
  min-height: 64px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2);
}
.req .t { font-size: 18px; font-weight: 650; line-height: 1.2; display: block; }
.req .a { font-size: 14px; color: var(--muted); display: block; margin-top: 2px; }
.req .n { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.req.mine { border-color: var(--gold); background: #231c0a; }
.req.mine .n { color: var(--gold); font-weight: 700; }
.req:disabled { opacity: .45; cursor: default; }
.req-msg:empty { display: none; }
.req-msg { margin: 10px 0 0; color: var(--amber); font-size: 15px; }
.foot { color: #5d6573; font-size: 13px; text-align: center; margin: 22px 0 0; }
