.backen { max-width: 1400px; margin-inline: auto; }
.backen-inhalt { display: grid; grid-template-columns: minmax(110px, 220px) 1fr; gap: clamp(12px, 3vw, 32px); align-items: center; margin-block: 20px; }
.backen-symbol svg { display: block; width: min(100%, 200px); height: auto; margin: auto; }
.backen-schritt { border: 2px solid #e0a84a; border-radius: 18px; padding: clamp(12px, 2vw, 24px); background: #0c1d38; }
.backen-schritt h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.backen-schritt p { margin-block: .4em; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.backen-aktionen { display: flex; flex-wrap: wrap; gap: 12px; }
.backen-aktionen .knopf { min-width: 160px; min-height: 96px; }
@media (max-height: 620px) {
  .backen > p { margin-block: 4px; }
  .backen-inhalt { margin-block: 8px; grid-template-columns: minmax(140px, 200px) 1fr; }
  .backen-schritt { padding: 10px 16px; }
}
@media (max-width: 480px) {
  .backen-inhalt { grid-template-columns: 1fr; margin-block: 10px; }
  .backen-symbol svg { width: 120px; }
  .backen-aktionen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backen-aktionen .knopf { min-width: 120px; min-height: 96px; }
}

/* Bild je Schritt und Fortschritt (13.11.2026). */
.backen-inhalt { grid-template-columns: minmax(180px, 420px) 1fr; }
.backen-symbol { display: grid; place-items: center; padding: 10px; border-radius: 24px; background: radial-gradient(circle at 50% 40%, #fff4dc, #e4b56e 75%); border: 3px solid #e0a84a; box-shadow: inset 0 0 0 4px #fff4dc99, 0 12px 26px #0007; }
.backen-symbol svg { width: 100%; max-width: 420px; max-height: 42vh; }
.backen-fortschritt { display: flex; gap: 8px; list-style: none; margin: 4px 0 10px; padding: 0; }
.backen-fortschritt li { flex: 1; height: 10px; border-radius: 6px; background: #ffffff26; }
.backen-fortschritt li.fertig { background: #e0a84a; }
.backen-fortschritt li.jetzt { background: #ffe4bd; box-shadow: 0 0 10px #ffe4bd99; }
.backen-geschafft .backen-zaehler { color: #ffe4bd; font-weight: 800; }
.backen-geschafft .backen-schritt { border-color: #ffe4bd; box-shadow: 0 0 0 2px #e0a84a44; }
.backen-geschafft .backen-symbol { border-color: #ffe4bd; box-shadow: inset 0 0 0 4px #fff4dc99, 0 0 0 3px #e0a84a55, 0 12px 26px #0007; }
.backen-geschafft.backen-3d .backen-schritt { background: #2f6b4add; border-color: #ffe4bd; }
body.bf-cvi .backen-geschafft .backen-schritt,
body.bf-cvi .backen-geschafft .backen-symbol { border-color: var(--bf-cvi-farbe, #ffd400); box-shadow: none; }

/* Form- und Verzierungswahl: drei große Dwell-Ziele */
.backen-wahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
#app .backen .backen-wahl {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; min-height: 96px; padding: 8px; font-weight: 800; overflow-wrap: anywhere;
  color: #fff9e9; background: #0c1d38; border: 2px solid #e0a84a; border-radius: 16px;
}
#app .backen .backen-wahl:hover { background: #4a3224; border-color: #fff4dc; }
#app .backen .backen-wahl.gewaehlt { border-color: #e0a84a; box-shadow: 0 0 0 3px #e0a84a55; background: #2f6b4a; }
#app .backen .backen-wahl > svg { width: 48px; height: 48px; color: #e0a84a; }
.backen-farbpunkt {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff4dc;
  background: var(--bk-farbe, #fff4dc); box-shadow: 0 3px 6px #0005;
}
.backen-streusel { display: grid; grid-template-columns: repeat(3, 10px); gap: 4px; place-items: center; }
.backen-streusel i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.backen-streusel i:nth-child(1) { background: #c83a42; }
.backen-streusel i:nth-child(2) { background: #2f6b4a; }
.backen-streusel i:nth-child(3) { background: #e0a84a; }
.backen-symbol { position: relative; }
.backen-feier { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.backen-feier i {
  position: absolute; top: -30px; width: 22px; height: 22px; background: #e0a84a;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: backen-fallen 3.2s ease-in forwards;
}
.backen-feier i:nth-child(odd) { background: #fff4dc; width: 16px; height: 16px; }
.backen-feier i:nth-child(1) { left: 6%; animation-delay: 0s } .backen-feier i:nth-child(2) { left: 13%; animation-delay: .4s }
.backen-feier i:nth-child(3) { left: 21%; animation-delay: .15s } .backen-feier i:nth-child(4) { left: 28%; animation-delay: .7s }
.backen-feier i:nth-child(5) { left: 36%; animation-delay: .25s } .backen-feier i:nth-child(6) { left: 43%; animation-delay: .9s }
.backen-feier i:nth-child(7) { left: 50%; animation-delay: .1s } .backen-feier i:nth-child(8) { left: 57%; animation-delay: .55s }
.backen-feier i:nth-child(9) { left: 64%; animation-delay: .3s } .backen-feier i:nth-child(10) { left: 71%; animation-delay: .8s }
.backen-feier i:nth-child(11) { left: 78%; animation-delay: .2s } .backen-feier i:nth-child(12) { left: 85%; animation-delay: .65s }
.backen-feier i:nth-child(13) { left: 91%; animation-delay: .45s } .backen-feier i:nth-child(14) { left: 96%; animation-delay: 1s }
@keyframes backen-fallen { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(560px) rotate(200deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .backen-feier { display: none; } }
body.christmas-ruhig .backen-feier { display: none; }
body.bf-cvi .backen-feier { display: none; }
body.bf-cvi #app .backen .backen-wahl { background: #000; border-color: var(--bf-cvi-farbe, #ffd400); }
@media (max-width: 390px) { .backen-wahlen { grid-template-columns: 1fr; } #app .backen .backen-wahl { flex-direction: row; } }
.backen-3d .backen-wahlen { pointer-events: auto; }
.backen-3d .backen-wahl { min-width: var(--knopf-b, 120px); min-height: var(--knopf-min-h, 96px); }
@media (max-height: 650px) { .backen-inhalt { grid-template-columns: minmax(160px, 280px) 1fr; } .backen-symbol svg { max-height: 34vh; } }
@media (max-width: 480px) { .backen-symbol svg { width: 100%; max-width: 240px; } }
body.bf-cvi .backen-symbol { background: #fff; border-color: var(--bf-cvi-farbe, #ffd400); }

/* ------------------------------------------------------------------ 3D Vollbild */
#app:has(> .backen.backen-3d), #app:has(> .backen.backen-laedt) { max-width: none; padding: 0 !important; }
.backen.backen-3d, .backen.backen-laedt {
  position: fixed; inset: 0; overflow: hidden; display: grid;
  grid-template-rows: auto minmax(0,1fr) auto; box-sizing: border-box;
  padding: 12px 16px 10px; background: #0c1d38; color: #fff9e9;
  --bk-leiste: var(--zurueck-h, 112px);
  --buehne-links: min(420px, 44vw);
}
html body #app > .backen.backen-3d > h1,
html body #app > .backen.backen-3d > p,
html body #app > .backen.backen-laedt > h1,
html body #app > .backen.backen-laedt > p {
  position: absolute; z-index: 4; left: var(--links, 10px); margin: 0;
  text-shadow: 0 2px 8px #000c; pointer-events: none;
  width: calc(var(--buehne-links) - 16px) !important; max-width: calc(var(--buehne-links) - 16px) !important;
  white-space: normal; overflow-wrap: break-word;
}
.backen-3d > h1, .backen-laedt > h1 { top: var(--oben, 10px); }
.backen-3d > p:not(.backen-schritt p), .backen-laedt > p:first-of-type { top: calc(var(--oben, 10px) + 2.7rem); }
.backen-3d .backen-inhalt {
  position: absolute; inset: 0 0 calc(var(--bk-leiste) + var(--unten, 10px) + var(--luecke, 8px));
  display: block; pointer-events: none; margin: 0;
}
.backen-3d .backen-symbol { display: none; }
.backen-3d .backen-schritt {
  position: absolute; top: calc(var(--oben, 10px) + 6.4rem);
  left: var(--links, 10px); right: auto; width: calc(var(--buehne-links) - 8px); max-width: calc(var(--buehne-links) - 8px);
  pointer-events: auto; background: #0c1d38d8; z-index: 3;
}
.backen-3d .backen-aktionen, .backen-laedt .backen-aktionen {
  position: absolute; left: var(--links, 10px); right: var(--rechts, 10px); bottom: var(--unten, 10px);
  z-index: 4; margin: 0;
}
.backen-3d .backen-aktionen .knopf[data-backen="zurueck"],
.backen-laedt .backen-aktionen .knopf[data-backen="zurueck"] {
  min-width: var(--zurueck-b, 220px); min-height: var(--zurueck-h, 112px);
}
.backen-3d .backen-aktionen .knopf { min-width: var(--knopf-b, 120px); min-height: var(--knopf-min-h, 96px); }
.backen.backen-3d > .backen-3d-scene {
  position: absolute;
  top: var(--oben, 12px);
  right: var(--rechts, 12px);
  bottom: calc(var(--bk-leiste) + var(--unten, 10px) + var(--luecke, 8px));
  left: calc(var(--links, 10px) + var(--buehne-links) + 56px);
  overflow: hidden; z-index: 0; border-radius: 18px; box-shadow: 0 0 0 2px #e0a84a;
}
.backen-3d-scene > canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 820px) {
  .backen.backen-3d { --buehne-links: min(92vw, 640px); }
  .backen.backen-3d > .backen-3d-scene {
    left: var(--links, 10px); right: var(--rechts, 10px);
    top: calc(var(--oben, 10px) + 5.6rem); height: 30vh; bottom: auto;
  }
  .backen-3d .backen-schritt { top: calc(30vh + 6.4rem); width: min(92vw, 640px); max-width: min(92vw, 640px); }
}

/* Die Bilder nutzen den Platz neben dem Schritttext. Höher spezifiziert als
   der gemeinsame Rahmen, damit dieser sie nicht erneut klein begrenzt. */
@media (min-width: 701px) and (min-height: 651px) {
  #app > .backen > :not(.backen-aktionen) { max-width: min(92vw, 1500px); }
  #app .backen .backen-inhalt { grid-template-columns: minmax(340px, 48%) minmax(0, 1fr); }
  #app .backen .backen-symbol svg { width: min(100%, calc(50vh * 1.25), 620px); max-width: none; max-height: none; }
}
@media (min-width: 701px) and (min-height: 451px) and (max-height: 650px) {
  #app .backen .backen-inhalt { grid-template-columns: minmax(240px, 42%) minmax(0, 1fr); }
  #app .backen .backen-symbol svg { width: min(100%, calc(44vh * 1.25), 420px); max-width: none; max-height: none; }
}
@media (max-width: 700px) {
  #app .backen .backen-inhalt { grid-template-columns: 1fr; gap: 10px; }
  #app .backen .backen-symbol { width: 100%; box-sizing: border-box; }
  #app .backen .backen-symbol svg { width: min(100%, 340px); max-width: none; max-height: none; }
}
@media (min-width: 701px) and (max-height: 450px) {
  #app .backen .backen-inhalt { grid-template-columns: minmax(200px, 38%) minmax(0, 1fr); }
  #app .backen .backen-symbol svg { width: min(100%, calc(36vh * 1.25)); max-width: none; max-height: none; }
  #app .backen .backen-aktionen .knopf { min-width: 120px; min-height: 96px; }
}
@media screen {
  html body #app > section.backen.backen-3d:not([hidden]) {
    position: relative; inset: auto; width: 100%; padding: 14px; overflow: visible;
    grid-template-columns: minmax(260px, 31%) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(max-content, 1fr) auto;
    grid-template-areas: "titel szene" "anleitung szene" "wahl szene" "fuss fuss"; gap: 10px;
  }
  html body #app > .backen.backen-3d > :is(h1, p) {
    position: static; width: auto !important; max-width: none !important; margin: 0;
  }
  #app .backen-3d > h1 { grid-area: titel; }
  #app .backen-3d > p { grid-area: anleitung; }
  #app .backen-3d .backen-inhalt { position: static; grid-area: wahl; align-self: center; }
  #app .backen-3d .backen-schritt { position: static; width: auto; max-width: none; }
  #app .backen-3d .backen-aktionen { position: static; grid-area: fuss; }
  #app .backen.backen-3d > .backen-3d-scene {
    grid-area: szene; position: relative; inset: auto; width: 100%; min-height: 270px; height: auto;
  }
  #app .backen-3d-scene canvas { position: absolute; inset: 0; }
}
@media screen and (orientation: portrait), screen and (max-width: 640px) {
  html body #app > section.backen.backen-3d:not([hidden]) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: max-content max-content auto minmax(0,1fr) auto;
    grid-template-areas: "titel" "anleitung" "szene" "wahl" "fuss";
  }
  #app .backen.backen-3d > .backen-3d-scene { height: clamp(230px, 35dvh, 450px); min-height: 0; }
}

#app .backen:not(.backen-3d) .backen-symbol {position:relative;overflow:hidden;min-height:0;padding:0;background:#16293d;}
#app .backen .backen-standbild,#app .backen .backen-kontur {display:block;width:100%;height:100%;position:absolute;inset:0;object-fit:contain;}
body.bf-cvi #app .backen .backen-symbol {background:#000!important;}
body.bf-cvi #app .backen .backen-kontur {background:var(--bf-cvi-farbe,#ffd400)!important;mask:var(--bild) center/contain no-repeat;}
@media (orientation:portrait){
 #app .backen:not(.backen-3d) .backen-symbol {height:clamp(132px,30dvh,405px);}
}

.backen-sagen {color:#fff6dc;background:#152941;border:2px solid #dbaf66;border-radius:16px;
  width:min(580px,95vw);max-height:98dvh;box-sizing:border-box;padding:12px;}
.backen-sagen::backdrop {background:#091321d9;}
.backen-sagen div {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;}
.backen-sagen output {display:block;min-height:1.25em;margin:4px;}
#app .backen-sagen .knopf {width:100%;min-height:96px;margin:0;}
body.bf-cvi .backen-sagen {background:#000;color:var(--bf-cvi-farbe);border-color:currentColor;}
@media (max-height:450px){#app .backen-sagen .knopf {min-height:72px;}}
