/* Piano Basics — scoped styles (prefix pb-). Uses hub palette from /css/site.css. */
@font-face { font-family: "PBMusic"; src: url("/music/piano-basics/fonts/noto-music-subset.woff2") format("woff2"); font-display: block; }
.pb-mus { font-family: "PBMusic", "Noto Music", "Bravura Text", "Apple Symbols", "Segoe UI Symbol", serif; }
.pb-wrap { width: min(calc(100% - 2rem), 1040px); margin-inline: auto; padding: 1rem 0 3rem; }
#pb-app { min-height: 60vh; }
#pb-app h1 { font-family: var(--serif-display); font-weight: 700; letter-spacing: -0.02em; color: var(--purple-deep); line-height: 1.1; margin: .2rem 0 .5rem; font-size: clamp(1.9rem, 6vw, 2.9rem); }
#pb-app h1:focus { outline: none; }
#pb-app h2 { font-family: var(--serif-display); font-weight: 700; color: var(--brand-deep); font-size: clamp(1.25rem, 4vw, 1.6rem); line-height: 1.2; margin: 0 0 .5rem; }
.pb-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--purple); margin: 0; }
.pb-lede { font-size: clamp(1.05rem, 2.6vw, 1.22rem); color: var(--ink-soft); margin: .3rem 0 1rem; max-width: 40em; }
.pb-sub { color: var(--ink-soft); margin: 0 0 1rem; }
.pb-small { font-size: .9rem; color: var(--ink-faint); }
.center { text-align: center; justify-content: center; }
.pb-crumb { font-size: .92rem; color: var(--ink-faint); margin: .25rem 0 .6rem; }
.pb-crumb a { color: var(--ink-soft); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.pb-crumb a:hover { color: var(--purple); }
.pb-sec { margin: 2.2rem 0; }

/* Buttons */
.pb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: .55rem 1.05rem; border-radius: 999px; border: 2px solid var(--brand); background: #fff; color: var(--brand-deep); font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; touch-action: manipulation; transition: transform .12s, background .12s, box-shadow .12s; line-height: 1.15; text-align: center; }
.pb-btn:hover { background: var(--brand-wash); color: var(--brand-dark); }
.pb-btn:active { transform: translateY(1px); }
.pb-btn.pri { background: var(--purple); border-color: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-deep); }
.pb-btn.pri:hover { background: #7A1C99; color: #fff; }
.pb-btn.pri2 { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-deep); }
.pb-btn.pri2:hover { background: var(--brand-bright); color: #fff; }
.pb-btn.ghost { border-color: var(--rule-strong); color: var(--ink-soft); }
.pb-btn.big { min-height: 56px; font-size: 1.1rem; padding: .7rem 1.4rem; }
.pb-btn.sq { min-width: 52px; padding: .5rem; font-size: 1.15rem; }
.pb-btn.active { outline: 3px solid var(--gold); outline-offset: 2px; }
.pb-btn[disabled] { opacity: .45; cursor: default; }
.pb-btnrow { display: flex; flex-wrap: wrap; gap: .55rem; margin: .7rem 0; }
.pb-btnrow.center { justify-content: center; }

/* Hero */
.pb-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5rem; align-items: center; background: linear-gradient(135deg, #fff 0%, var(--purple-wash) 100%); border-radius: 22px; padding: clamp(1.1rem, 4vw, 2.2rem); box-shadow: var(--shadow-soft); border: 1px solid var(--purple-soft); margin-top: .6rem; }
.pb-hero h1 { font-size: clamp(2.3rem, 9vw, 3.6rem) !important; }
.pb-hero-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.pb-hero-art svg { width: 100%; max-width: 340px; margin: 0 auto; }
.pb-progress { height: 12px; background: var(--parchment-deep); border-radius: 999px; overflow: hidden; max-width: 420px; }
.pb-progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--purple)); border-radius: 999px; }
@media (max-width: 720px) { .pb-hero { grid-template-columns: 1fr; } .pb-hero-art { display: none; } }

