#haupt {
    visibility: hidden;
}


@supports (display: grid) {
    #alt {
        display:none;
    }
    
    #haupt { 
        visibility: visible; 
    }
}
 
/* delicious-handrawn-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Delicious Handrawn';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/delicious-handrawn-v3-latin-regular.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
            url('../fonts/delicious-handrawn-v3-latin-regular.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

@font-face {
        font-family: "Segment7";
        src:
                url(../fonts/Segment7Standard.woff2) format('woff2'),
                url(../fonts/Segment7Standard.woff) format('woff');
}

/* architects-daughter-regular - latin */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Architects Daughter';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/architects-daughter-v18-latin-regular.woff2') format('woff2'), /* Chrome 36+, Opera 23+, Firefox 39+ */
            url('../fonts/architects-daughter-v18-latin-regular.woff') format('woff'); /* Chrome 5+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
@font-face { 
    
             font-family: 'druck';
             src: url('../fonts/Druckschrift_BY_WOK.ttf') format('truetype'); 
             
}                 

* {
     box-sizing: border-box;
}

html,
body {
    width:100%;
    height:100%;
    margin:0;
    padding:0;
}

body {
   
    font-family:druck,times;
   height:100vh;
   display:flex;
   overflow:hidden;
   
  
    
}

#alt {
    position:absolute;
    background-color:white;
    border-style: solid;
    height:300px;
    width:300px;

    font-size:large;
   left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 0;
    
    
    
}

#start {
     position:absolute;
    height:100vh;
    width:100vw;
    background-color:black;
    z-index:1000;  
    padding:0px;
    margin:0px;
    color:white;
}

/* Warte-Spinner während der Initialisierung */
#start {
    display:flex;
    flex-direction: column;
    align-items:center;
    justify-content:center;
    gap: 2vh;
}

#start .lade-spinner {
    width: 10vh;
    height: 10vh;
    border-radius: 50%;
    border: 1.2vh solid rgba(255,255,255,0.25);
    border-top-color: rgba(255,255,255,0.95);
    animation: ladeDreh 0.9s linear infinite;
}

@keyframes ladeDreh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}




#haupt {
    width:100vw;
    height:100vh;
    min-width:100vw;
    min-height:100vh;
    flex: 0 0 100vw;
    display: grid;
    
        grid-template-columns: 6fr 4fr; 
        grid-template-rows: 18vh 1fr;
 background-image: url('../media/pics/dalli/graff.png');
   background-repeat: no-repeat;
    
    background-size: cover; 
} 




#ampeln {
   display:flex; 
         align-items:center;
   justify-content: center;
         gap: 0vh;
     height:auto;
         padding-top:0;
     align-self:start;
     grid-row:1;
     grid-column:1;
     z-index:20;
   

}

#ampel1, #ampel2 {
         height:13vh;
         width:13vh;
         box-shadow: none;
         filter: drop-shadow(10px 14px 6px rgba(0,0,0,0.72));
    
}

#ampel1 {
        content:url('../media/pics/dalli/ampelaus.png');
    height:13vh;
    width:13vh;
}

#ampel2 {
        content:url('../media/pics/dalli/ampelaus.png'); 
        height:13vh;
    width:13vh;
}

#zaehler {
  
  position:relative;
        margin-left:2vh;
    font-size:9vh;
   
    width:13vh;
    height:10vh;
    
    font-family: Segment7,monospace;
    background-color:black;
    border-radius: 5px;
    border-width: 0.5vh;
    border-color: darkgray;
    border-style: solid;
    box-shadow: inset -0.5vh -0.5vh 0.5vh 0.5vh rgba(255,255,255,0.5),
        5px 7px 8px 8px rgba(0,0,0,0.78);
    
    text-align:center;
}

#zaehler p {
    position:absolute;
    top:0px;
    left:0px;
    margin:0px;
   color:red;      
}
#zaehler p.zahl {
    color:red;
}

#zaehler p.dunkel {
    color:#303030;
}


#multi {   
    display:grid;
    grid-row: span 2;
    grid-column: 2;
    position:relative;
    grid-template-rows: 1fr 2fr;
    gap: 1.8vh;
    padding: 1.8vh 1.8vw;
   }

#multi.neu-layout .neu-aufgabe-bereich {
    grid-row: 1;
    min-height: 0;
}

#multi.neu-layout.aufgabeBildFormat .neu-aufgabe-bereich {
    display:flex;
    align-items:center;
    justify-content:center;
}

