@font-face {
  font-family: Barlow;
  src: url("../fonts/Barlow-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Barlow;
  src: url("../fonts/Barlow-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0c0c;
  --bg-2: #141414;
  --bg-3: #1c1c1c;
  --line: #2a2a28;
  --text: #f5f5f3;
  --muted: #b7b7b0;
  --soft: #8d8d86;
  --accent: #ff6b2c;
  --accent-dim: rgba(255, 107, 44, 0.14);
  --nav: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: Barlow, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button {
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
img, svg { max-width: 100%; }

.app { min-height: 100dvh; }

.view {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 20px calc(148px + env(safe-area-inset-bottom));
}
.view.day-view { padding-bottom: calc(176px + env(safe-area-inset-bottom)); }
.view.play-view { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

.eyebrow {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 13px;
  margin: 0 0 8px;
}
.display {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 12vw, 64px);
  line-height: 0.88;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
.display .accent { color: var(--accent); }
.lede { color: var(--muted); margin: 12px 0 0; font-size: 16.5px; }
.section-label {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--muted);
  margin: 28px 0 10px;
}

.banner {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 14.5px;
}
.banner.deload { background: var(--accent-dim); }
.stack { display: flex; flex-direction: column; gap: 10px; }

.card, .ex, .tip, .rule, .hist, .exrow {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.card, .tip, .rule { padding: 14px 16px; }
.tip h3, .rule h3, .ex h3, .hist h3 {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 18px;
  margin: 0 0 6px;
}
.tip p, .rule p, .card p { margin: 0; color: var(--muted); }
.card strong, .tip strong { color: var(--text); font-weight: 600; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.plain li:last-child { border-bottom: 0; }

.ex { padding: 14px 14px 12px; margin: 0 0 10px; }
.ex-top { display: flex; gap: 10px; align-items: baseline; }
.num {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.pres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 15px;
}
.pres span, .pills span {
  background: var(--bg-3);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
}
.eq { margin: 0 0 6px; color: var(--text); }
.cue { margin: 0; color: var(--muted); }
.fb { margin: 8px 0 0; color: var(--soft); font-size: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text);
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 18px;
  width: 100%;
}
.btn.primary { background: var(--accent); color: #0c0c0c; border-color: var(--accent); }
.btn.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  min-height: 48px;
  letter-spacing: 0.06em;
  font-size: 16px;
}
.btn.small { width: auto; min-height: 44px; font-size: 15px; padding: 8px 12px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

.dock, .start-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  z-index: 15;
  padding: 18px 20px 10px;
  background: linear-gradient(transparent, #0c0c0c 36%);
}
.start-dock { bottom: calc(var(--nav) + env(safe-area-inset-bottom)); }
.dock { bottom: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

.switch {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.switch.on { border-color: var(--accent); background: var(--accent-dim); }
.switch .knob {
  width: 44px;
  height: 28px;
  border-radius: 999px;
  background: #2a2a28;
  position: relative;
  flex: none;
}
.switch .knob i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s ease;
}
.switch.on .knob { background: var(--accent); }
.switch.on .knob i { transform: translateX(16px); background: #0c0c0c; }
.switch span { font-size: 15px; }

.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: flex;
  background: rgba(12, 12, 12, 0.94);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
  backdrop-filter: blur(12px);
}
body.playing .nav { display: none; }
.nav button {
  flex: 1;
  min-height: 52px;
  color: var(--soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}
.nav button.on { color: var(--accent); }
.nav svg { width: 22px; height: 22px; }

.progress {
  height: 6px;
  background: #2a2a28;
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 14px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
}
.player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 22px;
}
.fig {
  background: #141414;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  margin: 8px 0 12px;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fig svg { display: block; height: 168px; width: auto; max-width: 100%; }
.player .eq {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.player h1 {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 9vw, 48px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.player h1.prep-title {
  font-family: Barlow, sans-serif;
  font-weight: 600;
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pills span {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
}
.quote {
  margin: 8px 0 12px;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: var(--text);
}
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.inputs.one { grid-template-columns: 1fr; }
.field { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.field label {
  display: block;
  text-align: center;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}
.stepper input {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  text-align: center;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  font-size: 32px;
  padding: 4px 0;
}
.hint { text-align: center; color: var(--soft); font-size: 12px; margin: 4px 0 0; }
.suggest {
  background: var(--bg-2);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14.5px;
  margin: 8px 0 0;
}
.suggest.ready { background: var(--accent-dim); color: var(--text); }
.pill {
  display: inline-block;
  background: var(--accent);
  color: #0c0c0c;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 7px;
  margin-right: 6px;
}
.error { color: var(--accent); min-height: 0; margin: 6px 0 0; font-size: 14px; }
.note { margin-top: 8px; color: var(--muted); }
.note summary { min-height: 44px; display: flex; align-items: center; }
.note input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}

.timer-num {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  font-size: 108px;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin: 12px 0;
  font-variant-numeric: tabular-nums;
}
.timer-track { height: 8px; background: #2a2a28; border-radius: 99px; overflow: hidden; }
.timer-track span { display: block; height: 100%; background: var(--accent); transform-origin: left center; width: 100%; }

.statgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 16px 0; }
.stat {
  background: var(--bg-2);
  border-radius: 14px;
  padding: 10px;
  border: 1px solid var(--line);
}
.stat .k {
  display: block;
  color: var(--soft);
  font-family: "Barlow Condensed", Barlow, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
.stat .v {
  display: block;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  margin-top: 4px;
}
.setlist { margin: 8px 0 16px; }
.setlist h3 { margin-bottom: 4px; }
.setline { color: var(--muted); margin: 0; }

.weekstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.week {
  flex: none;
  width: 92px;
  scroll-snap-align: start;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 10px;
  text-align: left;
  min-height: 84px;
}
.week.on { border-color: var(--accent); }
.week.deload .phase { color: var(--accent); }
.week .wk {
  display: block;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  font-size: 20px;
}
.week .when, .week .phase { display: block; color: var(--muted); font-size: 12px; }
.daylist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.daybtn, .daystatic {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.daybtn.today { border-color: var(--accent); }
.dow {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  width: 40px;
  color: var(--accent);
}
.daybtn strong, .daystatic strong { display: block; font-size: 15.5px; }
.daybtn em, .daystatic em { display: block; font-style: normal; color: var(--muted); font-size: 13px; }

.seg { display: flex; gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 14px; margin: 12px 0; }
.seg button { flex: 1; min-height: 44px; border-radius: 10px; color: var(--muted); font-family: "Barlow Condensed", Barlow, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.seg button.on { background: var(--accent); color: #0c0c0c; }

.hist {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin: 0 0 8px;
}
.hist .when { color: var(--soft); font-size: 13px; }
.hist .sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.spark { width: 88px; height: 32px; flex: none; }
.exline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.exline strong { display: block; }
.exline span { color: var(--muted); font-size: 13px; }
.chart { width: 100%; height: auto; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(480px, 100%);
  background: #141414;
  border-radius: 20px 20px 0 0;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet h2 {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  text-transform: uppercase;
  margin: 0 0 8px;
  font-size: 32px;
}
.sheet p { color: var(--muted); }
.sheet .btn { margin-top: 8px; }

.footer-note { color: var(--soft); font-size: 13px; margin-top: 22px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
