/* Humbucker shared styles: colors, light/dark theme, page header, mic + theme buttons, the dock */
:root{--bg:#fff;--fg:#111;--mut:#666;--card:#fff;--line:#ddd;--acc:#d9531e;--ok:#2e8b57;--bad:#e5383b;--f1:#1f6feb;--f2:#1a9a4a;--f3:#e8730c;--f4:#9b3fd1;--dotfg:#fff;--modal:#fff;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);color-scheme:light}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#000;--fg:#f2f2f2;--mut:#9a9a9a;--card:#0c0c0c;--line:#2a2a2a;--acc:#ff7a45;--ok:#4cc985;--f1:#4c9aff;--f2:#3ddc84;--f3:#ffa043;--f4:#c78bff;--dotfg:#000;--modal:#171717;color-scheme:dark}}
:root[data-theme="dark"]{--bg:#000;--fg:#f2f2f2;--mut:#9a9a9a;--card:#0c0c0c;--line:#2a2a2a;--acc:#ff7a45;--ok:#4cc985;--f1:#4c9aff;--f2:#3ddc84;--f3:#ffa043;--f4:#c78bff;--dotfg:#000;--modal:#171717;color-scheme:dark}

html{scroll-padding-top:env(safe-area-inset-top,0px)}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font:16px/1.5 system-ui,-apple-system,Segoe UI,sans-serif}
main{max-width:640px;margin:0 auto;padding:20px 16px calc(var(--dock) + 24px)}
h1{font-size:22px;margin:0}
.top{display:flex;gap:8px;justify-content:space-between;align-items:center;margin-bottom:4px}
.lt{display:flex;align-items:center;gap:8px}
/* the logo image in the header: 30px tall, its width follows the image. img/logo_dark.png on the dark theme,
   img/logo_light.png on the light one; the homepage is dark in both themes, so it keeps the dark logo. */
.logo{line-height:1}
.logo a{display:flex;align-items:center;color:inherit;text-decoration:none}
.logo img{display:block;height:30px;width:auto;max-width:180px}
@media (max-width:430px){.logo img{height:26px;max-width:140px}}
.logo img.logo-lt{display:none}
html[data-theme="light"] body:not(.home) .logo img.logo-lt{display:block}
html[data-theme="light"] body:not(.home) .logo img.logo-dk{display:none}
.tag{color:var(--mut);font-weight:600}
.tb{display:flex;align-items:center;gap:12px}
/* "Wings: ⚡ 120 XP": the name in bold orange (to your profile), then this week's XP (to the leaderboard) */
.hwho{display:flex;align-items:baseline;min-width:0;font-size:14px;white-space:nowrap}
.hsep{margin-right:5px}
.hxp{color:var(--fg);text-decoration:none;font-variant-numeric:tabular-nums}
.hxp i{font-style:normal;font-size:12px;margin-right:2px}
.hxp:hover{text-decoration:underline}
#theme{padding:6px 12px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--fg);font-size:14px;cursor:pointer}
/* Mic on / Mic off: a small pill, the size of the level and genre tags on My riffs, with room before your name */
#mic{font:inherit;font-size:11px;font-weight:600;line-height:1.5;padding:1px 8px;border-radius:999px;border:1.5px solid var(--bad);
  background:transparent;color:var(--fg);cursor:pointer;white-space:nowrap;margin-right:10px}
#acct{color:var(--acc);font-weight:700;text-decoration:none;max-width:10em;overflow:hidden;text-overflow:ellipsis}
#acct:hover{text-decoration:underline}
/* signed out: Sign in as an orange pill button, filled when you point at it */
#acct.hSignIn{display:inline-block;padding:5px 13px;border:1px solid var(--acc);border-radius:999px;line-height:1.2;max-width:none;transition:background .15s,color .15s}
#acct.hSignIn:hover,#acct.hSignIn:focus-visible{background:var(--acc);color:#fff;text-decoration:none}
#acct.hSignIn:focus-visible{outline:2px solid var(--acc);outline-offset:2px}
.hwho:has(.hSignIn){align-items:center}
.hSignIn+.hsep{margin-right:8px}
#theme:hover{border-color:var(--mut)}
#mic.on{border-color:var(--ok)}
p.sub{color:var(--mut);margin:0 0 18px}

