/* tap-r Piano — modul-eigene Styles. Nutzt bewusst dieselben CSS-Variablen/Grundkomponenten wie
   /style.css (Farbpalette, Fonts, .btn/.row/.modal/.sessioncard, s. docs/STYLEGUIDE.md) — hier
   nur, was für Klaviatur/Übungsfluss/Statistik neu dazukommt. */

.pmain { max-width:1240px; margin:0 auto; padding:32px 28px 64px; display:flex; flex-direction:column; gap:22px; width:100%; }
.pview h2 { margin-bottom:14px; }

.phero { padding:4px 2px 6px; }
.phero h1 { font-size:28px; font-weight:600; letter-spacing:-.3px; margin-bottom:8px; }
.phero p { font-family:var(--font-ui); font-size:15px; color:var(--sub); max-width:56ch; line-height:1.5; }

.pcard { background:var(--bg2); border:1px solid var(--line); border-radius:12px; padding:18px 20px; }
.pcardlabel { font-size:11px; letter-spacing:.6px; text-transform:uppercase; color:var(--sub); font-weight:600; margin-bottom:10px; }
.prow { padding:8px 0; }
.prow select, .pAuthForm input { background:var(--bg); border:1px solid var(--line); color:var(--text);
  font-family:inherit; border-radius:8px; padding:6px 10px; }
.pnuminput { width:80px; text-align:right; }
input[type="range"] { accent-color:var(--main); width:140px; }
.btn.linklike { border:none; background:none; color:var(--sub); text-decoration:underline; padding:6px 0; display:block; margin:4px auto 0; }
.btn.linklike:hover { color:var(--main); }
#pHomeLink { color:var(--sub); text-decoration:none; font-size:13px; padding:7px 11px; }
#pHomeLink:hover { color:var(--main); }
.modalbox .onboardx { position:absolute; top:10px; right:12px; background:none; border:none; color:var(--sub); cursor:pointer; font-size:14px; }
.modalbox .onboardx:hover { color:var(--text); }
.modalbox { position:relative; }

/* ---------- Header: Level-/Streak-Chips ---------- */
.plevelchip { display:inline-flex; align-items:center; gap:7px; font-size:12px; color:var(--sub); padding:6px 10px; }
.plevelchip #pLevelNum { color:var(--text); font-weight:600; font-family:var(--font-mono); }
.plevelbar { width:52px; height:5px; border-radius:3px; background:var(--surface); overflow:hidden; display:inline-block; }
.plevelfill { display:block; height:100%; background:var(--main); transition:width .25s ease; }
.pstreakchip { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--warn); padding:6px 8px; }
.pstreakchip .navico { width:14px; height:14px; fill:var(--warn); stroke:none; }
@media (prefers-reduced-motion: reduce) { .plevelfill, .pxpfill, .psessioncard, .pgamecard { transition:none; } }

