:root {
  --bg: #0b1220;
  --panel: rgba(19, 34, 53, 0.74);
  --muted-panel: #24333f;
  --accent: #86b8cc;
  --accent-2: #b7d9e6;
  --text: #eef4f7;
  --muted: #b9c7cf;
  --good: #8ce99a;
  --bad: #ffc9c9;
  --yellow: #ffd43b;
  --green: #8ce99a;
  --purple: #d0bfff;
  --orange: #ffbe76;
  --line: rgba(255,255,255,0.08);
  --gold: #ffd86b;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(134,184,204,0.06), transparent 22%),
    radial-gradient(circle at 80% 30%, rgba(208,191,255,0.05), transparent 20%),
    radial-gradient(circle at 30% 80%, rgba(255,190,118,0.04), transparent 18%),
    linear-gradient(180deg, #0b1220 0%, #0e1627 100%);
  color: var(--text);
  font-family: "Avenir", "Helvetica", "Arial", sans-serif;
}

body {
  overflow: hidden;
}

.app {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.screen-active {
  display: block;
}

.screen-title {
  margin: 0;
  font-size: 2.4rem;
  text-align: center;
  text-shadow: 0 0 18px rgba(183, 217, 230, 0.08);
}

.screen-subtitle {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

.options-wrap {
  min-height: 100vh;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.option-card,
.stats-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  backdrop-filter: blur(8px);
}

.option-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.option-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.option-start-btn {
  margin-top: 8px;
}

.stats-card {
  padding: 16px;
  text-align: center;
}

.stats-title {
  font-weight: 800;
  margin-bottom: 8px;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.stats-item {
  text-align: center;
}

.stats-value {
  font-size: 1.6rem;
  font-weight: 900;
}

.stats-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.topbar {
  display: grid;
  grid-template-columns: 220px 1fr 420px;
  gap: 20px;
  align-items: start;
  padding: 18px 24px 0;
}

.top-center {
  display: grid;
  gap: 12px;
}

.training-top-buttons {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  align-items: center;
}

.primary-btn {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #9ac7d7 0%, #86b8cc 100%);
  color: #08131a;
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(134,184,204,0.18);
}

.secondary-top-btn {
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  background: rgba(36, 51, 63, 0.92);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
}

.play-note-btn {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffd09a 0%, #ffbe76 100%);
  color: #3c2200;
  font-size: 1rem;
  font-weight: 800;
  padding: 0 18px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255,190,118,0.14);
}

.primary-btn:hover,
.secondary-top-btn:hover,
.play-note-btn:hover,
.clef-btn:hover,
.difficulty-btn:hover,
.training-btn:hover,
.piano-hand-btn:hover,
.sound-btn:hover,
.piano-key:hover {
  filter: brightness(1.05);
}

.clef-row,
.difficulty-row,
.training-row,
.piano-hand-row,
.sound-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.clef-btn,
.difficulty-btn,
.training-btn,
.piano-hand-btn,
.sound-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: rgba(36, 51, 63, 0.94);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.clef-btn.active {
  background: var(--accent-2);
  color: #08131a;
  font-weight: 800;
}

.difficulty-btn.active {
  background: var(--yellow);
  color: #4d3a00;
  font-weight: 800;
}

.training-btn.active {
  background: var(--green);
  color: #15351d;
  font-weight: 800;
}

.piano-hand-btn.active {
  background: var(--purple);
  color: #2b1845;
  font-weight: 800;
}

.sound-btn.active {
  background: var(--orange);
  color: #3c2200;
  font-weight: 800;
}

.piano-hand-card {
  display: none;
}

.piano-hand-card.visible {
  display: grid;
}

.stats-right {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
}

.stat {
  text-align: center;
  min-width: 90px;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 4px;
}

.time-stat {
  min-width: 220px;
}

.progress-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #8ce99a 0%, #ffd43b 60%, #ff8787 100%);
  border-radius: 999px;
  transition: width 240ms linear;
}

.streak-chip-wrap {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffd8a8;
  background: rgba(255, 190, 118, 0.08);
  border: 1px solid rgba(255, 190, 118, 0.12);
  transition: all 180ms ease;
}

.streak-chip.combo-mid {
  color: #d8ffd8;
  border-color: rgba(140, 233, 154, 0.22);
  background: rgba(140, 233, 154, 0.08);
}

.streak-chip.combo-high {
  color: #ffe8a3;
  border-color: rgba(255, 216, 107, 0.26);
  background: rgba(255, 216, 107, 0.08);
  box-shadow: 0 0 16px rgba(255, 216, 107, 0.12);
}

.main-area {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: 10px 24px 0;
}

.feedback {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 1.35rem;
  font-weight: 700;
}

.feedback.neutral {
  background: transparent;
  color: var(--muted);
}

.feedback.good {
  background: rgba(47, 158, 68, 0.18);
  color: #b8f0c5;
}

.feedback.bad {
  background: rgba(201, 42, 42, 0.18);
  color: #ffc9c9;
}

.reward-banner {
  position: absolute;
  top: 95px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 64px;
  padding: 14px 28px;
  border-radius: 18px;
  font-size: 2.2rem;
  font-weight: 900;
  background: #ffd43b;
  color: #4d3a00;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  margin: 0;
  z-index: 30;
  pointer-events: none;
}

.reward-banner.hidden {
  display: none;
}

.reward-banner.show {
  display: inline-block;
}

.training-tools {
  display: flex;
  justify-content: center;
  width: 100%;
}

.staff-panel {
  width: min(95vw, 1500px);
  height: min(52vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: filter 160ms ease, transform 160ms ease;
}

.staff-panel.hit-flash {
  filter: drop-shadow(0 0 14px rgba(140, 233, 154, 0.24));
}

.staff-panel.hit-scale {
  transform: scale(1.01);
}

#staff-svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.03));
}

.staff-line,
.ledger-line {
  stroke: #f1f4f6;
  stroke-width: 3.2;
  stroke-linecap: round;
}

.notehead {
  fill: #f6f7f9;
}

.note-stem {
  stroke: #f6f7f9;
  stroke-width: 4;
  stroke-linecap: round;
}

.note-clef {
  fill: #f6f7f9;
  font-family: "Noto Music", "Bravura Text", "Segoe UI Symbol", "DejaVu Sans", serif;
  dominant-baseline: middle;
  text-anchor: middle;
}

.note-clef.fallback {
  font-family: "Avenir", "Helvetica", "Arial", sans-serif;
  font-weight: 800;
}

.hint {
  font-size: 1.2rem;
  color: var(--text);
  text-align: center;
}

.midi-status {
  font-size: 1rem;
  color: var(--muted);
}

.midi-status.ok {
  color: #8ce99a;
}

.midi-status.bad {
  color: #ffc9c9;
}

.bottom-area {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 20;
  padding: 8px 24px 24px;
}

.piano-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.piano-keyboard {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 14px 10px 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

.piano-key {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform 80ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.piano-key:active,
.piano-key.key-active {
  transform: translateY(2px);
}

.piano-key.white {
  width: 92px;
  height: 112px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #eaf5f9 0%, #cfe6ee 100%);
  color: #08131a;
  font-size: 1.95rem;
  box-shadow: 0 10px 20px rgba(183,217,230,0.12);
}

.piano-key.black {
  position: absolute;
  top: 14px;
  width: 56px;
  height: 68px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #2b3440 0%, #121922 100%);
  color: #eef4f7;
  font-size: 0.95rem;
  z-index: 5;
  box-shadow: 0 10px 18px rgba(0,0,0,0.28);
}

.black-cs { left: 72px; }
.black-ds { left: 170px; }
.black-fs { left: 366px; }
.black-gs { left: 464px; }
.black-as { left: 562px; }

@media (max-width: 1200px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .stats-right {
    justify-content: center;
  }

  .training-top-buttons {
    grid-template-columns: 1fr;
  }

  .primary-btn {
    font-size: 1.5rem;
  }

  .staff-panel {
    height: min(46vh, 460px);
  }

  .piano-key.white {
    width: 74px;
    height: 100px;
    font-size: 1.6rem;
  }

  .piano-key.black {
    width: 46px;
    height: 60px;
    font-size: 0.78rem;
  }

  .black-cs { left: 59px; }
  .black-ds { left: 139px; }
  .black-fs { left: 299px; }
  .black-gs { left: 379px; }
  .black-as { left: 459px; }
}

.round-mode-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.round-mode-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: rgba(36, 51, 63, 0.94);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.round-mode-btn.active {
  background: #9dd6a8;
  color: #102915;
  font-weight: 800;
}

.round-config {
  display: none;
  gap: 10px;
  margin-top: 4px;
}

.round-config.visible {
  display: grid;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.slider-label {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.slider-value {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--accent-2);
}

.round-slider {
  width: 100%;
  accent-color: #86b8cc;
  cursor: pointer;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.piano-key.black {
  width: 48px;
}

.black-cs { left: 76px; }
.black-ds { left: 174px; }
.black-fs { left: 370px; }
.black-gs { left: 468px; }
.black-as { left: 566px; }

@media (max-width: 1200px) {
  .piano-key.black {
    width: 40px;
  }

  .black-cs { left: 62px; }
  .black-ds { left: 142px; }
  .black-fs { left: 302px; }
  .black-gs { left: 382px; }
  .black-as { left: 462px; }
}


/* ===== Compact 1080p Layout Override ===== */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
}

.app {
  min-height: 100vh;
  height: 100vh;
}

.screen {
  height: 100vh;
  overflow: hidden;
}

#options-screen {
  overflow: hidden;
}

.options-wrap {
  box-sizing: border-box;
  width: min(1120px, calc(100vw - 48px));
  max-width: 1120px;
  height: 100vh;
  margin: 0 auto;
  padding: 18px 20px 16px;
  display: grid;
  grid-template-rows: auto auto auto repeat(6, auto) auto;
  gap: 10px;
  align-content: start;
}

.options-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 34px;
}

.options-topbar-spacer {
  flex: 1;
}

.exit-btn {
  min-width: 120px;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.screen-title {
  margin: 0;
  font-size: clamp(2.2rem, 3.4vw, 3.5rem);
  line-height: 1.04;
  text-align: center;
}

.screen-subtitle {
  margin: 0;
  font-size: 1.02rem;
  text-align: center;
  opacity: 0.95;
}

.stats-card,
.option-card {
  padding: 14px 18px;
  border-radius: 18px;
}

.stats-title,
.option-label {
  margin-bottom: 8px;
}

.stats-grid {
  gap: 8px;
}

.stats-value {
  font-size: 1.05rem;
}

.stats-label {
  font-size: 0.82rem;
}

.clef-row,
.difficulty-row,
.training-row,
.piano-hand-row,
.round-mode-row,
.sound-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.clef-btn,
.difficulty-btn,
.training-btn,
.piano-hand-btn,
.round-mode-btn,
.sound-btn {
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.96rem;
}

.round-config {
  margin-top: 2px;
  gap: 6px;
}

.slider-head {
  min-height: 24px;
}

.slider-label,
.slider-value {
  font-size: 0.92rem;
}

.round-slider {
  margin: 0;
}

.slider-scale {
  font-size: 0.78rem;
}

.options-footer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding-top: 4px;
  background: linear-gradient(to bottom, rgba(5,15,32,0), rgba(5,15,32,0.78) 35%, rgba(5,15,32,0.95) 100%);
}

.option-start-btn {
  width: 100%;
  min-height: 58px;
  font-size: 1.02rem;
  border-radius: 16px;
}

@media (max-height: 1080px) {
  .options-wrap {
    width: min(1080px, calc(100vw - 36px));
    padding: 12px 16px 12px;
    gap: 8px;
  }

  .screen-title {
    font-size: clamp(1.9rem, 2.8vw, 2.7rem);
  }

  .screen-subtitle {
    font-size: 0.95rem;
  }

  .stats-card,
  .option-card {
    padding: 11px 14px;
    border-radius: 16px;
  }

  .stats-title,
  .option-label {
    margin-bottom: 6px;
    font-size: 0.95rem;
  }

  .clef-btn,
  .difficulty-btn,
  .training-btn,
  .piano-hand-btn,
  .round-mode-btn,
  .sound-btn {
    padding: 7px 12px;
    font-size: 0.92rem;
  }

  .option-start-btn {
    min-height: 52px;
    font-size: 0.98rem;
  }
}

@media (max-height: 980px) {
  .options-wrap {
    gap: 6px;
    padding: 10px 14px 10px;
  }

  .screen-title {
    font-size: 1.7rem;
  }

  .screen-subtitle {
    font-size: 0.88rem;
  }

  .stats-card,
  .option-card {
    padding: 9px 12px;
    border-radius: 14px;
  }

  .stats-title,
  .option-label {
    margin-bottom: 4px;
    font-size: 0.9rem;
  }

  .clef-btn,
  .difficulty-btn,
  .training-btn,
  .piano-hand-btn,
  .round-mode-btn,
  .sound-btn {
    padding: 6px 10px;
    font-size: 0.88rem;
  }

  .slider-label,
  .slider-value,
  .slider-scale {
    font-size: 0.75rem;
  }

  .option-start-btn {
    min-height: 48px;
  }
}
/* ===== End Compact 1080p Layout Override ===== */



/* ===== Akkordmodus ===== */
.task-type-row,
.chord-family-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.task-type-btn,
.chord-family-btn {
  border: 0;
  border-radius: 12px;
  padding: 8px 14px;
  background: rgba(36, 51, 63, 0.94);
  color: var(--text);
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.task-type-btn.active,
.chord-family-btn.active {
  background: #9fd8ee;
  color: #102531;
  font-weight: 800;
}

.chord-family-card {
  display: none;
}

.chord-family-card.visible {
  display: block;
}

.tiny-help {
  margin-top: 8px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.disabled-card {
  opacity: 0.62;
}

.chord-input-hint {
  margin: 6px auto 0;
  text-align: center;
  font-size: 0.95rem;
  color: #b5d7e6;
}

.hidden {
  display: none !important;
}
/* ===== Ende Akkordmodus ===== */


/* ---- Fix Klickproblem Akkordmodus ---- */

.options-wrap {
  position: relative;
  z-index: 5;
}

.options-footer {
  pointer-events: none;
}

.options-footer .option-start-btn {
  pointer-events: auto;
}

.option-card,
.stats-card,
.round-config,
.round-mode-row,
.clef-row,
.training-row,
.sound-row {
  position: relative;
  z-index: 6;
}

/* verhindert unsichtbares overlay */
#options-screen::before,
#options-screen::after {
  pointer-events: none;
}


/* ---- Augenschonender Notenmodus ---- */

body {
  background: radial-gradient(circle at 50% 40%, #0b1c32 0%, #071424 55%, #040c17 100%);
}

.staff-panel svg line,
.staff-panel svg path,
.staff-panel svg circle,
.staff-panel svg ellipse {
  stroke: #d6dde4 !important;
  fill: #d6dde4 !important;
}

.staff-panel {
  filter: brightness(0.95) contrast(0.92);
}

.feedback.good {
  background: rgba(70, 170, 120, 0.25);
}

.feedback.bad {
  background: rgba(200, 90, 90, 0.25);
}

/* weniger grelle Piano-Tasten */
.piano-key.white {
  background: linear-gradient(#eef3f6, #dfe6ec);
}

.piano-key.black {
  background: linear-gradient(#1a2129, #0f151b);
}


/* ===== v11.1 Großer vertikaler Motivationsberg ===== */

.time-stat .mountain-progress,
.streak-chip-wrap .mountain-progress {
  display: none !important;
}

.summit-mountain-panel {
  position: fixed;
  top: 164px;
  right: 28px;
  z-index: 12;
  width: 188px;
  pointer-events: none;
}

.summit-mountain-card {
  border-radius: 24px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, rgba(18,34,56,0.92), rgba(9,20,35,0.90));
  box-shadow: 0 16px 40px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
}

.summit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.summit-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: rgba(240,245,249,0.96);
}

.summit-counter {
  font-size: 1rem;
  font-weight: 900;
  color: rgba(228,239,186,0.98);
}

.summit-scene {
  position: relative;
  height: 330px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(114,149,186,0.18), rgba(19,33,50,0.10) 28%, rgba(10,19,31,0.22) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.summit-sky-glow {
  position: absolute;
  inset: 10px 10px auto 10px;
  height: 110px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 10%, rgba(223,240,255,0.18), rgba(223,240,255,0.02) 66%, transparent 70%);
}

.summit-peak-shape {
  position: absolute;
  inset: 34px 14px 18px 14px;
  background: linear-gradient(180deg, rgba(92,108,124,0.96), rgba(57,67,79,0.98));
  clip-path: polygon(52% 2%, 79% 26%, 98% 100%, 2% 100%, 20% 58%, 34% 42%);
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.18));
}

.summit-base {
  position: absolute;
  left: 26px;
  bottom: 22px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(170, 218, 161, 0.98);
  box-shadow: 0 0 12px rgba(170, 218, 161, 0.35);
}

.summit-checkpoint {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(217,225,232,0.34);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.summit-checkpoint.active {
  background: rgba(235, 242, 171, 0.98);
  box-shadow: 0 0 12px rgba(235, 242, 171, 0.42);
  transform: scale(1.12);
}

.summit-checkpoint.step-1 { left: 34px; bottom: 52px; }
.summit-checkpoint.step-2 { left: 48px; bottom: 84px; }
.summit-checkpoint.step-3 { left: 61px; bottom: 114px; }
.summit-checkpoint.step-4 { left: 75px; bottom: 144px; }
.summit-checkpoint.step-5 { left: 88px; bottom: 174px; }
.summit-checkpoint.step-6 { left: 101px; bottom: 202px; }
.summit-checkpoint.step-7 { left: 113px; bottom: 228px; }
.summit-checkpoint.step-8 { left: 123px; bottom: 252px; }
.summit-checkpoint.step-9 { left: 132px; bottom: 274px; }
.summit-checkpoint.step-10 { left: 139px; bottom: 298px; }

.summit-climber {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: rgba(255,255,255,0.98);
  font-size: 16px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(255,255,255,0.28);
  transition: transform 220ms ease;
  transform: translate(26px, 292px);
}

.summit-flag {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 1.65rem;
  color: rgba(238,244,248,0.84);
  text-shadow: 0 0 10px rgba(255,255,255,0.08);
  transition: transform 220ms ease, color 220ms ease, text-shadow 220ms ease;
}

.summit-flag.active,
.summit-reached .summit-flag {
  color: rgba(255, 228, 132, 0.98);
  text-shadow: 0 0 16px rgba(255, 228, 132, 0.45);
  transform: scale(1.12) rotate(-6deg);
}

.summit-caption {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(208,220,230,0.78);
}

@media (max-width: 1600px) {
  .summit-mountain-panel {
    right: 14px;
    width: 172px;
  }

  .summit-scene {
    height: 300px;
  }
}

@media (max-width: 1366px), (max-height: 900px) {
  .summit-mountain-panel {
    top: 146px;
    right: 10px;
    width: 154px;
  }

  .summit-mountain-card {
    padding: 12px 12px 10px;
    border-radius: 20px;
  }

  .summit-title {
    font-size: 0.9rem;
  }

  .summit-counter {
    font-size: 0.92rem;
  }

  .summit-scene {
    height: 258px;
    border-radius: 18px;
  }

  .summit-checkpoint.step-1 { left: 27px; bottom: 40px; }
  .summit-checkpoint.step-2 { left: 38px; bottom: 64px; }
  .summit-checkpoint.step-3 { left: 48px; bottom: 88px; }
  .summit-checkpoint.step-4 { left: 58px; bottom: 111px; }
  .summit-checkpoint.step-5 { left: 68px; bottom: 134px; }
  .summit-checkpoint.step-6 { left: 78px; bottom: 156px; }
  .summit-checkpoint.step-7 { left: 87px; bottom: 177px; }
  .summit-checkpoint.step-8 { left: 95px; bottom: 197px; }
  .summit-checkpoint.step-9 { left: 103px; bottom: 216px; }
  .summit-checkpoint.step-10 { left: 109px; bottom: 234px; }

  .summit-base { left: 20px; bottom: 18px; }
  .summit-flag { top: 14px; right: 14px; font-size: 1.45rem; }
}

/* ===== Ende v11.1 Großer vertikaler Motivationsberg ===== */


/* ===== Expedition Himalaya v11.2 ===== */

#mountain-progress,
.mountain-progress,
[id*="motivation"][id*="berg"],
[class*="motivation"][class*="berg"] {
  display: none !important;
}

.expedition-himalaya {
  position: fixed;
  right: clamp(16px, 2vw, 28px);
  top: 180px;
  z-index: 18;
  width: min(230px, 18vw);
  pointer-events: none;
}

.expedition-card {
  pointer-events: none;
  position: relative;
  overflow: hidden;
  padding: 16px 14px 14px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(18,34,58,0.96), rgba(7,20,38,0.93));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 14px 30px rgba(0,0,0,0.18);
}

.expedition-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(190, 212, 228, 0.82);
}

.expedition-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.expedition-title {
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.05;
  color: rgba(245,248,252,0.98);
}

.expedition-stage-badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(240,245,250,0.92);
  font-size: 0.76rem;
  font-weight: 800;
}

.expedition-stage-name {
  margin-top: 10px;
  font-size: 1.02rem;
  font-weight: 900;
  color: rgba(245, 227, 160, 0.96);
}

.expedition-meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.expedition-meta > div {
  display: grid;
  gap: 2px;
}

.expedition-meta-label,
.expedition-progress-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(188, 205, 220, 0.74);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.expedition-meta span:last-child,
.expedition-progress-value {
  font-size: 0.92rem;
  font-weight: 900;
  color: rgba(244,248,251,0.96);
}

.expedition-mountain-wrap {
  position: relative;
  margin-top: 14px;
  height: 340px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(74,105,145,0.26), rgba(9,20,36,0.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  overflow: hidden;
}

.expedition-sky-glow {
  position: absolute;
  top: -4%;
  left: 8%;
  width: 84%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236,244,255,0.18), rgba(236,244,255,0.02) 65%, transparent 72%);
}

