/* Band room design layer. Loaded AFTER band.css. Targets only ids/classes that band.html has
 * (and band_downloads.css classes). Do not rename ids; this file only restyles. */

:root {
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --top-h: 56px;
  --surface: var(--panel);
  --surface-2: var(--panel-2);
  --border: var(--line);
  --border-hover: #3a4560;
  --focus: var(--accent);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 8px 24px rgba(0, 0, 0, .22);
  color-scheme: dark;
}

html {
  scroll-padding-top: calc(var(--top-h) + var(--s-4));
  -webkit-tap-highlight-color: transparent;
}
body {
  line-height: 1.45;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* type */
h1 { font-size: 26px; letter-spacing: -.01em; margin-bottom: var(--s-2); }
#songView > h2,
#listView > h2 {
  display: flex; align-items: center; gap: var(--s-2);
  margin: var(--s-6) 0 var(--s-3); font-size: 12px; letter-spacing: .1em;
}
#songView > h2::after,
#listView > h2::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#songView > h2:first-of-type { margin-top: var(--s-5); }
.meta { gap: var(--s-2) var(--s-3); }
.msg { margin: var(--s-2) 0; }

/* sticky top bar: stays in flow (so content never sits under it), honours the notch */
.top {
  min-height: var(--top-h);
  padding: calc(var(--s-3) + env(safe-area-inset-top, 0px)) max(var(--s-4), env(safe-area-inset-right, 0px)) var(--s-3) max(var(--s-4), env(safe-area-inset-left, 0px));
  background: rgba(20, 24, 33, .94);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  box-shadow: 0 1px 0 var(--border), 0 6px 18px rgba(0, 0, 0, .18);
  z-index: 20;
}
.top .logo { line-height: 1.2; }

/* anything jumped to (focus, anchors) lands below the bar */
#songView, #listView, #songView > h1, #songView > h2, #listView > h1,
.player, .chords-now, .lyrics-panel, #partButtons, .actions, .songs {
  scroll-margin-top: calc(var(--top-h) + var(--s-4));
}

/* layout */
.wrap {
  max-width: 600px;
  padding: var(--s-4) max(var(--s-4), env(safe-area-inset-right, 0px)) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)) max(var(--s-4), env(safe-area-inset-left, 0px));
}

/* cards: one surface style for every block on the song page */
.player, .chords-now, .lyrics-panel, #songView .actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.player { padding: var(--s-5) var(--s-4); gap: var(--s-3); }
.chords-now { margin-top: var(--s-4); padding: var(--s-4); }
.lyrics-panel { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); }
#songView .actions { margin-top: 0; padding: var(--s-4); gap: var(--s-3); }
#songView > .actions + h2 { margin-top: var(--s-6); }
.songs { gap: var(--s-3); }
.song {
  padding: var(--s-4); background: var(--surface); border-color: var(--border);
  transition: border-color .15s, background-color .15s;
}
.song:hover { background: var(--surface-2); border-color: var(--border-hover); }
.song-title { font-size: 17px; }
.song-sub { margin-top: var(--s-1); }

/* buttons */
.btn {
  min-height: 44px;
  border-radius: var(--radius);
  transition: background-color .15s, border-color .15s, filter .15s, transform .06s;
  -webkit-user-select: none;
  user-select: none;
}
.btn:not(.primary):not(.ghost):not(.toggle):hover:not(:disabled) { border-color: var(--border-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.primary { box-shadow: 0 4px 14px rgba(124, 156, 255, .22); }
.btn.ghost { min-height: 44px; padding: var(--s-2) var(--s-3); }
.btn.ghost:hover:not(:disabled) { background: rgba(124, 156, 255, .1); }
.btn.toggle { min-height: 48px; font-size: 15px; padding: var(--s-2) var(--s-3); }
.btn.toggle[aria-pressed="true"] { box-shadow: 0 4px 14px rgba(124, 156, 255, .22); }
.toggles { gap: var(--s-2); margin-top: var(--s-4); }
.chips { gap: var(--s-2); }
.chips .btn { min-height: 44px; font-size: 14px; }
.actions .btn.primary.block { min-height: 52px; font-size: 16px; }

/* song parts */
.parts { gap: var(--s-2); }
.part {
  min-height: 56px; border-radius: var(--radius); border-color: var(--border);
  transition: background-color .15s, border-color .15s, transform .06s;
}
.part:hover:not([aria-pressed="true"]) { border-color: var(--border-hover); }
.part:active { transform: translateY(1px); }
.part[aria-pressed="true"] { box-shadow: 0 4px 14px rgba(124, 156, 255, .22); }

/* play button and seek bar (dark; the native white range is replaced) */
.play { box-shadow: 0 8px 24px rgba(124, 156, 255, .28); transition: filter .15s, transform .06s; }
.play:hover:not(:disabled) { filter: brightness(1.07); }
.play:active:not(:disabled) { transform: translateY(1px); }
.timeline { gap: var(--s-2); }
#time { color: var(--text); font-size: 16px; }

.timeline input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 28px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.timeline input[type="range"]:disabled { opacity: .4; cursor: default; }
.timeline input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.timeline input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px; /* (8px track - 22px thumb) / 2 with the 1px track border */
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(0, 0, 0, .5);
  cursor: pointer;
}
.timeline input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-sizing: border-box;
}
.timeline input[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}
.timeline input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(0, 0, 0, .5);
  cursor: pointer;
}
.timeline input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(124, 156, 255, .45); }
.timeline input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(124, 156, 255, .45); }

