:root { --bg: #0b1024; --panel: #161d3a; --key: #d8deee; --keyd: #7b86a6; --ink: #121a33; --acc: #c7f0d8; --accd: #5f9a7e;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #070a18; overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--mono); font-weight: 700; color: #e6ecff; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; }

/* XP-Balken an der Oberkante */
.xp { position: fixed; top: 0; left: 0; right: 0; height: calc(5px + env(safe-area-inset-top)); background: #1a2246; z-index: 5; }
.xp i { position: absolute; left: 0; bottom: 0; top: 0; width: 0; background: linear-gradient(90deg, #2ee6a8, #22d3ee, #b15cff, #ff4d6d);
  box-shadow: 0 0 10px rgba(46, 230, 168, .6); transition: width .4s; }
.xp.up i { animation: xpup .8s ease-out 2; }
@keyframes xpup { 50% { filter: brightness(2); } }

.app { width: min(100vw, 520px); height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding: calc(13px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }

/* Kopf */
.top { display: flex; align-items: center; gap: 8px; flex: none; }
.title { flex: 1; min-width: 0; line-height: 1.15; }
.title b { display: block; font-size: 14px; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title small, .score small { font-size: 10px; opacity: .65; letter-spacing: .1em; white-space: nowrap; }
.score { text-align: right; line-height: 1.15; min-width: 64px; }
.score b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.score small { color: #ffd60a; opacity: 1; }
.ico { width: 22px; height: 22px; }

/* Plastik-Buttons */
.b { appearance: none; border: 0; height: 40px; min-width: 40px; padding: 0 8px; border-radius: 8px; background: var(--key); color: var(--ink); font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 3px 0 var(--keyd); transition: transform .04s, box-shadow .04s; }
.b.sm { padding: 0; font-size: 20px; }
.b:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--keyd); }
.b.on { background: #ff9dc0; box-shadow: 0 3px 0 #a84a6e; color: #5a1030; }
.b.play { width: 48px; background: var(--acc); box-shadow: 0 3px 0 var(--accd); }
.b.play.on { background: #ff9d8a; box-shadow: 0 3px 0 #b3503f; }
.tri { display: block; width: 14px; height: 14px; background: currentColor; clip-path: polygon(10% 0, 100% 50%, 10% 100%); }
.play.on .tri { clip-path: none; background: linear-gradient(to right, currentColor 0 36%, transparent 36% 64%, currentColor 64%); }

/* Bühne mit Lanes */
.stage { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 12px; overflow: hidden; background: #0b1024; box-shadow: inset 0 0 0 1px #1e2750; }
#lanes { position: absolute; inset: 0; display: block; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px;
  background: radial-gradient(ellipse at center, rgba(11,16,36,.78), rgba(11,16,36,.95)); }
.overlay[hidden] { display: none; }
.overlay h1 { margin: 0; font-size: 64px; letter-spacing: .08em; line-height: 1;
  background: linear-gradient(90deg, #ff4d6d, #ff9f1c, #2ee6a8, #22d3ee, #b15cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.overlay h2 { margin: 0; font-size: 28px; letter-spacing: .2em; }
.overlay .sub { margin: 0; font-size: 11px; letter-spacing: .3em; opacity: .7; }
.overlay .song { margin: 14px 0 4px; font-size: 15px; color: #ffd60a; letter-spacing: .06em; }
.overlay .how { max-width: 260px; font-size: 12px; font-weight: 400; line-height: 1.5; opacity: .75; margin: 6px 0 0; }
.b.go { height: 52px; padding: 0 28px; font-size: 18px; background: var(--acc); box-shadow: 0 4px 0 var(--accd); }

/* Meldungen (Level-up, Jam, …) */
.toast { position: absolute; left: 50%; top: 28%; transform: translate(-50%, -50%); pointer-events: none; text-align: center; white-space: nowrap;
  font-size: 18px; letter-spacing: .08em; color: #fff; text-shadow: 0 0 12px rgba(0,0,0,.9), 0 0 24px rgba(46,230,168,.5); opacity: 0; }
.toast.show { animation: toast 1.5s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }

/* Mute-Tasten in einer Reihe */
.keys { flex: none; height: clamp(64px, 11dvh, 92px); display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; touch-action: none; }
.key { --f: 0; appearance: none; border: 0; border-radius: 10px; padding: 0; cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 8px; gap: 2px;
  background: #161d3a; color: var(--c); box-shadow: 0 5px 0 #070a18, inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent);
  transition: transform .05s, box-shadow .05s, background .08s; }
.key b { font-size: clamp(8px, 2.5vw, 11px); letter-spacing: .02em; }
.key small { font-size: 8px; letter-spacing: .1em; opacity: .7; }
.key.on { background: var(--c); color: var(--ink); filter: brightness(calc(1 + var(--f) * .4));
  box-shadow: 0 5px 0 #070a18, 0 0 calc(6px + var(--f) * 20px) color-mix(in srgb, var(--c) 75%, transparent); }
.key.down { transform: translateY(3px); box-shadow: 0 2px 0 #070a18, inset 0 0 0 2px var(--c); }
.key.on.down { box-shadow: 0 2px 0 #070a18; }
.key.locked { --c: #3a4469; background: #0f1430; color: #4a5478; }
.key.locked::before { content: ''; position: absolute; top: 30%; left: 50%; width: 14px; height: 11px; margin-left: -7px; border-radius: 2px; background: #3a4469;
  box-shadow: 0 -6px 0 -3px #0f1430, 0 -8px 0 -2px #3a4469; }
.key.nope { animation: nope .3s; }
@keyframes nope { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* Menü */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(5, 8, 18, .6); }
.sheet-card { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; top: 12%; width: min(100vw, 520px); background: #121936; border-radius: 14px 14px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; box-shadow: 0 -6px 30px rgba(0,0,0,.5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; letter-spacing: .1em; }
.sheet-body { overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; }
.b.act { height: 50px; font-size: 14px; flex: none; }
.sheet h3 { font-size: 11px; letter-spacing: .14em; opacity: .75; margin: 12px 0 0; }
.fav { display: flex; gap: 8px; flex: none; }
.fav .b:first-child { flex: 1; height: 50px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 0 12px; }
.fav small { font-size: 10px; opacity: .7; }
.fav .b.sm { height: 50px; width: 50px; }
.help p { font-weight: 400; font-size: 13px; line-height: 1.5; color: #d5e6ff; margin: 8px 0; }
.help b { color: var(--acc); }
