/* shred.ikbr.io — dark practice-room theme, no framework. */

:root {
  --bg: #111417;
  --panel: #191d22;
  --border: #2a2f36;
  --text: #e8e8ea;
  --muted: #9aa1ab;
  --accent: #e8552e;
  --st-not_started: #6b7280;
  --st-notes_learned: #3b82f6;
  --st-building_speed: #d99a1f;
  --st-at_tempo: #22a35e;
  --st-polished: #1fa5a0;
  /* Practice-heatmap sequential ramp: single hue (blue), dark-surface
     mirror of the dataviz skill's light->dark rule — darkest/near-surface
     at zero minutes, brightest at the top bucket. */
  --heat-0: #20242b;
  --heat-1: #163a63;
  --heat-2: #1c5cab;
  --heat-3: #3987e5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

nav a {
  color: var(--text);
  font-weight: 600;
  padding: 0.5rem 0.25rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

nav a:hover { color: var(--accent); text-decoration: none; }

#session-badge { margin-left: auto; color: var(--muted); font-size: 0.9rem; }

main#screen {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
}

.muted { color: var(--muted); font-size: 0.9rem; }

.err {
  color: #f87171;
  padding: 1rem;
}

/* status pills */
.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  color: #0b0d10;
  background: var(--st-not_started);
}
.pill.not_started, select option[value="not_started"] { background: var(--st-not_started); }
.pill.notes_learned { background: var(--st-notes_learned); color: #f5f8ff; }
.pill.building_speed { background: var(--st-building_speed); }
.pill.at_tempo { background: var(--st-at_tempo); color: #f5fff9; }
.pill.polished { background: var(--st-polished); color: #f5fffe; }
.pill.backlog { background: var(--st-not_started); }
.pill.active { background: var(--st-building_speed); }
.pill.done { background: var(--st-at_tempo); color: #f5fff9; }

/* song cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  min-height: 44px;
}

.card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* generic flex forms */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.song-head { font-size: 1.1rem; }

input, select, button {
  font-size: 1rem;
  padding: 0.5rem 0.6rem;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0d0f12;
  color: var(--text);
}

input:focus, select:focus, button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  min-width: 44px;
}

button:hover { opacity: 0.9; }

button.danger {
  background: transparent;
  color: #f87171;
  border: 1px solid #f87171;
}

/* section table */
.sections { display: flex; flex-direction: column; gap: 0.5rem; }

.section-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
}

.section-row .row { background: transparent; border: none; padding: 0.25rem 0; margin: 0; }

details { margin-top: 0.25rem; }
summary { cursor: pointer; color: var(--muted); padding: 0.5rem 0; min-height: 44px; display: flex; align-items: center; }

.videos { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; }
.video-row { background: transparent; border: none; padding: 0.25rem 0; margin: 0; }

/* looper screen */
.video-tabs { gap: 0.4rem; }
.tab-btn, .speed-btn, .ql-min {
  background: #0d0f12;
  color: var(--text);
  border: 1px solid var(--border);
  min-width: auto;
}
.tab-btn.active, .speed-btn.active, .ql-min.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.player-box {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.player-box .yt-embed,
.player-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.speed-row { gap: 0.35rem; }

.metro-box { margin: 1rem 0; }
.metronome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quicklog-strip {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.75rem;
  margin-top: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ql-flash { min-height: 1.2em; }

/* today screen */
.today-session, .today-start { gap: 0.75rem; }
.elapsed { font-weight: 700; font-size: 1.2rem; min-width: 6em; }
.today-start button { flex: 1; min-width: 140px; padding: 1rem; font-size: 1.1rem; }
.today-card { margin-bottom: 1rem; }
.today-card h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.today-sections { display: flex; flex-direction: column; gap: 0.4rem; }
.today-sec {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.6rem;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #0d0f12;
}
.today-sec:hover { border-color: var(--accent); text-decoration: none; }

/* dashboard: status legend (shared with section grid + today pills) */
.grid-legend { flex-wrap: wrap; gap: 0.85rem; background: none; border: none; padding: 0.25rem 0; }
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-swatch.not_started { background: var(--st-not_started); }
.legend-swatch.notes_learned { background: var(--st-notes_learned); }
.legend-swatch.building_speed { background: var(--st-building_speed); }
.legend-swatch.at_tempo { background: var(--st-at_tempo); }
.legend-swatch.polished { background: var(--st-polished); }

/* dashboard: section grid */
.section-grid { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; }
.grid-row { display: flex; align-items: center; gap: 0.6rem; }
.grid-label {
  flex: 0 0 150px;
  width: 150px;
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grid-squares { display: flex; gap: 3px; flex-wrap: wrap; }
.grid-sq {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
  background: var(--st-not_started);
  cursor: pointer;
}
.grid-sq.notes_learned { background: var(--st-notes_learned); }
.grid-sq.building_speed { background: var(--st-building_speed); }
.grid-sq.at_tempo { background: var(--st-at_tempo); }
.grid-sq.polished { background: var(--st-polished); }
.grid-sq.selected, .grid-sq:focus { outline: 2px solid #fff; outline-offset: 1px; }

.spark-box { margin: 0.75rem 0 1.5rem; }
.spark-box h3 { font-size: 0.95rem; margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.spark-practice { font-size: 0.85rem; }
.sparkline { width: 100%; max-width: 600px; height: 120px; display: block; }

/* dashboard: heatmap */
.stat-tile { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { color: var(--muted); }
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.heat-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--heat-0); }
.heat-cell.empty { background: transparent; }
.heat-cell.h1 { background: var(--heat-1); }
.heat-cell.h2 { background: var(--heat-2); }
.heat-cell.h3 { background: var(--heat-3); }
.heat-legend { gap: 0.35rem; background: none; border: none; padding: 0.35rem 0 1.25rem; font-size: 0.8rem; }

/* dashboard: run-throughs */
.rt-list { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.5rem; }
.rt-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d0f12;
}