/* Lesson path */
.pb-path { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .7rem; counter-reset: none; }
.pb-unit { display: flex; gap: .85rem; align-items: center; padding: .8rem 1rem; background: #fff; border: 2px solid var(--rule); border-radius: 16px; text-decoration: none; color: var(--ink); min-height: 72px; transition: border-color .15s, transform .15s; }
.pb-unit:hover { border-color: var(--purple-light); transform: translateY(-1px); color: var(--ink); }
.pb-unit .num { flex: 0 0 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--purple-wash); color: var(--purple); font-weight: 800; font-size: 1.2rem; border: 2px solid var(--purple-light); }
.pb-unit.done .num { background: var(--brand); color: #fff; border-color: var(--brand); }
.pb-unit.next { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-wash); }
.pb-unit .tx { display: flex; flex-direction: column; line-height: 1.25; }
.pb-unit small { color: var(--ink-faint); font-size: .88rem; }

/* Tiles */
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .8rem; margin-bottom: 1rem; }
.pb-grid.two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.pb-tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; background: #fff; border-radius: 18px; border: 2px solid var(--rule); text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 rgba(19,47,18,.06); min-height: 120px; position: relative; transition: border-color .15s, transform .15s; }
.pb-tile:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--ink); }
.pb-tile b { font-size: 1.1rem; color: var(--purple-deep); line-height: 1.2; }
.pb-tile small { color: var(--ink-soft); font-size: .93rem; line-height: 1.4; }
.pb-tile .ic { font-size: 1.8rem; line-height: 1; }
.pb-tile .st { margin-top: auto; font-size: .85rem; font-weight: 700; color: var(--brand-deep); }
.pb-tile .lvl { color: var(--purple); letter-spacing: 2px; font-size: .8rem; }
.pb-tile .lvl i { color: var(--purple-soft); font-style: normal; }
.pb-tile.song { border-left: 6px solid var(--purple); }