.expedition-mountain-shape {
  position: absolute;
  left: 18%;
  bottom: 12px;
  width: 68%;
  height: 84%;
  background: linear-gradient(180deg, rgba(189,198,210,0.52), rgba(115,127,143,0.40));
  clip-path: polygon(8% 100%, 28% 63%, 47% 51%, 71% 14%, 93% 100%);
  filter: drop-shadow(0 10px 12px rgba(0,0,0,0.16));
}

.expedition-path {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
}

.expedition-dot {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  left: calc(18% + (var(--step) * 6.65%));
  bottom: calc(10% + (var(--step) * 7.9%));
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.expedition-dot.active {
  background: rgba(235, 241, 173, 0.96);
  box-shadow: 0 0 9px rgba(235,241,173,0.35);
  transform: scale(1.06);
}

.expedition-climber {
  position: absolute;
  transform: translate(-50%, 50%);
  font-size: 20px;
  line-height: 1;
  color: rgba(225,255,200,0.95);
  text-shadow: 0 0 10px rgba(225,255,200,0.24);
  transition: left 260ms ease, bottom 260ms ease, transform 260ms ease, color 260ms ease;
}

.expedition-climber.summit {
  color: rgba(255, 229, 128, 0.98);
  text-shadow: 0 0 12px rgba(255,229,128,0.44);
  transform: translate(-50%, 50%) scale(1.12);
}

.expedition-flag {
  position: absolute;
  right: 11%;
  top: 12px;
  font-size: 26px;
  color: rgba(255, 233, 145, 0.95);
  text-shadow: 0 0 10px rgba(255,233,145,0.36);
}

.expedition-fireworks {
  position: absolute;
  right: 8%;
  top: 8%;
  width: 92px;
  height: 92px;
  pointer-events: none;
}

.expedition-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,244,176,1), rgba(255,198,109,0.82));
  box-shadow: 0 0 10px rgba(255,224,139,0.42);
  animation: expedition-firework 880ms ease-out forwards;
  animation-delay: var(--delay);
}

