/* automatic-bassoon-v2 — light, sheet-friendly music viewer */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #ffffff;
  color: #1a1a1e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

#app { min-height: 100%; }

/* ---------- PIN ---------- */
.pin-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  user-select: none;
  -webkit-user-select: none;
}
.pin-title { font-size: 20px; letter-spacing: 2px; color: #8a8a93; text-transform: uppercase; }
.pin-dots { display: flex; gap: 18px; }
.pin-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #b9b9c2;
  transition: background .12s, border-color .12s;
}
.pin-dot.filled { background: #1a1a1e; border-color: #1a1a1e; }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 84px);
  gap: 14px;
  touch-action: manipulation;
}
.pin-insecure {
  grid-column: 1 / -1;
  max-width: 260px;
  color: #b3261e;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
  padding: 20px 4px;
}
.pin-key {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 1px solid #e0e0e6;
  background: #f1f1f4;
  color: #1a1a1e;
  font-size: 30px;
  cursor: pointer;
  touch-action: manipulation;
}
.pin-key:active { background: #e2e2e8; }
.pin-key.fn { font-size: 18px; color: #8a8a93; }
.pin-screen.shake .pin-dots { animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-12px); }
  75% { transform: translateX(12px); }
}

/* ---------- LIBRARY ---------- */
.library { padding: 20px 16px 48px; max-width: 700px; margin: 0 auto; }
.library h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.library .sub { color: #8a8a93; font-size: 13px; margin-bottom: 16px; }
.search {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #e0e0e6;
  background: #f4f4f6;
  color: #1a1a1e;
  outline: none;
}
.search:focus { border-color: #b9b9c2; }
.quick-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.qf {
  flex: 1;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid #e0e0e6;
  background: #f4f4f6;
  color: #1a1a1e;
  cursor: pointer;
}
.qf.active { background: #1a1a1e; border-color: #1a1a1e; color: #ffffff; }
.grid {
  display: flex;
  flex-direction: column;
}
.card {
  background: #ffffff;
  border: none;
  border-bottom: 1px solid #ececf0;
  border-radius: 0;
  padding: 14px 4px;
  cursor: pointer;
}
.card:active { background: #f4f4f6; }
.card-body { padding: 0; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; }
.card-meta { font-size: 13px; color: #8a8a93; }
.card-meta .resume { color: #2e7d32; }
.audio-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.audio-chip {
  font-size: 11px;
  color: #33333a;
  background: #eef0f3;
  border-radius: 20px;
  padding: 4px 10px;
  text-decoration: none;
}
.empty { color: #8a8a93; text-align: center; margin-top: 60px; }

/* ---------- VIEWER ---------- */
.viewer {
  position: fixed;
  inset: 0;
  background: #ffffff;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.viewer img.page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
.viewer img.page.bump-left { animation: bump-left .3s ease; }
.viewer img.page.bump-right { animation: bump-right .3s ease; }
@keyframes bump-left {
  0% { transform: translateX(0); }
  35% { transform: translateX(-16px); }
  100% { transform: translateX(0); }
}
@keyframes bump-right {
  0% { transform: translateX(0); }
  35% { transform: translateX(16px); }
  100% { transform: translateX(0); }
}