#multi.neu-layout .neu-loesung-bereich {
    grid-row: 2;
    min-height: 0;
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5vw, 1fr));
    grid-auto-rows: 1fr;
    gap: 1.6vh 1.2vw;
    align-items: stretch;
}

#multi.neu-layout.antwortQuadratisch .neu-loesung-bereich {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    justify-content: center;
    align-content: center;
    justify-items: stretch;
}

#multi.neu-layout.antwortQuadratisch .neu-loesung-bereich .antwort {
    aspect-ratio: 1 / 1;
}

#multi.neu-layout.antwortQuer .neu-loesung-bereich {
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
}

#multi.neu-layout.antwortQuer .neu-loesung-bereich .antwort {
    aspect-ratio: 3 / 1;
}

#multi.neu-layout.modusTippen {
    grid-template-rows: 1fr 1fr;
    align-items: stretch;
    justify-items: stretch;
}

#multi.neu-layout.modusTippen .neu-loesung-bereich {
    display:flex;
    align-items: stretch;
}

#bild {    
    width:calc(100% - 1.2vw);     
    margin-left:1.2vw;
    aspect-ratio:4/3;  
    display:grid;
    position:relative;      
    grid-row:2;
    grid-column: 1;
    align-self: start;
    justify-self:center;
    
}
 
div.teil {
    background-color:green;
    border:solid;
    border-width: 0px;
    box-shadow: inset 0px 0px 20px 9px rgba(0,0,0,0.65);
    background-image: url('../media/pics/dalli/blech.png');
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

div.teil.aufgedeckt {
    opacity: 0;
    visibility: hidden;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}



#rahmen {
   position:absolute; 
   width:100%;
   height:100%;
    background-image: url(../media/pics/dalli/rahmen.png);
   background-size: 100% 100%; 
   box-shadow: 20px 28px 8px 8px rgba(0,0,0,0.78);
   z-index:10;
}

#dalli { 
    display:grid;
    margin:4% 4%;
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.antwort, .aufgabe {
    position:relative;
    display:flex;
    align-items: center;
    padding:4%;
    background-color: transparent;
    background-image: none;
    justify-items: center;   
    margin: 0.5vw  ;    
    overflow: hidden;

    box-shadow: none;
    border-radius:0.5vw;
    color: #404040;
    text-shadow: none;
    
}

.aufgabe {
    color:red;
    text-shadow: 2px 2px 2px #666666, -2px -2px #FFFFFF;
    height:18vh;
    width:37vw; 
}

.antwort::before,
.aufgabe::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--kachel-bg-url, url('../media/pics/dalli/schilda.png'));
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    transform: rotate(var(--kachel-bg-rot, 0deg));
    transform-origin: center center;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.antwort > *,
.aufgabe > * {
    position: relative;
    z-index: 1;
}

#multi.neu-layout .aufgabe {
    width:100%;
    height:100%;
    margin:0;
}

#multi.neu-layout.aufgabeBildFormat .aufgabe {
    width:auto;
    height:100%;
    aspect-ratio: 1 / 1;
    max-width:100%;
    margin:0 auto;
}

/* Wenn die Aufgabe ein Bild ist oder viel Text hat, braucht die Aufgabenkachel mehr Höhe */
#multi.tallTask .aufgabe {
    height:36vh;
}

#multi.neu-layout.tallTask .aufgabe {
    height:100%;
}

.platzhalter {
    display:inline-block;
    min-width:1.2em;
    height:1.2em;
    line-height:1.2em;
    margin:0 0.1em;
    border:3px solid #888;
    border-radius:3px;
    font-weight:normal;
}


.antwort:hover {
    box-shadow: 3px 4px 8px 5px rgba(0,0,0,0.78);

}

/* Antwortkacheln bewusst ohne visuelle Effekte darstellen */
.antwort,
.antwort:hover,
.antwort:focus,
.antwort:active,
.aufgabe,
.aufgabe:hover,
.aufgabe:focus,
.aufgabe:active {
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
}

/* Klick-Feedback nur als Schatten (ohne Rahmen). */
#multi .antwort.klick-richtig {
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.9), 0 0 16px rgba(56, 176, 0, 0.65) !important;
}

#multi .antwort.klick-falsch {
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.9), 0 0 16px rgba(229, 57, 53, 0.68) !important;
}

