/* Zahlenzauber – Kampf: Arena, Aufgaben, Sieg-Fenster */
/* Kampf */
.kampfleiste { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.arena { background-size: cover; background-position: center bottom; background-repeat: no-repeat; position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-radius: 28px; padding: 14px 16px 10px; min-height: 240px; overflow: hidden; box-shadow: var(--schatten); }
.seite { display: flex; flex-direction: column; justify-content: flex-end; }
.seite.rechts { align-items: flex-end; text-align: right; }
.herzen { display: flex; gap: 4px; margin-bottom: auto; background: rgba(255,255,255,.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 5px 8px; border-radius: 999px; align-self: flex-start; }
.herz { width: 24px; height: 22px; fill: var(--rot); filter: drop-shadow(0 2px 0 var(--rot-s)); transition: transform .3s; }
.herz.leer { fill: #d9d2ee; filter: none; transform: scale(.85); }
.mname { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; background: rgba(255,255,255,.85); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 999px; padding: 3px 12px; }
.bossmarke { font-size: .72rem; background: linear-gradient(180deg, var(--rot), var(--rot-d)); color: #fff; border-radius: 999px; padding: 1px 8px; vertical-align: 2px; }
.hpbalken { width: min(180px, 100%); height: 14px; background: rgba(255,255,255,.85); border-radius: 999px; overflow: hidden; margin: 8px 0 auto; box-shadow: inset 0 1px 3px rgba(18,8,60,.2); padding: 2px; }
.hpbalken span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--rot), #ff9a5d); box-shadow: inset 0 2px 0 rgba(255,255,255,.4); transition: width .45s cubic-bezier(.3,1.4,.5,1); }
.figur { position: relative; display: flex; align-items: flex-end; }
.avatar.kampf { width: 124px; height: 170px; filter: drop-shadow(0 8px 8px rgba(18,8,60,.2)); }
.avatar.kampf .stabglanz { animation: pulsieren 1.6s ease-in-out infinite; transform-origin: 107px 84px; }
@keyframes pulsieren { 50% { transform: scale(1.35); opacity: .6; } }
.monster.begleiter { width: 66px; height: 66px; margin-left: -12px; animation: wippen 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(18,8,60,.2)); }
.monster.kampf { width: 156px; height: 156px; animation: atmen 2.2s ease-in-out infinite; transform-origin: 50% 95%; filter: drop-shadow(0 8px 8px rgba(18,8,60,.2)); }
.monster.kampf.boss { width: 188px; height: 188px; }
@media (max-width: 480px) { .avatar.kampf { width: 94px; height: 129px; } .monster.kampf { width: 118px; height: 118px; } .monster.kampf.boss { width: 140px; height: 140px; } .monster.begleiter { width: 48px; height: 48px; } }
.gegner.treffer .monster { animation: treffer .5s; }
.gegner.angriff { animation: ausfall .5s; }
.held.getroffen { animation: wackeln .5s; }
@keyframes atmen { 50% { transform: scale(1.04, .96); } }
@keyframes wippen { 50% { transform: translateY(-7px); } }
@keyframes treffer { 0% { filter: brightness(2.6) drop-shadow(0 0 12px #fff); } 30% { transform: translateX(16px) rotate(7deg) scale(.95); } 60% { transform: translateX(-8px); } 100% { filter: drop-shadow(0 8px 8px rgba(18,8,60,.2)); transform: none; } }
@keyframes ausfall { 40% { transform: translateX(-60px) scale(1.1); } }
@keyframes wackeln { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.wackeln { animation: wackeln .45s; }
#effekte { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.zauber { position: absolute; left: 25%; top: 50%; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, var(--farbe) 55%, transparent 72%); box-shadow: 0 0 24px 10px var(--farbe); animation: flug .42s cubic-bezier(.5,0,.8,.6) forwards; }
.zauber::after { content: ""; position: absolute; right: 60%; top: 35%; width: 70px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, transparent, var(--farbe)); opacity: .7; }
.zauber.gross { width: 48px; height: 48px; }
@keyframes flug { 0% { transform: scale(.5); } 100% { left: 72%; top: 46%; transform: scale(1.5); opacity: .3; } }
.funke { position: absolute; left: 75%; top: 48%; width: 9px; height: 9px; border-radius: 50%; background: var(--farbe); box-shadow: 0 0 8px var(--farbe); animation: funke .8s ease-out forwards; }
@keyframes funke { 0% { transform: translate(0,0) scale(1.2); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
.blase { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); font-family: var(--f-display); font-weight: 700; font-size: 1.6rem; color: #fff; background: linear-gradient(180deg, #5fe39b, var(--gruen-d)); border-radius: 999px; padding: 4px 18px; box-shadow: 0 4px 0 var(--gruen-s), 0 10px 20px rgba(18,8,60,.25); animation: aufsteigen 1.3s forwards; white-space: nowrap; }
.blase.stufe { top: 36%; background: linear-gradient(180deg, var(--lila), #6a3fd0); box-shadow: 0 4px 0 #4a2a9a; font-size: 1rem; }
@keyframes aufsteigen { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 25% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px); } }
.serie { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%) scale(.8); font-family: var(--f-display); font-weight: 600; color: #5a3d00; background: linear-gradient(180deg, #ffe17a, var(--gold-d)); border-radius: 999px; padding: 2px 12px; box-shadow: 0 3px 0 var(--gold-s); opacity: 0; transition: opacity .2s, transform .2s; z-index: 2; }
.serie.an { opacity: 1; transform: translateX(-50%) scale(1); }

/* Aufgabe */
.aufgabe { margin-top: 16px; background: var(--panel); border-radius: var(--radius); padding: 16px 18px 20px; box-shadow: var(--schatten); }
.aufgabe.neu { animation: einblenden .3s cubic-bezier(.3,1.3,.5,1); }
@keyframes einblenden { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.aufgabe-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modulname { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--lila); background: #f1eaff; padding: 4px 10px; border-radius: 999px; }
.vorlesen { background: var(--panel-2); color: var(--lila); border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; flex: none; box-shadow: 0 3px 0 #ddd5f5; }
.vorlesen.betont { background: linear-gradient(180deg, #ffe17a, var(--gold-d)); color: #5a3d00; box-shadow: 0 3px 0 var(--gold-s); animation: wippen 1.4s ease-in-out 3; }
.hinweis { font-weight: 700; color: var(--tinte-weich); text-align: center; margin-top: 6px; }
.frage { font-family: var(--f-display); font-weight: 600; font-size: clamp(2.1rem, 8.5vw, 3rem); text-align: center; margin: 8px 0 12px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--tinte); }
.sachtext { display: block; font-family: var(--f-text); font-weight: 700; font-size: clamp(1.1rem, 4.4vw, 1.35rem); line-height: 1.55; text-align: left; max-width: 34em; margin: 0 auto; background: var(--panel-2); padding: 14px 16px; border-radius: 16px; }
.bild { display: flex; justify-content: center; margin-bottom: 14px; overflow-x: auto; }
.aufgabenbild { width: 100%; max-width: 440px; height: auto; display: block; }
.nebeneinander { display: flex; gap: 20px; justify-content: center; width: 100%; }
.nebeneinander .aufgabenbild { max-width: 170px; }
.musterreihe { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: center; }
.musterreihe .symbol { width: 36px; height: 36px; }
.luecke { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 3px dashed var(--lila); color: var(--lila); border-radius: 12px; font-size: 1.4rem; }
.optionen { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.option { min-height: 66px; border-radius: 18px; background: linear-gradient(180deg, #fff, #f3efff); font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; color: var(--tinte); box-shadow: inset 0 0 0 2px var(--linie), 0 5px 0 #d6cdf3, 0 8px 14px rgba(18,8,60,.08); display: grid; place-items: center; padding: 6px; transition: transform .08s; }
.option:active { transform: translateY(4px); box-shadow: inset 0 0 0 2px var(--linie), 0 1px 0 #d6cdf3; }
.option.richtig { background: linear-gradient(180deg, #7ff0b0, var(--gruen)); color: #fff; box-shadow: 0 5px 0 var(--gruen-s); }
.option.falsch { background: linear-gradient(180deg, #ff9aae, var(--rot)); color: #fff; box-shadow: 0 5px 0 var(--rot-s); }
.antwortfeld { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.eingabe { min-width: 150px; text-align: center; font-family: var(--f-display); font-weight: 600; font-size: 2.5rem; background: var(--panel-2); border-radius: 18px; padding: 4px 16px; box-shadow: inset 0 2px 4px rgba(18,8,60,.1); font-variant-numeric: tabular-nums; white-space: pre; color: var(--blau-d); }
.einheit { font-family: var(--f-display); font-size: 1.6rem; font-weight: 600; color: var(--tinte-weich); }
.ziffern { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 350px; margin: 0 auto; }
.ziffern button { height: 60px; border-radius: 18px; background: linear-gradient(180deg, #fff, #f3efff); font-family: var(--f-display); font-weight: 600; font-size: 1.7rem; color: var(--tinte); box-shadow: inset 0 0 0 2px var(--linie), 0 5px 0 #d6cdf3; transition: transform .06s; }
.ziffern button:active { transform: translateY(4px); box-shadow: inset 0 0 0 2px var(--linie), 0 1px 0 #d6cdf3; }
.ziffern .del { background: linear-gradient(180deg, #fff, #ffe9ee); color: var(--rot-d); }
.ziffern .ok { background: linear-gradient(180deg, #5fe39b, var(--gruen-d)); color: #fff; font-size: 1.15rem; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 5px 0 var(--gruen-s); }
.ziffern .ok:active { box-shadow: 0 1px 0 var(--gruen-s); }
.loesung { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: linear-gradient(180deg, #fff8e6, #ffefc7); border-radius: 18px; padding: 14px; box-shadow: inset 0 0 0 2px #ffe0a0; animation: einblenden .3s; }
.loesung b { font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; color: #b07800; }
.loesung span { font-weight: 700; font-size: 1.15rem; }


/* Sieg: neuer Rang und Abzeichen */
.rangauf, .abz-neu { display: flex; align-items: center; gap: 12px; text-align: left; border-radius: 18px; padding: 10px 14px; margin-top: 10px; }
.rangauf { background: linear-gradient(135deg, #fff3cf, #ffe08a); box-shadow: inset 0 0 0 2px #ffd25a; }
.abz-neu { background: #f3edff; }
.rangauf b, .abz-neu b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; }
.rangauf span, .abz-neu span { font-weight: 700; font-size: .88rem; color: var(--tinte-weich); }
.avatar.rangbild { width: 70px; height: 96px; flex: none; }
.abz-neu .medaille { width: 46px; height: 54px; flex: none; }


.hpzahl { font-family: var(--f-display); font-weight: 600; font-size: .8rem; color: var(--tinte); background: rgba(255,255,255,.8); border-radius: 999px; padding: 0 8px; margin: 3px 0 auto; font-variant-numeric: tabular-nums; }
.hpbalken { margin-bottom: 0; }
.gegner.wuetend .monster { animation: atmen .9s ease-in-out infinite, wutglut 1.2s ease-in-out infinite; }
@keyframes wutglut { 50% { filter: drop-shadow(0 0 14px #ff3b3b) saturate(1.4); } }
.blase.wut { background: linear-gradient(180deg, #ff7a7a, var(--rot-d)); box-shadow: 0 4px 0 var(--rot-s); top: 36%; font-size: 1.1rem; }
.blase.heilen { background: linear-gradient(180deg, #ff9ad1, #e0559f); box-shadow: 0 4px 0 #a8306f; top: 36%; font-size: 1rem; }
/* „Zu schwer“ */
.kopf-knoepfe { display: flex; align-items: center; gap: 8px; }
.zu-schwer { white-space: nowrap; background: #fff; color: var(--tinte-weich); font-weight: 800; font-size: .82rem; border-radius: 999px; padding: 8px 12px; box-shadow: inset 0 0 0 2px var(--linie), 0 3px 0 #e2dbf7; }
.zu-schwer:hover { color: var(--lila); }
.zu-schwer:disabled { opacity: .45; }
.loesung.hilfe { background: linear-gradient(180deg, #f1fbff, #def3ff); box-shadow: inset 0 0 0 2px #b6e2ff; }
.loesung.hilfe b { color: #1f66d1; }
/* Plus: Lösungsweg Schritt für Schritt (kern/loesungswege.js) */
.loesungsweg { margin: 0; padding: 0 0 0 1.4em; text-align: left; max-width: 34em; font-weight: 600; line-height: 1.45; }
.loesungsweg:empty { display: none; }
.loesungsweg li { margin: 4px 0; animation: einblenden .3s; }
.loesungsweg li:last-child { color: #1f7a4a; }
.loesung small { font-weight: 700; color: var(--tinte-weich); }
.ziffern .ok.breit { grid-column: span 3; height: 56px; }
.ziffern .komma { font-size: 2rem; line-height: 1; }
/* Bild-Antworten (lesefreie Aufgaben): untereinander, volle Breite, große Bilder */
.optionen.bilder { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
.optionen.bilder .option { padding: 8px 14px; min-height: 0; }
.optionen.untereinander { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
.optionen.untereinander .option { min-height: 54px; }
.optionen.bilder .aufgabenbild { max-height: 120px; }
