:root{--bg:#eef0f4;--card:#ffffff;--ink:#161b26;--soft:#4b5465;--line:#d3d8e1;--edge:#8a93a4;--focus:#2b5cad;--accent:#2b5cad;--accent-ink:#ffffff;--band:#1e2433;--band-soft:#b8c2d6;--wood:#4a2f22;--wood-2:#3b251b;--fret:#c9cdd4;--nut:#efe8d8;--string:#e9dfc6;--inlay:#efe6d0;--ask:#f2b01e;--good:#17803f;--bad:#c0352c;--h0:rgba(255,255,255,.10);--h1:rgba(212,68,59,.55);--h2:rgba(242,176,30,.55);--h3:rgba(29,154,82,.55)}
@media (prefers-color-scheme:dark){:root{--bg:#0f1218;--card:#1a1f2a;--ink:#eef1f6;--soft:#a6afbf;--line:#2f3645;--edge:#6b7488;--focus:#f2b01e;--accent:#7ba7f0;--accent-ink:#0d1420;--band:#151a26;--band-soft:#9aa6bd;--wood:#3e281d;--wood-2:#2f1e16}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:17px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-text-size-adjust:100%}
a{color:var(--accent)}
button{font:inherit;color:inherit}
header{background:var(--band);color:#fff}
.band,.tabs,main,footer{max-width:1040px;margin:0 auto;padding-left:16px;padding-right:16px}
.band{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding-top:14px;padding-bottom:8px}
.brand{font-weight:800;font-size:23px;text-decoration:none;color:#fff;letter-spacing:-.01em}
.brand::before{content:"";display:inline-block;width:11px;height:11px;border-radius:50%;background:var(--ask);margin-right:9px;box-shadow:0 0 0 3px rgba(242,176,30,.25)}
.tag{color:var(--band-soft);font-size:15px}
.tabs{display:flex;gap:6px;padding-bottom:12px;overflow-x:auto;scrollbar-width:none}
.tabs a{flex:1 0 auto;text-align:center;padding:9px 12px;border-radius:10px;background:rgba(255,255,255,.08);color:#fff;text-decoration:none;font-weight:700;font-size:16px;border:2px solid transparent;min-height:44px}
.tabs a:hover{border-color:rgba(255,255,255,.35)}
.tabs a[aria-current]{background:#fff;color:var(--band)}
h1{font-size:28px;line-height:1.2;margin:20px 0 4px}
h2{font-size:22px;margin:34px 0 8px}
.lead{color:var(--soft);margin:0 0 12px}
.prose{max-width:760px}

/* game card */
.game{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;margin:14px 0;box-shadow:0 2px 12px rgba(22,27,38,.07);scroll-margin-top:8px}
.firstrow{display:grid;grid-template-columns:1fr 1.6fr auto;gap:10px;align-items:end}
@media (max-width:620px){.firstrow{grid-template-columns:1fr 1fr}.firstrow .handbox{grid-column:1/-1}}
label,.lab{display:block;font-weight:600;font-size:14px;margin:0 0 4px;color:var(--soft)}
select{width:100%;font:inherit;font-size:16px;padding:9px 10px;min-height:44px;border:1.5px solid var(--edge);border-radius:9px;background:var(--bg);color:var(--ink)}
select:focus,button:focus-visible,input:focus-visible{outline:3px solid var(--focus);outline-offset:1px}
.seg{display:flex;border:1.5px solid var(--edge);border-radius:10px;overflow:hidden;background:var(--bg)}
.seg button{flex:1;border:0;background:transparent;padding:8px 12px;min-height:44px;cursor:pointer;font-size:15px;white-space:nowrap}
.seg button+button{border-left:1.5px solid var(--edge)}
.seg button.on{background:var(--accent);color:var(--accent-ink);font-weight:700}
.modes{display:flex;gap:6px;margin:14px 0 10px}
.modes button{flex:1;padding:10px 8px;min-height:48px;border-radius:10px;border:1.5px solid var(--edge);background:var(--bg);cursor:pointer;font-weight:700;font-size:16px}
.modes button small{display:block;font-weight:400;font-size:13px;color:var(--soft)}
.modes button.on{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.modes button.on small{color:var(--accent-ink);opacity:.85}
.playline{display:flex;gap:12px;align-items:center;margin:4px 0 10px}
.prompt{flex:1;display:flex;align-items:baseline;gap:12px;min-height:64px;padding:8px 14px;border-radius:12px;background:var(--bg);border:2px solid transparent;transition:background .15s}
.prompt #qbig{flex:none;font-size:40px;font-weight:800;line-height:1.1;min-width:1.2em}
.prompt #qsmall{font-size:16px;color:var(--soft)}
.prompt.find #qbig{color:var(--accent)}
.prompt.right{border-color:var(--good)}
.prompt.wrong{border-color:var(--bad)}
.prompt.wrong #qsmall{color:var(--ink)}
@media (max-width:520px){.prompt{flex-direction:column;gap:0;align-items:flex-start;min-height:118px}.prompt #qbig{font-size:34px}}
.start{flex:none;min-width:116px;min-height:56px;padding:0 20px;border:0;border-radius:12px;background:var(--good);color:#fff;font-weight:800;font-size:19px;cursor:pointer}
.start.stop{background:transparent;color:var(--ink);border:1.5px solid var(--edge);min-width:92px;font-size:17px;font-weight:700}
.score{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:15px;color:var(--soft);min-height:24px;margin:0 0 8px}
.score b{color:var(--ink)}
.summary{margin:0 0 10px;padding:10px 14px;border-radius:10px;background:rgba(23,128,63,.12);border:1.5px solid var(--good);font-weight:600}

/* neck */
.neckwrap{position:relative;padding:6px 0 0}
.neckwrap.up{display:grid;grid-template-columns:28px 1fr;gap:6px;max-width:420px;margin:0 auto}
.neckwrap.up.left{grid-template-columns:1fr 28px}
.neckwrap.up .fretnums{order:-1}
.neckwrap.up.left .fretnums{order:2}
.neck{position:relative;border-radius:6px;overflow:hidden;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.neck .wood{position:absolute;inset:0;background:linear-gradient(180deg,var(--wood),var(--wood-2))}
.neck.up .wood{background:linear-gradient(90deg,var(--wood-2),var(--wood),var(--wood-2))}
.neck i{position:absolute;display:block;pointer-events:none}
.neck .fw{background:var(--fret);box-shadow:0 0 0 .5px rgba(0,0,0,.3)}
.neck.across .fw{top:0;bottom:0;width:3px;margin-left:-1.5px}
.neck.up .fw{left:0;right:0;height:3px;margin-top:-1.5px}
.neck .fw.nut{background:var(--nut)}
.neck.across .fw.nut{width:8px;margin-left:-4px}
.neck.up .fw.nut{height:8px;margin-top:-4px}
.neck .dot{width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;background:var(--inlay);opacity:.85}
.neck .str{background:var(--string);box-shadow:0 1px 1px rgba(0,0,0,.45)}
.neck.across .str{transform:translateY(-50%)}
.neck.up .str{transform:translateX(-50%)}
.cells{position:absolute;inset:0;display:grid}
.cell{position:relative;border:0;margin:0;padding:0;background:transparent;cursor:pointer;display:grid;place-items:center;-webkit-tap-highlight-color:transparent}
.cell.off{cursor:default}
.cell b{display:grid;place-items:center;min-width:30px;height:30px;padding:0 4px;border-radius:15px;font-size:14px;font-weight:800;line-height:1;pointer-events:none}
.cell b:empty{min-width:0;padding:0}
.cell:hover b:empty{min-width:14px;height:14px;background:rgba(255,255,255,.35)}
.cell.show b{background:rgba(255,255,255,.9);color:#1d2230;font-weight:700;font-size:13px;min-width:28px;height:26px}
.cell.ask b{min-width:30px;background:var(--ask);box-shadow:0 0 0 4px rgba(242,176,30,.35);animation:pulse 1.1s ease-in-out infinite}
.cell.good b{background:var(--good);color:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.7)}
.cell.bad b{background:var(--bad);color:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.7)}
.cell.rest{opacity:.35}
.neck.heat .cell.h0{background:var(--h0)}
.neck.heat .cell.h1{background:var(--h1)}
.neck.heat .cell.h2{background:var(--h2)}
.neck.heat .cell.h3{background:var(--h3)}
@keyframes pulse{50%{box-shadow:0 0 0 9px rgba(242,176,30,.15)}}
@media (prefers-reduced-motion:reduce){.cell.ask b{animation:none}}
.fretnums{display:grid;font-size:14px;color:var(--soft);text-align:center;font-variant-numeric:tabular-nums}
.fretnums.across{margin-top:4px}
.fretnums.up span{display:grid;place-items:center}
.fretnums .mk{color:var(--ink);font-weight:700}
.legend{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:14px;color:var(--soft);margin:6px 0 0}
.legend i{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-1px;margin-right:5px}

/* note pad */
.pad{display:grid;gap:8px;margin:12px 0 4px}
.pad.n12{grid-template-columns:repeat(6,1fr)}
.pad.n7{grid-template-columns:repeat(7,1fr)}
@media (max-width:620px){.pad{gap:6px}.pad button{min-height:50px;font-size:17px}}
.pad button{min-height:52px;border-radius:10px;border:1.5px solid var(--edge);background:var(--bg);font-weight:800;font-size:19px;cursor:pointer}
.pad button:disabled{opacity:.45;cursor:default}
.pad button.good{background:var(--good);border-color:var(--good);color:#fff}
.pad button.bad{background:var(--bad);border-color:var(--bad);color:#fff}

/* settings */
.more{margin-top:12px;border-top:1px solid var(--line);padding-top:10px}
.more summary{cursor:pointer;font-weight:700;color:var(--accent);min-height:40px;display:flex;align-items:center}
.sets{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px;margin-top:8px}
@media (max-width:620px){.sets{grid-template-columns:1fr}}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{min-height:44px;min-width:52px;padding:6px 12px;border-radius:999px;border:1.5px solid var(--edge);background:var(--bg);cursor:pointer;font-weight:700}
.chip small{font-weight:400;color:var(--soft)}
.chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.chip.on small{color:var(--accent-ink)}
.frets{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:center}
.check{display:flex;gap:10px;align-items:center;font-weight:600;font-size:16px;color:var(--ink);min-height:44px;margin:0;cursor:pointer}
.check input{width:22px;height:22px;accent-color:var(--accent)}
.hint{font-size:14px;color:var(--soft);margin:4px 0 0}

/* progress */
.progress{margin-top:14px;padding:12px 14px;border-radius:12px;background:var(--bg)}
.progress h3{margin:0 0 4px;font-size:18px}
.pline{margin:0 0 6px;font-size:15px;color:var(--soft)}
.stats{display:flex;flex-wrap:wrap;gap:6px 18px;margin:4px 0 8px}
.stats b{font-size:20px}
.bars{display:flex;align-items:flex-end;gap:5px;height:84px;margin-top:8px}
.bars span{flex:1;max-width:34px;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center}
.bars i{display:block;width:100%;background:var(--accent);border-radius:4px 4px 0 0;min-height:2px}
.bars small{font-size:13px;color:var(--soft)}
.linkbtn{border:0;background:none;color:var(--accent);text-decoration:underline;cursor:pointer;padding:8px 0;font-size:15px}
.how{margin:10px 0 0;padding:0 0 0 20px;font-size:15px;color:var(--soft)}
.how li{margin:2px 0}

/* ad slot: outside the game card, filled by hand later; hidden while empty */
.ad-slot{margin:28px auto;min-height:100px;max-width:728px;text-align:center}
.ad-slot[hidden]{display:none}

table{border-collapse:collapse;width:100%;font-size:15px;margin:8px 0}
th,td{text-align:left;padding:7px 8px;border-bottom:1px solid var(--line)}
th{background:var(--card)}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin:14px 0}
.cards a{display:block;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--card);text-decoration:none;color:var(--ink);font-size:15px}
.cards b{display:block;font-size:18px;margin-bottom:2px;color:var(--accent)}
footer{margin-top:40px;padding-bottom:30px;font-size:14px;color:var(--soft);border-top:1px solid var(--line);padding-top:12px}
.tablewrap{overflow-x:auto;margin:8px 0}
.chart{font-size:14px;min-width:560px}
.chart th,.chart td{text-align:center;padding:6px 4px}
.chart td:first-child,.chart th:first-child{text-align:left;font-weight:700}
.prose h3{font-size:18px;margin:20px 0 4px}
.prose li{margin:4px 0}
/* while a round runs: only the prompt, the neck and the answer pad; idle: the door, the progress, free practice */
.game.playing .door,.game.playing .more,.game.playing .progress{display:none}
.game:not(.playing) .playline,.game:not(.playing) .timebar,.game:not(.playing) .score,.game:not(.playing) .neckwrap,.game:not(.playing) .pad{display:none}
.game.playing .pad{position:sticky;bottom:0;background:var(--card);padding:8px 0;margin-bottom:0;z-index:2}
@media (max-width:620px){.score{font-size:14px;gap:2px 12px}.modes button small{display:none}.modes button{min-height:46px;font-size:15px}.playline{margin-top:0}}
@media (max-width:440px){.tabs{gap:4px}.tabs a{flex:1 1 0;min-width:0;padding:9px 2px;font-size:14px}}

/* string names next to the nut, and the asked string in Find */
.neckwrap.across{display:grid;grid-template-columns:38px 1fr;column-gap:4px}
.neckwrap.across.left{grid-template-columns:1fr 38px}
.neckwrap.across .strnames{grid-column:1;grid-row:1}
.neckwrap.across .neck{grid-column:2;grid-row:1}
.neckwrap.across .fretnums{grid-column:2;grid-row:2}
.neckwrap.across.left .strnames{grid-column:2}
.neckwrap.across.left .neck,.neckwrap.across.left .fretnums{grid-column:1}
.neckwrap.up{grid-template-rows:auto auto;row-gap:2px}
.neckwrap.up .strnames{grid-column:2;grid-row:1}
.neckwrap.up .neck{grid-column:2;grid-row:2}
.neckwrap.up .fretnums{grid-column:1;grid-row:2}
.neckwrap.up.left .strnames,.neckwrap.up.left .neck{grid-column:1}
.neckwrap.up.left .fretnums{grid-column:2}
.strnames{display:grid;font-size:14px;font-weight:700;color:var(--ink);text-align:center}
.strnames span{display:grid;place-items:center;line-height:1.05}
.strnames small{font-weight:400;color:var(--soft);font-size:12px}
.strnames span{grid-auto-flow:column;gap:3px;align-items:baseline;place-content:center}
/* beginner setup, one tap; the address keeps it (?setup=beginner) for a teacher's link */
.beginline{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:0 0 10px}
.beginline .hint{margin:0}
.beginline .linkbtn{margin-left:4px}
.begin{min-height:44px;padding:6px 14px;border-radius:999px;border:1.5px solid var(--edge);background:var(--bg);cursor:pointer;font-weight:700;font-size:15px}
.begin.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
/* phone: Start right under the three modes, full width, so it shows without scrolling */
@media (max-width:620px){
  h1{font-size:25px;margin-top:12px}
  .lead{font-size:15px;line-height:1.45;margin-bottom:8px}
  .game{margin-top:10px}
  .modes{margin:10px 0 8px}
}
.neck .str.target{background:var(--ask);box-shadow:0 0 0 2px rgba(242,176,30,.35)}

/* the door (03.12.2026): your instrument once, then one big Practice button */
.pick{margin:0 0 12px}
.pick[hidden],.chosen[hidden],.today[hidden],.firstrow[hidden]{display:none}
.picklab{margin:0 0 6px;font-weight:700;font-size:17px}
.picks{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.pickbtn{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:92px;padding:6px 2px 6px;border-radius:12px;border:1.5px solid var(--edge);background:var(--bg);cursor:pointer;font-weight:700;font-size:14px}
.pickbtn .art{width:34px;height:70px}
@media (min-width:621px){.pickbtn .art{width:40px;height:84px}}
@media (max-width:400px){.pickbtn{font-size:13px}}
@media (prefers-color-scheme:dark){.pickbtn .art,.chosen .mini{filter:drop-shadow(0 0 .6px #efe6d0)}}
.pickbtn.on{border-color:var(--accent);box-shadow:inset 0 0 0 2px var(--accent);background:var(--card)}
.pick .linkbtn{font-size:14px}
.pick .firstrow{grid-template-columns:1.6fr auto;margin-top:4px}
@media (max-width:620px){.pick .firstrow{grid-template-columns:1fr}}
.chosen{display:flex;align-items:center;gap:10px;margin:0 0 10px;font-size:16px;color:var(--soft)}
.chosen b{color:var(--ink);margin-right:4px}
.chosen .mini{width:20px;height:42px;flex:none}
.chosen .linkbtn{margin-left:auto;padding:10px 4px}
.practice{display:block;width:100%;min-height:72px;padding:10px 16px;border:0;border-radius:14px;background:var(--good);color:#fff;font-weight:800;font-size:24px;line-height:1.15;cursor:pointer;box-shadow:0 3px 0 #0f5c2d}
.practice small{display:block;font-weight:600;font-size:15px;opacity:.92}
.practice:active{transform:translateY(2px);box-shadow:0 1px 0 #0f5c2d}
.today{margin:10px 0 0;font-size:16px;color:var(--soft)}
.today b{color:var(--ink)}
.summary{margin:0 0 12px;padding:12px 14px;border-radius:12px;background:rgba(23,128,63,.12);border:1.5px solid var(--good);font-weight:400}
.summary .sline{display:block;margin-top:4px}
.summary .up{font-weight:700;color:var(--good)}
@media (prefers-color-scheme:dark){.summary .up{color:#5fd08a}}
.timebar{height:6px;border-radius:3px;background:var(--line);margin:-4px 0 10px;overflow:hidden}
.timebar i{display:block;height:100%;width:0;background:var(--accent)}
.game:not(.practising) .timebar{display:none}
.free .modes{margin-top:8px}
.freestart{width:100%;margin:6px 0 12px}
.free .hint{margin:0}
/* progress: days in a row, level, map of the neck */
.days{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;margin:4px 0 8px}
.dnum{font-size:15px;color:var(--soft)}
.dnum b{font-size:26px;color:var(--ink);margin-right:5px}
.dots{display:flex;gap:4px}
.dots i{width:14px;height:14px;border-radius:50%;border:1.5px solid #808898;display:block}
.dots i.on{background:var(--good);border-color:var(--good)}
.dots i.now{outline:2px solid var(--accent);outline-offset:1px}
.lvl{margin:6px 0 4px;font-size:16px}
.lbar{display:flex;gap:4px;margin:0 0 10px}
.lbar i{flex:1;height:8px;border-radius:4px;background:var(--edge)}
.lbar i.done{background:var(--good)}
.lbar i.now{background:var(--ask)}
.map{display:block;width:100%;max-width:460px;height:auto;margin:4px 0 0}
.map .sn{font-size:15px;font-weight:700;fill:var(--ink);text-anchor:end}
.map .mn{font-size:15px;fill:var(--soft);text-anchor:middle}
.map .mk{fill:var(--ink);font-weight:700}
.g-known{fill:#1d9a52;background:#1d9a52}
.g-shaky{fill:#f2b01e;background:#f2b01e}
.g-weak{fill:#e35d52;background:#e35d52}
.g-new{fill:rgba(255,255,255,.08);stroke:#808898;stroke-width:1.2;background:var(--wood)}
.legend i.g-known,.legend i.g-shaky,.legend i.g-weak,.legend i.g-new{border-radius:50%}
.legend i.g-new{box-shadow:inset 0 0 0 1.5px #808898}
.legend i.g-weak{background:linear-gradient(45deg,transparent 40%,#fff 40% 60%,transparent 60%),linear-gradient(-45deg,transparent 40%,#fff 40% 60%,transparent 60%),#e35d52}
