/* Die Drehorgel – Gestaltung
   Warmes Holz, Messing, Papier. Große Schrift, deutliche Kontraste, großzügige Knöpfe. */

@font-face { font-family: 'Atkinson'; src: url('../fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('../fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --tinte: #2b1a0e;
  --tinte-weich: #5a3f28;
  --papier: #fbf3e2;
  --papier-2: #f2e4c6;
  --wand: #efe0c4;
  --holz-hell: #a1714a;
  --holz: #6e4527;
  --holz-dunkel: #3b2414;
  --messing: #c99a3a;
  --messing-hell: #f3dc94;
  --rot: #8e1f2b;
  --rot-dunkel: #6a1520;
  --gruen: #2f6b4a;
  --fokus: #0b4fd6;
  --radius: 14px;
  --schatten: 0 10px 24px rgba(59, 36, 20, .22), 0 2px 4px rgba(59, 36, 20, .2);
  --maserung: none;
  color-scheme: light;
  font-size: 112.5%;
}
html[data-text="gross"] { font-size: 125%; }
html[data-text="sehr-gross"] { font-size: 140%; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Atkinson', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--tinte);
  background-color: var(--wand);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 248, 230, .9), rgba(255, 248, 230, 0) 60%),
    radial-gradient(circle at 25% 25%, rgba(160, 110, 60, .07) 0 9px, transparent 10px),
    radial-gradient(circle at 75% 75%, rgba(160, 110, 60, .07) 0 9px, transparent 10px),
    repeating-linear-gradient(90deg, rgba(150, 100, 50, .05) 0 2px, transparent 2px 64px);
  background-size: auto, 64px 64px, 64px 64px, auto;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { font-family: 'Fraunces', Georgia, 'Times New Roman', serif; font-weight: 800; line-height: 1.15; margin: 0; }
h3 { font-weight: 600; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--papier); padding: .6rem 1rem; border-radius: 8px; z-index: 50; font-weight: 700; color: var(--tinte); }
.skip:focus { top: 1rem; }

:focus-visible { outline: 4px solid var(--fokus); outline-offset: 3px; border-radius: 10px; }
button:focus:not(:focus-visible) { outline: none; }

.ico { width: 1.4em; height: 1.4em; flex: none; }