@keyframes expedition-firework {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.4);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.12);
  }
}

.expedition-footer {
  margin-top: 12px;
}

.expedition-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.expedition-progress-track {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.expedition-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(135,201,166,0.92), rgba(244,225,142,0.92));
  transition: width 220ms ease;
}

.expedition-status {
  margin-top: 10px;
  min-height: 2.4em;
  font-size: 0.86rem;
  font-weight: 800;
  color: rgba(221, 230, 238, 0.88);
}

@media (max-width: 1800px) {
  .expedition-himalaya {
    width: 210px;
    top: 172px;
  }
  .expedition-mountain-wrap {
    height: 310px;
  }
}

@media (max-width: 1500px) {
  .expedition-himalaya {
    width: 190px;
    top: 166px;
  }
  .expedition-card {
    padding: 14px 12px 12px;
    border-radius: 22px;
  }
  .expedition-title {
    font-size: 1.08rem;
  }
  .expedition-mountain-wrap {
    height: 280px;
  }
  .expedition-dot {
    width: 11px;
    height: 11px;
  }
}

@media (max-width: 1200px) {
  .expedition-himalaya {
    top: 258px;
  }
}

/* ===== Ende Expedition Himalaya v11.2 ===== */


/* v11.3 firework */
.himalaya-firework {
  position:absolute;
  right:20px;
  top:20px;
  pointer-events:none;
  animation: fireworkFade 1.2s ease-out forwards;
}
@keyframes fireworkFade {
  0% {opacity:1; transform:scale(0.5);}
  100% {opacity:0; transform:scale(1.4);}
}


