/* 1Piano — design system */
:root {
  --bg1: #140f2e; --bg2: #24124a; --bg3: #0b2a4a;
  --card: rgba(255, 255, 255, .07); --card2: rgba(255, 255, 255, .12); --line: rgba(255, 255, 255, .12);
  --text: #f5f2ff; --muted: #b8b0d9; --pink: #ff5ea8; --violet: #7b5cff; --cyan: #4cc9f0; --mint: #06d6a0; --gold: #ffd166; --red: #ff5d73;
  --radius: 20px; --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: radial-gradient(1200px 800px at 10% -10%, #3b1a7a 0%, transparent 60%), radial-gradient(900px 700px at 110% 10%, #0f4a7a 0%, transparent 55%), linear-gradient(160deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed; overflow-x: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
/* app feel: no text-selection / copy menu on long-press (inputs still selectable) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .mono, .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--cyan); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.flex { flex: 1; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85em; word-break: break-all; opacity: .85; }
.tiny { font-size: .8rem; color: var(--muted); }

/* floating background notes */
#bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
#bg i { position: absolute; bottom: -60px; font-style: normal; font-size: 34px; color: rgba(255, 255, 255, .06); animation: floatUp 22s linear infinite; }
#bg i:nth-child(1) { left: 6%; animation-delay: 0s; } #bg i:nth-child(2) { left: 18%; animation-delay: -6s; font-size: 50px; }
#bg i:nth-child(3) { left: 31%; animation-delay: -12s; } #bg i:nth-child(4) { left: 47%; animation-delay: -3s; font-size: 44px; }
#bg i:nth-child(5) { left: 60%; animation-delay: -15s; } #bg i:nth-child(6) { left: 72%; animation-delay: -9s; font-size: 56px; }
#bg i:nth-child(7) { left: 84%; animation-delay: -18s; } #bg i:nth-child(8) { left: 94%; animation-delay: -1s; font-size: 40px; }
@keyframes floatUp { to { transform: translateY(-120vh) rotate(25deg); } }
body[data-screen=play] #bg, body[data-screen=stage] #bg, body[data-screen=wall] #bg { display: none; }

#app { position: relative; z-index: 1; min-height: 100%; }
.screen { min-height: 100dvh; animation: screenIn .35s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- basics ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 18px calc(40px + var(--safe-b)); }
.page-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.page-top h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.lead { color: var(--muted); font-size: 1.05rem; line-height: 1.5; max-width: 60ch; }
.icon-btn { min-width: 42px; height: 42px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, background .2s; }
.icon-btn:hover { background: var(--card2); } .icon-btn:active { transform: scale(.92); }
.icon-btn.on { background: linear-gradient(135deg, var(--violet), var(--pink)); border-color: transparent; }
.btn { border: 1px solid var(--line); background: var(--card2); padding: 11px 18px; border-radius: 999px; font-weight: 700; cursor: pointer; transition: transform .12s, filter .2s, background .2s; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); } .btn:active { transform: scale(.95); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--violet)); border: 0; box-shadow: 0 8px 24px -8px rgba(255, 94, 168, .7); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 13px; font-size: .9rem; }
.btn.big { padding: 15px 30px; font-size: 1.15rem; }
.btn.danger { background: rgba(255, 93, 115, .2); border-color: rgba(255, 93, 115, .5); }
.btn.on { background: linear-gradient(135deg, var(--mint), var(--cyan)); color: #062a2a; border-color: transparent; }
.btn.rec.on { background: var(--red); color: #fff; animation: pulseRec 1s infinite; }
@keyframes pulseRec { 50% { box-shadow: 0 0 0 8px rgba(255, 93, 115, .25); } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chip { border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; transition: all .15s; white-space: nowrap; }
.chip.sel { background: #fff; color: #2a1660; border-color: #fff; }
.pill { background: var(--card2); padding: 6px 12px; border-radius: 999px; font-weight: 700; color: var(--gold); }
.seg { display: inline-flex; background: rgba(0, 0, 0, .25); border-radius: 16px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 14px; border-radius: 12px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button.sel { background: #fff; color: #2a1660; }
.seg button:disabled { opacity: .3; }
.seg.big button { display: flex; flex-direction: column; align-items: center; padding: 12px 16px; }
.seg.big small { font-weight: 500; font-size: .75rem; opacity: .8; }
.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--muted); font-weight: 600; }
.chk input { width: 20px; height: 20px; accent-color: var(--pink); }
.warn { background: rgba(255, 209, 102, .12); border: 1px solid rgba(255, 209, 102, .35); padding: 12px 16px; border-radius: 14px; color: #ffe8b0; font-size: .95rem; line-height: 1.45; }
select, .txt, .search { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
select option { background: #241450; }
.search { width: 100%; font-size: 1.05rem; padding: 13px 16px; border-radius: 16px; margin: 6px 0; }

/* ---------- home ---------- */
.home-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.logo, .wl-logo { font-weight: 900; font-size: 1.6rem; letter-spacing: -.03em; }
.logo span, .wl-logo span { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: .38em; margin-right: .12em; background: linear-gradient(135deg, var(--pink), var(--violet)); box-shadow: 0 6px 18px -6px var(--pink); }
.hw-pill { background: rgba(6, 214, 160, .2); border: 1px solid rgba(6, 214, 160, .5); padding: 6px 10px; border-radius: 999px; }
.chip.me { background: var(--card2); }
.hello h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); margin-bottom: .15em; }
.hello p { color: var(--muted); margin: 0 0 16px; font-size: 1.1rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; backdrop-filter: blur(8px); }
.stat b { display: block; font-size: 1.25rem; } .stat small { color: var(--muted); }
.stat .big { font-size: 2rem; }
.stat.ring svg { width: 56px; height: 56px; transform: rotate(-90deg); flex: none; }
.stat.ring circle { fill: none; stroke-width: 9; } .stat.ring .bg { stroke: rgba(255, 255, 255, .1); }
.stat.ring .fg { stroke: url(#none); stroke: var(--mint); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.stat.lvl > div { flex: 1; min-width: 0; }
.xpbar { height: 8px; background: rgba(255, 255, 255, .1); border-radius: 9px; margin-top: 6px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--pink)); border-radius: 9px; }
.hero-card, .sotd { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 24px; color: var(--text); margin-bottom: 16px; background: linear-gradient(120deg, rgba(255, 94, 168, .35), rgba(123, 92, 255, .35)); border: 1px solid rgba(255, 255, 255, .2); position: relative; overflow: hidden; animation: cardIn .5s calc(var(--i, 0) * 50ms) both; transition: transform .2s; }
.hero-card:hover, .sotd:hover { transform: translateY(-2px); }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%); transform: translateX(-100%); animation: shine 3.5s 1s infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.hero-card small, .sotd small { color: #ffd9ef; font-weight: 600; }
.hero-card b, .sotd b { display: block; font-size: 1.4rem; }
.hc-icon { font-size: 2.4rem; width: 64px; height: 64px; display: grid; place-items: center; background: rgba(255, 255, 255, .15); border-radius: 18px; flex: none; }
.hc-go { margin-left: auto; width: 48px; height: 48px; flex: none; border-radius: 50%; background: #fff; color: var(--violet); display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .5); }
.sotd { background: var(--card); }
.sotd p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.ss-art { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; flex: none; background: linear-gradient(135deg, var(--a, var(--pink)), var(--b, var(--violet))); box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 14px 0 20px; }
.tiles.main { grid-template-columns: repeat(3, 1fr); }
.tiles.two { grid-template-columns: 1fr 1fr; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; min-height: 140px; border-radius: 24px; color: var(--text); border: 1px solid var(--line); cursor: pointer; text-align: left; overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--t1, #7b5cff) 55%, transparent), color-mix(in srgb, var(--t2, #4cc9f0) 40%, transparent)); transition: transform .2s, box-shadow .2s; animation: cardIn .5s calc(var(--i, 0) * 60ms) both; }
.tile:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); }
.tile:active { transform: scale(.97); }
.tile b { font-size: 1.25rem; } .tile small { color: rgba(255, 255, 255, .8); line-height: 1.35; }
.tile em { font-style: normal; color: var(--gold); font-weight: 700; margin-top: auto; }
.t-icon { font-size: 2.4rem; margin-bottom: 6px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); transition: transform .3s; }
.tile:hover .t-icon { transform: scale(1.15) rotate(-8deg); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.badges h3 small, .connect h3 small { color: var(--muted); font-weight: 600; }
.badge-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.badge { flex: none; width: 86px; text-align: center; padding: 10px 6px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); opacity: .45; }
.badge.on { opacity: 1; background: linear-gradient(160deg, rgba(255, 209, 102, .25), rgba(255, 94, 168, .15)); border-color: rgba(255, 209, 102, .4); }
.badge span { font-size: 1.8rem; display: block; } .badge small { font-size: .72rem; color: var(--muted); }
.connect { margin-top: 18px; }
.conn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.conn { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.conn:hover { background: var(--card2); } .conn > span { font-size: 1.8rem; } .conn small { display: block; color: var(--muted); font-size: .8rem; }
.kb-list { display: grid; gap: 10px; margin-top: 12px; } .kb-list .conn { width: 100%; color: inherit; font: inherit; }
.kb-msg { min-height: 1.2em; margin-top: 10px; } .kb-msg.err { color: #ffd166; font-size: .9rem; }

/* ---------- keyboard ---------- */
.kb { position: relative; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: none; user-select: none; -webkit-user-select: none; background: #07040f; }
.kb::-webkit-scrollbar { display: none; }
.kb-inner { position: relative; height: 100%; touch-action: none; }
.key { position: absolute; top: 0; touch-action: none; transition: background .08s, transform .06s, box-shadow .15s; }
.key.white { height: 100%; z-index: 1; border-radius: 0 0 10px 10px; background: linear-gradient(180deg, #e9e6f5 0%, #fff 12%, #fbfaff 88%, #e3dff2 100%); box-shadow: inset -1px 0 0 rgba(0, 0, 0, .18), inset 0 -6px 0 rgba(0, 0, 0, .07); }
.key.black { height: 62%; z-index: 2; border-radius: 0 0 7px 7px; background: linear-gradient(180deg, #2b2640 0%, #121019 70%, #1d1a2b 100%); box-shadow: inset 0 -5px 0 rgba(255, 255, 255, .08), 0 4px 6px rgba(0, 0, 0, .5); }
.key .lbl { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-weight: 800; font-size: clamp(9px, calc(var(--kw) * .34), 17px); color: #6a628c; pointer-events: none; }
.key .lbl sub { font-size: .65em; opacity: .7; }
.key.white.rainbow::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 4px; height: 3px; border-radius: 3px; background: var(--nc); opacity: .7; }
.key.middle-c .lbl::before { content: "•"; position: absolute; left: 0; right: 0; bottom: 1.3em; color: var(--pink); font-size: 1.4em; }
.key.white.down { background: linear-gradient(180deg, color-mix(in srgb, var(--nc) 55%, #fff), var(--nc)); transform: translateY(1px); box-shadow: inset 0 0 18px rgba(255, 255, 255, .6), 0 0 22px var(--nc); }
.key.black.down { background: linear-gradient(180deg, color-mix(in srgb, var(--nc) 60%, #000), var(--nc)); box-shadow: 0 0 20px var(--nc); }
.key.down .lbl { color: #2a1660; }
.key.down.remote { opacity: .9; }
.key.hint { animation: hintGlow 1.1s ease-in-out infinite; z-index: 3; }
.key.white.hint { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--nc) 45%, #fff)); }
.key.black.hint { background: linear-gradient(180deg, color-mix(in srgb, var(--nc) 40%, #111), color-mix(in srgb, var(--nc) 80%, #111)); }
.key.black.hint { z-index: 4; }
.key.hint-strong::before { content: "▼"; position: absolute; top: 6px; left: 0; right: 0; text-align: center; color: var(--nc); font-size: clamp(10px, calc(var(--kw) * .4), 20px); animation: bob .8s ease-in-out infinite; text-shadow: 0 0 6px rgba(0, 0, 0, .4); }
.key.black.hint-strong::before { color: #fff; }
@keyframes bob { 50% { transform: translateY(5px); } }
@keyframes hintGlow { 0%, 100% { box-shadow: 0 0 6px 1px var(--nc), inset 0 0 10px var(--nc); } 50% { box-shadow: 0 0 22px 6px var(--nc), inset 0 0 18px var(--nc); } }
.key.force-lbl::after { content: attr(data-name); position: absolute; left: 50%; bottom: 34%; transform: translateX(-50%); background: var(--nc); color: #1a0d3a; font-weight: 900; border-radius: 8px; padding: 2px 6px; font-size: 14px; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.key.black.force-lbl::after { bottom: 18%; }
.key.good { background: linear-gradient(180deg, #b8ffe6, #06d6a0) !important; box-shadow: 0 0 30px #06d6a0 !important; }
.key.bad { background: linear-gradient(180deg, #ffd0d6, #ff5d73) !important; animation: keyShake .3s; }
.key.auto { background: linear-gradient(180deg, #ddd5ff, #a48bff) !important; box-shadow: 0 0 16px #a48bff; }
.key.black.auto { background: linear-gradient(180deg, #5a46b8, #8b72ff) !important; }
@keyframes keyShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* ---------- full-screen play layouts ---------- */
.player, .lesson, .game, .free, .stage, .wall { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.pl-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 12px 8px; background: rgba(10, 6, 24, .55); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); z-index: 5; flex: none; }
.pl-title { display: flex; flex-direction: column; min-width: 0; }
.pl-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-title small { color: var(--muted); font-size: .8rem; }
.pl-prog { flex: 1; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .1); overflow: hidden; min-width: 40px; }
.pl-prog div { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); border-radius: 8px; transition: width .2s; }
.pl-stats { font-weight: 800; white-space: nowrap; }
.pl-staff { flex: none; width: 100%; height: clamp(90px, 18vh, 150px); background: rgba(255, 255, 255, .04); border-bottom: 1px solid var(--line); display: block; }
.pl-lane-wrap { position: relative; flex: 1; min-height: 80px; background: linear-gradient(180deg, rgba(10, 6, 30, .2), rgba(60, 30, 120, .25)); }
.pl-lane, .st-vis { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pl-coach { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; z-index: 3; }
.coach-bubble { background: rgba(255, 255, 255, .95); color: #2a1660; padding: 10px 18px; border-radius: 18px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); max-width: 90%; text-align: center; }
.coach-bubble::before { content: "🐤 "; }
.pl-kb { flex: none; height: clamp(130px, 34vh, 290px); padding-bottom: var(--safe-b); background: #07040f; box-shadow: 0 -10px 30px rgba(0, 0, 0, .5); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* praise popup */
.praise { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-weight: 900; font-size: clamp(1.6rem, 5vw, 2.6rem); color: var(--pc, var(--gold)); text-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 24px rgba(255, 209, 102, .6); pointer-events: none; white-space: nowrap; z-index: 20; animation: praise 1.4s cubic-bezier(.2, 1.4, .4, 1) forwards; }
body > .praise { position: fixed; }
.praise.big { font-size: clamp(2rem, 7vw, 3.6rem); background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 4px 12px rgba(255, 94, 168, .5)); }
@keyframes praise { 0% { transform: translate(-50%, -30%) scale(.4); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { transform: translate(-50%, -110%) scale(.95); opacity: 0; } }

/* toasts */
#toasts { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .96); color: #241450; padding: 11px 18px; border-radius: 16px; font-weight: 700; box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .6); animation: toastIn .45s cubic-bezier(.3, 1.5, .5, 1); }
.toast .ti { font-size: 1.4rem; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: all .35s; }
@keyframes toastIn { from { transform: translateY(-20px) scale(.9); opacity: 0; } }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 4, 22, .6); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal-wrap.in { opacity: 1; }
.modal { width: min(520px, 100%); max-height: 92dvh; overflow: auto; background: linear-gradient(160deg, #2c1868, #1a1040); border: 1px solid rgba(255, 255, 255, .18); border-radius: 28px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); transform: translateY(20px) scale(.96); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.modal.wide { width: min(760px, 100%); }
.modal-wrap.in .modal { transform: none; }
.song-setup h2, .result h2 { font-size: 1.6rem; }
.song-setup p { color: var(--muted); line-height: 1.5; }
.song-setup.center { text-align: center; }
.ss-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.ss-head .ss-art { width: 70px; height: 70px; font-size: 2.2rem; border-radius: 20px; }
.ss-head h2 { margin: 0; } .ss-head p { margin: 2px 0 0; }
.fact { background: rgba(255, 209, 102, .1); border-radius: 14px; padding: 10px 14px; color: #ffe8b0 !important; }
.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.mode-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 8px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); cursor: pointer; transition: all .15s; }
.mode-card span { font-size: 2rem; } .mode-card small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.mode-card.sel { border-color: var(--pink); background: rgba(255, 94, 168, .18); transform: translateY(-2px); }
.ss-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.ss-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.result { text-align: center; }
.result .ss-actions { justify-content: center; }
.big-stars { font-size: 4rem; letter-spacing: 6px; margin: 4px 0 8px; }
.big-stars .st { color: rgba(255, 255, 255, .15); display: inline-block; }
.big-stars .st.on { color: var(--gold); text-shadow: 0 0 24px rgba(255, 209, 102, .8); animation: starIn .6s var(--d) cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes starIn { from { transform: scale(0) rotate(-120deg); } }
.big-emoji { font-size: 4rem; animation: pop .6s cubic-bezier(.3, 1.8, .5, 1); }
.res-stats { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.res-stats > div { background: var(--card); border-radius: 16px; padding: 10px 16px; min-width: 90px; }
.res-stats b { display: block; font-size: 1.5rem; } .res-stats small { color: var(--muted); }
.newbest { color: var(--gold) !important; font-weight: 800; }

/* ---------- lessons ---------- */
.dots { display: flex; gap: 5px; margin-left: auto; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .15); transition: all .3s; }
.dots i.done { background: var(--mint); } .dots i.cur { background: var(--gold); transform: scale(1.4); }
.ls-coach { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 4px; flex: none; }
.pip { font-size: 2.6rem; animation: pipBob 2.4s ease-in-out infinite; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
@keyframes pipBob { 50% { transform: translateY(-5px) rotate(-6deg); } }
.ls-say { background: #fff; color: #2a1660; border-radius: 6px 22px 22px 22px; padding: 12px 18px; font-size: clamp(1rem, 2.5vw, 1.25rem); line-height: 1.45; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .6); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; max-width: 900px; }
.ls-say p { margin: 0; flex: 1; min-width: 200px; }
.ls-say b { color: #c2187a; }
.ls-say.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.ls-stage { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ls-extra { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; pointer-events: none; z-index: 4; }
.ls-extra > * { pointer-events: auto; }
.counter { display: flex; gap: 8px; }
.counter i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .3); transition: all .3s; }
.counter i.on { background: var(--mint); border-color: var(--mint); transform: scale(1.15); box-shadow: 0 0 14px var(--mint); }
.quiz { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding: 0 10px; }
.quiz .btn { font-size: 1.1rem; padding: 14px 22px; }
.quiz .right { background: var(--mint); color: #053; } .quiz .wrong { background: var(--red); animation: keyShake .3s; }
.chord-meter { background: rgba(0, 0, 0, .4); padding: 10px 18px; border-radius: 16px; font-weight: 800; font-size: 1.2rem; }
.chord-meter span { opacity: .4; } .chord-meter span.on { opacity: 1; color: var(--mint); }
.path { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; max-width: 620px; }
.path-node { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); color: var(--text); animation: cardIn .45s calc(var(--i) * 45ms) both; transition: transform .2s; margin-left: calc(sin(var(--i) * 0.9rad) * 40px + 40px); }
.path-node:hover { transform: translateX(6px); }
.path-node.done { background: rgba(6, 214, 160, .12); border-color: rgba(6, 214, 160, .4); }
.path-node.next { background: linear-gradient(120deg, rgba(255, 94, 168, .35), rgba(123, 92, 255, .35)); border-color: rgba(255, 255, 255, .35); box-shadow: 0 0 0 4px rgba(255, 94, 168, .2); animation: cardIn .45s calc(var(--i) * 45ms) both, nextPulse 2s 1s infinite; }
@keyframes nextPulse { 50% { box-shadow: 0 0 0 9px rgba(255, 94, 168, .08); } }
.pn-icon { font-size: 1.8rem; width: 52px; height: 52px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border-radius: 50%; flex: none; }
.pn-text b { display: block; } .pn-text small { color: var(--muted); }

/* ---------- songs ---------- */
.song-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 8px; }
.lvl-head { grid-column: 1 / -1; margin: 16px 0 2px; font-size: 1.05rem; color: var(--muted); }
.song-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--text); transition: transform .15s, background .2s; animation: cardIn .4s calc(var(--i) * 30ms) both; }
.song-card:hover { background: var(--card2); transform: translateY(-2px); }
.sc-main { flex: 1; min-width: 0; } .sc-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sc-main small { color: var(--muted); }
.sc-stars { color: rgba(255, 255, 255, .2); letter-spacing: 1px; } .sc-stars.has { color: var(--gold); }
.empty { color: var(--muted); text-align: center; grid-column: 1 / -1; padding: 30px; }

/* ---------- games ---------- */
.g-score { font-weight: 700; margin-left: auto; background: var(--card2); padding: 6px 14px; border-radius: 999px; } .g-score b { color: var(--gold); font-size: 1.2rem; }
.g-stage { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.g-center { text-align: center; } .g-center.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.g-center small { color: var(--muted); font-size: 1rem; display: block; margin-top: 6px; }
.g-note { font-size: clamp(5rem, 22vh, 10rem); font-weight: 900; line-height: 1; color: var(--nc); text-shadow: 0 0 40px var(--nc), 0 8px 0 rgba(0, 0, 0, .2); }
.g-big { font-size: clamp(2rem, 7vh, 3.4rem); font-weight: 900; }
.g-staff { width: min(560px, 92%); height: clamp(120px, 26vh, 200px); background: rgba(255, 255, 255, .05); border-radius: 18px; }
.g-timer { position: absolute; left: 16px; right: 16px; bottom: 10px; height: 8px; background: rgba(255, 255, 255, .1); border-radius: 8px; overflow: hidden; }
.g-timer div { height: 100%; background: linear-gradient(90deg, var(--mint), var(--cyan)); border-radius: 8px; }
.g-timer div.low { background: linear-gradient(90deg, var(--red), var(--gold)); }

/* ---------- freestyle ---------- */
.free-top { padding-right: 6px; }
.chips.inst { margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1; }
.chips.inst .chip span { margin-left: 6px; }
.free-bar { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; padding: 8px 12px; background: rgba(10, 6, 24, .4); border-bottom: 1px solid var(--line); flex: none; }
.free-bar .grp { display: flex; gap: 6px; align-items: center; }
.oct-lbl { min-width: 74px; text-align: center; font-weight: 800; font-size: .9rem; }
.beat-grp input[type=range] { width: 90px; accent-color: var(--pink); }
.bpm-lbl { font-weight: 700; font-size: .85rem; color: var(--muted); min-width: 28px; }
.free-vis { position: relative; flex: 1; min-height: 60px; }
.free-vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chord-pop { position: absolute; top: 14%; left: 50%; transform: translateX(-50%) scale(.8); text-align: center; opacity: 0; transition: all .25s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.chord-pop.show { opacity: 1; transform: translateX(-50%) scale(1); }
.chord-pop b { display: block; font-size: clamp(2.4rem, 9vh, 4.5rem); font-weight: 900; background: linear-gradient(90deg, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chord-pop small { color: var(--muted); font-size: 1.1rem; font-weight: 700; }
.beat-dot { position: absolute; top: 12px; right: 14px; width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.beat-dot.pulse { animation: beatPulse .3s; } .beat-dot.pulse.one { background: var(--pink); }
@keyframes beatPulse { from { background: var(--gold); transform: scale(1.7); box-shadow: 0 0 20px var(--gold); } }
.free-kbs { flex: none; height: clamp(150px, 40vh, 340px); display: flex; flex-direction: column; gap: 6px; background: #07040f; padding-bottom: var(--safe-b); }
.free-kbs.two { height: clamp(220px, 58vh, 520px); }
.free-kb { flex: 1; min-height: 0; }
.rec-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.rec-item { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 8px 10px; }
.rec-item > div { flex: 1; } .rec-item small { display: block; color: var(--muted); }

/* ---------- piano wall ---------- */
.wall-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin: 10px 0 16px; }
.phones { display: flex; gap: 6px; transform: rotate(-4deg); }
.ph { width: 70px; height: 120px; border-radius: 14px; border: 3px solid rgba(255, 255, 255, .7); background: linear-gradient(180deg, hsl(var(--h) 80% 60% / .4), rgba(0, 0, 0, .3)); display: grid; place-items: center; font-weight: 900; font-size: 1.6rem; position: relative; overflow: hidden; animation: phoneIn .6s calc(var(--h) * 2ms) cubic-bezier(.3, 1.5, .5, 1) both; }
.ph::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background: repeating-linear-gradient(90deg, #fff 0 13px, #222 13px 14px); }
@keyframes phoneIn { from { transform: translateY(40px) rotate(10deg); opacity: 0; } }
.wall-hero .lead { flex: 1; min-width: 260px; }
.tile.join { cursor: default; } .tile.join input { width: 100%; font-size: 1.6rem; text-align: center; letter-spacing: .3em; text-transform: uppercase; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin: 6px 0; font-weight: 900; }
.hint-line { color: var(--muted); }
.wall { --slot-hue: 280; background: #07040f; }
.wall-bar { display: flex; align-items: center; gap: 8px; padding: calc(4px + var(--safe-t)) 8px 4px; background: linear-gradient(90deg, hsl(var(--slot-hue) 70% 30%), #120a2a); flex: none; font-size: .9rem; }
.wall-bar .icon-btn { height: 34px; min-width: 34px; border-radius: 10px; font-size: .95rem; }
.wb-num { font-size: 1.3rem; font-weight: 900; } .wb-code b { letter-spacing: .15em; color: var(--gold); }
.wb-range, .wb-peers { color: var(--muted); font-weight: 700; }
.wall-kb { flex: 1; min-height: 0; padding-bottom: var(--safe-b); }
.wall-edge { position: absolute; top: 50px; z-index: 6; font-weight: 800; color: rgba(255, 255, 255, .5); font-size: .8rem; pointer-events: none; }
.wall-edge.l { left: 8px; } .wall-edge.r { right: 8px; }
.wall-big { position: fixed; inset: 0; display: grid; place-items: center; font-size: 40vh; font-weight: 900; color: hsl(var(--slot-hue) 90% 70%); pointer-events: none; opacity: 0; z-index: 30; text-shadow: 0 0 60px hsl(var(--slot-hue) 90% 50%); }
.wall-big.show { animation: bigNum 1.8s ease forwards; }
@keyframes bigNum { 0% { opacity: 0; transform: scale(.5); } 20% { opacity: 1; transform: scale(1.05); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.2); } }
.qr-box { width: min(260px, 70vw); margin: 10px auto; background: #fff; padding: 8px; border-radius: 18px; box-shadow: 0 10px 40px -10px rgba(76, 201, 240, .6); }
.qr-box svg { display: block; width: 100%; height: auto; }
.room-code { font-size: 3rem; font-weight: 900; letter-spacing: .25em; color: var(--gold); text-align: center; text-shadow: 0 0 24px rgba(255, 209, 102, .5); }
.room-code.inline { display: inline; font-size: 1.4em; }

/* ---------- TV stage ---------- */
.stage { background: radial-gradient(1000px 600px at 50% 120%, rgba(123, 92, 255, .35), transparent), #07040f; }
.stage-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; background: rgba(255, 255, 255, .04); border-bottom: 1px solid var(--line); flex: none; }
.st-brand { font-weight: 900; font-size: 1.4rem; } .st-brand span { color: var(--pink); }
.st-code { font-weight: 700; color: var(--muted); } .st-code b { color: var(--gold); font-size: 1.5rem; letter-spacing: .15em; }
.st-devs { display: flex; gap: 6px; color: var(--muted); flex-wrap: wrap; }
.dev { background: hsl(var(--h) 70% 40% / .5); border: 1px solid hsl(var(--h) 70% 60% / .7); padding: 4px 10px; border-radius: 999px; font-weight: 800; color: #fff; }
.dev small { font-weight: 600; opacity: .8; }
.stage-main { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stage-main .pl-lane-wrap { background: transparent; }
.stage-welcome { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 40px; padding: 30px; z-index: 3; transition: all .5s; }
.stage-welcome h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); }
.stage-welcome p { color: var(--muted); font-size: 1.2rem; }
.stage-welcome .qr-box.big { width: min(300px, 32vh); margin: 0; flex: none; }
.stage-welcome.mini { inset: auto 14px auto auto; top: 10px; padding: 0; gap: 0; opacity: .9; }
.stage-welcome.mini > div:not(.qr-box) { display: none; }
.stage-welcome.mini .qr-box.big { width: 110px; padding: 5px; border-radius: 12px; }
.stage-kb { height: clamp(140px, 30vh, 320px); }
.song-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 46vh; overflow: auto; margin: 12px 0; }
.song-pick button { text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.song-pick button:hover { background: var(--card2); } .song-pick small { color: var(--gold); }
.cast-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cast-ways > div { background: var(--card); padding: 14px; border-radius: 16px; } .cast-ways p { margin: 6px 0 0; font-size: .92rem; }

/* ---------- welcome ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.wl-card { width: min(640px, 100%); text-align: center; animation: pop .5s cubic-bezier(.3, 1.4, .5, 1); }
.wl-card h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.wl-logo { font-size: 3rem; margin-bottom: 12px; animation: pipBob 3s ease-in-out infinite; }
.wl-keys { display: flex; justify-content: center; margin: 22px auto 26px; height: 120px; max-width: 520px; }
.wl-keys i { flex: 1; background: #fff; margin: 0 1.5px; border-radius: 0 0 9px 9px; cursor: pointer; animation: keyWave 2.8s var(--d) ease-in-out infinite; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .08); }
.wl-keys i.down { background: var(--pink); }
@keyframes keyWave { 0%, 70%, 100% { transform: none; background: #fff; } 80% { transform: translateY(5px); background: #ffd6ec; } }
.wl-dots { display: flex; gap: 8px; margin-top: 28px; } .wl-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .2); } .wl-dots i.on { background: var(--pink); width: 24px; border-radius: 9px; }
.big-input { width: 100%; max-width: 420px; font-size: 1.6rem; text-align: center; padding: 14px; border-radius: 18px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); margin: 10px 0 18px; font-weight: 700; }
.big-input:focus { outline: none; border-color: var(--pink); }
.shake { animation: keyShake .25s 2; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 480px; margin: 0 auto 22px; }
.avatars button { font-size: 1.8rem; width: 54px; height: 54px; border-radius: 16px; border: 2px solid transparent; background: var(--card); cursor: pointer; transition: transform .15s; }
.avatars button.sel { border-color: var(--pink); background: rgba(255, 94, 168, .2); transform: scale(1.12); }
.choice { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 24px; }
.choice.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.choice button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; text-align: left; align-items: center; padding: 14px 18px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); cursor: pointer; transition: all .15s; }
.choice button span { grid-row: span 2; font-size: 2rem; } .choice button small { color: var(--muted); }
.choice.row button { grid-template-columns: 1fr; text-align: center; min-width: 120px; } .choice.row button span { grid-row: auto; }
.choice button.sel { border-color: var(--pink); background: rgba(255, 94, 168, .16); }
.who { margin-top: 26px; } .who p { color: var(--muted); }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.prof { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.prof span { font-size: 2.2rem; } .prof small { color: var(--muted); font-size: .78rem; text-align: center; }
.prof.sel { border-color: var(--pink); }

/* ---------- settings ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.card h3 + .set-row { border-top: 0; }
.set-row small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 30px; background: rgba(255, 255, 255, .15); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3, 1.5, .5, 1); }
.switch:checked { background: var(--mint); } .switch:checked::after { transform: translateX(20px); }
.set-row input[type=range] { accent-color: var(--pink); width: 160px; }
.meter { height: 6px; width: 160px; background: rgba(255, 255, 255, .1); border-radius: 6px; margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--mint); transition: width .08s; }

/* rotate hint for phones in portrait on keyboard screens */
.rotate-hint { display: none; position: fixed; inset: 0; z-index: 60; place-items: center; padding: 24px; background: rgba(10, 6, 30, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: rhIn .35s .25s both; }
.rh-card { max-width: 320px; text-align: center; background: linear-gradient(160deg, #2d1b69, #1b1446); border: 1px solid rgba(255, 255, 255, .14); border-radius: 26px; padding: 26px 22px 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.rh-card b { display: block; font-size: 1.25rem; margin-top: 4px; }
.rh-card p { margin: 8px 0 6px; color: var(--muted, #c9c3e6); }
.rh-card small { display: block; opacity: .65; font-size: .78rem; margin-bottom: 14px; }
.rh-card small b { display: inline; font-size: inherit; margin: 0; }
.rh-phone { width: 46px; height: 78px; margin: 4px auto 14px; border: 4px solid #fff; border-radius: 12px; position: relative; animation: rhTurn 2.4s ease-in-out infinite; box-shadow: 0 0 24px rgba(255, 92, 168, .45); }
.rh-phone i { position: absolute; left: 4px; right: 4px; bottom: 6px; height: 22px; border-radius: 3px; background: repeating-linear-gradient(90deg, #fff 0 5px, #ff5ca8 5px 6px); }
@keyframes rhTurn { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@keyframes rhIn { from { opacity: 0; } to { opacity: 1; } }
@media (orientation: portrait) and (max-width: 600px) { body.wants-landscape:not(.rotate-ok) .rotate-hint { display: grid; } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; } .stat.lvl { grid-column: span 2; }
  .tiles.main { grid-template-columns: 1fr 1fr; } .tile { min-height: 120px; padding: 16px; }
  .conn-row { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .tiles.two, .cast-ways { grid-template-columns: 1fr; }
  .pl-title small { display: none; }
  .chips.inst .chip span { display: none; }
  .stage-welcome { flex-direction: column; text-align: center; gap: 16px; }
  .path-node { margin-left: 0; }
}
@media (max-height: 500px) {
  .pl-top { padding-top: 4px; padding-bottom: 4px; } .icon-btn { height: 34px; min-width: 34px; }
  .pl-kb { height: 44vh; } .pl-staff { height: 80px; }
  .ls-coach { padding: 6px 10px 0; } .pip { font-size: 1.8rem; } .ls-say { padding: 8px 14px; font-size: .95rem; }
  .free-bar { padding: 4px 10px; } .free-kbs { height: 48vh; } .free-kbs.two { height: 66vh; }
  .g-note { font-size: 22vh; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
body.wants-landscape { overflow: hidden; }
.wall { position: relative; }

/* ---------- Pip's practice plan (home) ---------- */
.plan-card { margin-bottom: 16px; padding: 16px 18px 10px; border-radius: 24px; background: linear-gradient(135deg, rgba(255, 209, 102, .22), rgba(255, 94, 168, .22) 55%, rgba(123, 92, 255, .25)); border: 1px solid rgba(255, 255, 255, .2); animation: cardIn .5s calc(var(--i, 0) * 50ms) both; }
.pc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pc-head > div { flex: 1; min-width: 0; }
.pc-head small { color: #ffe7b0; font-weight: 700; }
.pc-head b { display: block; font-size: 1.3rem; }
.pc-pip { font-size: 2.2rem; animation: pipBob 2.4s ease-in-out infinite; }
@keyframes pipBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
.pc-items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.pc-items li { min-width: 0; }
.pc-items a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 16px; color: var(--text); background: rgba(10, 6, 30, .28); transition: background .2s, transform .15s; }
.pc-items a:hover { background: rgba(10, 6, 30, .45); transform: translateX(2px); }
.pc-items li.cur a { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px rgba(255, 209, 102, .7); }
.pc-items li.done a { opacity: .6; }
.pc-items li.done b { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .5); }
.pc-ic { font-size: 1.4rem; width: 1.8rem; text-align: center; }
.pc-items div { flex: 1; min-width: 0; }
.pc-items b { display: block; font-size: 1rem; }
.pc-items small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-items em { font-style: normal; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.plan-card.all-done { background: linear-gradient(135deg, rgba(6, 214, 160, .25), rgba(76, 201, 240, .22)); }
@media (max-width: 520px) { .pc-head .btn { padding: 8px 14px; } .pc-items em { display: none; } }

/* ---------- "Hear it" preview button ---------- */
.hear-btn { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; }
.hear-btn.on { background: linear-gradient(120deg, #06d6a0, #4cc9f0); color: #08121f; animation: hearPulse 1.2s ease-in-out infinite; }
@keyframes hearPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(76, 201, 240, .5); } 50% { box-shadow: 0 0 0 8px rgba(76, 201, 240, 0); } }
.ls-extra .hear-btn { margin: 6px auto; }

/* ---------- backing band chord label ---------- */
.pl-chord { position: absolute; top: 10px; right: 12px; z-index: 3; padding: 6px 14px; border-radius: 14px; font-weight: 800; font-size: 1.15rem; background: rgba(10, 6, 30, .55); border: 1px solid rgba(255, 255, 255, .18); color: #ffe7b0; pointer-events: none; }
.pl-chord::before { content: '🎸 '; font-size: .85em; }
.pl-chord.pop { animation: chordPop .35s ease-out; }
@keyframes chordPop { from { transform: scale(1.25); background: rgba(255, 209, 102, .45); } to { transform: scale(1); } }

.add-song { margin-right: 8px; white-space: nowrap; }
@media (max-width: 520px) { .add-song { padding: 6px 10px; font-size: .85rem; } }

/* ---------- family scoreboard + challenges ---------- */
.fam-board { margin: 6px 0 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .06); }
.fam-board h4 { margin: 0 0 6px; }
.fb-row { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.fb-row span { width: 1.6rem; text-align: center; }
.fb-row b { flex: 1; }
.fb-row em { font-style: normal; color: var(--gold); }
.fb-row i { font-style: normal; font-weight: 800; min-width: 3rem; text-align: right; }
.fb-row.me { background: rgba(255, 209, 102, .12); border-radius: 10px; }
.fam-line { margin: 6px 0; font-weight: 700; }
.fam-line.win { color: var(--mint); }
.fam-home { display: grid; gap: 8px; margin-bottom: 14px; }
.fam-ch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(120deg, rgba(255, 140, 66, .3), rgba(255, 94, 168, .3)); border: 1px solid rgba(255, 255, 255, .2); animation: cardIn .5s both; }
.fam-ch > span { font-size: 1.8rem; }
.fam-ch a { flex: 1; color: var(--text); }
.fam-ch small { display: block; color: #ffe0c8; font-weight: 600; }
.fam-ch b { display: block; font-size: 1.1rem; }
.fam-news { padding: 10px 14px; border-radius: 14px; background: rgba(6, 214, 160, .18); font-weight: 700; }

/* ---------- duet ---------- */
.duet-row { flex-direction: column; align-items: stretch; gap: 8px; }
.duet-who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.duet-who small { width: 100%; color: var(--muted); }
.duet-res { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.duet-res > div { display: grid; justify-items: center; gap: 2px; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, .07); border: 2px solid var(--c); }
.duet-res span { font-size: 1.8rem; } .duet-res small { color: var(--muted); }
.duet-res i { font-style: normal; font-size: 1.6rem; font-weight: 800; color: var(--c); }

/* ---------- recording ---------- */
.rec-pill { padding: 4px 10px; border-radius: 999px; background: #ff3b5c; color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .04em; animation: recBlink 1.2s steps(2, start) infinite; }
@keyframes recBlink { to { opacity: .45; } }
.btn.primary-alt { background: linear-gradient(120deg, #06d6a0, #4cc9f0); color: #08121f; }

/* ---------- sync ---------- */
.sync-code { font: 800 1.35rem ui-monospace, Consolas, monospace; letter-spacing: .08em; padding: 6px 12px; border-radius: 12px; background: rgba(255, 209, 102, .15); color: #ffe7b0; user-select: text; -webkit-user-select: text; }
.sync-in { width: 8.5em; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; margin-right: 6px; }

/* ---------- Song Maker ---------- */
.maker { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.mk-title { flex: 1 1 160px; min-width: 0; max-width: 340px; font-weight: 700; }
.mk-bar .seg button { padding: 6px 11px; }
.mk-lens button { display: flex; flex-direction: column; align-items: center; line-height: 1.05; min-width: 42px; }
.mk-lens button b { font-size: 1.15rem; } .mk-lens button small { font-size: .65rem; opacity: .75; }
.mk-bar input[type=range] { width: 110px; accent-color: var(--pink); }
.mk-strip { flex: 1; min-height: 70px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 12px; overflow-y: auto; }
.mk-empty { margin: auto; text-align: center; color: var(--muted); max-width: 46ch; line-height: 1.5; }
.mk-n { position: relative; min-width: calc(30px + var(--w) * 18px); height: 46px; padding: 0 8px; border-radius: 12px; border: 0; background: var(--nc); color: #1a1040; font-weight: 800; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.mk-n sub { font-size: .6em; } .mk-n small { font-size: .62rem; font-weight: 700; opacity: .65; }
.mk-n.rest { background: rgba(255, 255, 255, .12); color: var(--text); }
.mk-bl { width: 2px; height: 46px; background: rgba(255, 255, 255, .28); border-radius: 2px; margin: 0 3px; }
.mk-cur { width: 4px; height: 46px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: curBlink 1s steps(2) infinite; }
@keyframes curBlink { 50% { opacity: .25; } }
.add-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.add-grid .mode-card { color: inherit; font: inherit; }
.code-row { margin-top: 6px; } .code-in { width: 9.5em; text-transform: uppercase; letter-spacing: .15em; font-weight: 800; text-align: center; }
.song-setup textarea.txt, .song-setup .ti-title { width: 100%; margin: 6px 0; font-family: ui-monospace, Consolas, monospace; resize: vertical; }
.song-setup .ti-title { font-family: inherit; font-weight: 700; }
.room-code.song-code { font-size: 2.2rem; letter-spacing: .18em; }
.mine-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* ---------- Piano Guide ---------- */
.guide-kb { margin-bottom: 18px; height: clamp(150px, 26vh, 220px); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.guide-oct { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); margin: 8px 0; font-size: .9rem; }
.key-card { display: flex; gap: 14px; align-items: center; min-height: 132px; position: sticky; top: 8px; z-index: 6; background: linear-gradient(160deg, #2c1868, #1a1040); }
.kc-info { flex: 1; min-width: 0; } .kc-info h2 { margin: 0 0 4px; font-size: 2.2rem; } .kc-info h2 small { font-size: .5em; color: var(--muted); font-weight: 600; }
.kc-info h2 em { font-style: normal; font-size: .45em; background: rgba(255, 209, 102, .18); color: var(--gold); padding: 3px 10px; border-radius: 999px; vertical-align: middle; }
.kc-info p { margin: 4px 0; line-height: 1.45; } .kc-hint { color: var(--muted); font-size: 1.1rem; }
.kc-staff { width: 150px; height: 110px; flex: none; }
.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.word { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.word > span { font-size: 1.6rem; width: 1.4em; text-align: center; flex: none; } .word > div { flex: 1; } .word p { margin: 3px 0 0; color: var(--muted); line-height: 1.45; font-size: .93rem; }
.guide-link { margin-top: 10px; }
/* ---------- Freestyle jam tracks ---------- */
.key.safe::before { content: ""; position: absolute; left: 50%; bottom: 34%; width: clamp(6px, calc(var(--kw) * .26), 13px); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); pointer-events: none; }
.key.black.safe::before { bottom: 12%; }
.jam-chord { position: absolute; top: 10px; left: 14px; text-align: left; pointer-events: none; }
.jam-chord b { display: block; font-size: clamp(1.6rem, 6vh, 2.8rem); font-weight: 900; color: var(--mint); text-shadow: 0 0 18px rgba(6, 214, 160, .5); }
.jam-chord small { color: var(--muted); font-weight: 700; }
.jam-chord.pop b { animation: jamPop .3s ease-out; }
@keyframes jamPop { from { transform: scale(1.3); } to { transform: none; } }
.jam-grp select { max-width: 11.5em; }
@media (max-width: 720px) { .add-grid { grid-template-columns: 1fr; } .add-grid .mode-card { flex-direction: row; text-align: left; gap: 12px; } .kc-staff { width: 104px; height: 92px; } .kc-info h2 { font-size: 1.7rem; } }
.mk-note { vertical-align: -2px; }