/* ---------- Kopf ---------- */
.kopf {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between;
  padding: .9rem clamp(1rem, 3vw, 2rem);
  background: linear-gradient(180deg, #4a2e1a, var(--holz-dunkel));
  background-image: var(--maserung), linear-gradient(180deg, #4a2e1a, var(--holz-dunkel));
  color: #fbeed0;
  border-bottom: 5px solid var(--messing);
  box-shadow: 0 4px 14px rgba(40, 20, 5, .35);
}
.marke { display: flex; align-items: center; gap: .8rem; }
.marke-bild { width: 3.2rem; height: 3.2rem; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.kopf h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: .01em; color: #fff3d6; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.unterzeile { margin: .1rem 0 0; font-size: 1rem; color: #ecd6aa; }
.kopf-nav { display: flex; flex-wrap: wrap; gap: .6rem; }
.kopf-rechts { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; justify-content: flex-end; }
.sprache { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid rgba(243, 220, 148, .45); }
.sprache-knopf { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.8rem; padding: .3rem .85rem; border: 0; border-radius: 999px; background: transparent; color: #f3e2bd; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; }
.sprache-knopf[aria-checked="true"] { background: linear-gradient(180deg, var(--messing-hell), var(--messing)); color: #2b1a05; }
.flagge { width: 1.5rem; height: 1rem; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.35); flex: none; }
.flagge-de { background: linear-gradient(180deg, #111 0 33.3%, #dd0000 33.3% 66.6%, #ffce00 66.6%); }
.flagge-nl { background: linear-gradient(180deg, #ae1c28 0 33.3%, #fff 33.3% 66.6%, #21468b 66.6%); }
.zwischentitel { margin: 1rem 0 .5rem !important; font-weight: 700; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.2rem; padding: .55rem 1.1rem;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  color: var(--tinte);
  background: linear-gradient(180deg, #fffaf0, var(--papier-2));
  border: 2px solid #8a6542; border-radius: 999px;
  box-shadow: 0 3px 0 #8a6542, 0 6px 12px rgba(59, 36, 20, .18);
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease, background .2s;
}
.knopf:hover { background: linear-gradient(180deg, #fff, #f7ead0); }
.knopf:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6542, 0 3px 6px rgba(59, 36, 20, .2); }
.knopf[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.knopf-hell { background: rgba(255, 246, 225, .12); color: #fff3d6; border-color: rgba(243, 220, 148, .65); box-shadow: none; }
.knopf-hell:hover { background: rgba(255, 246, 225, .22); }
.knopf-rot { background: linear-gradient(180deg, #b0303d, var(--rot)); color: #fff; border-color: var(--rot-dunkel); box-shadow: 0 4px 0 var(--rot-dunkel), 0 8px 16px rgba(110, 20, 30, .3); }
.knopf-rot:hover { background: linear-gradient(180deg, #c03a47, #9c2532); }
.knopf-rot:active { box-shadow: 0 1px 0 var(--rot-dunkel); }
.knopf-holz { background: linear-gradient(180deg, #8a5a33, #5e3a1f); color: #fff6df; border-color: #3b2414; box-shadow: 0 4px 0 #3b2414, 0 8px 16px rgba(59, 36, 20, .3); }
.knopf-holz:hover { background: linear-gradient(180deg, #96643b, #684226); }
.knopf-gross { min-height: 4rem; padding: .7rem 1.6rem; font-size: 1.2rem; }
.link-knopf { font: inherit; background: none; border: 0; padding: 0; color: var(--rot); text-decoration: underline; cursor: pointer; font-weight: 700; }

/* ---------- Bühne ---------- */
.buehne {
  display: grid; gap: clamp(1rem, 2.5vw, 2rem);
  grid-template-columns: minmax(0, 1fr);
  max-width: 1480px; margin: 0 auto;
  padding: clamp(.8rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2rem) 2rem;
}
.buehne:focus { outline: none; }
@media (min-width: 1020px) {
  .buehne { grid-template-columns: minmax(0, 1.65fr) minmax(360px, 1fr); align-items: start; }
}

.jetzt {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem;
  padding: .7rem 1.2rem; margin: 0 auto .6rem; max-width: 52rem;
  background: linear-gradient(180deg, var(--messing-hell), var(--messing));
  border: 2px solid #8a6516; border-radius: 999px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 4px 10px rgba(90, 60, 10, .25);
  justify-content: center; text-align: center;
}
.jetzt-label { font-weight: 700; color: #4a3008; }
.jetzt-titel { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 1.3rem; color: #2b1a05; }
.marke-art { font-size: .85rem; font-weight: 700; padding: .1rem .6rem; border-radius: 999px; background: rgba(255, 255, 255, .55); color: #4a3008; }

.orgel-buehne {
  position: relative;
  width: 100%; margin: 0 auto;
  background:
    radial-gradient(closest-side at 50% 45%, rgba(255, 246, 220, .95), rgba(255, 246, 220, 0)),
    radial-gradient(ellipse 46% 10% at 50% 90%, rgba(110, 69, 39, .2), rgba(110, 69, 39, 0) 100%);
  aspect-ratio: 5 / 4;
  max-width: min(100%, calc((100vh - 9rem) * 1.25));
}
.orgel, .orgel svg { width: 100%; height: 100%; display: block; }
.orgel svg { overflow: visible; }
.kurbel-flaeche {
  position: absolute; border-radius: 50%;
  touch-action: none; -webkit-user-select: none; user-select: none;
  cursor: grab;
}
.kurbel-flaeche.dreht { cursor: grabbing; }
.kurbel-flaeche:focus-visible { outline: 4px dashed var(--fokus); outline-offset: -6px; }
.ablage-hinweis {
  position: absolute; inset: 8%; border: 4px dashed var(--rot); border-radius: 30px;
  display: none; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 800; font-size: 1.6rem; color: var(--rot);
  background: rgba(255, 248, 230, .72); pointer-events: none;
}
.orgel-buehne.ablegen .ablage-hinweis { display: flex; }

/* SVG-Feinheiten */
.neu { animation: einlegen .7s cubic-bezier(.3,.7,.4,1.2); }
@keyframes einlegen { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
html.reduziert .neu { animation: none; }
.svg-hint { font-family: 'Atkinson', sans-serif; font-weight: 700; font-size: 20px; fill: #e9d9b3; }
.svg-plaque { font-family: 'Fraunces', Georgia, serif; font-weight: 800; fill: #3a2408; letter-spacing: .03em; }
.svg-crown { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 26px; fill: #fff3d6; letter-spacing: .04em; }
.crank-hint { opacity: 0; transition: opacity .4s; }
.zeige-tipp .crank-hint { opacity: 1; animation: tippen 1.6s ease-in-out infinite; }
@keyframes tippen { 50% { opacity: .35; } }
.key { transform-box: fill-box; transform-origin: center; }
.spielt .key { animation: taste .55s ease-in-out infinite alternate; }
@keyframes taste { from { transform: translateY(0); } to { transform: translateY(3px); } }
.bulb { opacity: .55; transition: opacity .3s; }
.spielt .bulb { animation: lampe 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * -.12s); }
@keyframes lampe { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.spielt .glock-bar { animation: glocke .9s ease-in-out infinite; animation-delay: calc(var(--i) * -.13s); transform-box: fill-box; transform-origin: center; }
@keyframes glocke { 50% { transform: translateY(-3px); } }
html.reduziert .spielt .key, html.reduziert .spielt .bulb, html.reduziert .spielt .glock-bar, html.reduziert .zeige-tipp .crank-hint { animation: none; }
html.reduziert .spielt .bulb { opacity: 1; }

/* ---------- Steuerung ---------- */
.steuerung {
  display: grid; gap: 1rem;
  margin: .9rem auto 0; max-width: 52rem;
  padding: 1.1rem clamp(.8rem, 2vw, 1.4rem);
  background: linear-gradient(180deg, #fffaf0, var(--papier));
  border: 2px solid #c9a87c; border-radius: 22px; box-shadow: var(--schatten);
}
.modus { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; background: #e9d7b4; padding: .35rem; border-radius: 999px; }
.modus-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3.4rem; padding: .4rem .8rem; border: 0; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 1.05rem; color: var(--tinte-weich);
  background: transparent; cursor: pointer;
}
.modus-knopf[aria-checked="true"] { background: var(--holz-dunkel); color: #fff3d6; box-shadow: 0 3px 8px rgba(59, 36, 20, .35); }
.haupt { display: flex; justify-content: center; align-items: center; min-height: 4rem; text-align: center; }
.haupt .knopf-gross { min-width: min(100%, 16rem); }
.kurbel-tipp { margin: 0; font-size: 1.05rem; color: var(--tinte-weich); max-width: 36rem; }
.fortschritt { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; }
.zeit { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.2em; text-align: center; }
.neben { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; justify-content: center; }
.lautstaerke { display: flex; align-items: center; gap: .6rem; font-weight: 700; flex: 1 1 14rem; max-width: 22rem; }
.lautstaerke input { flex: 1; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 2.4rem; background: transparent; cursor: pointer; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--messing) var(--wert, 0%), #dcc7a1 var(--wert, 0%)); border: 1px solid #8a6542; }
input[type="range"]::-moz-range-track { height: 12px; border-radius: 99px; background: #dcc7a1; border: 1px solid #8a6542; }
input[type="range"]::-moz-range-progress { height: 12px; border-radius: 99px; background: var(--messing); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4bf, #c99a3a 60%, #7a5814); border: 2px solid #5a3f10; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4bf, #c99a3a 60%, #7a5814); border: 2px solid #5a3f10; }
input[type="range"]:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Musikschrank ---------- */
.schrank-bereich { display: grid; gap: 1rem; align-content: start; }
.schrank {
  position: relative;
  border-radius: 18px 18px 10px 10px;
  background-color: var(--holz);
  background-image: var(--maserung), linear-gradient(90deg, #5a3720, #7a4e2c 18%, #6e4527 50%, #7a4e2c 82%, #5a3720);
  padding: 0 14px 0;
  box-shadow: var(--schatten), inset 0 0 0 2px rgba(0,0,0,.25);
}
.schrank-krone {
  margin: 0 -14px; padding: 1.1rem 1rem .9rem; text-align: center;
  border-radius: 18px 18px 0 0;
  background-image: var(--maserung), linear-gradient(180deg, #8a5a33, #5e3a1f);
  border-bottom: 5px solid var(--messing);
  position: relative;
}
.schrank-krone::before { content: ''; position: absolute; left: 50%; top: -14px; width: 120px; height: 28px; transform: translateX(-50%); border-radius: 60px 60px 0 0; background-image: var(--maserung), linear-gradient(180deg, #8a5a33, #6e4527); }
.schrank-krone h2 {
  position: relative; display: inline-block; font-size: 1.6rem; color: #3a2408; padding: .3rem 1.4rem;
  background: linear-gradient(180deg, var(--messing-hell), var(--messing)); border-radius: 999px; border: 2px solid #6f4f10;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6);
}
.schrank-innen {
  background: linear-gradient(180deg, #2e1b0e, #3f2615 30%, #3a2313);
  padding: 1rem clamp(.6rem, 2vw, 1rem) 1.2rem;
  box-shadow: inset 0 10px 18px rgba(0, 0, 0, .55), inset 0 0 0 3px rgba(0,0,0,.25);
}
.schrank-tipp { margin: 0 0 .8rem; color: #f3e2bd; font-size: 1rem; }
@media (pointer: coarse) { .nur-maus { display: none; } }
.regal-titel { color: #f3dc94; font-size: 1.15rem; margin: 1.1rem 0 .6rem; padding-top: .9rem; border-top: 8px solid #5e3a1f; box-shadow: 0 -3px 0 rgba(0,0,0,.4); }
.regal-leer { color: #e3cfa5; margin: 0; font-style: italic; }
.schrank-sockel { height: 26px; margin: 0 -14px; border-radius: 0 0 10px 10px; background-image: var(--maserung), linear-gradient(180deg, #5e3a1f, #3b2414); border-top: 4px solid var(--messing); }

.regal {
  list-style: none; margin: 0; padding: 0 0 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.1rem .8rem;
  background: linear-gradient(180deg, transparent calc(100% - 12px), #6e4527 calc(100% - 12px));
  border-radius: 2px;
}
.regal li { display: flex; }

.buch {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: stretch; text-align: left;
  min-height: 9.5rem; padding: 0; margin: 0;
  font: inherit; color: var(--tinte); cursor: pointer;
  background: none; border: 0; border-radius: 8px;
  transition: transform .18s ease, filter .18s;
}
.buch-deckel {
  flex: 1; display: flex; flex-direction: column; gap: .35rem;
  padding: .7rem .7rem .6rem;
  background-color: var(--buchfarbe, #e6c9a0);
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.35), rgba(255,255,255,0) 40%),
    repeating-linear-gradient(0deg, rgba(90, 60, 20, .05) 0 2px, transparent 2px 5px);
  border-radius: 6px 6px 2px 2px;
  border: 1px solid rgba(70, 45, 20, .45);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.18);
}
.buch-emblem { width: 2.4rem; height: 2.4rem; color: rgba(50, 30, 12, .72); }
.buch-etikett {
  background: #fffaf0; border: 1px solid rgba(90, 60, 25, .35); border-radius: 4px;
  padding: .35rem .45rem; box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.buch-titel { display: block; font-weight: 700; font-size: 1.02rem; line-height: 1.2; color: #24160a; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.buch-unter { display: block; font-size: .85rem; color: #5a3f28; margin-top: .15rem; line-height: 1.25; }
.buch-falten {
  height: 18px; border-radius: 0 0 4px 4px;
  background: repeating-linear-gradient(180deg, #f5ead0 0 2px, #c9b386 2px 3px, #efe1bf 3px 5px);
  border: 1px solid rgba(70, 45, 20, .4); border-top: 0;
  box-shadow: 0 6px 8px rgba(0, 0, 0, .45);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 97% 80%, 94% 100%, 91% 80%, 88% 100%, 0 100%);
}
.buch-art { position: absolute; top: .45rem; right: .45rem; font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: rgba(255,255,255,.75); color: #4a3008; }
.buch:hover { transform: translateY(-3px); }
.buch[aria-pressed="true"] { transform: translateY(-8px) scale(1.02); filter: drop-shadow(0 0 0 transparent); }
.buch[aria-pressed="true"] .buch-deckel { outline: 4px solid #ffd76a; outline-offset: 2px; box-shadow: 0 0 22px rgba(255, 215, 106, .8), inset 0 0 0 4px rgba(255,255,255,.25); }
.buch.ist-drin .buch-deckel { opacity: .5; }
.buch.ist-drin::after {
  content: attr(data-drin); position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) rotate(-6deg);
  background: var(--rot); color: #fff; font-weight: 700; font-size: .85rem; padding: .25rem .6rem; border-radius: 6px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.buch:focus-visible { outline: 4px solid #8fc0ff; outline-offset: 4px; }
.buch[draggable="true"] { cursor: grab; }

.auswahl {
  position: sticky; bottom: .6rem; z-index: 5;
  display: grid; gap: .8rem; justify-items: center; text-align: center;
  padding: 1rem; border-radius: 20px;
  background: linear-gradient(180deg, #fffaf0, var(--papier)); border: 2px solid #c9a87c; box-shadow: var(--schatten);
}
.auswahl-text { margin: 0; font-size: 1.05rem; }
.auswahl .knopf-gross { width: min(100%, 22rem); }
.eigen-aktionen { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.eigenes { display: grid; gap: .6rem; padding: 0 .2rem; }
.eigenes .knopf-gross { width: 100%; }
.info { margin: 0; color: var(--tinte-weich); }
.info.klein { font-size: .9rem; }

/* Einlege-Animation */
.flug {
  position: fixed; z-index: 40; pointer-events: none; border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 700; padding: .4rem; color: #24160a;
  background-image: repeating-linear-gradient(0deg, rgba(90, 60, 20, .08) 0 2px, transparent 2px 5px);
}

/* ---------- Dialoge ---------- */
.dialog {
  border: 0; padding: 0; border-radius: 22px; color: var(--tinte);
  width: min(46rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem);
  background: var(--papier); box-shadow: 0 30px 60px rgba(30, 15, 5, .5);
}
.dialog::backdrop { background: rgba(35, 20, 8, .55); }
.dialog-klein { width: min(30rem, calc(100vw - 1.5rem)); }
.dialog-seite { margin-right: 0; margin-left: auto; height: 100dvh; max-height: 100dvh; border-radius: 22px 0 0 22px; width: min(34rem, 100vw); }
.dialog-kopf {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.2rem; background-image: var(--maserung), linear-gradient(180deg, #5e3a1f, var(--holz-dunkel));
  color: #fff3d6; border-bottom: 4px solid var(--messing);
}
.dialog-kopf h2 { font-size: 1.5rem; }
.dialog-inhalt { padding: 1.2rem 1.3rem 1.6rem; }
.dialog-inhalt h3 { font-size: 1.2rem; margin: 1.4rem 0 .6rem; }
.dialog-inhalt h3:first-child { margin-top: 0; }
.dialog-knoepfe { display: flex; gap: .7rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.2rem; }
.schritte { padding-left: 1.4rem; display: grid; gap: .7rem; }
.schritte ul { padding-left: 1.2rem; margin: .4rem 0 0; display: grid; gap: .4rem; }
kbd { background: #fff; border: 1px solid #8a6542; border-bottom-width: 3px; border-radius: 6px; padding: 0 .4rem; font-family: inherit; font-weight: 700; }

.feld { display: grid; gap: .4rem; font-weight: 700; }
.feld input[type="text"] { font: inherit; font-size: 1.1rem; padding: .7rem .9rem; border-radius: 12px; border: 2px solid #8a6542; background: #fff; color: var(--tinte); }

/* Einstellungen */
.wahl { display: grid; gap: .6rem; margin: 0; padding: 0; border: 0; }
.wahl legend { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.2rem; margin-bottom: .6rem; padding: 0; }
.wahl + .wahl { margin-top: 1.4rem; }
.modelle { display: grid; gap: .7rem; }
.modell-karte {
  display: grid; grid-template-columns: 4.2rem 1fr; gap: .4rem .9rem; align-items: center;
  padding: .8rem 1rem; border-radius: 16px; border: 2px solid #c9a87c; background: #fffaf0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.modell-karte svg { grid-row: span 2; width: 4.2rem; height: 4.2rem; color: var(--holz); }
.modell-karte strong { font-size: 1.1rem; }
.modell-karte span { color: var(--tinte-weich); font-size: .95rem; }
.modell-karte[aria-checked="true"] { border-color: var(--rot); background: #fff1e8; box-shadow: 0 0 0 3px rgba(142, 31, 43, .25); }
.farben { display: flex; flex-wrap: wrap; gap: .6rem; }
.farbe {
  display: grid; justify-items: center; gap: .3rem; width: 5.4rem;
  padding: .45rem .3rem; border-radius: 14px; border: 2px solid transparent; background: none; cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 700; color: var(--tinte); text-align: center; line-height: 1.15;
}
.farbe i { display: block; width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid rgba(0,0,0,.35); box-shadow: inset 0 3px 6px rgba(255,255,255,.4), 0 2px 4px rgba(0,0,0,.25); }
.farbe[aria-checked="true"] { border-color: var(--rot); background: #fff1e8; }
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid #e3d0aa; font-weight: 700; cursor: pointer; }
.schalter small { display: block; font-weight: 400; color: var(--tinte-weich); }
.schalter input { width: 1.8rem; height: 1.8rem; accent-color: var(--rot); flex: none; }
.auswahl-zeile { display: flex; flex-wrap: wrap; gap: .5rem; }
.auswahl-zeile button { min-height: 3rem; }
.auswahl-zeile button[aria-checked="true"] { background: var(--holz-dunkel); color: #fff3d6; border-color: var(--holz-dunkel); box-shadow: none; }

/* Quellen */
.quelle { padding: 1rem 0; border-bottom: 1px solid #e3d0aa; }
.quelle h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.quelle dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: 0; }
.quelle dt { font-weight: 700; color: var(--tinte-weich); }
.quelle dd { margin: 0; overflow-wrap: anywhere; }
.quelle a { color: var(--rot); font-weight: 700; }
.hinweis-box { background: #fff1d6; border-left: 6px solid var(--messing); padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; }

/* Meldungen */
.meldung {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; width: min(36rem, calc(100vw - 2rem));
  padding: 1rem 1.2rem; border-radius: 16px; font-weight: 700; font-size: 1.05rem;
  background: #2b1a0e; color: #fff3d6; box-shadow: 0 14px 30px rgba(0,0,0,.4); border: 2px solid var(--messing);
}
.meldung.fehler { background: #6a1520; border-color: #f3a7a7; }
.meldung[hidden] { display: none; }

.fuss { text-align: center; padding: 1rem 1rem 2.5rem; color: var(--tinte-weich); font-size: .95rem; }
.noscript { padding: 2rem; text-align: center; font-size: 1.3rem; }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 1019px) {
  .orgel-buehne { max-width: min(100%, calc((100vh - 6rem) * 1.25)); }
}
@media (max-width: 560px) {
  :root { font-size: 106.25%; }
  .kopf { padding: .7rem 1rem; }
  .kopf-rechts { width: 100%; }
  .sprache { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .sprache-knopf { justify-content: center; }
  .kopf-nav { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .kopf-nav .knopf { padding: .45rem .4rem; flex-direction: column; gap: .15rem; min-height: 3.6rem; font-size: .85rem; border-radius: 14px; }
  .buehne { padding-left: .6rem; padding-right: .6rem; }
  .jetzt-titel { font-size: 1.15rem; }
  .modus-knopf { font-size: .95rem; flex-direction: column; gap: .1rem; min-height: 3.8rem; border-radius: 18px; }
  .modus { border-radius: 22px; }
  .regal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .neben .knopf { flex: 1 1 8rem; }
  .lautstaerke { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.bewegt) * { scroll-behavior: auto !important; }
}
html.reduziert .buch, html.reduziert .knopf { transition: none; }

/* ---------- Laptop & Desktop: alles Wichtige ohne Scrollen ---------- */
@media (min-width: 1020px) {
  .kopf { padding-top: .6rem; padding-bottom: .6rem; }
  .marke-bild { width: 2.8rem; height: 2.8rem; }
  .kopf h1 { font-size: 2rem; }
  .jetzt { padding: .5rem 1.2rem; margin-bottom: .4rem; }
  .orgel-buehne { max-width: min(100%, max(480px, calc((100vh - 23rem) * 1.25))); }
  .steuerung { grid-template-columns: auto minmax(0, 1fr); gap: .8rem 1.2rem; margin-top: .5rem; padding: .9rem 1.1rem; }
  .modus { grid-column: 1; }
  .modus-knopf { white-space: nowrap; font-size: .98rem; padding: .4rem .6rem; gap: .4rem; min-height: 3.2rem; }
  .haupt { grid-column: 2; min-height: 3.2rem; }
  .haupt .knopf-gross { min-height: 3.4rem; width: 100%; }
  .kurbel-tipp { font-size: .95rem; line-height: 1.35; }
  .fortschritt { grid-column: 1 / -1; }
  .neben { grid-column: 1 / -1; flex-wrap: nowrap; }
  .neben .knopf { white-space: nowrap; }
}
@media (min-width: 1020px) {
  .auswahl { grid-template-columns: 1fr auto; align-items: center; justify-items: start; text-align: left; padding: .7rem .9rem; gap: .5rem .8rem; }
  .auswahl .knopf-gross { width: auto; min-height: 3.4rem; font-size: 1.1rem; }
  .eigen-aktionen { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Lied hinzufügen: Gerät oder für alle ---------- */
.datei-name { margin: 0 0 1rem; overflow-wrap: anywhere; }
.feld + .feld { margin-top: .9rem; }
.wahl.ort { margin-top: 1.2rem; }
.ort-wahl { display: grid; gap: .7rem; }
@media (min-width: 640px) { .ort-wahl { grid-template-columns: 1fr 1fr; } }
.ort-karte {
  position: relative; display: grid; gap: .4rem; align-content: start;
  padding: .9rem 1rem .9rem 3rem; border-radius: 16px; border: 2px solid #c9a87c; background: #fffaf0; cursor: pointer;
}
.ort-karte input { position: absolute; left: 1rem; top: 1.1rem; width: 1.4rem; height: 1.4rem; accent-color: var(--rot); margin: 0; }
.ort-kopf { display: flex; align-items: center; gap: .45rem; font-size: 1.08rem; }
.ort-text { color: var(--tinte-weich); font-size: .95rem; line-height: 1.4; }
.ort-aus { color: var(--rot); font-weight: 700; }
.ort-karte:has(input:checked) { border-color: var(--rot); background: #fff1e8; box-shadow: 0 0 0 3px rgba(142, 31, 43, .2); }
.ort-karte:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.ort-karte:focus-within { outline: 4px solid var(--fokus); outline-offset: 2px; }
.feld-hinweis { font-weight: 400; color: var(--tinte-weich); font-size: .9rem; }
#upCodeRow { margin-top: 1rem; }
.fortschritt-upload { display: grid; gap: .4rem; margin-top: 1rem; font-weight: 700; }
.fortschritt-upload progress { width: 100%; height: 1.2rem; accent-color: var(--messing); }
.fehlertext { margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 10px; background: #fde8e8; color: #7a1018; font-weight: 700; border-left: 6px solid #b3202e; }
#confirmCodeRow { margin-top: .8rem; }

/* ================= Kompakte Buchablage (Zeilen) ================= */
.fach { margin: 0 0 .9rem; border-radius: 12px; background: rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 1px rgba(243, 220, 148, .18); }
.fach > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem;
  min-height: 3.2rem; padding: .5rem .9rem; border-radius: 12px;
  font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.15rem; color: #f3dc94;
}
.fach > summary::-webkit-details-marker { display: none; }
.fach > summary::after { content: ''; margin-left: auto; width: .7rem; height: .7rem; border-right: 3px solid #f3dc94; border-bottom: 3px solid #f3dc94; transform: rotate(45deg); transition: transform .2s; }
.fach[open] > summary::after { transform: rotate(-135deg); }
.fach > summary:focus-visible { outline: 4px solid #8fc0ff; outline-offset: 2px; }
.fach-zahl { font-family: 'Atkinson', sans-serif; font-weight: 400; font-size: .95rem; color: #e3cfa5; }
.fach .regal { padding: 0 .5rem .6rem; }
.fach .regal-leer { padding: 0 .9rem .8rem; }

.regal { display: flex; flex-direction: column; gap: .4rem; background: none; padding-bottom: 0; }
.regal li { display: block; }
.buch {
  width: 100%; min-height: 3.6rem; flex-direction: row; align-items: center; gap: .7rem;
  padding: .35rem .6rem .35rem .35rem; border-radius: 10px;
  background: linear-gradient(180deg, #fffaf0, #f3e6c8); border: 1px solid rgba(70, 45, 20, .45);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  text-align: left;
}
.buch:hover { transform: none; background: linear-gradient(180deg, #fff, #f7ecd4); }
.buch-ruecken {
  flex: none; width: 2.6rem; align-self: stretch; min-height: 2.8rem; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--buchfarbe, #e6c9a0);
  background-image: repeating-linear-gradient(180deg, rgba(90, 60, 20, .14) 0 2px, transparent 2px 6px);
  box-shadow: inset 0 0 0 1px rgba(70, 45, 20, .35), inset -4px 0 0 rgba(0,0,0,.08);
}
.buch .buch-emblem { width: 1.7rem; height: 1.7rem; color: rgba(50, 30, 12, .75); }
.buch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.buch .buch-titel { font-size: 1.05rem; line-height: 1.2; }
.buch .buch-unter { font-size: .85rem; margin-top: .05rem; }
.buch-rechts { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; max-width: 7.5rem; }
.buch .buch-art { position: static; font-size: .72rem; background: rgba(110, 69, 39, .12); text-align: right; line-height: 1.2; }
.buch-drin { font-size: .72rem; font-weight: 700; color: #fff; background: var(--rot); padding: .05rem .45rem; border-radius: 99px; white-space: nowrap; }
.buch-drin:empty { display: none; }
.buch.ist-drin { box-shadow: 0 0 0 3px var(--rot), 0 2px 0 rgba(0,0,0,.35); }
.buch.ist-drin::after { content: none; }
.buch[aria-pressed="true"] { transform: none; background: linear-gradient(180deg, #fff6d6, #ffe7a3); box-shadow: 0 0 0 4px #ffd76a, 0 0 14px rgba(255, 215, 106, .6); }
.buch[aria-pressed="true"] .buch-deckel { outline: none; }
/* Nummer in der Reihenfolge (nur „Automatisch spielen“) */
.buch-nr { display: none; }
.buch.wahl-modus .buch-nr {
  display: flex; flex: none; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 3px solid #8a6542; background: #fff; color: var(--tinte);
  font-weight: 700; font-size: 1.15rem;
}
.buch.wahl-modus.in-reihe .buch-nr { background: var(--rot); border-color: var(--rot-dunkel); color: #fff; }
.buch.wahl-modus.laeuft .buch-nr { background: var(--gruen); border-color: #163824; }
@media (max-width: 560px) {
  .regal { grid-template-columns: none; }
  .buch-rechts { max-width: 5.8rem; }
  .buch .buch-titel { font-size: 1rem; }
}

/* Sprache im Hinzufügen-/Ändern-Dialog */
.sprache-wahl { margin-top: 1.1rem; }
.sprach-karte { display: inline-flex; align-items: center; gap: .55rem; min-height: 3rem; padding: .4rem 1rem; border: 2px solid #c9a87c; border-radius: 999px; background: #fffaf0; cursor: pointer; font-weight: 700; }
.sprach-karte input { width: 1.3rem; height: 1.3rem; accent-color: var(--rot); margin: 0; }
.sprach-karte:has(input:checked) { border-color: var(--rot); background: #fff1e8; }
.sprach-karte:focus-within { outline: 4px solid var(--fokus); outline-offset: 2px; }

/* Reihenfolge im Automatikmodus */
.reihenfolge { grid-column: 1 / -1; border: 2px solid #c9a87c; border-radius: 16px; background: #fffaf0; padding: .7rem .9rem; }
.reihenfolge-kopf { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .4rem; }
.reihenfolge-kopf h3 { font-size: 1.15rem; }
.knopf-klein { min-height: 2.8rem; padding: .35rem .9rem; font-size: .95rem; }
.reihenfolge-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; max-height: 15rem; overflow-y: auto; }
.q-item { display: grid; grid-template-columns: 2.1rem 1fr auto; align-items: center; gap: .6rem; padding: .35rem .5rem; border-radius: 10px; background: #f6ecd6; }
.q-nr { width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #fff; border: 2px solid #8a6542; }
.q-titel { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.q-status { font-size: .85rem; font-weight: 700; color: var(--tinte-weich); white-space: nowrap; }
.q-laeuft { background: #e2f1e6; box-shadow: inset 0 0 0 2px var(--gruen); }
.q-laeuft .q-nr { background: var(--gruen); border-color: #163824; color: #fff; }
.q-laeuft .q-status { color: var(--gruen); }
.q-naechstes .q-status { color: var(--rot); }
.q-fertig { opacity: .55; }
.q-fertig .q-titel { text-decoration: line-through; text-decoration-thickness: 2px; }
.reihenfolge-leer { margin: 0; color: var(--tinte-weich); }
#clearQueueBtn { justify-self: center; }
@media (min-width: 1020px) { #clearQueueBtn { grid-column: 1 / -1; justify-self: start; } }

.buch-zeile2 { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .45rem; margin-top: .15rem; }
.buch .buch-zeile2 .buch-unter { margin-top: 0; }
.buch .buch-zeile2 .buch-art { font-size: .72rem; padding: .02rem .45rem; }
.buch > .buch-drin { flex: none; }
.fach-zahl { margin-left: -.2rem; }

@media (max-width: 560px) {
  .schrank-innen { padding-left: .4rem; padding-right: .4rem; }
  .fach .regal { padding: 0 .3rem .5rem; }
  .fach > summary { font-size: 1.05rem; padding: .45rem .7rem; }
  .buch { gap: .5rem; padding: .3rem .45rem .3rem .3rem; min-height: 3.4rem; }
  .buch-ruecken { width: 2.1rem; min-height: 2.5rem; }
  .buch .buch-emblem { width: 1.4rem; height: 1.4rem; }
  .buch.wahl-modus .buch-nr { width: 2.1rem; height: 2.1rem; font-size: 1.05rem; }
  .buch > .buch-drin { position: absolute; top: -.55rem; right: .6rem; }
  .buch { position: relative; }
}
.buch .buch-titel { text-wrap: pretty; }

/* ===== Hochgeladene Lieder verwalten (16.10.2026) ===== */
#manageBtn { margin-top: .6rem; }
.mg-kopf { display: flex; align-items: center; gap: .5rem; margin: 1.2rem 0 .5rem; font-size: 1.15em; }
.mg-kopf .ico { width: 1.3em; height: 1.3em; }
.mg-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.mg-zeile { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 12px;
  background: rgba(255, 248, 232, .9); border: 2px solid rgba(110, 69, 39, .25); color: #3a2414; }
.mg-zeile .buch-ruecken { flex: 0 0 auto; }
.mg-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.mg-titel { overflow-wrap: anywhere; }
.mg-info { font-size: .9em; opacity: .8; }
.mg-knoepfe { display: flex; gap: .4rem; flex: 0 0 auto; }
@media (max-width: 560px) {
  .mg-zeile { flex-wrap: wrap; }
  .mg-text { flex-basis: calc(100% - 4rem); }
  .mg-knoepfe { width: 100%; }
  .mg-knoepfe .knopf { flex: 1 1 0; justify-content: center; }
}
.mg-zeile .buch-emblem { width: 1.6rem; height: 1.6rem; }
.mg-sperre { display: flex; flex-direction: column; gap: .6rem; }
.mg-sperre .knopf { align-self: flex-start; }
#mgLock { margin-top: 1.2rem; }
.mg-zurueck { white-space: nowrap; }
