main:has(> .kerze) { max-width: none; }
.kerze { min-height: min(100%, 600px); display: grid; grid-template-rows: auto minmax(220px, 1fr) auto auto; gap: 8px; }
.kerze-kopf .dorf-logo { display: block; height: 28px; width: auto; margin: 0 0 .25rem; filter: drop-shadow(0 2px 6px #000a); }
.kerze-kopf span { color: #f5d48f; font-size: .75rem; font-weight: 800; letter-spacing: .13em; }
.kerze-kopf h1 { margin: 4px 0; }
.kerze-kopf p, .kerze-status { margin: 0; }
.kerze-buehne { position: relative; display: grid; place-items: center; overflow: hidden; width: 100%; min-height: 220px; padding: 0; border: 2px solid #ddbd7d; border-radius: 20px; background: radial-gradient(ellipse at 50% 40%, #355053, #102939 65%, #0a172a); color: white; cursor: pointer; }
.kerze-buehne:focus-visible { outline: 4px solid white; outline-offset: 3px; }
.kerze-buehne:hover { border-color: #ffe5a4; }
.kerze-lichtschein { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, #e8ab4f44, transparent 62%); opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.kerze-bild { position: absolute; width: min(100%, 800px); height: 100%; }
.kerze-glanz, .kerze-flamme { opacity: 0; transition: opacity .5s ease; }
.kerze-brennt .kerze-glanz, .kerze-brennt .kerze-lichtschein { opacity: 1; }
.kerze-halb .kerze-lichtschein { opacity: .55; }
.kerze-voll .kerze-lichtschein { opacity: 1; }
.kerze-an-0 .kerze-flamme-0,
.kerze-an-1 .kerze-flamme-1,
.kerze-an-2 .kerze-flamme-2 { opacity: 1; }
.kerze-brennt .kerze-buehne { border-color: #ffe5a4; box-shadow: inset 0 0 48px #ffb34733, 0 0 28px #ffd27a44; }
.kerze-feier .kerze-buehne { box-shadow: inset 0 0 60px #ffb34755, 0 0 40px #ffd27a66; }
.kerze-aus .kerze-buehne { border-color: #6a8498; box-shadow: none; }
.kerze-ziele {
  position: absolute; inset: auto 8px 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; z-index: 2;
}
.kerze-ziel {
  min-height: 96px; border-radius: 14px; border: 2px solid #9eb4c888; background: #091828eb; color: #fff;
  font: 700 clamp(.9rem, 1.8vw, 1.2rem)/1.2 var(--schrift, sans-serif); cursor: pointer; position: relative;
}
.kerze-ziel-an, .kerze-ziel[aria-pressed="true"] { background: #3a2810ee; border-color: #ffd27a; color: #fff6d8; box-shadow: 0 0 18px #ffb34755; }
.kerze-aktion { display: block; padding: .55rem .7rem; }
.kerze-status { min-height: 1.5em; }
.kerze-status-frisch { color: #ffe9a8; }
.kerze-fuss { display: flex; }
.kerze-fuss .knopf { min-width: min(220px, 100%); min-height: 112px; }
@media (min-height: 451px) { #app:has(> .kerze) {max-width:none;padding:10px!important} .kerze { height: calc(100dvh - 20px); min-height: 0; padding-bottom: 130px; box-sizing: border-box; } .kerze-fuss { position: fixed; left: 10px; bottom: 10px; z-index: 6; } #app .kerze-fuss .knopf {min-width:220px;min-height:112px} }
@media (max-height: 650px) { .kerze-kopf p { display: none; } }
@media (max-width: 560px) { #app .kerze-fuss .knopf { min-width: 176px; min-height: 96px; } }
@media (prefers-reduced-motion: reduce) { .kerze-lichtschein, .kerze-glanz, .kerze-flamme { transition: none; } .kerze-brennt .kerze-buehne { box-shadow: none; } }
body.bf-cvi .kerze-buehne { background: #000; border-color: var(--bf-cvi-farbe, #ffd400); }
body.bf-cvi .kerze-brennt .kerze-buehne { border-color: var(--bf-cvi-farbe, #ffd400); box-shadow: none; }
body.bf-cvi .kerze-tanne, body.bf-cvi .kerze-lichtschein, body.bf-cvi .kerze-glanz { display: none; }
body.bf-cvi .kerze-flamme { transition: none; }
body.bf-cvi .kerze-aktion-an { background: #000; border-color: var(--bf-cvi-farbe, #ffd400); color: #fff; box-shadow: none; }
body.christmas-ruhig .kerze-lichtschein, body.christmas-ruhig .kerze-glanz, body.christmas-ruhig .kerze-flamme { transition: none; }
body.christmas-ruhig .kerze-brennt .kerze-buehne { box-shadow: none; }

/* ------------------------------------------------------------------ 3D Vollbild */
.kerze.kerze-3d, .kerze.kerze-laedt {
  position: fixed; inset: 0; max-width: none; margin: 0; overflow: hidden;
  display: block; min-height: 0; height: auto; padding: 0;
  --kerze-leiste: var(--zurueck-h, 112px);
  background: #0a1420; color: var(--text, #fbf7ee);
  transition: background .6s ease;
}
.kerze.kerze-3d.kerze-brennt, .kerze.kerze-laedt.kerze-brennt {
  background: #1c2618;
}
.kerze-3d .kerze-kopf, .kerze-laedt .kerze-kopf {
  position: absolute; z-index: 2; top: var(--oben, 10px); left: var(--links, 10px); right: auto;
  max-width: min(42rem, 70vw); pointer-events: none; text-shadow: 0 2px 8px #000c;
}
@media (max-height: 700px) { .kerze-3d .kerze-kopf > p, .kerze-laedt .kerze-kopf > p { display: none; } }
.kerze-3d .kerze-buehne {
  position: absolute; inset: 0 0 calc(var(--kerze-leiste) + var(--unten, 10px) + var(--luecke, 8px));
  border: 0; border-radius: 0; background: transparent; min-height: 0;
  pointer-events: none;
}
.kerze-3d .kerze-bild, .kerze-3d .kerze-lichtschein, .kerze-3d .kerze-ziele { display: none; }
.kerze-3d .fest-3d-targets { position: absolute; inset: 0; pointer-events: none; }
.kerze-3d .fest-3d-target {
  position: absolute; transform: translate(-50%, -50%);
  width: var(--ziel, 120px); height: var(--ziel, 120px);
  padding: 0; border: 0; background: transparent; border-radius: 50%;
  cursor: pointer; pointer-events: auto;
}
.kerze-3d .fest-target-ring {
  display: block; width: 48%; height: 48%; margin: auto;
  border: 2px solid #ffd27a88; border-radius: 50%;
}
.kerze-3d .fest-3d-target.kerze-ziel-an .fest-target-ring,
.kerze-3d .fest-3d-target[aria-pressed="true"] .fest-target-ring {
  border-color: #fff5c7; box-shadow: 0 0 18px #ffb34788; background: #ffb34722;
}
.kerze-3d .kerze-status, .kerze-laedt .kerze-status {
  position: absolute; z-index: 2; left: var(--links, 10px); right: auto;
  bottom: calc(var(--kerze-leiste) + var(--unten, 10px) + var(--luecke, 8px) + 8px);
  top: auto; width: max-content; max-width: min(90vw, 36rem);
  padding: 10px 14px; border-radius: 12px;
  background: var(--flaeche-glas, #0b1622d8); margin: 0; pointer-events: none;
}
.kerze-3d .kerze-fuss, .kerze-laedt .kerze-fuss {
  position: absolute; left: var(--links, 10px); right: var(--rechts, 10px); bottom: var(--unten, 10px);
  z-index: 4; margin: 0;
}
.kerze-3d .kerze-fuss .knopf, .kerze-laedt .kerze-fuss .knopf {
  min-width: var(--zurueck-b, 220px); min-height: var(--zurueck-h, 112px);
}
.kerze-3d .kerze-3d-scene, .kerze-laedt .kerze-3d-scene {
  position: absolute; inset: 0 0 calc(var(--kerze-leiste) + var(--unten, 10px) + var(--luecke, 8px)) !important;
  overflow: hidden;
}
.kerze-3d-scene > canvas { width: 100%; height: 100%; display: block; }
.kerze-3d .fest-3d-targets { position: absolute; inset: 0; pointer-events: none; }
.kerze-3d .fest-3d-target {
  position: absolute; transform: translate(-50%, -50%);
  width: var(--ziel, 120px); height: var(--ziel, 120px);
  min-width: 96px; min-height: 96px;
  padding: 0; border: 0; background: transparent; border-radius: 50%;
  cursor: pointer; pointer-events: auto;
}
.kerze-3d .fest-target-ring {
  display: block; width: 64%; height: 64%; margin: auto;
  border: 2px dashed #fff2be; border-radius: 50%;
  box-shadow: 0 0 0 2px #25364766, 0 0 20px #ffdc8b44;
}
.kerze-3d .fest-3d-target:hover .fest-target-ring,
.kerze-3d .fest-3d-target:focus-visible .fest-target-ring {
  border: 4px solid #fff5c7; background: #ffe3a322;
}
.kerze-3d .fest-3d-target.kerze-ziel-an .fest-target-ring {
  border: 3px solid #ffd27a; box-shadow: 0 0 0 2px #ffb34744, 0 0 28px #ffd27a88;
  background: #ffd27a22;
}
.kerze-3d.kerze-brennt { background: #1a2a28; }
.kerze-3d.kerze-aus { background: #0a1420; }
.kerze-3d .kerze-status-frisch,
.kerze-laedt .kerze-status-frisch {
  outline: 2px solid #ffe9a8aa; background: #2a3a28e8;
}
@media (min-height: 451px) {
  .kerze.kerze-3d, .kerze.kerze-laedt { height: auto; padding-bottom: 0; }
  .kerze-3d .kerze-fuss, .kerze-laedt .kerze-fuss { position: absolute; }
}
/* Der Leuchter steht zwischen der Überschrift und der Statuszeile. */
#app:has(> .kerze) {padding:0!important;}
#app > .kerze {
  box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto minmax(150px,1fr) auto auto;gap:6px;
  position:relative;inset:auto;width:100%;height:100dvh;min-height:0;overflow:auto;
  padding:8px;background:#102337;color:#fff4df;
}
#app .kerze > .kerze-kopf {
  position:static;max-width:none;width:auto;grid-area:1/1;margin:0;
  text-shadow:none;background:transparent;box-shadow:none;border:0;
}
#app .kerze-kopf > :is(.dorf-logo,span) {display:none;}
#app .kerze > :is(.kerze-3d-scene,.kerze-buehne) {
  grid-area:2/1;position:relative!important;inset:auto!important;min-height:0;
  box-sizing:border-box;width:100%;height:auto;align-self:stretch;
  overflow:hidden;border-radius:14px!important;
}
#app .kerze-3d > .kerze-buehne {display:none;}
#app .kerze-3d .kerze-3d-scene > canvas {position:absolute;inset:0;}
#app .kerze-3d .fest-3d-target {width:var(--ziel,120px);height:var(--ziel,120px);min-width:96px;min-height:96px;}
#app .kerze-3d .fest-target-ring {border:2px dashed #ffeba7bb;width:46%;height:46%;background:none;box-shadow:0 0 0 1px #43342077;}
#app .kerze-3d .fest-3d-target:focus-visible .fest-target-ring {border:4px solid #fff;}
#app .kerze > .kerze-status {position:static;inset:auto;grid-area:3/1;max-width:100%;width:auto;margin:0;padding:6px 10px;}
#app .kerze > .kerze-fuss {position:static;inset:auto;grid-area:4/1;margin:0;padding:0;}
#app .kerze .kerze-buehne {display:grid;grid-template-rows:minmax(0,1fr) auto;align-items:stretch;justify-items:stretch;}
#app .kerze.kerze-3d .kerze-buehne {display:none;}
#app .kerze .kerze-bild {position:static;grid-area:1/1;justify-self:center;width:100%;height:100%;max-width:1000px;min-height:0;}
#app .kerze .kerze-ziele {position:static;grid-area:2/1;margin:4px;gap:4px;}
#app .kerze .kerze-aktion {padding:4px;overflow-wrap:anywhere;}
#app .kerze .kerze-ziel {min-width:0;}
body.bf-cvi #app .kerze,body.bf-cvi #app .kerze .kerze-buehne {background:#000!important;}
body.bf-cvi .kerze .kerze-bild > :not(.kerze-einzeln) {display:none;}
body.bf-cvi .kerze .kerze-einzeln > :is(rect,ellipse,path) {fill:#000;stroke:var(--bf-cvi-farbe,#ffd400);stroke-width:5;}
body.bf-cvi .kerze .kerze-flamme > * {display:none;}
body.bf-cvi .kerze .kerze-flamme > path:nth-of-type(2) {display:block;fill:var(--bf-cvi-farbe,#ffd400);opacity:1;}
@media (max-height:450px) and (orientation:landscape) {
  #app > .kerze {grid-template-columns:minmax(0,1fr) clamp(170px,29vw,240px);grid-template-rows:auto 1fr auto;}
  #app .kerze > :is(.kerze-3d-scene,.kerze-buehne) {grid-area:1/1/4/2;}
  #app .kerze > .kerze-kopf {grid-area:1/2;}
  #app .kerze > .kerze-status {grid-area:2/2;align-self:end;padding:3px;}
  #app .kerze > .kerze-fuss {grid-area:3/2;}
  #app .kerze .kerze-fuss .knopf {min-width:0!important;width:100%;min-height:72px!important;}
  #app .kerze .kerze-ziel {min-height:72px;}
}
#app .kerze > .kerze-status {min-width:0;box-sizing:border-box;white-space:normal;overflow-wrap:break-word;}
#app > .kerze > p.kerze-status {width:auto!important;max-width:100%!important;}
