:root {
  --ink: #151515;
  --text: #333;
  --muted: #777;
  --line: #e6e6e6;
  --dash: #d5d5d5;
  --bg: #fff;
  --soft: #f6f6f4;
  --bar: #151515;
  --bar-line: #3a3a3a;
  --bar-muted: #9a9a9a;
}
* { box-sizing: border-box; }
[hidden]:not(.fab) { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Montserrat', system-ui, sans-serif; font-size: 16px; line-height: 1.5;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* Hlavička */
.nav {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid #ececec; box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.nav .wrap { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 60px; }
.nav-side { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none; position: relative; }
.nav-side svg { width: 22px; height: 22px; }
.logo { display: flex; flex-direction: column; align-items: center; text-decoration: none; justify-self: center; }
.logo img { height: 30px; margin: -5px 0 -7px; }
.logo span { font-weight: 600; font-size: 12.5px; letter-spacing: .42em; margin-right: -.42em; }
.badge {
  position: absolute; top: 6px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.badge:empty { display: none; }

/* Typografia */
.kick { font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.divider {
  display: flex; align-items: center; gap: 12px; margin: 28px 0 16px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ''; flex: 1; border-top: 2px dashed var(--dash); }

/* Domov */
.home-hero { text-align: center; padding: 40px 0 8px; }
.home-hero h1 { font-size: 28px; line-height: 1.12; text-transform: uppercase; margin: 10px 0 12px; letter-spacing: .01em; }
.home-hero p { color: var(--text); font-size: 15px; margin: 0 auto; max-width: 30em; }
.search { display: block; position: relative; margin: 24px 0 4px; }
.search input {
  width: 100%; height: 50px; border: 1.5px solid var(--ink); border-radius: 0; padding: 0 16px 0 46px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); -webkit-appearance: none;
}
.search svg { position: absolute; left: 15px; top: 15px; width: 20px; height: 20px; }
.songs { list-style: none; margin: 0; padding: 0; }
.songs li { border-bottom: 1px solid var(--line); }
.songs a, .songs .soon { display: flex; align-items: center; gap: 14px; padding: 15px 0; text-decoration: none; }
.songs .t { font-weight: 700; font-size: 16px; }
.songs .s { font-size: 12.5px; color: var(--muted); }
.songs .k { margin-left: auto; font-weight: 700; font-size: 14px; min-width: 30px; text-align: right; }
.songs .soon { color: #aaa; }
.songs .soon .t { font-weight: 600; }
.songs .soon .k { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; min-width: auto; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 0 60px; }

/* Pieseň – hlavička: pieseň je hlavná, ovládanie je tiché */
.song-hero { text-align: center; padding: 28px 0 6px; }
.song-hero h1 { font-size: 26px; line-height: 1.12; text-transform: uppercase; margin: 8px 0 10px; letter-spacing: .01em; }
.meta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.meta b { color: var(--ink); }
.add-set {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 4px 2px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.add-set svg { width: 12px; height: 12px; }
.add-set:hover { color: var(--ink); }
.mykey { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mykey button { text-decoration: underline; font-weight: 600; color: var(--muted); }

.order {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; margin: 18px 0 0;
  font-size: 12px; color: #aaa;
}
.order .lbl { display: none; }
.order button { font-weight: 500; color: var(--muted); padding: 3px 2px; }
.order button:hover, .order button:active { color: var(--ink); }
.order i { font-style: normal; padding: 0 3px; }

.views { display: flex; justify-content: center; gap: 18px; margin: 14px 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.views button { padding: 4px 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #aaa; border-bottom: 1.5px solid transparent; }
.views button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.tip {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 18px; font-size: 12.5px; color: var(--muted);
}
.tip b { font-weight: 700; color: var(--ink); }
.tip button { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink); text-decoration: underline; flex: none; }
.tip[hidden] { display: none; }

/* Pieseň – text */
.sheet { padding-bottom: 160px; }
.sec { margin-bottom: 26px; scroll-margin-top: 76px; }
.sec h2 { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }
.sec h2::after { content: ''; display: block; width: 22px; height: 3px; background: var(--ink); margin-top: 5px; }
.sec h2 small { font-size: inherit; color: var(--muted); margin-left: 6px; letter-spacing: .06em; }
.ln { margin-bottom: .5em; line-height: 1.12; color: var(--text); }
.seg { display: inline-block; vertical-align: bottom; white-space: pre; }
.seg > .c { display: block; height: 1.38em; padding-right: .35em; font-weight: 700; color: var(--ink); font-size: .84em; }
.seg > .c:empty { height: 0; }
.seg > .c button { font-weight: 700; padding: 0 1px; margin: 0 -1px; border-radius: 3px; }
.seg > .c button:active { background: #eee; }
.seg > span { display: block; }
.bars { display: flex; flex-wrap: wrap; gap: 6px 0; font-weight: 700; font-size: .92em; }
.bars button { min-width: 52px; text-align: left; font-weight: 700; padding: 2px 0; }
.chords-only .ln { color: var(--ink); }
.chords-only .cl { display: flex; flex-wrap: wrap; gap: 2px 0; margin-bottom: .55em; font-weight: 700; font-size: .95em; }
.chords-only .cl button { min-width: 52px; text-align: left; font-weight: 700; }
.text-only .ln { font-size: 1.08em; margin-bottom: .35em; }
.authors { font-size: 12px; color: var(--muted); margin-top: 30px; }
.centered .sec h2, .centered .ln, .centered .authors { text-align: center; }
.centered .sec h2::after { margin-left: auto; margin-right: auto; }
.centered .bars, .centered .cl { justify-content: center; }

/* Ovládanie – svetlý, tenký panel */
.ctl {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.97); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(0,0,0,.05);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); transition: transform .25s ease;
}
.ctl.mini { transform: translateY(calc(100% + 10px)); }
.ctl .wrap { display: flex; flex-direction: column; gap: 6px; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctl label, .ctl .lbl { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #aaa; }
.ctl-grp { display: flex; flex-direction: column; gap: 1px; }
.ctl .wrap > .ctl-grp > .lbl { display: none; }
.keys button[aria-pressed="true"]::before { width: 26px !important; height: 26px !important; margin-left: -13px !important; top: 4px !important; }
.keys { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0; }
.keys button {
  height: 34px; font-size: 13px; font-weight: 600; color: #8a8a8a; position: relative;
}
.keys button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.keys button[aria-pressed="true"]::before {
  content: ''; position: absolute; left: 50%; top: 3px; width: 28px; height: 28px; margin-left: -14px;
  border: 1.5px solid var(--ink); border-radius: 50%;
}
.keys button.orig::after {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: #bbb;
}
.step { display: flex; align-items: center; }
.step button { width: 30px; height: 34px; font-size: 17px; color: #8a8a8a; }
.step button:active { color: var(--ink); }
.step output { min-width: 22px; text-align: center; font-weight: 700; font-size: 15px; }
.icon-btn.spd { width: 40px; font-size: 12px; font-weight: 600; color: #8a8a8a; }
.ctl .shape { font-size: 11px; font-weight: 500; color: var(--muted); min-height: 14px; text-align: center; }
.icon-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: #8a8a8a; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn[aria-pressed="true"] { color: var(--ink); }
.hide-ctl { margin-left: auto; }

.fab {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 31;
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 19px;
  background: rgba(255,255,255,.97); color: var(--ink); border: 1px solid var(--line); font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,0,0,.10); transition: opacity .2s, transform .2s;
}
.fab svg { width: 18px; height: 18px; }
.fab[hidden] { display: flex; opacity: 0; transform: translateY(20px); pointer-events: none; }
.fab .play { display: none; }
.scrolling .fab .play { display: block; }

.scroll-ctl { display: flex; align-items: center; gap: 3px; }

/* Spodný panel (prstoklad, setlist) */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff;
  transform: translateY(100%); transition: transform .25s ease;
  padding: 18px 0 calc(24px + env(safe-area-inset-bottom)); max-height: 85vh; overflow-y: auto;
}
.drawer .wrap { position: relative; }
.open .drawer-bg { opacity: 1; pointer-events: auto; }
.open .drawer { transform: none; }
.drawer h3 { margin: 0 0 4px; font-size: 26px; }
.drawer .x { position: absolute; right: 12px; top: -6px; width: 40px; height: 40px; font-size: 26px; line-height: 1; }
.inst { display: flex; border: 1.5px solid var(--ink); margin: 14px 0 18px; }
.inst button { flex: 1; height: 36px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.inst button + button { border-left: 1.5px solid var(--ink); }
.inst button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.diagram { display: flex; justify-content: center; }
.diagram svg { max-width: 100%; height: auto; }
.diagram-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.drawer-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* Tlačidlá */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; width: 100%;
  border: 1.5px solid var(--ink); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.btn.solid { background: var(--ink); color: #fff; }
.btn svg { width: 18px; height: 18px; }

/* Setlist */
.set-list { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.set-list li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); counter-increment: n; }
.set-list li::before { content: counter(n, decimal-leading-zero); font-weight: 700; font-size: 12px; color: var(--muted); width: 22px; }
.set-list a { text-decoration: none; flex: 1; min-width: 0; }
.set-list .t { font-weight: 700; }
.set-list .s { font-size: 12.5px; color: var(--muted); }
.set-list .kk { font-weight: 700; font-size: 15px; }
.set-list .rm, .set-list .mv { width: 34px; height: 34px; border: 1px solid var(--line); font-size: 16px; color: var(--muted); }
.set-name { width: 100%; height: 48px; border: 0; border-bottom: 2px solid var(--ink); font: inherit; font-size: 22px; font-weight: 700; padding: 0; text-align: center; text-transform: uppercase; background: transparent; color: var(--ink); border-radius: 0; }
.set-name:focus { outline: none; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 12px 18px; font-size: 14px; font-weight: 600; z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.shared-note { background: var(--soft); padding: 12px 14px; font-size: 13.5px; margin-bottom: 16px; border-left: 3px solid var(--ink); }

@media (min-width: 700px) {
  .home-hero h1 { font-size: 38px; }
  .song-hero h1 { font-size: 28px; }
}