/* ===== v11.4 Summit Fireworks ===== */
.himalaya-summit-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 40;
}

.himalaya-summit-burst.hidden {
  display: none;
}

.himalaya-summit-burst .burst-core {
  position: absolute;
  right: 24px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 237, 153, 0.95);
  box-shadow: 0 0 12px rgba(255, 237, 153, 0.55);
}

.himalaya-summit-burst .spark {
  position: absolute;
  right: 29px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 243, 182, 0.95);
  box-shadow: 0 0 10px rgba(255, 243, 182, 0.35);
  opacity: 0;
}

.himalaya-summit-burst.play .spark {
  animation: himalayaSpark 1000ms ease-out forwards;
}

.himalaya-summit-burst.play .burst-core {
  animation: himalayaCore 900ms ease-out forwards;
}

.himalaya-summit-burst .spark.s1 { --dx:  0px;  --dy: -58px; animation-delay: 0ms; }
.himalaya-summit-burst .spark.s2 { --dx: 32px;  --dy: -42px; animation-delay: 50ms; }
.himalaya-summit-burst .spark.s3 { --dx: 48px;  --dy: -8px;  animation-delay: 90ms; }
.himalaya-summit-burst .spark.s4 { --dx: 36px;  --dy: 28px;  animation-delay: 120ms; }
.himalaya-summit-burst .spark.s5 { --dx:  0px;  --dy: 42px;  animation-delay: 140ms; }
.himalaya-summit-burst .spark.s6 { --dx: -34px; --dy: 28px;  animation-delay: 110ms; }
.himalaya-summit-burst .spark.s7 { --dx: -48px; --dy: -8px;  animation-delay: 70ms; }
.himalaya-summit-burst .spark.s8 { --dx: -30px; --dy: -42px; animation-delay: 30ms; }
.himalaya-summit-burst .spark.s9 { --dx: 22px;  --dy: -64px; animation-delay: 20ms; }
.himalaya-summit-burst .spark.s10{ --dx: -22px; --dy: -64px; animation-delay: 20ms; }
.himalaya-summit-burst .spark.s11{ --dx: 58px;  --dy: 8px;   animation-delay: 120ms; }
.himalaya-summit-burst .spark.s12{ --dx: -58px; --dy: 8px;   animation-delay: 120ms; }

