﻿/* AssistUK Musikgarten — nur was über kern/css/spiel.css hinausgeht (Muster: spiele/fishing/css/fishing.css).
   Bühne: #szene (Garten am Abend, nur Bild) füllt den Bildschirm; #spiel (Kern: fest, z-index 6) trägt „Pause“, die
   Statuszeile und die vier Instrumente als große Flächen. Dunkler Arcade-Auftritt wie alle Spiele (bis 10.11. hell). */
html, body { background: var(--grund); }
#buehne { position: fixed; inset: 0; }
#szene { position: fixed; inset: 0; z-index: 1; overflow: hidden; background: linear-gradient(180deg, #101a3c, #3a2f6b 45%, #0f3a30 75%); --blitz: #ffd76a; }
.garten-bild { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#spiel[hidden] { display: none; }
#spiel .pause-knopf { z-index: 3; }

/* ---------- Bewegung: Sterne funkeln, Lichterkette schimmert; beim Anschlag leuchtet sie in der Farbe des Instruments ---------- */
@keyframes mg-funkeln { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes mg-schimmern { 0%, 100% { opacity: .16; transform: scale(1); } 50% { opacity: .34; transform: scale(1.15); } }
@keyframes mg-blitz { 0% { opacity: .9; transform: scale(1.7); } 100% { opacity: .22; transform: scale(1); } }
@keyframes mg-ring { 0% { transform: scale(.55); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes mg-schlag { 0% { transform: scale(1); } 22% { transform: scale(1.06) rotate(-4deg); } 55% { transform: scale(.98) rotate(3deg); } 100% { transform: scale(1); } }
@keyframes mg-dran { 0%, 100% { box-shadow: 0 6px 0 #0009, 0 0 0 0 var(--farbe); } 50% { box-shadow: 0 6px 0 #0009, 0 0 0 10px var(--farbe); } }
.garten-bild .funkeln { animation: mg-funkeln 4.4s ease-in-out infinite; }
.garten-bild .funkeln.f1 { animation-delay: -1.5s; animation-duration: 5.2s; }
.garten-bild .funkeln.f2 { animation-delay: -3s; animation-duration: 6.4s; }
.garten-bild .licht .hof { transform-box: fill-box; transform-origin: center; animation: mg-schimmern 5s ease-in-out infinite; }
.garten-bild .licht.l1 .hof { animation-delay: -1.2s; } .garten-bild .licht.l2 .hof { animation-delay: -2.4s; } .garten-bild .licht.l3 .hof { animation-delay: -3.6s; }
#szene.klingt .licht .hof { fill: var(--blitz); animation: mg-blitz .7s ease-out 1 both; }
#buehne.ruhig .deko { display: none; }
#buehne.still *, body.bf-bewegung-wenig #buehne * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { #buehne * { animation: none !important; transition: none !important; } }

/* ---------- Startseite: der Garten als Titelbild, die Instrumente links und rechts von „Spielen“ ---------- */
.garten-titel-bild { position: absolute; width: clamp(90px, 15vh, 220px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 12px 10px #0008); }
.garten-titel-bild.a { left: 5%; top: 30%; transform: rotate(-8deg); }
.garten-titel-bild.b { left: 17%; top: 46%; transform: rotate(6deg); }
.garten-titel-bild.c { right: 17%; top: 46%; transform: rotate(-5deg); }
.garten-titel-bild.d { right: 5%; top: 30%; transform: rotate(7deg); }
#szene.spiel .garten-titel-bild { display: none; }
@media (orientation: portrait) {
  .garten-titel-bild { width: clamp(72px, 21vw, 170px); top: 44%; }
  .garten-titel-bild.a { left: 3%; } .garten-titel-bild.b { left: 27%; top: 47%; } .garten-titel-bild.c { right: 27%; top: 47%; } .garten-titel-bild.d { right: 3%; }
}
@media (max-height: 500px) {
  .garten-titel-bild { width: 84px; top: 30%; }
  .garten-titel-bild.a { left: 1%; } .garten-titel-bild.b { left: 13%; top: 34%; } .garten-titel-bild.c { right: 13%; top: 34%; } .garten-titel-bild.d { right: 1%; }
}
/* Kopf-Knöpfe bis 1400 px etwas schmaler, Text einzeilig (sonst bricht „Alle Spiele“ neben dem Namen um) */
@media (min-width: 1101px) and (max-width: 1400px) { .garten-start .start-ecke .knopf.glas { padding: 10px 14px; white-space: nowrap; } }
/* Kacheln der Spielarten: Zeichen bzw. Zahl, Name, bei „Nachspielen“ die Länge der Folge und Sterne */
.garten-start .level-gitter { --spalten: 4; }
.garten-start .level-knopf.modus { flex-direction: row; gap: clamp(8px, 1.2vw, 20px); padding: 6px 12px; }
.garten-start .level-knopf.modus > span:not(.dwell-dot) { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.garten-start .modus-text { font-size: var(--s-text); line-height: 1.12; text-align: center; }
.garten-start .modus-text small { font-size: var(--s-klein); margin-top: 2px; }
.garten-start .level-knopf.modus svg { width: 40px; height: 40px; }
@media (max-width: 900px) { .garten-start .level-knopf.modus { flex-direction: column; gap: 2px; } .garten-start .modus-text { font-size: var(--s-klein); } }
@media (max-width: 560px) { .garten-start .level-gitter { --spalten: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-height: 500px) {
  .garten-start .level-knopf.modus { flex-direction: row; gap: 8px; padding: 4px 8px; }
  .garten-start .modus-text { font-size: var(--s-klein); }
  .garten-start .modus-text small { display: none; }
  .garten-start .level-knopf.modus svg { width: 30px; height: 30px; }
}
@media (max-width: 400px) and (max-height: 700px) { .garten-start .modus-text small { display: none; } .garten-start .level-knopf.modus svg { width: 28px; height: 28px; } }

/* ---------- Im Spiel: oben Pause · Status · (Nochmal hören), darunter die vier Instrumente als große Flächen ---------- */
.garten-spiel { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--luecke);
  padding: var(--oben) var(--rechts) var(--unten) var(--links); }
.garten-kopf { min-height: var(--knopf-min-h); display: flex; align-items: center; justify-content: center; gap: var(--luecke);
  padding-left: calc(151px + var(--luecke)); }
.garten-spiel:not(.nach) .garten-kopf { padding-right: calc(151px + var(--luecke)); }
.garten-status { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; text-align: center;
  padding: 10px 22px; min-height: 64px; border-radius: var(--r-pille); background: var(--flaeche-zeile); border: 3px solid var(--rand);
  font-size: clamp(18px, 1.3vw + 1.3vh, 34px); font-weight: 700; color: var(--text); }
.garten-status[data-art="du"] { border-color: var(--akzent); }
.garten-status[data-art="gut"] { border-color: #7fdc86; color: #b9f5bd; }
.garten-punkte { display: flex; gap: 8px; }
.garten-punkte:empty { display: none; }
.garten-punkte i { width: 18px; height: 18px; border-radius: 50%; background: #ffffff38; border: 2px solid #ffffff80; }
.garten-punkte i.war { background: var(--akzent); border-color: #fff; }
.knopf.garten-hoeren { flex: none; min-width: 151px; }
.garten-instrumente { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 28px); align-items: stretch; }
/* Feinschliff 17.11.2026: Lack-/Specular-Highlight auf Instrumentflächen (kein Soft-SFX, keine neuen Assets). */
.knopf.garten-instrument { --farbe: #ffd76a; position: relative; width: 100%; height: 100%; min-width: 0; min-height: var(--knopf-min-h); padding: clamp(8px, 1.4vh, 20px); gap: clamp(4px, 1.2vh, 14px);
  border-radius: clamp(22px, 4vh, 44px); border: 4px solid color-mix(in srgb, var(--farbe) 70%, #fff 0%);
  background:
    radial-gradient(ellipse 42% 28% at 28% 22%, rgba(255,255,255,0.38) 0%, rgba(255,255,255,0.08) 42%, transparent 70%),
    radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--farbe) 42%, transparent) 0%, transparent 64%),
    linear-gradient(180deg, #15253688, #0b1622a8 55%, #0b1622e0);
  box-shadow: 0 6px 0 #0009, 0 0 34px color-mix(in srgb, var(--farbe) 25%, transparent), inset 0 1px 0 rgba(255,255,255,0.28); font-size: clamp(18px, 1.4vw + 1.6vh, 40px); color: var(--text); }
.knopf.garten-instrument::after { content: ""; position: absolute; inset: 10% 18% auto 12%; height: 18%; border-radius: 999px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.55), rgba(255,255,255,0.08) 55%, transparent); opacity: 0.7; }
.garten-instrument img { flex: 1 1 0; min-height: 0; width: 100%; max-width: 640px; object-fit: contain; filter: drop-shadow(0 8px 8px #0008) drop-shadow(0 -2px 6px rgba(255,255,255,0.18)); }
.garten-instrument > span:not(.dwell-dot):not(.garten-ringe) { flex: none; text-shadow: var(--schrift-schatten); }
.garten-ringe { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.garten-ringe i { position: absolute; width: min(74%, 62vh); aspect-ratio: 1; border-radius: 50%; border: 6px solid var(--farbe); opacity: 0; }
.garten-instrument.klingt { border-color: #fff; background:
  radial-gradient(ellipse 48% 32% at 30% 20%, rgba(255,255,255,0.5) 0%, transparent 65%),
  radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--farbe) 70%, transparent) 0%, transparent 72%),
  linear-gradient(180deg, #15253688, #0b1622a8 55%, #0b1622e0); }
.garten-instrument.klingt img { animation: mg-schlag .5s ease-out 1; }
.garten-instrument.klingt .garten-ringe i { animation: mg-ring .9s ease-out 1; }
.garten-instrument.klingt .garten-ringe i + i { animation-delay: .18s; }
.garten-instrument.zuletzt { border-color: #fff; box-shadow: 0 6px 0 #0009, 0 0 0 5px var(--farbe), 0 0 44px color-mix(in srgb, var(--farbe) 55%, transparent), inset 0 1px 0 rgba(255,255,255,0.35); }
.garten-instrument.dran { animation: mg-dran 1.6s ease-in-out infinite; border-style: dashed; border-color: #fff; }
/* der Garten spielt vor: die Flächen treten zurück, nur das klingende Instrument leuchtet */
.garten-spiel.hoert .garten-instrument:not(.zuletzt) { filter: saturate(.55) brightness(.72); }
.garten-spiel.hoert .garten-hoeren { opacity: .5; }

/* Hochformat und schmal: 2 × 2 Flächen; Status unter Pause und „Nochmal hören“ */
@media (max-width: 760px), (orientation: portrait) {
  .garten-instrumente { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .garten-kopf { flex-wrap: wrap; justify-content: flex-end; padding: 0; min-height: 0; }
  .garten-spiel:not(.nach) .garten-kopf { padding-right: 0; }
  .garten-status { order: 2; flex: 1 1 100%; }
  .garten-spiel .garten-kopf::before { content: ""; order: 0; flex: 1 1 auto; height: var(--knopf-min-h); }
  .knopf.garten-hoeren { order: 1; min-width: var(--knopf-b); }
}
/* kompakt (Handy quer, ≤ 500 hoch): vier Flächen nebeneinander, flache Kopfzeile */
@media (max-height: 500px) and (min-width: 561px) {
  .garten-instrumente { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  .garten-kopf { flex-wrap: nowrap; justify-content: center; padding: 0 0 0 calc(var(--knopf-b) + 12px + var(--luecke)); min-height: var(--knopf-min-h); }
  .garten-spiel:not(.nach) .garten-kopf { padding-right: calc(var(--knopf-b) + 12px + var(--luecke)); }
  .garten-spiel .garten-kopf::before { content: none; }
  .garten-status { order: 0; flex: 1 1 auto; min-height: 48px; padding: 6px 14px; font-size: 17px; border-width: 2px; }
  .knopf.garten-hoeren { order: 1; min-width: var(--knopf-b); }
  .knopf.garten-instrument { border-width: 3px; font-size: 17px; }
  .garten-punkte i { width: 14px; height: 14px; }
}
@media (max-height: 420px) and (max-width: 640px) { .knopf.garten-hoeren { min-width: 96px; min-height: 72px; } }
@media (max-width: 400px) { .garten-status { font-size: 17px; min-height: 52px; padding: 6px 12px; } .knopf.garten-instrument { font-size: 18px; } }

/* ---------- CVI: schwarzer Grund, kein Garten; Instrumente auf heller Scheibe, Zustände nicht nur über Farbe ---------- */
body.bf-cvi #szene { background: #000; }
body.bf-cvi #szene > * { display: none; }
body.bf-cvi .garten-status { background: #000; border: 3px solid #fff; color: #fff; }
body.bf-cvi .knopf.garten-instrument::after { display: none; }
body.bf-cvi .garten-instrument img { background: radial-gradient(circle closest-side, #fff 0 92%, transparent 93%); filter: none; }
body.bf-cvi:not(#bf-nie) .knopf.garten-instrument.zuletzt { border-color: #fff !important; outline: 6px solid var(--bf-cvi-farbe, #ffd400); outline-offset: 3px; }
body.bf-cvi:not(#bf-nie) .knopf.garten-instrument.dran { border-style: dashed !important; animation: none; }
body.bf-cvi .garten-ringe i { border-color: #fff; }
body.bf-cvi .garten-spiel.hoert .garten-instrument:not(.zuletzt) { filter: none; }

/* iPhone SE quer (≤ 640 × 420): drei Knöpfe des Ergebnisses in einer Reihe (sonst zwei Reihen à 120 → unten hinaus) */
@media (max-height: 420px) and (max-width: 640px) {
  .dialog { padding: 6px 12px 10px; }
  .dialog p { font-size: 15px; margin: 0 0 6px; }
  .dialog-knoepfe .knopf, .dialog-knoepfe .knopf.haupt { min-width: 120px; min-height: 96px; padding: 6px 8px; gap: 6px; font-size: 16px; }
  .dialog-knoepfe .knopf.haupt { min-width: 160px; }
  .dialog-knoepfe .knopf svg { width: 28px; height: 28px; }
}

/* sehr schmal (≤ 400 px): „Nochmal hören“ mit Symbol über dem Text neben „Pause“; Titelbilder weichen den Knöpfen */
@media (max-width: 400px) {
  .knopf.garten-hoeren { flex-direction: column; gap: 2px; padding: 6px; font-size: var(--s-klein); max-width: calc(100vw - 175px - 2 * var(--rand-aussen)); }
}
@media (max-width: 400px) and (max-height: 600px) { .garten-titel-bild { display: none; } }
