:root {
  --bg: #fffbea;
  --bg2: #fff3c4;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #7a6a55;
  --line: #eadfc4;
  --yellow: #ffc727;
  --yellow-d: #e8a800;
  --orange: #f08c00;
  --red: #e03131;
  --green: #2f9e44;
  --violet: #7048e8;
  --accent: #ff8a00;
  --accent-ink: #fff;
  --shadow: 0 6px 22px rgba(120, 80, 0, .12);
  --radius: 16px;
  --wood: #c78b4f;
  --fret: #e9e3d6;
  /* Bezpieczne obszary (notch, paski systemowe). W aplikacji na Androida Capacitor wstrzykuje --safe-area-inset-*,
     bo starsze WebView (< 140) nie podają poprawnych env(safe-area-inset-*). */
  --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sar: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sal: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --gut: 16px;
  --kurak-gutter: 0px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130d; --bg2: #221b11; --card: #241d14; --ink: #f5ecda; --muted: #b9a888; --line: #3b3122;
    --shadow: 0 6px 22px rgba(0, 0, 0, .4); --wood: #6b4524; --fret: #8c8577;
  }
}
:root[data-theme="dark"] {
  --bg: #17130d; --bg2: #221b11; --card: #241d14; --ink: #f5ecda; --muted: #b9a888; --line: #3b3122;
  --shadow: 0 6px 22px rgba(0, 0, 0, .4); --wood: #6b4524; --fret: #8c8577;
}

* { box-sizing: border-box; }
html {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(255, 138, 0, .2);
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  height: 100%;
}
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Nunito, system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: visible;
  position: relative;
}
a { color: var(--orange); }
h1, h2, h3, h4, .logo { font-family: 'Baloo 2', Nunito, sans-serif; line-height: 1.2; }
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px calc(var(--gut) + var(--sar)) calc(140px + var(--sab)) calc(var(--gut) + var(--sal) + var(--kurak-gutter));
  overflow: visible;
}