/* Schrift mit leichtem Gravur-Look (helle Oberkante, dunklere Unterkante). */
#multi .antwort [data-rz-typ="text"],
#multi .aufgabe [data-rz-typ="text"],
#multi .antwort p,
#multi .aufgabe p {
    color: #3f3f3f;
    text-shadow:
        0 -1px 0 rgba(255, 255, 255, 0.72),
        0 1.4px 0 rgba(0, 0, 0, 0.40),
        0 2px 2px rgba(0, 0, 0, 0.20) !important;
}

.antwort img,
.antwort img.bild-mit-transparenz,
.aufgabe img,
.aufgabe img.bild-mit-transparenz,
#multi .antwort img,
#multi .aufgabe img,
#multi .antwort img.bild-mit-transparenz,
#multi .aufgabe img.bild-mit-transparenz {
    border: none !important;
    box-shadow: none !important;
    filter: none !important;
    background: transparent !important;
}

#multi img {
    max-height:80%;
    max-width:80%;
    margin-left:auto;
    margin-right:auto;   
    border:solid;
    border-width: 5px;
    border-color:#404040;
    box-shadow:  0 -2px 2px #666666, 0 2px 2px #FFFFFF;
}

#multi img.bild-mit-transparenz {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    filter: none !important;
}

/* Geld-Anzeige aus Einzelbildern (aus aMeta/lMeta.geldRender) */
#multi .geld-render {
    width:100%;
    height:100%;
    display:grid;
    place-items:center;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    overflow:hidden;
    gap: 0.6vh 0.6vw;
    padding: 0.6vh 0.6vw;
}

#multi .geld-render .geldteil-wrap {
    position:relative;
    display:block;
}

#multi .geld-render .geldteil-img {
    display:block;
    border:none;
    box-shadow:none;
    margin:0;
    position:absolute;
    top:50%;
    left:50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    max-width:100%;
    max-height:100%;
    object-fit: contain;
}

#multi .geld-render .geldteil-img.geld-rot {
    transform: translate(-50%, -50%) rotate(90deg);
}

/* Geldrechnen: Rechenzeichen (+, -, =) bei Geldbildern immer gut lesbar halten */
#multi .geldrechnen-zeichen > span {
    display:block;
    font-size:1.9rem;
    line-height:1;
    font-weight:700;
}

/* Geldrechnen: Text-Summanden neben Geldbildern im Dalli größer darstellen */
#multi .geldrechnen-summand > span {
    display:block;
    font-size: clamp(1.4rem, 2.4vw, 3rem);
    line-height:1.1;
    font-weight:700;
}

/* Zusätzlicher Schutz: Geldbilder dürfen nie über die Kachel hinausragen */
#multi .antwort,
#multi .aufgabe {
    overflow:hidden;
}

#multi.neu-layout .antwort {
    width:100%;
    height:100%;
    margin:0;
}

#multi.neu-layout.modusTippen .antwort.antwort-eingabe {
    width:100%;
    height:100%;
    min-height:0;
    max-height:none;
}



#multi.q.z0 .antwort {
     width:18vw;
     height:18vw;
     max-height:30vh;
}

#multi.b.z0 .antwort {
     width:37vw;
     height:12vh;
}

#multi.q.z1 .antwort {
     width:11.5vw;
     height:11vw;
     max-height:20vh;
}

#multi.b.z1 .antwort {
     width:18vw;
     height:10vh;
}

#multi.b.z2 .antwort { 
     width:18vw;
     height:8vh; 
}



#multi.q.z2 .antwort {
     width:8.5vw;
     height:8.5vw; 
     max-height:17vh;
}

#multi.q.z3 .antwort {
     width:6.5vw;
     height:6.5vw;
     max-height:10vh;
}

.antwort p, .aufgabe p{   
    margin: 0 auto;
}

#multi.modusTippen .antwort-eingabe {
    width:auto;
    height:auto;
    min-height:0;
    flex: 0 0 auto;
    background-size: 100% 100%;
    display:flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2vh;
    padding: 1.5vh 1.5vw;
}

#multi.modusTippen {
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: flex-start;
    align-items: center;
    height:100%;
    min-height:0;
}

#multi.modusTippen .antwort-eingabe {
    margin-left:auto;
    margin-right:auto;
}

#multi.modusTippen .antwort.antwort-eingabe {
    width:auto;
    height:auto;
    min-height:0;
    max-height:none;
    flex: 0 0 auto;
}

#multi.modusTippen.tallTask .antwort-eingabe {
    min-height:0;
}

#multi.modusTippen .antwort-eingabe-zeile {
    height:auto;
    min-height:3.1em;
}

