.xylophon-instrument {
  border: 2px solid #e3c686; border-radius: 1.3rem; padding: .8rem clamp(.4rem, 2vw, 1.4rem) 1.2rem;
  background: linear-gradient(180deg, #1c3354, #14263f); box-shadow: inset 0 -1rem 2rem #0e1c32;
}
.xylophon-staebe {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(.25rem, 1vw, .55rem);
  align-items: end; min-height: clamp(9rem, 28vh, 16rem);
}
.xylophon-stab {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  min-width: 0; min-height: clamp(5.5rem, 18vh, 12rem); height: calc(55% + (var(--i, 0) * 5%));
  padding: .5rem .2rem; border: 3px solid #fff5d8; border-radius: .85rem;
  background: var(--stabfarbe, #e0a84a); color: #fff; cursor: pointer; font: inherit; font-weight: 800;
  box-shadow: inset 0 -10px 18px rgba(0,0,0,.22), 0 4px 0 rgba(0,0,0,.18);
}
.xylophon-staebe .xylophon-stab:nth-child(1) { min-height: 92%; }
.xylophon-staebe .xylophon-stab:nth-child(2) { min-height: 86%; }
.xylophon-staebe .xylophon-stab:nth-child(3) { min-height: 80%; }
.xylophon-staebe .xylophon-stab:nth-child(4) { min-height: 74%; }
.xylophon-staebe .xylophon-stab:nth-child(5) { min-height: 68%; }
.xylophon-staebe .xylophon-stab:nth-child(6) { min-height: 62%; }
.xylophon-staebe .xylophon-stab:nth-child(7) { min-height: 56%; }
.xylophon-staebe .xylophon-stab:nth-child(8) { min-height: 50%; }
.xylophon-stab:focus-visible { outline: 5px solid #fff; outline-offset: 3px; }
.xylophon-stab.xylophon-aktiv {
  transform: translateY(6px); box-shadow: 0 0 0 5px #ffdf71, inset 0 0 1.2rem rgba(255,255,255,.35);
}
.xylophon-stab.xylophon-cue {
  box-shadow: 0 0 0 5px #9fd27a99, 0 0 18px #b8e89a66;
  outline: 3px solid #d7f5c0;
}
@media (prefers-reduced-motion: reduce) {
  .xylophon-stab.xylophon-cue { box-shadow: 0 0 0 5px #9fd27a99; }
}
body.christmas-ruhig .xylophon-stab.xylophon-cue { box-shadow: 0 0 0 5px #9fd27a99; }
body.bf-cvi .xylophon-stab.xylophon-cue {
  outline: 4px solid var(--bf-cvi-farbe, #ffd400); box-shadow: none;
}
.xylophon-name { font-size: clamp(1rem, 2.2vw, 1.5rem); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.xylophon-status { min-height: 1.5em; }
.xylophon-fuss { display: flex; flex-wrap: wrap; gap: .6rem; }
.xylophon-fuss .knopf { flex: 1 1 10rem; min-width: max(12rem, 220px); min-height: 112px; }

@media (max-width: 700px) {
  .xylophon-staebe { grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 12rem; }
  .xylophon-fuss .knopf { min-width: 120px; min-height: 96px; }
}

/* ------------------------------------------------------------------ 3D Vollbild — Kopf oben links, Tasten frei (wie Glockenspiel) */
.xylophon.xylophon-3d, .xylophon.xylophon-laedt {
  position: fixed; inset: 0; max-width: none; margin: 0; overflow: hidden;
  border: 0; border-radius: 0; padding: 0; box-shadow: none;
  --xylophon-leiste: var(--zurueck-h, 112px);
  background: #14263f; color: var(--text, #fbf7ee);
}
.xylophon-3d .xylophon-kopf, .xylophon-laedt .xylophon-kopf {
  position: absolute; z-index: 2; top: var(--oben, 10px); left: var(--links, 10px); right: auto;
  max-width: min(42rem, 70vw); pointer-events: none; text-shadow: 0 2px 8px #000c;
  background: none; border-radius: 0; padding: 0; backdrop-filter: none;
}
.xylophon-3d .xylophon-kopf h1 { margin: 0; font-size: var(--s-titel, 32px); }
.xylophon-3d .xylophon-kopf p { margin: 6px 0 0; max-width: 28em; }
.xylophon-3d .xylophon-instrument { display: none; }
.xylophon-3d .xylophon-status {
  position: absolute; z-index: 2; left: var(--links, 10px); right: auto;
  bottom: calc(var(--xylophon-leiste) + var(--unten, 10px) + var(--luecke, 8px) + 8px);
  width: max-content; max-width: min(90vw, 36rem); margin: 0; padding: 10px 14px; border-radius: 12px;
  background: var(--flaeche-glas, #0b1622d8); color: #fff; pointer-events: none;
}
.xylophon-3d .xylophon-fuss {
  position: absolute; left: var(--links, 10px); right: var(--rechts, 10px); bottom: var(--unten, 10px);
  z-index: 4; margin: 0; justify-content: flex-start;
}
.xylophon-3d .xylophon-fuss .knopf {
  min-width: var(--zurueck-b, 220px); min-height: var(--zurueck-h, 112px);
}
.xylophon-3d .xylophon-3d-scene, .xylophon-laedt .xylophon-3d-scene {
  position: absolute; inset: 0 0 calc(var(--xylophon-leiste) + var(--unten, 10px) + var(--luecke, 8px)) !important;
  overflow: hidden;
}
.xylophon-3d-scene > canvas { width: 100%; height: 100%; display: block; }
.xylophon-3d .fest-3d-targets { position: absolute; inset: 0; pointer-events: none; }
.xylophon-3d .fest-3d-target {
  position: absolute; transform: translate(-50%, -50%);
  width: var(--ziel, 120px); height: var(--ziel, 120px);
  padding: 0; border: 0; background: transparent; border-radius: 50%;
  cursor: pointer; pointer-events: auto;
}
.xylophon-3d .fest-target-ring {
  display: block; width: 64%; height: 64%; margin: auto;
  border: 2px dashed #fff2be; border-radius: 50%;
  box-shadow: 0 0 0 2px #25364766, 0 0 20px #ffdc8b44;
}
.xylophon-3d .fest-3d-target:hover .fest-target-ring,
.xylophon-3d .fest-3d-target:focus-visible .fest-target-ring {
  border: 4px solid #fff5c7; background: #ffe3a322;
}
.xylophon-laedt .xylophon-instrument { display: none; }
@media (max-height: 650px) { .xylophon-3d .xylophon-kopf p, .xylophon-laedt .xylophon-kopf p { display: none; } }