/* The dock: the site's sections as icons, anchored to the bottom. 50px tall, plus the phone's home-bar area. */
:root{--dock:50px}
.dock{position:fixed;left:0;right:0;bottom:0;z-index:15;display:flex;justify-content:center;
  height:calc(var(--dock) + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);
  background:var(--card);border-top:1px solid var(--line)}
.dock a{flex:0 1 120px;display:flex;align-items:center;justify-content:center;height:var(--dock);color:var(--mut);text-decoration:none}
.dock svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dock a:hover{color:var(--fg)}
.dock a[aria-current="page"]{color:var(--acc)}
.dock a[aria-current="page"] svg{stroke-width:2.3}
.dock a{position:relative}
/* My account: a green dot on the icon while you're signed in */
.dock .online{position:absolute;top:calc(50% - 15px);left:calc(50% + 7px);width:10px;height:10px;border-radius:50%;
  background:#22c55e;box-shadow:0 0 0 2px var(--card)}
.dock a:focus-visible{outline:2px solid var(--acc);outline-offset:-4px;border-radius:8px}
@media print{.dock{display:none}}

@media (max-width:640px){.top{flex-wrap:nowrap}h1{font-size:20px}.tb{gap:6px}}
@media (max-width:430px){.tag{display:none}#acct{max-width:7em}}

/* Paint the page background as soon as the stylesheet loads, so a switch between pages never flashes white */
html[data-theme="dark"]{background:#000}
html[data-theme="light"]{background:#fff}
@media (prefers-color-scheme:dark){html:not([data-theme="light"]){background:#000}}
/* A page title with an i button beside it; the button opens How it works in a box (common.js, data-info) */
.pgHead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}
/* page titles: hand-lettered in Permanent Marker (loaded in header.php), the normal font until it arrives */
.pgTitle{font-family:'Permanent Marker',system-ui,-apple-system,Segoe UI,sans-serif;font-weight:400;color:var(--acc);font-size:24px;line-height:1.2;letter-spacing:.3px;margin:0}
.infoBtn{flex:0 0 auto;width:30px;height:30px;border-radius:50%;border:1.5px solid var(--mut);background:transparent;color:var(--mut);
  font:italic 700 16px/1 Georgia,serif;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.infoBtn:hover{color:var(--fg);border-color:var(--fg)}
.infoBtn:focus-visible{outline:2px solid var(--f1);outline-offset:2px}
/* the ? version (Jam Tracks, Tab writer, Metronome, Tuner), like the Chords page: a bold ? in a filled circle with a thin border */
.infoBtn.qBtn{width:32px;height:32px;border:1px solid var(--line);background:var(--card);color:var(--fg);font:700 17px/1 system-ui,-apple-system,Segoe UI,sans-serif}
.infoBtn.qBtn:hover{border-color:var(--mut)}
.infoOv{position:fixed;inset:0;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;padding:20px;z-index:20}
.infoOv[hidden]{display:none}
.infoOv .infoBox{background:var(--card);color:var(--fg);border:1px solid var(--line);border-radius:16px;padding:20px 22px;max-width:440px;
  max-height:calc(100% - 40px);overflow-y:auto;text-align:left}
.infoOv .infoHead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}
.infoOv .infoHead h2{margin:0;font-size:22px}
.infoOv .infoBox p,.infoOv .infoBox li{font-size:15px;line-height:1.5}
.infoOv .infoBox p{margin:0 0 8px}
.infoOv .infoBox ul{padding-left:20px;margin:8px 0 0}
.infoOv .infoBox li+li{margin-top:6px}
/* The close × on every box and sheet: a square button with slightly rounded corners and an orange border,
   like the site's other buttons. No focus ring (the boxes put focus on it as they open); keyboard focus tints it instead. */
button.xBtn{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;margin:0;
  border:1.5px solid var(--acc);border-radius:8px;background:transparent;color:var(--fg);cursor:pointer}
button.xBtn:hover{background:color-mix(in srgb,var(--acc) 14%,transparent)}
button.xBtn:focus,button.xBtn:focus-visible{outline:none}
button.xBtn:focus-visible{background:color-mix(in srgb,var(--acc) 22%,transparent)}
button.xBtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
/* Guitar sound panel (sound-panel.js): the guitar, pedals and band, shared by every page that plays sound */
details.sndPanel{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px 16px;margin:0 0 14px;text-align:left}
.sndPanel summary{cursor:pointer;font-weight:700;display:flex;align-items:center;flex-wrap:wrap;list-style:none}
.sndPanel summary::-webkit-details-marker{display:none}
/* the open/close marker is a guitar pick: pointing right when closed, down when open, 5px before the title */
.sndPanel summary::before{content:"";flex:none;width:14px;height:14px;margin-right:5px;background:var(--acc);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 23C9 19 3 12 3 7.5 3 3.5 7 1 12 1s9 2.5 9 6.5C21 12 15 19 12 23z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 23C9 19 3 12 3 7.5 3 3.5 7 1 12 1s9 2.5 9 6.5C21 12 15 19 12 23z'/%3E%3C/svg%3E") center/contain no-repeat;
  transform:rotate(-90deg);transition:transform .2s ease}
.sndPanel[open] summary::before{transform:none}
@media (prefers-reduced-motion:reduce){.sndPanel summary::before{transition:none}}
.sndPanel .sndSum{font-weight:400;font-size:13px;color:var(--mut);margin-left:10px}
.sndPanel .sndNote{color:var(--mut);font-size:13px;margin:10px 0 4px}
.sndPanel .sndH{font-size:14px;margin:16px 0 8px}
.sndPanel .sndGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
@media (max-width:560px){.sndPanel .sndGrid{grid-template-columns:1fr}}
.sndPanel .sndF{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--mut);min-width:0}
.sndPanel .sndF[hidden]{display:none}
.sndPanel .sndF output{color:var(--fg)}
.sndPanel .sndF input[type=range]{width:100%;accent-color:var(--f1)}
.sndPanel .sndBand{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px}
.sndPanel .sndChk{display:flex;align-items:center;gap:6px;font-size:14px}
.sndPanel .sndVol{display:flex;align-items:center;gap:8px;font-size:14px;flex:1;min-width:180px}
.sndPanel .sndVol input{flex:1;min-width:0;accent-color:var(--f1)}
.sndPanel select{width:100%;box-sizing:border-box;font:inherit;font-size:15px;padding:8px 10px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--fg);min-height:40px;min-width:0}

/* Tile icons (emoji). Some are drawn black on iPhones (the music notes, the score, the hammers, the gear), which
   vanish on the dark theme's cards. Those carry .emo.dk, and in dark mode they're flipped to light, keeping their
   hue; the coloured ones (guitar, drum, star) are left alone. No disc or background behind any of them. */
.emo{font-style:normal;margin-right:.3em;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
:root[data-theme="dark"] .emo.dk{filter:invert(1) hue-rotate(180deg)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .emo.dk{filter:invert(1) hue-rotate(180deg)}}
/* Every modal looks the same, so it's always clear where it is: centred, over a dark blurred backdrop, on a slightly
   lighter panel than the page, with an orange-tinted border and a deep shadow. Used by the How it works boxes
   (.infoOv), the play-along boxes (.ov, css/play.css), Riffsmith's sheets (dialog.rsSheet) and .rrModal dialogs. */
:root{--modalEdge:color-mix(in srgb,var(--acc) 55%,var(--line));--modalShadow:0 0 0 1px rgba(0,0,0,.04),0 24px 64px rgba(0,0,0,.55)}
.infoOv,.ov{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.infoOv>.infoBox,.ov>.box,dialog.rsSheet,dialog.rrModal{background:var(--modal);border:1.5px solid var(--modalEdge);box-shadow:var(--modalShadow)}
dialog.rsSheet::backdrop,dialog.rrModal::backdrop{background:rgba(0,0,0,.72);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
@media (prefers-reduced-transparency:reduce){.infoOv,.ov,dialog.rsSheet::backdrop,dialog.rrModal::backdrop{-webkit-backdrop-filter:none;backdrop-filter:none}}

/* A small modal dialog (<dialog class="rrModal">), such as Save riff: a heading with ×, a form, buttons at the foot */
dialog.rrModal{box-sizing:border-box;width:calc(100% - 28px);max-width:440px;max-height:calc(100% - 40px);margin:auto;padding:18px 20px 20px;
  border-radius:16px;color:var(--fg);overflow:auto;overscroll-behavior:contain}
.rrModal .mdHead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 12px}
.rrModal .mdHead h2{margin:0;font-size:20px}
.rrModal label.mdField{display:block;margin:0 0 14px}
.rrModal .mdField>span{display:block;font-size:12px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--mut);margin-bottom:6px}
.rrModal input[type=text]{box-sizing:border-box;width:100%;font:inherit;font-size:16px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);color:var(--fg)}
.rrModal input[type=text]:focus{outline:2px solid var(--acc);outline-offset:-1px;border-color:var(--acc)}
.rrModal .mdSwitch{display:flex;align-items:flex-start;gap:12px;padding:12px;border:1px solid var(--line);border-radius:12px;cursor:pointer;margin:0 0 6px}
.rrModal .mdSwitch input{flex:0 0 auto;width:20px;height:20px;margin:2px 0 0;accent-color:var(--acc)}
.rrModal .mdSwitch b{display:block;font-size:15px}
.rrModal .mdSwitch small{display:block;color:var(--mut);font-size:13px;line-height:1.45}
.rrModal .mdSwitch.off{opacity:.6;cursor:default}
.rrModal .mdNote{font-size:13px;color:var(--mut);margin:6px 0 0}
.rrModal .mdNote a{color:var(--acc)}
.rrModal .mdErr{font-size:14px;color:var(--bad);margin:10px 0 0}
.rrModal .mdErr:empty{display:none}
.rrModal .mdFoot{display:flex;gap:10px;justify-content:flex-end;margin-top:18px}
.rrModal .mdFoot button{font:inherit;font-weight:600;font-size:15px;padding:10px 18px;border-radius:10px;cursor:pointer;border:1px solid var(--line);background:transparent;color:var(--fg)}
.rrModal .mdFoot button.go{background:var(--acc);border-color:var(--acc);color:#fff}
.rrModal .mdFoot button:disabled{opacity:.55;cursor:default}
.rrModal .mdSwitch small a{color:var(--acc)}

/* The bar back to the lessons, on a page opened from a lesson's tip card (inc/header.php, ?rrnext=) */
.rrBackBar{position:sticky;top:8px;z-index:12;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 14px;
  padding:10px 14px;border:1.5px solid var(--f1);border-radius:12px;background:color-mix(in srgb,var(--f1) 14%,var(--card));
  color:var(--fg);text-decoration:none;font-size:14px;box-shadow:0 6px 20px rgba(0,0,0,.25)}
.rrBackBar span{color:var(--mut)}
.rrBackBar b{color:var(--f1)}
.rrBackBar:hover,.rrBackBar:focus-visible{background:color-mix(in srgb,var(--f1) 22%,var(--card))}

.rrModal .mdNote b{color:var(--fg)}
.rrModal .mdXp{color:var(--fg);font-size:14px}
.rrModal .mdFoot button.go.bad{background:var(--bad);border-color:var(--bad)}

/* a name box with a dice button beside it: a made-up name (scripts/riff-names.js) */
.rrModal .mdField>label{display:block;font-size:12px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--mut);margin-bottom:6px}
.mdNameRow{display:flex;gap:8px}
.mdNameRow input{flex:1;min-width:0}
.mdDice{flex:0 0 auto;display:grid;place-items:center;width:44px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--fg);cursor:pointer}
.mdDice svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7}
.mdDice:hover,.mdDice:focus-visible{border-color:var(--acc);color:var(--acc)}
.mdDice:active svg{transform:rotate(90deg);transition:transform .15s}
.rrModal div.mdField{margin:0 0 14px}