#multi.modusTippen .antwort-eingabe-zeile .antwort-feld {
    height:3.1em;
}

#multi.modusTippen .antwort-pruefen {
    height:auto;
    min-height:2.6em;
    padding: 0.3em 0.6em;
}

#multi .antwort-feld {
    width:100%;
    height:58%;
    border:2px solid #404040;
    border-radius:0.5vw;
    text-align:center;
    font-size: 2.2em;
    color:#202020;
    background-color: rgba(255,255,255,0.9);
}

#multi .antwort-eingabe-zeile {
    width:100%;
    height:58%;
    display:flex;
    align-items:center;
    gap:0.6vw;
}

#multi .antwort-eingabe-zeile-doppelt {
    gap: 1.0vw;
}

#multi .antwort-gruppe {
    display:flex;
    align-items:center;
    gap:0.6vw;
    flex:1;
}

#multi .antwort-label {
    font-size:1.3em;
    color:#202020;
    white-space:nowrap;
    min-width: 3.2em;
    text-align:left;
}

#multi .antwort-eingabe-zeile .antwort-feld {
    height:100%;
    flex:1;
}

#multi .antwort-waehrung {
    font-size:1.7em;
    color:#202020;
    min-width:1.8em;
    text-align:left;
}

#multi .antwort-pruefen {
    width:100%;
    height:30%;
    border:2px solid #404040;
    border-radius:0.5vw;
    font-size:1.5em;
    color:#202020;
    background-color: rgba(255,255,255,0.9);
}

/* Zeilenumbruch nur bei "hohen" Aufgaben aktivieren, sonst kann es das Layout beeinflussen */
#multi.tallTask .aufgabe p {
    width: 100%;
    margin: 0;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.sieg {
    align-self: center;
    height:80vh;
    width:42vw;
    position:absolute;
    z-index: 4000;
    top:20vh;
    left:5%;
    background-image: url('../media/pics/pergkl2.png');
    background-size: 80% 80%;
    padding: 10% 10% 10% 10%;
    background-repeat: no-repeat;
    font-family: 'Delicious Handrawn';

    
  }
  .sieg p {
      font-size:3vh;
      max-height:100%;
      overflow:hidden;
      color:black;
      width:70%;
  }
 .sieg h1 {
      font-size:6vh;
      max-height:100%;
      overflow:hidden;
      color:red;
      
  }

  .nochmal {
      width:40px;
      height:40px;
    background-image: url('../media/pics/nochmal.png');
      background-size:100% 100%;
  } 

  .weiter-btn {
      display: inline-block;
      padding: 10px 28px;
      font-size: 1.1em;
      font-weight: bold;
      background: #4caf50;
      color: #fff;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      margin-top: 12px;
  }
  .weiter-btn:hover {
      background: #388e3c;
  }

@media (orientation: landscape){
        #haupt {
                grid-template-columns: 1fr 1fr;
        }
}
  
  

@media (orientation: portrait){
    #haupt{
         display:grid;
         grid-template-columns: 1fr;
         grid-template-rows: 14vh 42vh 1fr;
         width:100vw;
         height:100vh;
    }

    #ampeln {
        grid-row:1;
        grid-column:1;
        align-self:start;
        justify-self:center;
        padding-top:0.8vh;
    }

    #bild {
        grid-row:2;
        grid-column:1;
        margin:0;
        margin-left:1.2vw;
        width:calc(100% - 1.2vw);
        height:100%;
        min-height:0;
        aspect-ratio:auto;
        align-self:stretch;
        justify-self:stretch;
    }

    #multi {
       grid-row:3;
       grid-column:1;
       width:100%;
       height:100%;
       min-height:0;
    }

    .aufgabe {
        width:100%;
        height:100%;
    }

    #multi.tallTask .aufgabe {
        height:100%;
    }

    #multi.modusTippen .antwort-eingabe {
        width:100%;
        height:100%;
        min-height:0;
        flex: 0 0 auto;
    }

    #multi.modusTippen .antwort-eingabe {
        margin-left:auto;
        margin-right:auto;
    }

    #multi.modusTippen.tallTask .antwort-eingabe {
        min-height:0;
    }

    #multi .antwort-feld {
        font-size: 1.4em;
    }

    #multi .antwort-waehrung {
        font-size: 1.2em;
        min-width:1.5em;
    }

    #multi .antwort-pruefen {
        font-size: 1.1em;
    }
    
    #multi.z0 .antwort {
     width:22vw;
     height:22vw; 
}
     
    
    
    #multi.z1 .antwort {
     width:12vw;
     height:12vw;
}