@keyframes himalayaSpark {
  0%   { opacity: 0; transform: translate(0,0) scale(0.5); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1); }
}

@keyframes himalayaCore {
  0%   { opacity: 1; transform: scale(0.7); }
  50%  { opacity: 1; transform: scale(1.35); }
  100% { opacity: 0; transform: scale(0.45); }
}

.himalaya-stage-toast {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  min-width: 210px;
  max-width: 280px;
  text-align: center;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(18, 42, 64, 0.94);
  color: #eef3d1;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255,255,255,0.06);
  opacity: 0;
  pointer-events: none;
  z-index: 41;
}

.himalaya-stage-toast.show {
  animation: himalayaToast 1900ms ease forwards;
}

@keyframes himalayaToast {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.97); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  80%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.98); }
}

.himalaya-card.summit-glow {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 28px rgba(244, 226, 142, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.03);
}

.himalaya-next-expedition {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(232, 239, 196, 0.9);
  opacity: 0;
  transition: opacity 220ms ease;
}

.himalaya-next-expedition.show {
  opacity: 1;
}
/* ===== End v11.4 Summit Fireworks ===== */


/* ===== v12.3.1 Motivation Layout Fix ===== */
.motivation-options-card {
  display: block;
}

.motivation-grid-fixed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.motivation-cell-fixed {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.motivation-value-fixed {
  font-size: 1.12rem;
  font-weight: 900;
  color: rgba(239, 244, 247, 0.96);
  line-height: 1.1;
}

.motivation-subvalue-fixed {
  margin-top: 3px;
  font-size: 0.92rem;
  font-weight: 800;
  color: rgba(220, 232, 239, 0.88);
}

.motivation-label-fixed {
  margin-top: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(193, 208, 217, 0.72);
}

.training-motivation-mini-fixed {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.training-motivation-pill-fixed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  color: rgba(240, 244, 247, 0.94);
  font-size: 0.88rem;
  font-weight: 800;
}

.training-motivation-pill-fixed .small {
  font-size: 0.8rem;
  opacity: 0.9;
}

#v12_3_box {
  display: none !important;
}

