/* Title font: Rock Salt by Font Diner (Apache License 2.0, see fonts/LICENSE-rock-salt.txt) */
@font-face {
  font-family: 'Rock Salt';
  src: url('fonts/rock-salt-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #1b1d21;
  --panel: #2a2d33;
  --button: #3a3d44;
  --button-2: #50545d;
  --text: #f2f2f2;
  --muted: #aaa;
  --amber: #e8a33d;
  --green: #3c8c5a;
  --red: #c0473d;
  --touch: 60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: var(--text); background: var(--button); border: none;
  border-radius: 14px; min-height: var(--touch); padding: 0 18px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:active { transform: scale(0.97); }
.screen { max-width: 1180px; margin: 0 auto; padding: 16px; }
h1 { font-size: 30px; margin: 6px 0 16px; }

/* My Songs */
.songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.song-tile { position: relative; background: var(--panel); border-radius: 16px; }
.song-tile .open { display: block; width: 100%; text-align: left; padding: 12px; background: none; border-radius: 16px; }
.song-tile .more { position: absolute; top: 18px; right: 18px; width: 56px; min-height: 56px; padding: 0;
  font-size: 26px; background: rgba(0,0,0,0.65); border-radius: 12px; }
.song-tile img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: #000; }
.song-tile .title { font-size: 21px; font-weight: 600; margin: 12px 2px 4px; }
.song-tile .meta { font-size: 16px; color: var(--muted); margin: 0 2px 4px; }
.add-tile { min-height: 220px; font-size: 22px; background: none; border: 3px dashed #555; color: #ccc; }
.empty { color: var(--muted); font-size: 20px; margin: 4px 0 18px; }

/* Dialog */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog { background: var(--panel); border-radius: 18px; padding: 22px; width: min(620px, 100%); }
.dialog h2 { margin: 0 0 14px; font-size: 24px; }
.dialog p { font-size: 19px; margin: 0 0 16px; }
.dialog input { width: 100%; font-size: 20px; padding: 14px; border-radius: 12px; border: none; }
.dialog .error { color: #ff8a80; font-size: 18px; min-height: 26px; margin-top: 8px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; }
.dialog .ok { background: var(--amber); color: #000; font-weight: 700; }
.dialog .danger { background: var(--red); font-weight: 700; }

/* Banner */
.banner { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--red); color: #fff; font-size: 19px; border-radius: 14px;
  padding: 0 22px; min-height: var(--touch); display: flex; align-items: center; z-index: 20; }
.banner[hidden] { display: none; }
.dialog .choices { display: flex; flex-direction: column; gap: 10px; }
.dialog .choices button { font-size: 20px; }

/* Practice screen */
.practice { padding-top: 10px; padding-bottom: 12px; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; }
.practice-head { flex: none; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.practice-head .back { flex: none; }
.practice-head .song-title { flex: 1; min-width: 0; text-align: left; background: none; font-size: 26px;
  font-weight: 700; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.practice-top { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 270px; gap: 16px; }
/* The video is as big as fits in the space left over, keeping 16:9. */
.video-area { min-height: 0; container-type: size; display: flex; justify-content: center; align-items: flex-start; }
.video-box { position: relative; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16/9;
  background: #000; border-radius: 12px; overflow: hidden; }
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-message { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 18px; text-align: center; padding: 24px; font-size: 20px; color: #ff8a80; background: #000; }
.video-message p { margin: 0; max-width: 34em; }
.video-message .remove-song { background: var(--red); color: #fff; font-weight: 700; padding: 0 26px; }
.video-message[hidden] { display: none; }
.loops { background: var(--panel); border-radius: 12px; padding: 12px; display: flex; flex-direction: column;
  gap: 10px; overflow-y: auto; }
.loops h3 { margin: 2px 4px 2px; font-size: 17px; color: var(--muted); font-weight: 500; }
.loop-row { display: flex; gap: 8px; }
.loop-row .loop { flex: 1; min-width: 0; text-align: left; padding: 10px 14px; font-size: 19px; }
.loop-row .loop small { display: block; color: #bbb; font-size: 15px; margin-top: 3px; }
.loop-row .more { flex: none; width: 56px; padding: 0; font-size: 24px; }
.loop-row.active .loop, .loop-row.active .more { background: var(--amber); color: #000; }
.loop-row.active .loop small { color: #222; }
.save-loop { background: none; border: 2px dashed #555; color: #ccc; }
.add-chapters { background: none; border: 2px dashed #555; color: #ccc; font-size: 17px; }
.add-chapters[hidden] { display: none; }
.loop-row.whole .loop { background: #33363d; }
.loop-row.whole.active .loop { background: var(--amber); color: #000; }
/* The slider: a tall touch area around a thinner bar. */
.strip-hit { flex: none; position: relative; padding: 15px 0; margin: 2px 0; touch-action: none; cursor: pointer; }
.strip { position: relative; height: 22px; background: #333; border-radius: 11px; }
.strip-time { position: absolute; bottom: 100%; transform: translateX(-50%); background: #fff; color: #000;
  font-size: 18px; font-weight: 700; padding: 6px 10px; border-radius: 8px; pointer-events: none;
  font-variant-numeric: tabular-nums; }
.strip-time[hidden] { display: none; }
.strip .sel { position: absolute; top: 0; bottom: 0; background: var(--amber); border-radius: 11px; }
.strip .head { position: absolute; top: -6px; bottom: -6px; width: 6px; margin-left: -3px; background: #fff; border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4); }
.controls { flex: none; display: grid; grid-template-columns: 1.2fr 1fr 1.2fr 1fr; gap: 14px; }
.panel { background: var(--panel); border-radius: 14px; padding: 12px; text-align: center; }
.panel .label { color: var(--muted); font-size: 16px; }
.panel .value { font-size: 34px; font-weight: 700; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.panel .row { display: flex; gap: 8px; }
.panel .row button { flex: 1; min-height: 64px; font-size: 22px; }
.panel .wide { width: 100%; margin-top: 8px; font-size: 18px; background: var(--button-2); }
.big { display: flex; flex-direction: column; gap: 10px; }
.big button { flex: 1; font-size: 24px; font-weight: 700; }
.big .top { background: var(--amber); color: #000; }
.big .play { background: var(--green); }
button:disabled { opacity: 0.4; }

/* Welcome (new device) and guest note */
.welcome { max-width: 760px; text-align: center; padding-top: 12vh; }
.welcome h1 { font-size: 40px; }
.welcome-text { font-size: 22px; color: var(--muted); margin: 0 0 30px; }
.welcome-choices { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.welcome-choice { min-height: 80px; min-width: 300px; font-size: 24px; font-weight: 700; }
.ok { background: var(--amber); color: #000; font-weight: 700; }
.welcome-note { font-size: 18px; color: var(--muted); margin-top: 24px; }
.songs-head { display: flex; align-items: center; gap: 16px; }

.guest-note { font-size: 17px; color: var(--muted); }

/* The site's name: "Again, slower..." with slower... in black on amber */
.brand { font-family: 'Rock Salt', cursive; font-weight: 400; line-height: 1.6; margin: 0; }
/* inline-block + tight line-height: Rock Salt reserves a lot of space above and below its letters */
.brand .slow { display: inline-block; line-height: 1.05; background: var(--amber); color: #000;
  padding: 0.16em 0.28em 0.04em; border-radius: 0.14em; }
.welcome .brand { font-size: 46px; margin-bottom: 18px; }
.songs-head .brand { font-size: 30px; flex: 1; }
.songs-title { font-size: 30px; margin: 4px 0 16px; }
