@font-face { font-family: "Unbounded"; src: url("/fonts/unbounded-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbmono-latin.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0b0a0d;
  --ink: #ecebf1;
  --muted: #85838f;
  --faint: #ffffff14;
  --don: #f04b3c;
  --kat: #4598e0;
  --display: "Unbounded", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background:
    radial-gradient(ellipse 60% 40% at 88% -5%, #f04b3c1c, transparent 70%),
    radial-gradient(ellipse 40% 35% at 100% 10%, #4598e014, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
[hidden] { display: none !important; }

body {
  margin: 0 auto;
  max-width: 1240px;
  min-height: 100vh;
  padding: 0 max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
  color: var(--ink);
  font: 15px/1.6 var(--sans);
}
::selection { background: var(--don); color: #fff; }
.mono { font-family: var(--mono); }

.top { padding: clamp(28px, 6vh, 64px) 0 20px; }
.home { font: 0.75rem var(--mono); color: var(--muted); text-decoration: none; }
.home:hover { color: var(--ink); }
.top h1 { margin: 2px 0 4px; font: 700 clamp(2rem, 7vw, 3.2rem)/1 var(--display); letter-spacing: -0.02em; }
.sub { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* upload: one row, like the site's lists */
/* title on the left, the upload row on the right, as wide as the editor below */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 48px; }
.intro .top { flex: 0 0 auto; }
.drop { flex: 1 1 420px; max-width: 680px; margin-bottom: 20px; border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); }
.drop-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 2px; cursor: pointer; }
.drop-row input { display: none; }
.drop-name { font: 500 1.05rem var(--display); }
.drop-meta { font-size: 0.75rem; color: var(--muted); }
.drop-row:hover .drop-name, .drop.over .drop-name { color: var(--don); }
.heads-up { margin: 6px 0 0; max-width: 46ch; font-size: 0.7rem; line-height: 1.5; color: var(--muted); opacity: .8; }
.heads-up b { margin-right: 6px; color: var(--don); font-weight: 500; }
.status { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0 2px 16px; font-size: 0.8rem; color: var(--muted); }
.status.err { color: var(--don); }

/* while the server works: a row of dots floating left and right, don and kat in turn, each a
   little ahead of the next, so the row sways like a wave (drawn by app.js, drawDots) */
.dots { display: none; flex: 0 0 auto; width: 74px; height: 8px; }
.status.busy .dots { display: block; }

button, select, input { font: inherit; color: inherit; }
button {
  padding: 3px 6px; border: 0; border-radius: 3px; background: none; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 0.78rem;
}
button:hover { color: var(--ink); background: var(--faint); }
button:disabled { opacity: .35; cursor: default; background: none; }
select, input[type=text], .field input, textarea {
  border: 1px solid var(--faint); border-radius: 3px; background: #ffffff08;
}
select { padding: 2px 4px; font-family: var(--mono); font-size: 0.78rem; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; font-size: 0.78rem; color: var(--muted); }
.bar label { display: flex; align-items: center; gap: 6px; }
.bar .clock { color: var(--ink); font-size: 0.95rem; min-width: 8.5ch; }
.bar .sep { flex: 1; }
.bar .hint { opacity: .6; font-size: 0.7rem; }
/* the one control people must find: a quiet outline like the other controls, a red icon,
   and a faint red tint while playing */
.bar .play {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 11px; border: 1px solid #ffffff2e; border-radius: 4px;
  color: var(--ink); font-size: 0.8rem; transition: background .15s, border-color .15s;
}
.bar .play .ico { width: 1.1em; text-align: center; font-size: 0.7rem; color: var(--don); }
.bar .play:hover { background: var(--faint); border-color: #ffffff55; color: var(--ink); }
.bar .play.on { background: #f04b3c14; border-color: #f04b3c70; }
/* tap mode: outlined like play, lit in the colour of the taps on the waveform while it's on */
.bar .tap { padding: 3px 9px; border: 1px solid #ffffff2e; border-radius: 4px; color: var(--ink); font-size: 0.8rem; }
.bar .tap.on { background: #e8c54722; border-color: #e8c547aa; color: #e8c547; }
.bar input[type=range] { width: 84px; accent-color: var(--don); }
.bar .hover { display: inline-block; width: 10ch; white-space: nowrap; color: var(--kat); font-size: 0.85rem; }

.wave { display: block; width: 100%; height: 260px; border-top: 1px solid var(--faint); border-bottom: 1px solid var(--faint); cursor: crosshair; touch-action: none; }
.overview { display: block; width: 100%; height: 34px; margin-bottom: 18px; border-bottom: 1px solid var(--faint); cursor: pointer; touch-action: none; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.col-head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 2px; font-size: 0.72rem; color: var(--muted); }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--faint); }
.lines { max-height: 300px; overflow-y: auto; }
.lines li {
  display: grid; grid-template-columns: 5ch 10ch 1fr auto; gap: 12px; align-items: baseline;
  padding: 7px 2px; border-bottom: 1px solid var(--faint); cursor: pointer; font-family: var(--mono); font-size: 0.82rem;
}
.lines li .n { color: var(--muted); }
.lines li .bpm { font: 500 0.95rem var(--display); }
.lines li .t { color: var(--muted); }
.lines li .warn { color: var(--don); font-size: 0.72rem; }
.lines li:hover .bpm { color: var(--don); }
.lines li.on { background: #f04b3c14; }
.lines li.on .bpm { color: var(--don); }

.field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 2px; border-bottom: 1px solid var(--faint); }
.field .k { width: 6ch; font-size: 0.72rem; color: var(--muted); }
.field .u { font-size: 0.72rem; color: var(--muted); }
.field input { width: 12ch; padding: 3px 6px; font-size: 0.9rem; }
.field .sp { width: 10px; }
.joint { margin: 10px 2px; font-size: 0.75rem; color: var(--muted); }
.joint b { color: var(--don); font-weight: 500; }

.out { margin-top: 28px; }
/* the way fixes reach the bench set: outlined red like play, filled once the timing was changed */
#send-fix { border: 1px solid #f04b3c70; color: var(--ink); transition: background .15s, border-color .15s; }
#send-fix:hover { background: #f04b3c33; }
#send-fix.ready { background: var(--don); border-color: var(--don); color: #fff; }
#send-fix.ready:hover { background: #ff5e4f; }
#send-fix.sent:disabled { opacity: 1; color: var(--kat); border-color: #4598e070; background: none; }
.fix-hint { margin-right: 8px; font-size: 0.72rem; color: var(--don); }
@media (max-width: 760px) { .fix-hint { display: none; } }
/* above the waveform: the grid is judged there, so the doubts must be read there */
.notes { margin: 0 0 4px; padding: 6px 2px; font-size: 0.75rem; color: var(--muted); }
.notes p { margin: 0; }
.notes p + p { margin-top: 4px; }
.notes b { color: var(--don); font-weight: 500; }
.notes.unsure { padding: 10px 14px; border-left: 2px solid var(--don); background: #f04b3c14; color: var(--ink); font-size: 0.82rem; }
.notes button { padding: 1px 6px; border: 1px solid #f04b3c88; color: var(--ink); }
.notes button:hover { background: #f04b3c33; }
.notes p.fix-note { color: var(--muted); font-size: 0.75rem; }
.notes.unsure p.fix-note { margin-top: 8px; }
/* an .osu dropped on the page takes its red lines: the box lights up like the drop row */
.drop-osu { color: var(--muted); opacity: .7; text-transform: none; }
.out.over .drop-osu { color: var(--don); opacity: 1; }
.out.over textarea { border-color: var(--don); }
@media (max-width: 760px) { .drop-osu { display: none; } }
textarea { width: 100%; min-height: 9.5em; padding: 10px; font-size: 0.82rem; line-height: 1.5; resize: vertical; color: var(--ink); }