@media (max-width: 1500px) {
  .motivation-grid-fixed {
    grid-template-columns: 1fr;
  }

  .motivation-value-fixed {
    font-size: 1rem;
  }

  .motivation-subvalue-fixed {
    font-size: 0.86rem;
  }
}

@media (max-width: 1100px), (max-height: 800px) {
  .training-motivation-mini-fixed {
    gap: 6px;
  }

  .training-motivation-pill-fixed {
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .training-motivation-pill-fixed .small {
    font-size: 0.74rem;
  }
}
/* ===== Ende v12.3.1 Motivation Layout Fix ===== */


/* ===== v12.5 Goal + Keyboard Scaling ===== */
.goal-cell-fixed {
  grid-column: 1 / -1;
}

.goal-pill-fixed {
  width: auto;
}

.piano-wrap {
  width: min(92vw, 860px);
  margin: 10px auto 0;
}

.piano-keyboard {
  width: 100%;
  max-width: 860px;
  height: min(24vh, 240px);
  min-height: 150px;
}

.piano-key.white {
  height: 100%;
  width: calc(100% / 7);
  font-size: clamp(1.1rem, 2.1vw, 1.6rem);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 18px;
  box-sizing: border-box;
}

.piano-key.black {
  height: 58%;
  width: clamp(38px, 4.6vw, 54px);
  font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  padding-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
}

.black-cs { left: calc((100% / 7) * 1 - (clamp(38px, 4.6vw, 54px) / 2)); }
.black-ds { left: calc((100% / 7) * 2 - (clamp(38px, 4.6vw, 54px) / 2)); }
.black-fs { left: calc((100% / 7) * 4 - (clamp(38px, 4.6vw, 54px) / 2)); }
.black-gs { left: calc((100% / 7) * 5 - (clamp(38px, 4.6vw, 54px) / 2)); }
.black-as { left: calc((100% / 7) * 6 - (clamp(38px, 4.6vw, 54px) / 2)); }

@media (max-width: 1300px) {
  .piano-wrap { width: min(94vw, 760px); }
  .piano-keyboard { height: min(22vh, 210px); min-height: 138px; }
}

@media (max-width: 900px), (max-height: 820px) {
  .piano-wrap { width: min(96vw, 680px); }
  .piano-keyboard { height: min(20vh, 185px); min-height: 126px; }
  .piano-key.white {
    padding-bottom: 14px;
    font-size: clamp(1rem, 2vw, 1.35rem);
  }
  .piano-key.black {
    width: clamp(30px, 4.2vw, 44px);
    font-size: 0.9rem;
  }
}
/* ===== Ende v12.5 Goal + Keyboard Scaling ===== */


/* ===== v12.5.1 Keyboard Layout Fix ===== */
.main-area {
  padding-bottom: 8px !important;
}

.bottom-area {
  margin-top: 6px !important;
  padding-top: 0 !important;
}

.piano-wrap {
  width: min(92vw, 860px);
  margin: 0 auto 0 !important;
}

.piano-keyboard {
  width: 100%;
  max-width: 860px;
  height: min(19vh, 190px) !important;
  min-height: 128px !important;
}

.hint {
  margin-top: 10px !important;
  margin-bottom: 4px !important;
}

.midi-status {
  margin-top: 4px !important;
  margin-bottom: 6px !important;
}

.staff-panel {
  margin-bottom: 8px !important;
}

.piano-key.white {
  padding-bottom: 12px !important;
  font-size: clamp(1rem, 1.8vw, 1.4rem) !important;
}

.piano-key.black {
  height: 56% !important;
  width: clamp(32px, 4vw, 46px) !important;
  font-size: clamp(0.8rem, 1vw, 1rem) !important;
  padding-bottom: 9px !important;
}

.black-cs { left: calc((100% / 7) * 1 - (clamp(32px, 4vw, 46px) / 2)) !important; }
.black-ds { left: calc((100% / 7) * 2 - (clamp(32px, 4vw, 46px) / 2)) !important; }
.black-fs { left: calc((100% / 7) * 4 - (clamp(32px, 4vw, 46px) / 2)) !important; }
.black-gs { left: calc((100% / 7) * 5 - (clamp(32px, 4vw, 46px) / 2)) !important; }
.black-as { left: calc((100% / 7) * 6 - (clamp(32px, 4vw, 46px) / 2)) !important; }

@media (max-width: 1200px), (max-height: 820px) {
  .piano-keyboard {
    height: min(17vh, 170px) !important;
    min-height: 116px !important;
  }

  .piano-key.white {
    padding-bottom: 10px !important;
    font-size: clamp(0.95rem, 1.6vw, 1.25rem) !important;
  }

  .piano-key.black {
    width: clamp(28px, 3.8vw, 40px) !important;
    font-size: 0.82rem !important;
  }

  .black-cs { left: calc((100% / 7) * 1 - (clamp(28px, 3.8vw, 40px) / 2)) !important; }
  .black-ds { left: calc((100% / 7) * 2 - (clamp(28px, 3.8vw, 40px) / 2)) !important; }
  .black-fs { left: calc((100% / 7) * 4 - (clamp(28px, 3.8vw, 40px) / 2)) !important; }
  .black-gs { left: calc((100% / 7) * 5 - (clamp(28px, 3.8vw, 40px) / 2)) !important; }
  .black-as { left: calc((100% / 7) * 6 - (clamp(28px, 3.8vw, 40px) / 2)) !important; }
}
/* ===== Ende v12.5.1 Keyboard Layout Fix ===== */


/* ===== v12.5.2 Staff + Keyboard Balance Fix ===== */
.staff-panel {
  margin-top: 2px !important;
  margin-bottom: 4px !important;
  min-height: 270px !important;
}

#staff-svg {
  width: 100% !important;
  height: clamp(250px, 34vh, 360px) !important;
}