/* chord display */
.chords-now .label { font-size: 11px; }

/* selects: dark, custom chevron, 44px tall */
select {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  min-width: 120px;
  padding: var(--s-2) 38px var(--s-2) var(--s-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238691a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  color: var(--text);
  font: inherit;
  color-scheme: dark;
  cursor: pointer;
}
select:disabled { opacity: .4; cursor: default; }
select option { background: var(--surface-2); color: var(--text); }
.speed { gap: var(--s-2) var(--s-3); margin-top: var(--s-4); }
.speed label { color: var(--muted); font-size: 14px; }
.speed .small { min-width: 0; }

/* lyrics */
.lyrics-head { gap: var(--s-2) var(--s-3); }
.lyrics-head h2 { font-size: 12px; }
.lyrics-toggle { min-height: 40px; padding: var(--s-2) var(--s-3); font-size: 14px; }
.lyrics-body { max-height: 280px; margin-top: var(--s-2); padding-right: var(--s-1); }
.lyric-line.current { box-shadow: inset 3px 0 0 var(--accent); }

/* backing track checklist */
.checks { gap: var(--s-2); }
.check { min-height: 48px; background: var(--surface-2); }
.check:hover { border-color: var(--border-hover); }
.check input { cursor: pointer; }
.backing-row { gap: var(--s-2); }
.fmt { display: inline-flex; align-items: center; gap: var(--s-2); }
.fmt select { min-width: 96px; }

/* focus rings everywhere a keyboard user can land */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
.part:focus-visible,
.song:focus-visible,
.check input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.check:focus-within { border-color: var(--focus); }
input[type="range"]:focus-visible { outline-offset: 4px; }

/* small phones: no horizontal scroll, one column for the part grid */
@media (max-width: 380px) {
  .toggles { grid-template-columns: 1fr; }
  .backing-row { grid-template-columns: 1fr; }
  .speed select, .fmt select { width: 100%; }
  .speed { align-items: stretch; }
  .speed label { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .part, .song, .play, .timeline input[type="range"] { transition: none !important; }
}

/* Phone held sideways: two columns (player + live + my part | mixer + speed), short bar, less padding.
   Portrait is unchanged: .land and its columns are plain blocks there. */
.land, .col-main, .col-side { min-width: 0; }
@media (orientation: landscape) and (max-height: 500px) {
  .top { padding: 6px 12px; position: sticky; }
  .logo { font-size: 16px; }
  .wrap { max-width: 900px; padding: 8px 16px 24px; }
  h1 { font-size: 20px; margin: 0 0 2px; }
  h2 { margin: 10px 0 6px; }
  .meta { font-size: 13px; }
  .msg { margin: 4px 0; }
  .land {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 var(--s-4); align-items: start;
  }
  .player { margin-top: 10px; padding: 10px 12px; gap: 8px; }
  .play { height: 48px; min-width: 132px; font-size: 16px; }
  .live { margin-top: 6px; }
  .parts { gap: 8px; }
  .part { min-height: 48px; }
  .toggles { margin-top: 8px; }
  .speed { margin-top: 8px; }
  .speed select { min-height: 44px; }
  .btn { min-height: 44px; }
  .lyrics-panel, .downloads { grid-column: 1 / -1; }
  .lyrics-body { max-height: 180px; }
  .col-side .mixer { margin-top: 4px; }
}