/* Badges */
.pb-badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .6rem; }
.pb-badges li { background: #fff; border: 2px dashed var(--rule-strong); border-radius: 16px; padding: .7rem; text-align: center; display: flex; flex-direction: column; gap: .15rem; opacity: .7; }
.pb-badges li.on { border: 2px solid var(--gold); background: linear-gradient(180deg, #fff, #FBF4E2); opacity: 1; }
.pb-badges .ic { font-size: 1.8rem; }
.pb-badges b { font-size: .95rem; color: var(--purple-deep); line-height: 1.2; }
.pb-badges small { font-size: .8rem; color: var(--ink-faint); line-height: 1.3; }
.pb-parents { background: #fff; border-left: 5px solid var(--brand); padding: 1rem 1.2rem; border-radius: 12px; }
.pb-parents p { margin: 0; color: var(--ink-soft); }

/* Cards */
.pb-card { background: #fff; border-radius: 20px; padding: clamp(1rem, 3.5vw, 1.5rem); box-shadow: var(--shadow-soft); border: 1px solid var(--rule); margin: 1rem 0; min-width: 0; }
.pb-card p { margin: .3rem 0 .8rem; }
.pb-card.learn h2 .n, .pb-qt .n { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--purple); color: #fff; font-size: .8em; margin-right: .5em; vertical-align: .1em; }
.pb-card-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .4rem .8rem; }
.pb-read { min-height: 44px; border-radius: 999px; border: 2px solid var(--purple-light); background: var(--purple-wash); color: var(--purple-deep); font: inherit; font-weight: 700; font-size: .92rem; padding: .3rem .9rem; cursor: pointer; }
.pb-read.playing { background: var(--purple); color: #fff; border-color: var(--purple); }
.pb-card.demo { border: 2px solid var(--brand-light); background: linear-gradient(180deg, #fff, var(--brand-wash)); }
.pb-card.check { border: 2px solid var(--purple-soft); }
.pb-art { margin: .4rem 0; overflow: hidden; }
.pb-art svg, .pb-art .pb-staff { margin: 0 auto; max-width: 100%; height: auto; }
.pb-art.sm svg { max-width: 260px; }
.pb-cap { text-align: center; font-size: .93rem; color: var(--ink-soft); margin: .3rem 0 0 !important; }
.pb-dot { display: inline-block; width: .8em; height: .8em; border-radius: 3px; vertical-align: -.05em; }
.pb-hilo { display: flex; align-items: center; gap: .5rem; }
.pb-hilo svg { flex: 1; min-width: 0; }
.pb-hilo span { font-weight: 800; color: var(--purple-deep); font-size: .9rem; text-align: center; flex: 0 0 auto; }
.pb-abc { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pb-abc span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--purple); color: #fff; font-weight: 800; font-size: 1.3rem; }
.pb-abc span.again { background: var(--purple-soft); color: var(--purple-deep); width: auto; min-width: 46px; padding: 0 .4rem; }
.pb-hands { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.pb-hands svg { width: min(44%, 210px); height: auto; }
.pb-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: .8rem; align-items: start; }
.pb-two figure { margin: 0; }
.pb-two figcaption { text-align: center; font-size: .95rem; color: var(--ink-soft); }
.pb-vt { width: 100%; border-collapse: collapse; font-size: .98rem; }
.pb-vt td { padding: .3rem .4rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.pb-vt td.ic { width: 34px; color: var(--ink); }
.pb-vt td.ct { color: var(--purple-deep); font-weight: 600; }
.pb-ico { display: inline-block; vertical-align: middle; }
.pb-bigico svg { width: 60px; height: 100px; margin: 0 auto; }
.pb-dyns { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; text-align: center; }
.pb-dyns > div { background: var(--purple-wash); border-radius: 16px; padding: .8rem 1rem; min-width: 120px; }
.pb-dyns .big { display: block; font-size: 2.6rem; line-height: 1.1; color: var(--purple-deep); }
.pb-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.pb-week span { background: var(--parchment-deep); border-radius: 10px; padding: .4rem .1rem; text-align: center; font-size: .78rem; display: flex; flex-direction: column; }
.pb-week span.on { background: var(--brand-wash); color: var(--brand-deep); font-weight: 700; }
.pb-printlinks { display: flex; flex-wrap: wrap; gap: .5rem; }
.pb-lhead { margin: .4rem 0 1rem; }
.pb-steps { list-style: none; display: flex; gap: .4rem; padding: 0; margin: .4rem 0 0; flex-wrap: wrap; }
.pb-steps li { background: var(--purple-wash); color: var(--purple-deep); font-weight: 700; font-size: .85rem; padding: .2rem .7rem; border-radius: 999px; }
.pb-lnav { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin: 1.5rem 0; }

/* Quick check */
.pb-q { padding: .6rem 0 .4rem; border-bottom: 1px dashed var(--rule); }
.pb-qt { font-weight: 700; font-size: 1.12rem; margin: .2rem 0 .6rem; }
.pb-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .5rem; }
.pb-choice { min-height: 52px; border-radius: 14px; border: 2px solid var(--rule-strong); background: #fff; font: inherit; font-weight: 700; font-size: 1.02rem; color: var(--ink); padding: .5rem .8rem; cursor: pointer; text-align: left; touch-action: manipulation; }
.pb-choice:hover:not([disabled]) { border-color: var(--purple); background: var(--purple-wash); }
.pb-choice.good { background: #E3F4E1; border-color: var(--brand); color: var(--brand-dark); }
.pb-choice.bad { background: #FBEDED; border-color: #D9A3A3; color: #7A2E2E; animation: pb-shake .35s; }
.pb-choice[disabled] { cursor: default; }
.pb-fb { min-height: 1.5em; font-weight: 600; margin: .5rem 0 0 !important; }
.pb-fb.good { color: var(--brand-deep); }
.pb-fb.bad { color: #8A4B12; }
.pb-fb.big { font-size: 1.1rem; text-align: center; }
.pb-done { text-align: center; padding: 1rem 0 .3rem; }
.pb-win { font-size: 1.3rem; font-weight: 800; color: var(--purple-deep); }
@keyframes pb-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Demo widgets */
.pb-say { min-height: 1.6em; font-weight: 600; color: var(--purple-deep); text-align: center; margin: .6rem 0 0 !important; }
.pb-switch { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; font-weight: 600; font-size: .95rem; cursor: pointer; margin-right: .8rem; }
.pb-switch input { width: 22px; height: 22px; accent-color: var(--purple); }
.pb-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.pb-tab { min-height: 44px; border-radius: 999px; border: 2px solid var(--purple-light); background: #fff; color: var(--purple-deep); font: inherit; font-weight: 700; font-size: .92rem; padding: .3rem .85rem; cursor: pointer; }
.pb-tab[aria-selected="true"] { background: var(--purple); color: #fff; border-color: var(--purple); }
.pb-staffdemo { margin: .4rem 0; overflow: hidden; }
.pb-staffdemo svg { margin: 0 auto; max-width: 100%; height: auto; }
.pb-staffdemo .pb-n[role="button"] { cursor: pointer; }
.pb-beats { display: flex; justify-content: center; gap: .5rem; margin: .5rem 0; }
.pb-beats span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; background: var(--parchment-deep); color: var(--ink-faint); transition: background .08s, transform .08s; }
.pb-beats span.on { background: var(--brand); color: #fff; transform: scale(1.12); }
.pb-beats span.on.ci { background: var(--gold); }
.pb-rgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: .5rem; }
.pb-btn.rv { border-radius: 16px; flex-direction: column; min-height: 88px; }
.pb-btn.rv .pb-ico { width: 24px; height: 40px; }
.pb-checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.pb-checklist label { display: flex; align-items: center; gap: .7rem; min-height: 48px; padding: .3rem .7rem; background: #fff; border-radius: 12px; border: 1px solid var(--rule); cursor: pointer; }
.pb-checklist input { width: 24px; height: 24px; accent-color: var(--brand); }

/* Keyboard */
.pb-kbw { margin: .6rem 0; }
.pb-kb-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border-radius: 12px; background: #1F1A1D; padding: 10px 8px 8px; box-shadow: inset 0 3px 0 #3A2F35, 0 6px 16px -10px rgba(0,0,0,.6); scrollbar-width: thin; }
.pb-kb { --kw: 36px; position: relative; display: flex; height: 170px; min-width: calc(var(--n) * var(--kw)); width: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pb-kb-scroll.big .pb-kb { height: 190px; --kw: 40px; }
.pb-kb button { min-width: 0 !important; min-height: 0 !important; margin: 0; font: inherit; cursor: pointer; touch-action: pan-x; -webkit-tap-highlight-color: transparent; }
.pb-wk { flex: 1 1 0; position: relative; background: linear-gradient(180deg, #F4F1EA 0%, #fff 12%, #fff 88%, #ECE7DD 100%); border: 1px solid #8C8580; border-top: 0; border-radius: 0 0 8px 8px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 0 8px; color: #3D4A41; box-shadow: inset 0 -5px 0 #DCD5C8; transition: background .06s, box-shadow .06s; }
.pb-wk .pb-lab { font-weight: 800; font-size: 1.05rem; line-height: 1; }
.pb-wk.mid::after { content: ""; position: absolute; bottom: 50px; width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.pb-midc { font-size: .6rem; font-weight: 700; color: var(--purple); line-height: 1; margin-top: 3px; white-space: nowrap; }
.pb-bk { position: absolute; top: 0; height: 62%; z-index: 2; background: linear-gradient(180deg, #2A2427 0%, #141113 85%, #322B2E 100%); border: 1px solid #000; border-radius: 0 0 6px 6px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 0 6px; color: #fff; box-shadow: inset 0 -6px 0 #3A3236, 0 3px 4px rgba(0,0,0,.4); }
.pb-bk .pb-lab { font-size: .58rem; font-weight: 700; line-height: 1.1; text-align: center; opacity: .85; }
.pb-labels-off .pb-lab, .pb-labels-off .pb-midc { visibility: hidden; }
.pb-wk.down { background: linear-gradient(180deg, #EDE2F2, #F6EAF9); box-shadow: inset 0 -2px 0 #D4A8E0; }
.pb-bk.down { background: linear-gradient(180deg, #5A2A6A, #3B1A46); box-shadow: inset 0 -2px 0 #2A1030; }
.pb-wk.on, .pb-wk.pos { background: linear-gradient(180deg, #fff, #E8F5E6); }
.pb-wk.target { background: linear-gradient(180deg, #F6EAF9, #EDD4F4); box-shadow: inset 0 0 0 3px var(--purple), inset 0 -5px 0 #D4A8E0; }
.pb-bk.target, .pb-bk.on { background: linear-gradient(180deg, #A43BC4, #6E1A8A); }
.pb-bk.grp { background: linear-gradient(180deg, #A43BC4, #6E1A8A); }
.pb-bk.grp3 { background: linear-gradient(180deg, #3FA53D, #20700F); }
.pb-wk.quiz { background: linear-gradient(180deg, #FFF7E0, #F6E6B8); box-shadow: inset 0 0 0 3px var(--gold), inset 0 -5px 0 #E2CC90; }
.pb-wk.good, .pb-bk.good { background: linear-gradient(180deg, #CFEBCB, #9ED39A) !important; }
.pb-wk.bad, .pb-bk.bad { background: linear-gradient(180deg, #F8DADA, #EFB9B9) !important; animation: pb-shake .3s; }
.pb-bub { display: none; }
.has-bub .pb-bub { display: grid; place-items: center; position: absolute; bottom: 42px; width: 30px; height: 30px; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 800; font-size: 1rem; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.pb-bk.has-bub .pb-bub { width: 24px; height: 24px; font-size: .85rem; bottom: 30px; }
.pb-wk.mid.has-bub::after { display: none; }
.pb-labels-off .has-bub .pb-bub { bottom: 14px; }
.pb-wk.quiz .pb-bub { background: var(--gold) !important; color: #3B2A08; }
@media (max-width: 520px) { .pb-kb { height: 150px; --kw: 34px; } .pb-kb-scroll.big .pb-kb { height: 170px; --kw: 36px; } .pb-wk .pb-lab { font-size: .95rem; } .has-bub .pb-bub { width: 26px; height: 26px; } }

/* Staff */
.pb-staff { display: block; overflow: visible; }
.pb-staff .pb-n { color: #27211E; transition: color .1s; }
.pb-staff .pb-hl { fill: var(--purple-wash); opacity: 0; transition: opacity .12s; }
.pb-staff .pb-n.now { color: var(--purple); }
.pb-staff .pb-n.now .pb-hl { opacity: 1; }
.pb-staff .pb-fg { font-weight: 800; fill: var(--brand-deep); font-family: var(--sans); }
.pb-staff .pb-lt { font-weight: 800; fill: var(--purple-deep); font-family: var(--sans); }
.pb-staff .pb-cnt { font-weight: 600; fill: #7A857C; font-family: var(--sans); }
.pb-staff .pb-ts { font-family: var(--serif-display); font-weight: 800; }
.pb-staff .pb-n.now .pb-fg, .pb-staff .pb-n.now .pb-lt { fill: var(--purple); }

/* Song player */
.pb-songhead h1 { margin-bottom: .2rem !important; }
.pb-blurb { color: var(--ink-soft); margin: 0 0 .6rem; font-size: 1.05rem; }
.pb-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.pb-chips li { background: var(--purple-wash); color: var(--purple-deep); font-weight: 700; font-size: .86rem; padding: .25rem .7rem; border-radius: 999px; }
.pb-player { padding-bottom: 1rem; }
.pb-controls { display: flex; flex-direction: column; gap: .5rem; }
.pb-modes { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; }
.pb-ctl2 { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; }
.pb-tempo { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 700; min-height: 44px; flex: 1 1 260px; }
.pb-tempo input { flex: 1 1 140px; accent-color: var(--purple); min-height: 32px; }
.pb-tempo output { font-size: .85rem; color: var(--ink-faint); font-weight: 600; flex-basis: 100%; }
.pb-now { display: flex; align-items: center; gap: .8rem; background: var(--parchment); border-radius: 16px; padding: .6rem .9rem; margin: .7rem 0; min-height: 76px; }
.pb-now-l { --fc: var(--purple); flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; padding: .2rem .4rem; border-radius: 14px; background: #fff; border: 3px solid var(--fc); }
.pb-now-note { font-size: 2rem; font-weight: 800; color: var(--purple-deep); line-height: 1; }
.pb-now-f { font-size: .8rem; font-weight: 800; color: var(--fc); }
.pb-now-r { display: flex; flex-direction: column; min-width: 0; }
.pb-now-r b { font-size: 1.12rem; color: var(--purple-deep); }
.pb-now-r small { color: var(--ink-soft); font-size: .95rem; }
.pb-staffbox { max-height: 440px; overflow-y: auto; overflow-x: hidden; background: #FFFEFA; border: 1px solid var(--rule); border-radius: 14px; padding: 6px 4px; scroll-behavior: smooth; }
.pb-staffbox svg { margin: 0 auto; }
.pb-keyhint kbd { font: inherit; font-size: .8rem; background: #fff; border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 .3rem; }
@media (hover: none), (pointer: coarse) { .pb-keyhint { display: none; } }
.pb-songfoot .pb-hp { display: grid; grid-template-columns: 170px 1fr; gap: 1rem; align-items: center; }
.pb-songfoot .pb-hp > svg { width: 100%; }
.pb-songfoot .pb-hp .pb-mini { max-width: 320px; }
.pb-tip { background: var(--gold-soft); border-radius: 12px; padding: .6rem .8rem; margin-top: .8rem !important; }
@media (max-width: 560px) { .pb-modes { grid-template-columns: 1fr 1fr 52px; gap: .4rem; } .pb-modes .pb-btn { padding: .45rem .5rem; font-size: .95rem; } .pb-hide-sm { display: none; } .pb-ctl2 { gap: 0 .2rem; } .pb-ctl2 .pb-switch { font-size: .88rem; margin-right: .4rem; } .pb-ctl2 .pb-btn.ghost { min-height: 44px; padding: .3rem .8rem; font-size: .9rem; } .pb-tempo { flex-basis: 100%; } .pb-tempo output { flex-basis: auto; } .pb-now { min-height: 64px; margin: .5rem 0; padding: .45rem .6rem; } .pb-now-l { min-width: 62px; } .pb-now-note { font-size: 1.6rem; } .pb-now-r b { font-size: 1rem; } .pb-now-r small { font-size: .88rem; } .pb-songfoot .pb-hp { grid-template-columns: 1fr; } .pb-songfoot .pb-hp > svg { max-width: 150px; margin: 0 auto; }  }

/* Hands */
.pb-hand .pb-f { cursor: default; }
.pb-hands.tap .pb-f { cursor: pointer; }
.pb-hand .pb-f.glow .pb-fshape { fill: #EDD4F4; stroke: var(--purple); stroke-width: 4; }
.pb-hand .pb-f.quiz .pb-fshape { fill: #FFE9A8; stroke: #B5850F; stroke-width: 5; }
.pb-hand .pb-f.quiz .pb-fnum { fill: #B5850F !important; }
.pb-fmart { display: flex; justify-content: center; margin: .4rem 0; }
.pb-fmart svg { width: min(100%, 240px); height: auto; }
.pb-fmart svg.pb-mini { width: min(100%, 300px); }

/* Games */
.pb-gbar { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.pb-pill { background: var(--purple-wash); color: var(--purple-deep); border-radius: 999px; padding: .3rem .9rem; font-weight: 700; }
.pb-letters { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; margin-top: .6rem; }
.pb-letters.five { grid-template-columns: repeat(5, 1fr); }
.pb-choice.let { text-align: center; font-size: 1.5rem; min-height: 60px; padding: .2rem; }
.pb-star { color: #B5850F; }
.pb-drum { display: block; margin: .8rem auto .3rem; width: 150px; height: 150px; border-radius: 50%; border: 6px solid var(--brand-deep); background: radial-gradient(circle at 50% 40%, #fff, #E8F5E6 60%, #CBE5C6); font: inherit; font-weight: 800; font-size: 1.6rem; color: var(--brand-deep); cursor: pointer; touch-action: manipulation; box-shadow: 0 6px 0 var(--brand-deep); }
.pb-drum.live { border-color: var(--purple); color: var(--purple); }
.pb-drum.hit { transform: translateY(4px) scale(.97); box-shadow: 0 2px 0 var(--brand-deep); background: radial-gradient(circle at 50% 40%, #fff, #EDD4F4 60%, #D4A8E0); }
.pb-result { text-align: center; padding: 1rem 0; }
@media (max-width: 400px) { .pb-letters { grid-template-columns: repeat(4, 1fr); } .pb-choice.let { min-height: 56px; } }

/* Free play */
.pb-freetop { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: center; }
.pb-bigname { text-align: center; display: flex; flex-direction: column; }
.pb-bigname span { font-size: clamp(2.4rem, 10vw, 3.6rem); font-weight: 800; color: var(--purple-deep); line-height: 1.1; }
.pb-bigname small { color: var(--ink-soft); font-weight: 600; }
@media (max-width: 560px) { .pb-freetop { grid-template-columns: 1fr; } }

/* Reference cards */
.pb-refs { display: grid; gap: 1rem; }
.pb-refcard { background: #fff; border: 2px solid var(--purple-soft); border-radius: 18px; padding: 1rem 1.2rem; box-shadow: var(--shadow-soft); }
.pb-refcard h2 { color: var(--purple-deep) !important; border-bottom: 3px solid var(--brand); padding-bottom: .3rem; }
.pb-refcard svg { margin: .4rem auto; max-width: 100%; height: auto; }
.pb-refcard ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.pb-refcard ul.two { columns: 2 260px; }
.pb-refcard li { margin: .15rem 0; break-inside: avoid; }

/* Toast + confetti */
#pb-toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 150%); background: var(--purple-deep); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 600; z-index: 300; transition: transform .3s; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 2rem); text-align: center; }
#pb-toast.show { transform: translate(-50%, 0); }
.pb-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 290; overflow: hidden; }
.pb-confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: pb-fall linear forwards; }
@keyframes pb-fall { to { transform: translateY(105vh) rotate(540deg); opacity: .7; } }

/* Printable song sheet (shared with songbook) */
#pb-print { display: none; }
.pb-sheet { background: #fff; color: #111; font-family: var(--sans); }
.pb-sh-head { text-align: center; border-bottom: 2px solid #111; padding-bottom: .15in; margin-bottom: .15in; }
.pb-sh-brand { font-size: 9pt; letter-spacing: .14em; text-transform: uppercase; margin: 0; color: #444; }
.pb-sheet h2 { font-family: var(--serif-display); font-size: 24pt; margin: .04in 0 0; color: #111 !important; line-height: 1.1; }
.pb-sh-sub { margin: .04in 0 0; font-size: 10.5pt; color: #333; }
.pb-sh-info { display: grid; grid-template-columns: 2.6in 1fr; gap: .2in; align-items: start; margin-bottom: .1in; }
.pb-sh-kb svg { width: 2.6in; height: auto; }
.pb-sh-cap { font-size: 8.5pt; color: #333; margin: .03in 0 0; line-height: 1.3; }
.pb-sh-notes p { margin: 0 0 .06in; font-size: 10pt; line-height: 1.35; }
.pb-sh-legend { display: flex; flex-wrap: wrap; gap: .02in .16in; }
.pb-sh-legend span { display: inline-flex; align-items: center; gap: .03in; font-size: 9pt; }
.pb-sh-legend .pb-ico { width: 13px; height: 22px; }
.pb-sh-staff svg { width: 100%; height: auto; }
.pb-sh-staff .pb-fg { fill: #111; }
.pb-sh-staff .pb-lt { fill: #111; }
.pb-sh-staff .pb-cnt { fill: #666; }
.pb-sh-staff .pb-hl { display: none; }
.pb-sh-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .1in; border-top: 1px solid #999; padding-top: .08in; margin-top: .12in; font-size: 9pt; color: #444; }

@page { size: letter; margin: 0.55in 0.6in; }
@media print {
  html, body { background: #fff !important; }
  body::before, .site-header, .site-footer, .site-dock, .skip, .pb-noprint, .pb-crumb, .pb-lnav, #pb-toast, .pb-confetti, .pb-read { display: none !important; }
  body.has-dock { padding-bottom: 0 !important; }
  .pb-wrap { width: 100%; padding: 0; }
  html.pb-ps #pb-app, html.pb-ps .pb-sbscreen { display: none !important; }
  html.pb-ps #pb-print { display: block !important; }
  .pb-sheet { break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid; }
  .pb-sheet:last-child { break-after: auto; page-break-after: auto; }
  .pb-card, .pb-refcard { box-shadow: none !important; border-color: #999 !important; }
  .pb-refcard { break-inside: avoid; page-break-inside: avoid; border-width: 1px; }
  .pb-refs { gap: .25in; }
  .pb-refcard svg.pb-staff { max-height: 1.6in; width: auto; }
  .pb-refcard .pb-hands svg { width: 1.4in; }
  .pb-refcard .pb-mini { max-height: 1.9in; width: auto; }
  .pb-kb-scroll, .pb-player, .pb-songfoot { display: none !important; }
  a { color: #111 !important; text-decoration: none !important; }
}

/* Songbook screen view: sheets shown as paper pages */
.pb-sbook { display: grid; gap: 1.2rem; }
.pb-sbook .pb-sheet { max-width: 8.5in; width: 100%; margin: 0 auto; padding: clamp(.8rem, 4vw, .6in); border-radius: 6px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.45); border: 1px solid var(--rule); overflow: hidden; }
.pb-cover h3 { font-family: var(--serif-display); font-size: 13pt; margin: .12in 0 .05in; color: #111; }
.pb-cv-name { font-size: 12pt; margin: .2in 0; }
.pb-cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 2.8in), 1fr)); gap: .25in; }
.pb-cv-list, .pb-cv-how { margin: 0; padding-left: 1.2rem; font-size: 10.5pt; line-height: 1.55; }
.pb-cv-list span { color: #555; font-size: 9pt; }
.pb-cover .pb-mini { width: 100%; max-width: 5.6in; height: auto; margin: .05in auto; }
@media (max-width: 640px) { .pb-sh-info { grid-template-columns: 1fr; } .pb-sh-kb svg { width: 100%; max-width: 2.8in; } .pb-sheet h2 { font-size: 20pt; } }
@media print {
  .pb-sbook { display: block; }
  .pb-sbook .pb-sheet { max-width: none; padding: 0; border: 0; box-shadow: none; border-radius: 0; margin: 0; }
  .pb-sh-info { grid-template-columns: 2.6in 1fr !important; }
  .pb-sh-kb svg { width: 2.6in !important; }
  .pb-sheet h2 { font-size: 24pt !important; }
}
@media print {
  .pb-lhead .pb-lede { display: none; }
  #pb-app h1 { font-size: 20pt !important; margin: 0 0 .1in !important; }
  .pb-refcard { font-size: 10pt; padding: .12in .18in; line-height: 1.35; }
  .pb-refcard h2 { font-size: 14pt !important; margin-bottom: .06in !important; }
  .pb-refcard .pb-hands svg { width: auto !important; height: 1.25in; }
  .pb-refcard .pb-mini { max-height: 1.45in; }
  .pb-refcard svg.pb-staff { max-height: 1.25in; }
  .pb-refcard .pb-two { grid-template-columns: 1fr 1fr; gap: .15in; }
  .pb-refcard .pb-vt td { padding: .02in .04in; font-size: 9.5pt; }
  .pb-refcard .pb-cap { font-size: 8.5pt; }
}
@media print { .pb-refs { display: block; } .pb-refcard { margin: 0 0 .2in; } }