.main-area {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

.feedback {
  margin-top: 2px !important;
  margin-bottom: 6px !important;
}

.reward-banner {
  margin-bottom: 4px !important;
}

.hint {
  margin-top: 6px !important;
  margin-bottom: 2px !important;
}

.midi-status {
  margin-top: 2px !important;
  margin-bottom: 4px !important;
}

.bottom-area {
  margin-top: 2px !important;
  padding-top: 0 !important;
}

.piano-wrap {
  margin: 0 auto !important;
}

.piano-keyboard {
  height: min(21vh, 205px) !important;
  min-height: 138px !important;
}

@media (max-width: 1200px), (max-height: 820px) {
  .staff-panel {
    min-height: 235px !important;
  }

  #staff-svg {
    height: clamp(220px, 30vh, 310px) !important;
  }

  .piano-keyboard {
    height: min(19vh, 182px) !important;
    min-height: 124px !important;
  }
}
/* ===== Ende v12.5.2 Staff + Keyboard Balance Fix ===== */


/* ===== v12.6 Fixed Keyboard Height + Flex Layout ===== */
#training-screen {
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.topbar {
  flex: 0 0 auto !important;
}

.main-area {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding-top: 4px !important;
  padding-bottom: 0 !important;
}

.feedback {
  flex: 0 0 auto !important;
  margin-top: 2px !important;
  margin-bottom: 6px !important;
}

