:root {
  --bg: #0b0b0f;
  --panel: #17171d;
  --line: #2a2a33;
  --text: #f4f4f6;
  --muted: #8d8d99;
  --accent: #ff5a1f;
  --accent-press: #d94512;
  --ok: #2fbf71;
  --warn: #ffb020;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px calc(env(safe-area-inset-bottom) + 12px);
  max-width: 560px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: .02em;
}
.event { font-weight: 600; color: var(--text); }

.clock { text-align: center; }
.time {
  font-size: clamp(64px, 22vw, 120px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.02em;
}
.sub { margin-top: 4px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.clock.count .time { color: var(--warn); }
.clock.done .time { color: var(--ok); }
.clock.capped .time { color: var(--accent); }

.move {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.move-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.move-name { font-size: 22px; font-weight: 700; }
.move-count { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.move-row.small { margin-top: 10px; font-size: 14px; color: var(--muted); }
.total { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; white-space: nowrap; }
.bar { margin-top: 10px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .12s ease-out; }

.tap {
  flex: 1;
  min-height: 160px;
  border: 0;
  border-radius: 28px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: clamp(56px, 18vw, 96px);
  font-weight: 800;
  touch-action: manipulation;
  transition: transform .06s, background .06s;
}
.tap:active, .tap.pressed { background: var(--accent-press); transform: scale(.985); }
.tap:disabled { background: var(--panel); color: var(--muted); }
.tap.done { background: var(--ok); }

footer { display: flex; gap: 10px; }
.ctl {
  flex: 1;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  touch-action: manipulation;
}
.ctl:disabled { color: var(--muted); opacity: .5; }
.ctl.armed { background: var(--accent); border-color: var(--accent); }

.splits {
  position: fixed;
  inset: 0;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);
  overflow-y: auto;
  max-width: 560px;
  margin: 0 auto;
}
.splits[hidden] { display: none; }
.splits-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 18px; margin-bottom: 12px; }
.splits-head .ctl { flex: 0 0 auto; padding: 0 16px; }
.splits ol { list-style: none; margin: 0; padding: 0; }
.splits li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.splits li .c { color: var(--muted); }
.splits li.todo { color: var(--muted); }