/* ---------- MIDI-Karte ---------- */
.pmidicard { display:flex; flex-direction:column; gap:8px; }
.pmidirow { display:flex; align-items:center; gap:12px; }
.pmidiicon { width:20px; height:20px; fill:none; stroke:var(--main); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.pmidistatus { flex:1 1 auto; font-family:var(--font-ui); font-size:13px; color:var(--text); }
.pmidirow select { background:var(--bg); border:1px solid var(--line); color:var(--text); font-family:inherit;
  font-size:13px; border-radius:8px; padding:6px 10px; flex:none; max-width:200px; }

/* ---------- Klaviatur ---------- */
.pkeyboardwrap { background:var(--bg2); border:1px solid var(--line); border-radius:12px; padding:14px; }
.pkeyboard { position:relative; height:clamp(150px, 22vw, 220px); background:var(--surface); border:1px solid var(--line);
  border-radius:8px; overflow:hidden; user-select:none; touch-action:none; }
.pkey { position:absolute; top:0; bottom:0; border:1px solid var(--line); border-radius:0 0 6px 6px;
  cursor:pointer; transition:background .08s, transform .08s; padding:0; }
.pkey-white { height:100%; z-index:1;
  background:linear-gradient(180deg, #F2ECDD 0%, #DDD5BF 88%, #CFC6AC 100%); }
[data-theme="light"] .pkey-white { background:linear-gradient(180deg, #FFFFFF 0%, #FBF9F2 90%, #EEE9D8 100%); }
.pkey-black { height:60%; z-index:2; border-radius:0 0 4px 4px;
  background:linear-gradient(180deg, #3A3D42 0%, #2A2C30 70%, #1C1D20 100%); border-color:#141516; }
.pkey-white:hover { background:color-mix(in srgb, var(--main) 16%, #DDD5BF); }
.pkey-black:hover { background:color-mix(in srgb, var(--main) 28%, #2A2C30); }
.pkey-down.pkey-white, .pkey:active.pkey-white { background:var(--main); transform:translateY(1px); }
.pkey-down.pkey-black, .pkey:active.pkey-black { background:var(--main-active, var(--main)); transform:translateY(1px); }
.pkey-expect { box-shadow:inset 0 0 0 3px var(--main); }
.pkey-correct { background:var(--correct) !important; }
.pkey-wrong { background:var(--error) !important; }
@media (prefers-reduced-motion: reduce) { .pkey { transition:none; } }

/* ---------- Dashboard ("Üben"-Ruhezustand) ---------- */
#pDashboard { display:flex; flex-direction:column; gap:22px; }
.pdashgrid { display:grid; grid-template-columns:repeat(4, 1fr); gap:16px; }
@media (max-width:980px) { .pdashgrid { grid-template-columns:1fr 1fr; } }
@media (max-width:640px) { .pdashgrid { grid-template-columns:1fr; } }
.pcoachcard p, .proadmapcard p { font-family:var(--font-ui); font-size:13px; line-height:1.5; color:var(--text); margin:0 0 6px; }
.pstreakrow { display:flex; align-items:center; gap:16px; margin-bottom:8px; }
.pstreaknum { display:flex; flex-direction:column; }
.pstreaknum b { font-size:26px; font-family:var(--font-mono); color:var(--main); }
.pstreaknum span { font-size:11px; color:var(--sub); }
.plevelinfo { flex:1 1 auto; display:flex; flex-direction:column; gap:5px; }
.plevelinfo span { font-size:12px; color:var(--sub); }
.pxpbar { height:6px; border-radius:3px; background:var(--surface); overflow:hidden; }
.pxpfill { display:block; height:100%; background:var(--main); transition:width .3s ease; }
.pbadgestrip { display:flex; flex-wrap:wrap; gap:6px; }
.pbadge { display:inline-block; padding:3px 9px; border-radius:999px; border:1px solid var(--line);
  font-size:11px; color:var(--sub); background:var(--surface); cursor:default; }
.proadmaprow { font-size:13px; margin-bottom:10px; }
.proadmaprow b { color:var(--text); }

.psessiongrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:12px; }
.psessioncard { position:relative; text-align:left; background:var(--bg2); border:1px solid var(--line); border-radius:12px;
  padding:16px; cursor:pointer; display:flex; flex-direction:column; gap:4px; font-family:inherit; color:var(--text);
  transition:border-color .12s, background .12s; }
.psessioncard:hover { border-color:var(--main); background:color-mix(in srgb, var(--main) 6%, var(--bg2)); }
.psessioncard b { font-size:14px; }
.psessioncard span { font-size:12px; color:var(--sub); }
.psessioncard.recommended { border-color:var(--main); }
.precommended { position:absolute; top:10px; right:10px; background:var(--main); color:var(--bg);
  font-size:10px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; padding:2px 7px; border-radius:999px; }
.precentlist { list-style:none; display:flex; flex-direction:column; gap:6px; }
.precentlist li { font-size:13px; color:var(--text); font-family:var(--font-ui); }

/* ---------- Übungsablauf (aktive Sitzung / Demo) ---------- */
#pSessionStage { display:flex; flex-direction:column; align-items:center; gap:10px; }
.pstage-wrap { text-align:center; width:100%; max-width:520px; margin:0 auto; }
.pdemobadge { display:inline-block; margin-bottom:10px; padding:3px 10px; border-radius:999px;
  background:color-mix(in srgb, var(--main) 16%, transparent); color:var(--main);
  font-size:11px; letter-spacing:.4px; text-transform:uppercase; font-weight:600; }
.pactions { display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; }
.btn.big { padding:12px 26px; font-size:15px; border-radius:10px; }
.pstage { display:flex; flex-direction:column; align-items:center; gap:10px; margin-top:6px; }
.pkindrow { display:flex; align-items:center; justify-content:center; gap:12px; position:relative; }
.pkind { font-size:12px; letter-spacing:1px; text-transform:uppercase; color:var(--sub); }
.pcountdown { font-family:var(--font-mono); font-variant-numeric:tabular-nums; font-size:13px; color:var(--sub); }
.pinstruction { font-size:28px; font-weight:600; font-family:var(--font-mono); font-variant-numeric:tabular-nums; transition:opacity .3s ease; }
body.large-notation .pinstruction { font-size:40px; }
body.notation-xlarge .pinstruction { font-size:54px; }
/* Screenreader bekommen unabhängig von der Offenlegungsstufe immer den vollen Notennamen (s.
   piano-app.js renderInstruction) — visuell reduziert, aber nie informationsärmer für AT. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ---------- Notenschrift (Stufe 3+, s. piano-notation.js) ---------- */
.pnotation-wrap { display:flex; justify-content:center; margin:6px 0 2px; }
.pnotation-wrap[hidden] { display:none; }
.pstaffline { stroke:var(--sub); stroke-width:1; }
.pclef { fill:var(--text); }
.pledger { stroke:var(--text); stroke-width:1.3; }
.psharp { fill:var(--main); font-family:var(--font-mono); }
.pnotehead { fill:var(--main); }
.pfeedback { min-height:22px; font-weight:600; }
.pfeedback.ok { color:var(--correct); }
.pfeedback.bad { color:var(--error); }
.pstreaklive { min-height:16px; font-size:12px; color:var(--main); font-weight:600; }

/* ---------- Arcade ---------- */
.pgamegrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:14px; }
.pgamecard { text-align:left; background:var(--bg2); border:1px solid var(--line); border-radius:12px;
  padding:18px; cursor:pointer; display:flex; flex-direction:column; gap:5px; font-family:inherit; color:var(--text);
  transition:border-color .12s, background .12s; }
.pgamecard:hover { border-color:var(--main); background:color-mix(in srgb, var(--main) 6%, var(--bg2)); }
.pgamecard b { font-size:15px; }
.pgamecard span { font-size:12px; color:var(--sub); }
.pgamebest { color:var(--main) !important; font-weight:600; }
.pgamehead { display:flex; justify-content:center; gap:20px; margin-bottom:14px; font-family:var(--font-mono); }
.pgamestat { font-size:14px; font-variant-numeric:tabular-nums; }
.pgameprompt { font-size:26px; font-weight:600; text-align:center; margin-bottom:14px; min-height:34px; }
.pgamechoices { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; max-width:420px; margin:12px auto 0; }
.pgameresultok { color:var(--correct); font-weight:600; }

/* ---------- Statistik ---------- */
.pstatnums { display:flex; gap:24px; flex-wrap:wrap; margin-bottom:6px; }
.pstatnum { display:flex; flex-direction:column; }
.pstatnum b { font-size:24px; font-family:var(--font-mono); }
.pstatnum span { color:var(--sub); font-size:12px; }
.pmastery { display:flex; flex-direction:column; gap:10px; margin-bottom:22px; }
.pmastery.compact { margin-bottom:0; gap:7px; }
.pmastery.compact .pmrow { grid-template-columns:1fr 1fr 34px; }
.pmrow { display:grid; grid-template-columns:140px 1fr 44px; align-items:center; gap:10px; }
.pmlabel { font-size:13px; color:var(--sub); }
.pmbar { height:8px; background:var(--surface); border-radius:4px; overflow:hidden; }
.pmfill { height:100%; background:var(--main); }
.pmpct { font-size:12px; text-align:right; font-variant-numeric:tabular-nums; }
.pchart { width:100%; height:auto; max-width:600px; display:block; margin-bottom:22px; }

.pweakgrid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:16px; margin-bottom:22px; }
.pweakcol h4 { font-size:12px; color:var(--sub); text-transform:uppercase; letter-spacing:.4px; margin-bottom:8px; font-weight:600; }
.pweakcol ul { list-style:none; display:flex; flex-direction:column; gap:4px; }
.pweakcol li { font-size:13px; font-family:var(--font-mono); }

.pcalendar { display:grid; grid-template-rows:repeat(7, 11px); grid-auto-flow:column; gap:3px; margin-bottom:22px; }
.pcalcell { width:11px; height:11px; border-radius:2px; background:var(--surface); }
.pcalcell.lvl1 { background:color-mix(in srgb, var(--main) 30%, var(--surface)); }
.pcalcell.lvl2 { background:color-mix(in srgb, var(--main) 55%, var(--surface)); }
.pcalcell.lvl3 { background:color-mix(in srgb, var(--main) 78%, var(--surface)); }
.pcalcell.lvl4 { background:var(--main); }

.pcoach p { font-family:var(--font-ui); font-size:13px; line-height:1.5; color:var(--text); margin:6px 0; }

/* ---------- Barrierefreiheit: hoher Kontrast ---------- */
body.high-contrast { --line:color-mix(in srgb, var(--text) 55%, var(--bg)); }
body.high-contrast .pkey { border-width:2px; }
body.high-contrast .pmbar, body.high-contrast .pxpbar, body.high-contrast .plevelbar { outline:1px solid var(--line); }

/* ---------- Barrierefreiheit: reduzierte Bewegung — App-Einstellung ZUSÄTZLICH zur
   OS-Media-Query oben, für alle, die kein OS-weites prefers-reduced-motion setzen können/wollen. */
body.reduce-motion, body.reduce-motion * { transition:none !important; animation:none !important; }

.pdevinfo { font-size:11px; background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:10px;
  white-space:pre-wrap; word-break:break-word; color:var(--sub); margin-top:8px; }

@media (max-width:640px) {
  .pmrow { grid-template-columns:100px 1fr 40px; }
  .pkeyboardwrap { padding:8px; }
  .pmidirow { flex-wrap:wrap; }
  .pmidirow select { max-width:100%; flex:1 1 100%; }
  .pgamechoices { grid-template-columns:repeat(2, 1fr); }
}