.reward-banner,
.training-tools,
.hint,
.midi-status {
  flex: 0 0 auto !important;
}

.staff-panel {
  flex: 1 1 auto !important;
  min-height: 220px !important;
  margin-top: 2px !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#staff-svg {
  width: 100% !important;
  height: clamp(220px, 30vh, 320px) !important;
  max-height: 32vh !important;
}

.hint {
  margin-top: 6px !important;
  margin-bottom: 4px !important;
}

.midi-status {
  margin-top: 2px !important;
  margin-bottom: 6px !important;
}

.bottom-area {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 8px !important;
}

.piano-wrap {
  width: min(94vw, 900px) !important;
  margin: 0 auto !important;
}

.piano-keyboard {
  width: 100% !important;
  max-width: 900px !important;
  height: 210px !important;
  min-height: 210px !important;
  max-height: 210px !important;
  overflow: visible !important;
}

.piano-key.white {
  height: 100% !important;
  width: calc(100% / 7) !important;
  font-size: clamp(1.1rem, 1.9vw, 1.45rem) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding-bottom: 16px !important;
  box-sizing: border-box !important;
}

.piano-key.black {
  height: 58% !important;
  width: 46px !important;
  font-size: 0.95rem !important;
  padding-bottom: 10px !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.black-cs { left: calc((100% / 7) * 1 - 23px) !important; }
.black-ds { left: calc((100% / 7) * 2 - 23px) !important; }
.black-fs { left: calc((100% / 7) * 4 - 23px) !important; }
.black-gs { left: calc((100% / 7) * 5 - 23px) !important; }
.black-as { left: calc((100% / 7) * 6 - 23px) !important; }

@media (max-width: 1200px), (max-height: 820px) {
  #staff-svg {
    height: clamp(200px, 27vh, 280px) !important;
    max-height: 28vh !important;
  }

  .staff-panel {
    min-height: 200px !important;
  }

  .piano-keyboard {
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
  }

  .piano-key.white {
    font-size: clamp(1rem, 1.7vw, 1.25rem) !important;
    padding-bottom: 12px !important;
  }

  .piano-key.black {
    width: 40px !important;
    font-size: 0.84rem !important;
  }

  .black-cs { left: calc((100% / 7) * 1 - 20px) !important; }
  .black-ds { left: calc((100% / 7) * 2 - 20px) !important; }
  .black-fs { left: calc((100% / 7) * 4 - 20px) !important; }
  .black-gs { left: calc((100% / 7) * 5 - 20px) !important; }
  .black-as { left: calc((100% / 7) * 6 - 20px) !important; }
}
/* ===== Ende v12.6 Fixed Keyboard Height + Flex Layout ===== */


/* ===== v12.7 Key Highlight Feedback ===== */
.piano-key {
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.piano-key.key-correct {
  box-shadow:
    0 0 0 2px rgba(119, 215, 150, 0.95),
    0 0 18px rgba(119, 215, 150, 0.35) !important;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.piano-key.key-wrong {
  box-shadow:
    0 0 0 2px rgba(235, 120, 120, 0.95),
    0 0 18px rgba(235, 120, 120, 0.32) !important;
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.piano-key.black.key-correct {
  box-shadow:
    0 0 0 2px rgba(119, 215, 150, 0.95),
    0 0 14px rgba(119, 215, 150, 0.28) !important;
}

.piano-key.black.key-wrong {
  box-shadow:
    0 0 0 2px rgba(235, 120, 120, 0.95),
    0 0 14px rgba(235, 120, 120, 0.26) !important;
}
/* ===== Ende v12.7 Key Highlight Feedback ===== */


/* ===== v12.7.1 Sound Restore + Key Highlight ===== */
.piano-key {
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.piano-key.key-correct {
  box-shadow:
    0 0 0 2px rgba(119, 215, 150, 0.95),
    0 0 18px rgba(119, 215, 150, 0.35) !important;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.piano-key.key-wrong {
  box-shadow:
    0 0 0 2px rgba(235, 120, 120, 0.95),
    0 0 18px rgba(235, 120, 120, 0.32) !important;
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.piano-key.black.key-correct {
  box-shadow:
    0 0 0 2px rgba(119, 215, 150, 0.95),
    0 0 14px rgba(119, 215, 150, 0.28) !important;
}

.piano-key.black.key-wrong {
  box-shadow:
    0 0 0 2px rgba(235, 120, 120, 0.95),
    0 0 14px rgba(235, 120, 120, 0.26) !important;
}
/* ===== Ende v12.7.1 Sound Restore + Key Highlight ===== */
