:root {
  --ink: #070b14;
  --panel: #10182a;
  --line: rgba(232, 208, 154, 0.16);
  --ivory: #f7f1e4;
  --muted: #b7ad9c;
  --gold: #e0b15a;
  --gold-2: #f0cb86;
  --on-gold: #1c1408;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: Fraunces, Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(224, 177, 90, 0.16), transparent 42%),
    var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
}
button, input { font: inherit; }
button { cursor: pointer; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.app {
  display: flex;
  height: calc(100dvh - 108px);
  min-height: 0;
}

.setlist {
  width: min(300px, 88vw);
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.4rem;
}
.mark {
  margin: 0;
  font-family: var(--display);
  color: var(--gold);
  font-size: 1.35rem;
}
.icon-btn {
  display: none;
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}
#song-list { overflow: auto; padding: 0.3rem 0.5rem 1rem; }
.song {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ivory);
  border: 0;
  border-radius: 10px;
  padding: 0.8rem 0.7rem;
  font-size: 1.05rem;
}
.song:hover { background: rgba(224, 177, 90, 0.08); }
.song.active { background: var(--gold); color: var(--on-gold); font-weight: 700; }
.song:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold-2);
  outline-offset: 2px;
}

.chart {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chart-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
}
.set-toggle {
  display: none;
  background: var(--gold);
  color: var(--on-gold);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(224, 177, 90, 0.28);
}
.set-toggle:hover { background: var(--gold-2); }
#status { margin: 0; color: var(--muted); font-size: 0.92rem; }
#pdf-container {
  flex: 1;
  overflow: auto;
  background: #1a2233;
  min-height: 0;
}
#pdf-container iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pdf-page {
  display: block;
  margin: 0.8rem auto;
  max-width: calc(100% - 1.2rem);
  height: auto;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.player {
  position: sticky;
  bottom: 0;
  height: 108px;
  background: rgba(10, 14, 24, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 0.35rem 0.8rem 0.7rem;
}
.progress input { width: 100%; accent-color: var(--gold); }
.player-row { display: flex; align-items: center; gap: 0.7rem; }
.now { min-width: 0; flex: 1; }
.now-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#now {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 700;
  flex: none;
}
.play:hover { background: var(--gold-2); }
#time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.vol, .check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.vol input { width: 84px; accent-color: var(--gold); }

@media (max-width: 800px) {
  .set-toggle, .icon-btn { display: inline-flex; }
  .setlist {
    position: fixed;
    z-index: 4;
    inset: 0 auto 108px 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.35);
  }
  .setlist.open { transform: none; }
  .vol { display: none; }
  #now { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .setlist { transition: none; }
}