#multi.z2 .antwort {
     width:16vw;
     height:16vw; 
}

#multi.z3 .antwort {
     width:16vw;
     height:16vw;
}

    #multi.modusTippen .antwort.antwort-eingabe {
        width:100%;
        height:100%;
        min-height:0;
        max-height:none;
        flex: 0 0 auto;
    }

    #multi.modusTippen .antwort-eingabe-zeile {
        min-height:2.7em;
    }

    #multi.modusTippen .antwort-eingabe-zeile .antwort-feld {
        height:2.7em;
    }

    #multi.modusTippen .antwort-pruefen {
        min-height:2.3em;
        padding: 0.25em 0.5em;
    }
    
.sieg {
    width:100%;
    top:5px;
    height:50vh;
    padding: 2%;
}    
   
.sieg p {
 
    font-size: 1em; 
}  

.sieg h1 {
 
    font-size: 1em; 
}  

}

@media (min-aspect-ratio: 16/9){
    #bild {
        height:75vh; 
        width:auto;
    }
    
  
    
    
}

/* Skin: Graffiti = bisheriges Erscheinungsbild */
#haupt.skin-graffiti {
    background-image: url('../media/pics/dalli/graff.png');
}

/* Im Graffiti-Skin nur Ampel-Feedback, kein Rot/Grün-Schatten auf den Kacheln. */
#haupt.skin-graffiti #multi .antwort.klick-richtig,
#haupt.skin-graffiti #multi .antwort.klick-falsch {
    box-shadow: none !important;
}

/* Skin: Einfach = ohne Deko, Fokus auf Bild links + Kacheln rechts */
#haupt.skin-einfach {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 1.2vh 1vw;
    padding: 1.2vh 1vw;
    padding-bottom: 5vh;
    background-image: none;
    background-color: #eef2f5;
}

#haupt.skin-einfach #ampeln {
    display: none;
}

#haupt.skin-einfach #bild {
    grid-row: 1;
    grid-column: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    aspect-ratio: auto;
    align-self: stretch;
    justify-self: stretch;
}

#haupt.skin-einfach #rahmen {
    display: none;
}

#haupt.skin-einfach #dalli {
    margin: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #d5dbe3;
    border-radius: 12px;
    overflow: hidden;
    background-position: center center;
}

#haupt.skin-einfach div.teil {
    background-image: none;
    background-color: var(--abdeck-farbe-mitte, #c62828);
    background-image: linear-gradient(160deg, var(--abdeck-farbe-hell, #ea4a4a) 0%, var(--abdeck-farbe-mitte, #c62828) 45%, var(--abdeck-farbe-dunkel, #9d1818) 100%);
    border: 1px solid var(--abdeck-farbe-rand, #7f1010);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -3px 6px rgba(0, 0, 0, 0.28),
        0 1px 2px rgba(0, 0, 0, 0.22);
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

#haupt.skin-einfach #multi {
    grid-row: 1;
    grid-column: 2;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    gap: 1.2vh;
}

#haupt.skin-einfach #multi .aufgabe,
#haupt.skin-einfach #multi .antwort {
    background: #ffffff;
    border: 1px solid #d5dbe3;
    border-radius: 10px;
    color: #1f2933;
    padding: 3%;
}

#haupt.skin-einfach #multi .aufgabe {
    background: transparent;
    border: none;
    border-radius: 0;
}

#haupt.skin-einfach #multi .aufgabe::before,
#haupt.skin-einfach #multi .antwort::before {
    display: none;
}

#haupt.skin-einfach #multi .antwort [data-rz-typ="text"],
#haupt.skin-einfach #multi .aufgabe [data-rz-typ="text"],
#haupt.skin-einfach #multi .antwort p,
#haupt.skin-einfach #multi .aufgabe p {
    color: #111827;
    text-shadow: none !important;
}

#haupt.skin-einfach #multi img,
#haupt.skin-einfach #multi img.bild-mit-transparenz {
    border: none !important;
    box-shadow: none !important;
    max-width: 88%;
    max-height: 88%;
}

@media (orientation: portrait) {
    #haupt.skin-einfach {
        grid-template-columns: 1fr;
        grid-template-rows: 44vh 1fr;
    }

    #haupt.skin-einfach #bild {
        grid-row: 1;
        grid-column: 1;
    }

    #haupt.skin-einfach #multi {
        grid-row: 2;
        grid-column: 1;
    }
}