/* ---------- Pasek górny ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: calc(10px + var(--sat)) calc(16px + var(--sar)) 10px calc(16px + var(--sal));
  background: var(--yellow);
  box-shadow: 0 2px 0 var(--yellow-d);
}
.logo { font-size: 26px; font-weight: 800; color: #2b2118; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.logo span:last-child { color: #c2410c; }
.logo-k { font-size: 28px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #2b2118; text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 700; }
.nav a:hover { background: rgba(255, 255, 255, .45); }
.nav a.active { background: #2b2118; color: var(--yellow); }
.xp { font-weight: 700; font-size: 14px; color: #2b2118; white-space: nowrap; }
.menu-btn { display: none; background: none; border: 0; font-size: 26px; cursor: pointer; color: #2b2118; }

/* ---------- Przyciski i kontrolki ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--line);
  font: 700 15px Nunito, sans-serif; cursor: pointer; text-decoration: none;
  transition: transform .08s, background .15s;
}
.btn:hover { border-color: var(--yellow-d); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.accent, .btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--red); }
.btn.big { padding: 13px 22px; font-size: 17px; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); }
.toolbar .lbl { font-weight: 700; color: var(--muted); font-size: 14px; }
.tempo, .chk, .sel { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.tempo input { width: 130px; accent-color: var(--accent); }
select, input[type="url"], input[type="search"], input[type="number"], input:not([type]), textarea {
  font: 15px Nunito, sans-serif; color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: 10px; padding: 7px 10px;
}
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }
.warn { color: #c2410c; font-weight: 700; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 16px 0; }
.stars { color: var(--orange); letter-spacing: 1px; font-size: .95em; white-space: nowrap; }
.stars .off { color: var(--line); }
.page-title { font-size: 34px; margin: 10px 0 4px; }
.sub { color: var(--muted); margin-top: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 200px; }

/* ---------- Start ---------- */
.hero {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 28px;
  align-items: center;
  padding: 16px 0 20px;
}
.hero-kurak {
  width: 100%;
  max-width: 180px;
  max-height: 215px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-kurak svg, .kurak-svg {
  width: 100%;
  max-width: 100%;
  max-height: 215px;
  height: auto;
  aspect-ratio: 200 / 230;
  object-fit: contain;
  animation: bob 2.6s ease-in-out infinite;
}
.hero-txt {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero h1 { font-size: 48px; margin: 0; line-height: 1.1; }
.hero h1 span { color: #c2410c; }
.lead { font-size: 18px; margin: 0; line-height: 1.45; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }

/* Karta YouTube na pulpicie */
.yt-pulpit-card {
  margin: 16px 0 20px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.yt-pulpit-card h3 {
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.yt-pulpit-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}
.yt-paste { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; align-items: stretch; }
.yt-paste input { flex: 1; min-width: min(240px, 100%); }
.yt-paste .btn { white-space: nowrap; }
.yt-paste.card { flex-direction: column; }
.yt-my-songs {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.yt-my-songs-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.yt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.yt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg2);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  transition: transform .1s, background .15s;
}
.yt-chip:hover {
  background: var(--yellow);
  transform: translateY(-1px);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat b { display: block; font: 800 22px 'Baloo 2', sans-serif; }
.stat span { color: var(--muted); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.tile { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); transition: transform .12s; }
.tile:hover { transform: translateY(-3px); border-color: var(--yellow); }
.tile .ti { font-size: 34px; }
.tile small { color: var(--muted); }
.levels ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Kurs ---------- */
.lvl-group h2 { font-size: 22px; margin: 26px 0 10px; }
.lesson-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.lesson-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.lesson-card:hover { border-color: var(--yellow); }
.lesson-card.done { border-color: var(--green); }
.lesson-card .li { font-size: 28px; }
.lesson-card .lt { flex: 1; display: flex; flex-direction: column; }
.lesson-card small { color: var(--muted); }
.ok { color: var(--green); font-weight: 800; }

/* ---------- Kroki ---------- */
.crumbs { font-size: 14px; color: var(--muted); }
.steps-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; }
.sn-dot { display: flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; white-space: nowrap; font: 600 13px Nunito, sans-serif; }
.sn-dot span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); font-weight: 800; }
.sn-dot.seen span { background: var(--green); color: #fff; }
.sn-dot.cur { border-color: var(--accent); }
.sn-dot.cur span { background: var(--accent); color: #fff; }
.step-card h2 { margin-top: 0; }
.st-text { font-size: 17px; }
.step-ctl { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.finish { text-align: center; padding: 20px; }
.big-emoji { font-size: 64px; }
.finish .cta { justify-content: center; }

/* ---------- Akordy ---------- */
.chord-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.chord-card { background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 6px 8px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--ink); }
.chord-card:hover { border-color: var(--accent); }
.cc-play { font-size: 12px; color: var(--muted); font-weight: 700; }
.chord-svg .cd-name { font: 800 14px 'Baloo 2', sans-serif; fill: var(--ink); }
.cd-board { fill: none; }
.cd-str { stroke: var(--muted); stroke-width: 1; }
.cd-fret { stroke: var(--muted); stroke-width: 1; }
.cd-nut { stroke: var(--ink); stroke-width: 4; }
.cd-dot { fill: var(--ink); }
.cd-fi { fill: var(--card); font: 800 8px Nunito, sans-serif; }
.cd-open { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.cd-x { fill: var(--red); font: 800 11px Nunito, sans-serif; }
.cd-base { fill: var(--muted); font: 700 9px Nunito, sans-serif; }
.cd-sn { fill: var(--muted); font: 600 7px Nunito, sans-serif; }
.chord-missing { padding: 10px 14px; border: 2px dashed var(--line); border-radius: 12px; font-weight: 800; }

/* ---------- Tabulatura ---------- */
.scroller { overflow-x: auto; padding-bottom: 6px; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
.tab-grid { display: inline-flex; padding-left: 0; font: 700 14px ui-monospace, Consolas, monospace; padding: 6px 0; }
.tab-col { display: flex; flex-direction: column; flex: none; border-radius: 6px; }
.tab-col:not(.tab-head) span { justify-content: flex-start; padding-left: 8px; }
.tab-col span { height: 20px; display: flex; align-items: center; justify-content: center; background: linear-gradient(var(--muted), var(--muted)) center / 100% 1px no-repeat; }
.tab-col span i { font-style: normal; background: var(--card); padding: 0 2px; border-radius: 4px; line-height: 1; }
.tab-head { font-weight: 800; color: var(--muted); align-items: flex-end; }
.tab-head span { padding: 0 10px 0 0 !important; justify-content: flex-end; }
.tab-head span { background: none; }
.tab-bar { flex: none; width: 8px; margin: 16px 0; background: linear-gradient(var(--muted), var(--muted)) left / 2px 100% no-repeat; }
.tab-col.cur { background: rgba(255, 138, 0, .25); }
.tab-col.ok { background: rgba(47, 158, 68, .18); }
.practice-status { background: var(--bg2); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Pięciolinia ---------- */
.staff-box svg { display: block; }
.st-line, .st-bar { stroke: var(--ink); stroke-width: 1; }
.st-end { stroke-width: 3; }
.st-clef { fill: var(--ink); font-family: 'Segoe UI Symbol', 'Noto Music', 'Bravura', serif; }
.st-treble { font-size: 58px; }
.st-bass { font-size: 38px; }
.st-oct { fill: var(--ink); font: 700 11px serif; }
.st-brace { fill: none; stroke: var(--ink); stroke-width: 2; }
.st-head { fill: var(--ink); stroke: var(--ink); stroke-width: 1.2; }
.st-head.st-open { fill: var(--card); stroke-width: 1.8; }
.st-stem { stroke: var(--ink); stroke-width: 1.3; }
.st-flag { fill: none; stroke: var(--ink); stroke-width: 2; }
.st-dot { fill: var(--ink); }
.st-acc { fill: var(--ink); font: 15px serif; }
.st-rest { fill: var(--ink); font: 20px 'Segoe UI Symbol', 'Noto Music', serif; }
.st-trip { fill: var(--muted); font: italic 700 10px serif; }
.st-name { fill: var(--violet); font: 800 11px Nunito, sans-serif; }
.st-lyr { fill: var(--ink); font: 600 13px Nunito, sans-serif; }
.st-ext { stroke: var(--muted); stroke-width: 1; }
.st-hl { fill: transparent; }
.st-ev.cur .st-hl { fill: rgba(255, 138, 0, .22); }
.st-ev.ok .st-hl { fill: rgba(47, 158, 68, .14); }
.st-ev.cur .st-head, .st-ev.cur .st-stem { fill: var(--accent); stroke: var(--accent); }
.st-ev.cur .st-head.st-open { fill: var(--card); }
.st-ev.cur .st-lyr { fill: var(--accent); font-weight: 800; }

/* ---------- Podkład ---------- */
.pw-stage { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.pw-now { background: var(--bg); border-radius: 16px; padding: 8px 14px; border: 2px solid var(--accent); }
.pw-side { display: flex; flex-direction: column; align-items: center; color: var(--muted); }
.pw-next { opacity: .7; }
.pw-next-l { font-size: 12px; text-transform: uppercase; font-weight: 800; }
.pw-pattern { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.pw-pattern span { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font: 800 18px Nunito, sans-serif; background: var(--bg2); }
.pw-pattern span.rest { color: var(--muted); }
.pw-pattern span.cur { background: var(--accent); color: #fff; transform: scale(1.08); }
.pw-prog { display: flex; gap: 6px; flex-wrap: wrap; }
.pw-prog span { padding: 4px 10px; border-radius: 8px; background: var(--bg); border: 2px solid var(--line); font-weight: 800; cursor: pointer; }
.pw-prog span small { font-weight: 600; color: var(--muted); margin-left: 2px; }
.pw-prog span.cur { border-color: var(--accent); background: rgba(255, 138, 0, .15); }

/* ---------- Stroik ---------- */
.input-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.input-ctl select { max-width: 320px; }
.meter { width: 120px; height: 10px; border-radius: 5px; background: var(--bg2); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--yellow), var(--red)); transition: width .06s; }
.tn-display { text-align: center; padding: 16px; border-radius: 16px; background: var(--bg); margin: 12px 0; border: 3px solid var(--line); transition: border-color .2s, background .2s; }
.tn-display.in-tune { border-color: var(--green); background: rgba(47, 158, 68, .12); }
.tn-note { font: 800 64px 'Baloo 2', sans-serif; line-height: 1; }
.tn-note sub { font-size: 20px; color: var(--muted); }
.tn-meter { position: relative; height: 90px; max-width: 360px; margin: 6px auto; overflow: hidden; }
.tn-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.tn-needle { position: absolute; left: 50%; bottom: 0; width: 4px; height: 80px; background: var(--red); border-radius: 2px; transform-origin: bottom center; transform: translateX(-50%) rotate(0deg); transition: transform .12s; }
.in-tune .tn-needle { background: var(--green); }
.tn-center { position: absolute; left: 50%; bottom: 0; width: 2px; height: 90px; background: var(--muted); opacity: .4; transform: translateX(-50%); }
.tn-info { color: var(--muted); font-weight: 700; }
.tn-strings { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tn-str { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tn-str b { font-size: 20px; line-height: 1; }
.tn-str small { font-size: 10px; color: var(--muted); }
.tn-str.cur { border-color: var(--accent); background: rgba(255, 138, 0, .15); }

/* ---------- Metronom, gryf, struny ---------- */
.mt-dots { display: flex; gap: 10px; }
.mt-dots span { width: 26px; height: 26px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--line); }
.mt-dots span:first-child { border-color: var(--accent); }
.mt-dots span.on { background: var(--accent); }
.fretboard { min-width: 640px; width: 100%; height: auto; }
.fb-wood { fill: var(--wood); }
.fb-fret { stroke: var(--fret); stroke-width: 2; }
.fb-nut { stroke: #f8f4e8; stroke-width: 6; }
.fb-str { stroke: #ddd3bb; }
.fb-inlay { fill: rgba(255, 255, 255, .5); }
.fb-num, .fb-sn { fill: var(--muted); font: 700 11px Nunito, sans-serif; }
.fb-pt { cursor: pointer; }
.fb-pt circle { fill: var(--violet); stroke: #fff; stroke-width: 1.5; }
.fb-pt.root circle { fill: var(--red); }
.fb-pt text { fill: #fff; font: 800 9px Nunito, sans-serif; pointer-events: none; }
.strings-w { display: flex; flex-direction: column; gap: 6px; max-width: 480px; }
.str-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; color: var(--ink); padding: 4px; border-radius: 8px; }
.str-btn:hover { background: var(--bg2); }
.str-btn .sn { width: 22px; font-weight: 800; color: var(--muted); }
.str-btn .sl { flex: 1; height: var(--th); background: linear-gradient(90deg, #b0a68f, #e9e1cc, #b0a68f); border-radius: 2px; }
.str-btn b { width: 20px; }

/* ---------- Quiz, budowa ---------- */
.quiz { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.qq { font-weight: 800; font-size: 18px; }
.qopt.right { background: var(--green); border-color: var(--green); color: #fff; }
.qopt.wrong { background: var(--red); border-color: var(--red); color: #fff; }
.parts { width: 100%; max-width: 640px; height: auto; }
.parts text { fill: var(--ink); font: 700 12px Nunito, sans-serif; }
.pt-body { fill: #e8a35a; stroke: #8a5523; stroke-width: 2; }
.pt-neck { fill: #7a4a21; }
.pt-head { fill: #5b3416; }
.pt-key { fill: #ccc; }
.pt-fret { stroke: #d8d0bc; stroke-width: 1.5; }
.pt-hole { fill: #3b1d06; }
.pt-bridge { fill: #3b1d06; }
.pt-string { stroke: #eee; stroke-width: .7; }

/* ---------- Utwory ---------- */
.filters { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: 700 13px Nunito, sans-serif; }
.chips button.on { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.search { max-width: 360px; }
.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 10px; }
.song-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--card); border: 2px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.song-card:hover { border-color: var(--yellow); }
.song-card.done { border-color: var(--green); }
.sc-icon { font-size: 30px; width: 44px; text-align: center; }
.thumb { width: 72px; height: 40px; object-fit: cover; border-radius: 8px; }
.sc-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sc-body small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-body .pl { font-style: italic; }
.sc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; }
.song-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
.about { font-size: 16px; }
.chart-wrap { display: grid; gap: 20px; }
.chart-wrap.two { grid-template-columns: 1fr 1fr; }
.chart, .translation { background: var(--bg); border-radius: 12px; padding: 12px 16px; overflow-x: auto; }
.translation .ch { display: none; }
.cp-line { display: flex; flex-wrap: wrap; align-items: flex-end; margin: 2px 0; }
.seg { display: inline-flex; flex-direction: column; white-space: pre; }
.seg .ch { color: var(--orange); font-weight: 800; min-height: 1.3em; cursor: pointer; padding-right: 4px; }
.seg .ch:empty { cursor: default; }
.seg .tx { font-size: 16px; }
.cp-sec { margin: 12px 0 2px; color: var(--violet); }
.cp-gap { height: 8px; }
.edit-box { margin-top: 14px; }
.edit-box summary { cursor: pointer; font-weight: 800; }
.editor .ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.editor label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
.ed-l { margin-top: 12px; }
.ed-l code, .hint code { background: var(--bg2); padding: 1px 5px; border-radius: 5px; }
.chart-mini { margin-top: 14px; }

/* ---------- YouTube ---------- */
.yt-studio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.yt-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 760px;
  max-height: min(440px, 48vh);
  width: 100%;
  margin: 0 auto;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.yt-frame iframe, .yt-frame .yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mini-yt .yt-frame { max-width: 480px; max-height: 270px; }
.rate.on { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.loopT.on { background: var(--violet); color: #fff; border-color: var(--violet); }
.ab-info { font-weight: 700; color: var(--violet); font-size: 14px; }
.yt-markers { display: flex; flex-wrap: wrap; gap: 6px; }
.marker { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.marker button { background: none; border: 0; color: var(--ink); padding: 4px 8px; cursor: pointer; font: 700 13px Nunito, sans-serif; }
.marker button:hover { background: var(--bg2); }
.detect { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--bg2); }
.dt-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dt-live { display: flex; align-items: baseline; gap: 8px; }
.dt-chord { font: 800 40px 'Baloo 2', sans-serif; color: var(--orange); }
.dt-conf { color: var(--muted); font-size: 13px; }
.dt-timeline { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-item { display: flex; flex-direction: column; align-items: center; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 3px 8px; cursor: pointer; }
.dt-item small { color: var(--muted); font-size: 11px; }
.yt-find p { margin: 8px 0; }
.howto li { margin: 6px 0; }
.knobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.knobs label { display: flex; flex-direction: column; font-weight: 700; }
.knobs input { accent-color: var(--accent); }
.live-note { margin-top: 12px; font-size: 20px; }

/* ---------- Kurak ---------- */
.kurak-dock { position: fixed; left: calc(14px + var(--sal)); bottom: calc(12px + var(--sab)); z-index: 50; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
.kurak-btn { pointer-events: auto; width: 112px; height: 128px; padding: 0; border: 0; background: none; cursor: pointer; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2)); }
.kurak-btn svg { width: 100%; height: 100%; animation: bob 2.6s ease-in-out infinite; }
.kurak-bubble { pointer-events: auto; order: 2; position: relative; max-width: min(420px, calc(100vw - 150px)); max-height: 46vh; overflow: auto; background: var(--card); color: var(--ink); border: 3px solid var(--yellow); border-radius: 18px 18px 18px 4px; padding: 12px 14px 8px; margin-bottom: 70px; box-shadow: var(--shadow); font-size: 15px; }
.kb-text p { margin: 0 0 6px; }
.kb-text ul { margin: 4px 0; padding-left: 18px; }
.kb-close { position: absolute; top: 4px; right: 6px; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); }
.kb-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
.kb-tools button { background: var(--bg2); color: var(--ink); border: 0; border-radius: 999px; padding: 3px 10px; cursor: pointer; font: 700 12px Nunito, sans-serif; }
.kb-rate { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.kb-rate input { width: 70px; }
.k-beak-low { transform-origin: 100px 72px; transform-box: view-box; }
.talking .k-beak-low { animation: beak .16s ease-in-out infinite alternate; }
.talking .k-head { animation: nod .5s ease-in-out infinite alternate; transform-origin: 100px 90px; transform-box: view-box; }
.k-notes { opacity: 0; }
.talking .k-notes { opacity: 1; animation: notes 1s ease-in-out infinite alternate; }
.blink .k-eyes { transform: scaleY(.1); transform-origin: 100px 55px; transform-box: view-box; }
@keyframes beak { from { transform: rotate(0); } to { transform: translateY(5px) rotate(4deg); } }
@keyframes nod { from { transform: rotate(-2deg); } to { transform: rotate(2deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes notes { from { transform: translateY(0); } to { transform: translateY(-6px); } }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px calc(16px + var(--sar)) calc(150px + var(--sab)) calc(16px + var(--sal) + var(--kurak-gutter)); }

/* ---------- Telefon ---------- */
@media (max-width: 860px) {
  .menu-btn { display: block; margin-left: auto; }
  .xp { display: none; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--yellow); padding: 8px 16px 14px; box-shadow: 0 6px 12px rgba(0, 0, 0, .15); }
  .nav.open { display: flex; }
  .hero { grid-template-columns: 1fr; text-align: center; gap: 16px; }
  .hero-kurak { max-width: 150px; max-height: 175px; margin: 0 auto; }
  .hero-txt { align-items: center; }
  .hero h1 { font-size: 40px; }
  .cta { justify-content: center; }
  .yt-paste { justify-content: center; }
  .yt-pulpit-card { text-align: left; }
  .stats, .tiles { grid-template-columns: 1fr 1fr; }
  .chart-wrap.two { grid-template-columns: 1fr; }
  .kurak-btn { width: 76px; height: 88px; }
  .kurak-bubble { margin-bottom: 50px; max-width: calc(100vw - 110px); font-size: 14px; }
  .page-title { font-size: 27px; }
  .tempo input { width: 100px; }
}
.fb-pt text.bh { font-size: 7px; }
.tn-str b { white-space: nowrap; }
.tn-str b.long { font-size: 13px; }
.st-name { font-size: 10px; }

.apk-card h3 { margin-top: 0; }
.apk-card .btn.big { white-space: normal; text-align: center; }
.apk-steps { margin: 12px 0 0; padding-left: 22px; color: var(--muted); }
.apk-steps li { margin: 4px 0; }
/* ================= Responsywność: telefon, tablet, aplikacja na Androida ================= */
.chart-wrap > *, .card, .step-card, .yt-studio { min-width: 0; }
.row input, .yt-paste input { min-width: min(200px, 100%); }
.chart, .translation, .staff-box, .tab-box { max-width: 100%; }
/* Odtwarzacz 16:9 proporcjonalny, dopasowany do wysokości ekranu z miejscem na przewijanie. */
.yt-frame {
  width: 100%;
  max-width: min(760px, calc((100vh - 160px) * 16 / 9));
  max-height: min(440px, 48vh);
}
@supports (height: 100dvh) {
  .yt-frame {
    max-width: min(760px, calc((100dvh - 160px) * 16 / 9));
    max-height: min(440px, 48dvh);
  }
}
.mini-yt .yt-frame { max-width: 480px; max-height: 270px; }

/* Cele dotykowe ≥ 44 px (ekrany dotykowe i wąskie okna). */
@media (pointer: coarse), (max-width: 860px) {
  .btn, .btn.small, select, input[type="url"], input[type="search"], input[type="number"], input:not([type]) { min-height: 44px; }
  .btn.small { padding: 8px 14px; font-size: 14px; }
  .chips button, .sn-dot, .pw-prog span, .dt-item { min-height: 44px; }
  .chips button { padding: 8px 14px; }
  .sn-dot { padding-right: 14px; }
  .marker button { min-height: 40px; min-width: 40px; padding: 6px 10px; }
  .menu-btn { min-width: 48px; min-height: 48px; }
  .nav a { min-height: 44px; display: flex; align-items: center; }
  .kb-tools button { min-height: 40px; padding: 6px 14px; font-size: 13px; }
  .kb-close { min-width: 40px; min-height: 40px; top: 0; right: 0; }
  .kb-text { padding-right: 26px; }
  .kb-novoice .btn { margin-top: 6px; }
  .kb-rate input { width: 90px; }
  .str-btn { min-height: 44px; }
  .tn-str { width: 56px; height: 56px; }
  .chord-card { min-width: 44px; min-height: 44px; }
  input[type="range"] { min-height: 32px; }
  input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
}

/* Telefon pionowo (≈ 360–430 px). */
@media (max-width: 480px) {
  :root { --gut: 12px; }
  .topbar { gap: 8px; }
  .logo { font-size: 23px; }
  .hero { gap: 10px; padding: 6px 0; }
  .hero-kurak { max-width: 110px; max-height: 130px; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 17px; }
  .page-title { font-size: 25px; }
  .card { padding: 14px; }
  .stats, .tiles { gap: 8px; }
  .tile { padding: 14px; }
  .toolbar .sep { display: none; }
  .tempo input { width: 90px; }
  .song-card .sc-meta { font-size: 12px; }
  .tn-note { font-size: 54px; }
  .tn-str { width: 48px; height: 48px; }
  .dt-chord { font-size: 32px; }
  .kurak-btn { width: 64px; height: 74px; }
  .kurak-bubble { margin-bottom: 44px; max-width: calc(100vw - 96px - var(--sal) - var(--sar)); max-height: 40vh; font-size: 14px; padding: 10px 12px 6px; }
}

/* Tablet pionowo (≈ 600–860 px): więcej kolumn, menu w rozwijanym pasku. */
@media (min-width: 600px) and (max-width: 860px) {
  .stats, .tiles { grid-template-columns: repeat(4, 1fr); }
  .hero { grid-template-columns: 160px 1fr; text-align: left; gap: 18px; }
  .hero-kurak { max-width: 155px; max-height: 180px; }
  .cta { justify-content: flex-start; }
}

/* Tablet poziomo / małe laptopy (861–1180 px): menu mieści się w pasku. */
@media (min-width: 861px) and (max-width: 1180px) {
  .topbar { gap: 10px; }
  .logo { font-size: 23px; }
  .nav a { padding: 7px 9px; font-size: 15px; }
  .hero { grid-template-columns: 180px 1fr; gap: 20px; }
  .hero-kurak { max-width: 170px; max-height: 195px; }
  .hero h1 { font-size: 46px; }
}

/* Telefon poziomo (niska wysokość): mały Kurak w lewym marginesie, dymek z boku, kompaktowy pasek. */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --kurak-gutter: 62px; }
  .topbar { padding-top: calc(4px + var(--sat)); padding-bottom: 4px; gap: 10px; }
  .logo { font-size: 21px; }
  .logo-k { font-size: 22px; }
  .menu-btn { min-height: 40px; }
  .nav { max-height: calc(100vh - 60px); overflow-y: auto; padding-left: calc(16px + var(--sal)); }
  .nav.open { flex-direction: row; flex-wrap: wrap; }
  .container { padding-top: 10px; padding-bottom: calc(40px + var(--sab)); }
  .foot { padding-bottom: calc(24px + var(--sab)); }
  .hero { grid-template-columns: 90px 1fr; text-align: left; gap: 14px; padding: 4px 0; }
  .hero-kurak { max-width: 85px; max-height: 100px; margin: 0; }
  .hero h1 { font-size: 28px; }
  .lead { font-size: 15px; margin: 4px 0; }
  .cta { justify-content: flex-start; margin: 6px 0; }
  .stats, .tiles { grid-template-columns: repeat(4, 1fr); }
  .page-title { font-size: 24px; margin-top: 4px; }
  .card { padding: 12px 14px; margin: 10px 0; }
  .kurak-dock { left: calc(6px + var(--sal)); bottom: calc(6px + var(--sab)); }
  .kurak-btn { width: 52px; height: 60px; }
  .kurak-bubble { margin-bottom: 0; max-width: min(340px, 42vw); max-height: calc(100vh - 80px); font-size: 13px; padding: 8px 12px 4px; border-radius: 18px 18px 18px 4px; }
  .kb-tools { margin-top: 4px; padding-top: 4px; }
  .yt-frame {
    width: min(100%, calc((100vh - 60px) * 16 / 9));
    max-height: calc(100vh - 80px);
  }
  @supports (height: 100dvh) {
    .yt-frame {
      width: min(100%, calc((100dvh - 60px) * 16 / 9));
      max-height: calc(100dvh - 80px);
    }
  }
  .tn-display { padding: 8px; margin: 8px 0; }
  .tn-note { font-size: 44px; }
  .tn-meter { height: 70px; }
  .tn-needle { height: 62px; }
  .tn-center { height: 70px; }
}
