/* Das Lied der Sphären© - Gestaltung. Frei nach „Medusas Erben“ von Christiane Fehse (Drachenmutter).
   Grundlage ist die Inselreise. Senioren-Standard: 22px Grundschrift, grosse Knoepfe. */
html { font-size: 22px; }
* { box-sizing: border-box; }
:root {
  --tinte: #2a2030;
  --papier: #fbf6ec;
  --rand: #b99a5a;
  --gold: #e8b53a;
  --violett: #4a2f6a;
  --tief: #2a1c3e;
  --schatten: 0 6px 24px rgba(30, 15, 40, 0.25);
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--tinte);
  background: radial-gradient(ellipse at top, #3d2b5e 0%, #2a1f45 45%, #1c1630 100%) fixed;
  line-height: 1.5;
  overflow-x: hidden;
}
.ir-rahmen { max-width: 1500px; margin: 0 auto; padding: 0.5rem 0.7rem 1rem; }

/* Kopf */
.ir-kopf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem;
  background: var(--papier); border: 3px solid var(--rand); border-radius: 16px; padding: 0.4rem 0.8rem; box-shadow: var(--schatten);
}
.ir-titel h1 { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; margin: 0; color: var(--violett); letter-spacing: 0.02em; }
.ir-titel p { margin: 0; font-size: 0.7rem; color: #5a4a62; font-style: italic; }
.ir-werkzeuge { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.werkzeug {
  font-size: 0.75rem; padding: 0.35rem 0.7rem; min-height: 44px; border-radius: 12px; border: 2px solid var(--rand);
  background: #fff; color: var(--tinte); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; font-family: inherit;
}
.werkzeug:hover, .werkzeug:focus-visible { background: #fff3cf; }
/* Der Umschalter zur gemalten Fassung gehoert nur in die Vorschau; ohne diese Zeile stand er nach der Freigabe als leerer Knopf im Kopf (16.11.2026). */
.werkzeug[hidden] { display: none; }

/* Spielflaeche */
.spielflaeche { display: grid; grid-template-columns: 1fr; gap: 0.7rem; margin-top: 0.7rem; }
@media (min-width: 1100px) {
  /* --bw setzt spiel.js: so breit, wie Platz und Bildschirmhoehe es erlauben */
  .spielflaeche { grid-template-columns: var(--bw, minmax(0, 1fr)) clamp(300px, 24vw, 400px); justify-content: center; align-items: start; }
}
/* Im Spiel: "Worum geht es?" weg, damit die Buehne den Platz bekommt (nur das Startbild zeigt es) */
body.spielt .ir-info { display: none; }
.buehne {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  border: 4px solid var(--rand); box-shadow: var(--schatten); background: #2a1f45;
}
@supports not (aspect-ratio: 16 / 9) { .buehne { height: 0; padding-top: 56.25%; } }
#leinwand { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ortsname {
  position: absolute; left: 0.6rem; top: 0.6rem; background: rgba(251, 246, 236, 0.92); border: 2px solid var(--rand);
  border-radius: 10px; padding: 0.15rem 0.6rem; font-family: Georgia, serif; font-size: 0.85rem; font-weight: bold; color: var(--violett);
  pointer-events: none;
}
.ortsname:empty { display: none; }
.pins { position: absolute; inset: 0; }
.pin {
  position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 0.3rem;
  background: rgba(255, 252, 240, 0.94); border: 3px solid var(--gold); border-radius: 999px; padding: 0.15rem 0.6rem 0.15rem 0.3rem;
  font-size: 0.68rem; font-family: inherit; color: var(--tinte); cursor: pointer; min-height: 44px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  white-space: nowrap; animation: atmen 3s ease-in-out infinite;
}
.pin:hover, .pin:focus-visible { background: #fff3c4; transform: translate(-50%, -50%) scale(1.08); animation: none; }
.pin-bild { font-size: 1.15rem; line-height: 1; }
@keyframes atmen { 0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); } 50% { box-shadow: 0 0 0 6px rgba(232, 181, 58, 0.45), 0 3px 10px rgba(0, 0, 0, 0.35); } }
@media (max-width: 760px) {
  .pin { padding: 0.15rem; min-width: 44px; justify-content: center; }
  .pin-text { display: none; }
  .ortsname { font-size: 0.62rem; left: 0.3rem; top: 0.3rem; }
  .ir-titel h1 { font-size: 1.1rem; }
  .ir-titel p { display: none; }
  .ir-rahmen { padding: 0.3rem 0.35rem 1rem; }
  .ir-kopf { padding: 0.3rem 0.5rem; gap: 0.3rem 0.6rem; }
  .werkzeug { font-size: 0.68rem; padding: 0.2rem 0.45rem; }
  .spielflaeche { margin-top: 0.4rem; }
}

/* Gespraech */
.erzaehler {
  display: flex; gap: 0.7rem; align-items: flex-start; background: var(--papier); border: 3px solid var(--rand);
  border-radius: 16px; padding: 0.7rem 0.8rem; box-shadow: var(--schatten);
}
.sprecher-bild {
  flex: 0 0 auto; width: 4.2rem; height: 4.2rem; border-radius: 50%; overflow: hidden; background: radial-gradient(circle, #fff, #eadff5);
  border: 3px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 2rem; position: relative;
}
.sprecher-bild canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sprecher-rede { flex: 1 1 auto; min-width: 0; }
.sprecher-name { margin: 0; font-weight: bold; font-family: Georgia, serif; color: var(--violett); font-size: 0.85rem; }
.sprecher-links { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.nochmal {
  margin: 0; font-family: inherit; font-size: 0.6rem; min-height: 36px; padding: 0.05rem 0.45rem; white-space: nowrap;
  border-radius: 999px; border: 2px solid var(--rand); background: #fff; color: var(--tinte); cursor: pointer;
}
.nochmal:hover, .nochmal:focus-visible { background: #fff3cf; }
.nochmal[hidden] { display: none; }
.sprecher-text { margin: 0.15rem 0 0; font-size: 1rem; }
.sprecher-text.neu { animation: einblenden 0.5s ease; }
@keyframes einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.aktionen { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.6rem; }
.knopf {
  font-family: inherit; font-size: 0.95rem; text-align: left; padding: 0.55rem 0.9rem; min-height: 56px; border-radius: 14px;
  border: 3px solid var(--rand); background: #fffdf6; color: var(--tinte); cursor: pointer; box-shadow: 0 2px 0 var(--rand);
}
.knopf:hover, .knopf:focus-visible { background: #fff3cf; outline: 3px solid #3a7fd0; outline-offset: 2px; }
.knopf.haupt { background: linear-gradient(#ffe9a8, #ffd672); border-color: #c08a1f; font-weight: bold; box-shadow: 0 3px 0 #a87618; }
.knopf.leise { background: #f3eef6; font-size: 0.85rem; }
.knopf.erledigt { background: #e9f3e4; border-color: #8ab07a; }
.knopf:disabled { opacity: 0.55; cursor: not-allowed; }
.knopf:active { transform: translateY(2px); box-shadow: none; }
.knopf.tipp { outline: 4px solid #3a9a5a; outline-offset: 2px; animation: atmen 1.2s ease-in-out infinite; }

/* Sternlichter beim Lied der Sphaeren */
.sterne-reihe { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }
.stern-knopf { text-align: center; font-weight: bold; color: #1d1626; }
.stern-knopf.s0 { background: linear-gradient(#fff2b0, #f2c64a); border-color: #b8901a; }
.stern-knopf.s1 { background: linear-gradient(#ffe0ee, #f59ac2); border-color: #c0588a; }
.stern-knopf.s2 { background: linear-gradient(#e2f0ff, #8fc0f5); border-color: #3a74b8; }
.stern-knopf.s3 { background: linear-gradient(#e6ffe8, #8fdc9a); border-color: #3a9a4a; }
.stern-knopf.leuchtet { filter: brightness(1.25); transform: scale(1.05); box-shadow: 0 0 18px rgba(255, 240, 160, 0.9); }
.zaehler { font-size: 0.8rem; color: #f1e8fb; margin: 0.2rem 0 0; }
.pin.nur-bild { padding: 0.15rem; min-width: 52px; min-height: 52px; justify-content: center; background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 240, 180, 0.9); }
.pin.nur-bild .pin-text { display: none; }
.pin.nur-bild .pin-bild { color: #fff8d0; text-shadow: 0 0 6px #000; }

/* Zusatzflaeche */
.panel { margin-top: 0.7rem; background: #fffdf6; border: 3px solid var(--rand); border-radius: 16px; padding: 0.7rem 0.9rem; box-shadow: var(--schatten); }
.panel h2 { font-family: Georgia, serif; margin: 0 0 0.4rem; font-size: 1.1rem; color: var(--violett); }
.panel .knopf { margin: 0.2rem 0.4rem 0.2rem 0; text-align: center; }
.szenenliste { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.szenenliste .knopf { width: 100%; text-align: left; margin: 0; }
.schriftrolle {
  background: #fff8e2; border: 1px solid #dccb98; border-radius: 6px; padding: 0.8rem 1rem; font-family: Georgia, serif;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.15);
}

/* Ende: Abspann (volle Breite unter dem Bild) */
.abspann-feld { margin-top: 0.8rem; }
.abspann-feld[hidden] { display: none; }
.abspann { max-width: 900px; margin: 0 auto; }
.abspann { text-align: center; font-family: Georgia, serif; background: #fffaf0; border: 8px double #c08a1f; border-radius: 8px; padding: 1rem; }
.abspann h2 { font-size: 1.5rem; color: var(--violett); margin: 0.2rem 0; }
.abspann .untertitel { font-style: italic; margin: 0 0 0.6rem; }
.abspann .copyright { font-weight: bold; color: #5a2a6a; }
.abspann p { margin: 0.5rem 0; font-size: 0.95rem; }
.abspann .buch { background: #f6efff; border: 2px solid #c9b0e6; border-radius: 12px; padding: 0.6rem; }
.abspann a { color: #234a9a; font-weight: bold; }
.abspann .knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-top: 0.6rem; }

/* Info unten */
.ir-info { margin-top: 1rem; background: rgba(255, 253, 246, 0.94); border-radius: 16px; padding: 0.6rem 1rem; border: 2px solid #d9c49c; }
.ir-info h2 { font-family: Georgia, serif; font-size: 1.05rem; margin: 0.2rem 0; color: var(--violett); }
.ir-info p { font-size: 0.85rem; }
.ir-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; }
.ir-links a { color: #234a7a; }
.ir-links a.whatsapp { color: #128c4a; font-weight: bold; }
.copyright-zeile { font-size: 0.8rem; color: #5a4a62; }

@media (prefers-reduced-motion: reduce) {
  .pin, .sprecher-text.neu, .knopf.tipp { animation: none !important; }
}
.stoerung { font-size: 0.8rem; color: #8a2a12; background: #fff1e8; border: 1px solid #e3b9a0; border-radius: 10px; padding: 0.4rem 0.6rem; margin: 0.3rem 0 0; }

/* Vierte Runde (11.11.2026): Trefferflaeche direkt auf dem Gegenstand, Reisetasche, Erzaehlfluss */
.treffer {
  position: absolute; transform: translate(-50%, -50%); aspect-ratio: 1; min-width: 48px; min-height: 48px;
  border-radius: 50%; border: 0; padding: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
/* Fuenfte Runde (13.11.2026): Die heisse Flaeche glimmt leise, statt ein Schild zu tragen */
.treffer::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 4px solid #fff3b8;
  background: radial-gradient(circle, rgba(255, 244, 190, 0.26) 0%, rgba(255, 236, 150, 0.1) 55%, rgba(255, 236, 150, 0) 72%);
  box-shadow: 0 0 0 2px rgba(120, 70, 10, 0.55), 0 0 18px 6px rgba(255, 210, 80, 0.75), inset 0 0 16px rgba(255, 240, 180, 0.5);
  animation: glimmen 2.4s ease-in-out infinite;
}
@keyframes glimmen { 0%, 100% { opacity: 0.55; transform: scale(0.93); } 50% { opacity: 1; transform: scale(1.05); } }
.treffer:hover::before { background: rgba(255, 240, 170, 0.2); opacity: 1; animation: none; }
.treffer:focus-visible { outline: 4px solid #3a7fd0; outline-offset: 4px; }
.treffer.ruht { pointer-events: none; cursor: default; }
.treffer.ruht::before { opacity: 0.3; animation: none; }
/* Hilfe fuer alle, die danebentippen oder zoegern: heller Kreis und ein Fingerzeig */
.treffer.hilfe::before { border-color: #ffffff; border-width: 5px; box-shadow: 0 0 22px 9px rgba(255, 232, 130, 0.85), inset 0 0 16px rgba(255, 255, 220, 0.6); animation: glimmen 0.9s ease-in-out infinite; }
.treffer.hilfe::after {
  content: '👆'; position: absolute; left: 50%; top: 62%; font-size: 1.7rem; line-height: 1; transform: translateX(-50%);
  text-shadow: 0 0 6px #000, 0 0 3px #000; animation: fingerzeig 0.9s ease-in-out infinite; pointer-events: none;
}
@keyframes fingerzeig { 0%, 100% { margin-top: 0; } 50% { margin-top: 0.45rem; } }
/* Sterne beim Lied */
.treffer.stern.s0::before { border-color: #ffd23f; } .treffer.stern.s1::before { border-color: #ff8fc8; }
.treffer.stern.s2::before { border-color: #6fb8ff; } .treffer.stern.s3::before { border-color: #6fe39a; }
.treffer.leuchtet::before { opacity: 1 !important; transform: scale(1.12); border-width: 6px; box-shadow: 0 0 30px 14px rgba(255, 255, 220, 0.95); animation: none; }
.treffer.tipp::before { border-color: #3adf6a !important; border-width: 6px; opacity: 1; box-shadow: 0 0 20px 8px rgba(58, 223, 106, 0.8); animation: glimmen 0.9s ease-in-out infinite; }
/* Hinweis in der Randleiste: Text, kein Knopf */
.bild-hinweis { background: rgba(255, 253, 246, 0.1); border: 2px dashed rgba(255, 236, 170, 0.55); border-radius: 14px; padding: 0.4rem 0.7rem; color: #f8f1ff; }
.bild-kopf { margin: 0; font-size: 0.9rem; font-weight: bold; }
.bild-liste { list-style: none; margin: 0.3rem 0 0; padding: 0; font-size: 0.86rem; }
.bild-liste li { margin: 0.2rem 0; padding-left: 0.2rem; }
.bild-liste li.erledigt { opacity: 0.7; }
/* Die Vorleserin spricht: ein Ring pulsiert um das Sprecherbild */
.sprecher-bild.spricht { animation: sprechen 1.2s ease-out infinite; }
@keyframes sprechen { 0% { box-shadow: 0 0 0 0 rgba(232, 181, 58, 0.75); } 100% { box-shadow: 0 0 0 0.75rem rgba(232, 181, 58, 0); } }
.ton-hinweis {
  display: block; width: 100%; margin: 0 0 0.6rem; font-family: inherit; font-size: 0.95rem; font-weight: bold; text-align: left;
  padding: 0.6rem 0.9rem; min-height: 56px; border-radius: 14px; border: 3px solid #c0392b; background: #fff3e6; color: #5a1a10; cursor: pointer;
}
.ton-hinweis[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .treffer::before, .treffer.hilfe::before, .treffer.hilfe::after, .treffer.tipp::before, .sprecher-bild.spricht { animation: none !important; }
  .treffer::before { opacity: 0.8; }
}
.tasche {
  position: absolute; left: 0.4rem; bottom: 0.4rem; display: flex; gap: 0.25rem; align-items: center; pointer-events: none;
  background: rgba(40, 24, 60, 0.72); border: 2px solid var(--gold); border-radius: 999px; padding: 0.1rem 0.5rem 0.1rem 0.4rem;
}
.tasche[hidden] { display: none; }
.tasche::before { content: '🎒'; font-size: 1rem; }
.tasche .fund { font-size: 1.1rem; line-height: 1.3; }
.tasche .fund.neu { animation: fundNeu 1.6s ease; }
@keyframes fundNeu { 0% { transform: scale(0.2); } 40% { transform: scale(1.9); } 100% { transform: scale(1); } }
.fluss-reihe { display: flex; gap: 0.45rem; }
.knopf.klein { flex: 1 1 0; min-height: 44px; padding: 0.3rem 0.5rem; font-size: 0.78rem; text-align: center; box-shadow: none; }
.abspann .funde-zeile { color: #5a2a6a; }
@media (max-width: 760px) { .tasche .fund { font-size: 0.9rem; } .tasche::before { font-size: 0.85rem; } }
@media (prefers-reduced-motion: reduce) { .tasche .fund.neu { animation: none !important; } }

/* Film-Kulisse (Probe 14.11.2026): Foto und bewegte Schleife liegen hinter der Leinwand */
.kulisse { position: absolute; inset: 0; overflow: hidden; background: #0d0a14; }
.kulisse[hidden] { display: none; }
.kulisse video, .kulisse-nah { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: fill; transform-origin: 0 0; pointer-events: none; }
.kulisse-nah { opacity: 0; transition: opacity 0.6s ease; }
.kulisse-nah.da { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .kulisse-nah { transition: none; } }
