/* CSS-Variablen für responsive Schriften */
/* Die Root-Elemete beziehen sich auf den Desktop-View */
:root{
    --type-size-p2: 24px;
    --type-size-h2: 32px;
    --type-size-p1: 32px;
    --type-size-h1: 64px;
}

h1{
    font-size: var(--type-size-h1);
    color: #E4D2C0;
    text-align: center;
    margin-bottom: 0;
    margin-top: 0;
    -webkit-text-stroke-width: 1.5px;
    -webkit-text-stroke-color: #634832;
    font-family: 'Henny Penny';
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

h2{
    font-size: var(--type-size-h2);
    color: #FFF;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0;
    font-family: 'Henny Penny';
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

h2.Subtitle {
    margin-bottom: 55px;
}

h2.Black {
    color: black;
}

h3{ /*Das ist die Schrift p1 in Figma, aber p mit Nummern funktioniert nicht im CSS*/
    font-size: var(--type-size-p1);
    color: #FFF;
    text-align: center;
    font-family: 'Cormorant';
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 0;
    padding: 0;
}

h3.Black {
    color: black;
}

p{ /*Das ist die Schrift p2 in Figma*/
    font-size: var(--type-size-p2);
    color: #fff;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    text-align: center;
    font-family: 'Cormorant';
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.TextIntroFull {
    margin-bottom: 80px;
}


/*Alle Farben, die wir benötigen*/
:root{
    /*Dunkelbraun*/
    --color-primary: #634832;

    /*Hellbraun*/
    --color-secondary: #E4D2C0; 

    /*Weiss*/
    --color-text: #ffffff; 
}


/*Button default für Desktop-Styling, also der API-Button, bevor dieser geklickt wurde*/
#APIButton {
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='473' height='96' viewBox='0 0 473 96'><path d='M87 0L0 48.5L87 95.5H384.5L473 48.5L384.5 0H87Z' fill='%23634832'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;      
    background-position: center;
    background-color: transparent;
    border: none;
    width: 473px;
    height: 95.5px;
    flex-shrink: 0;
}

.TextInButton {
    font-size: var(--type-size-h2);
    color: #FFF;
    text-align: center;
    font-family: 'Henny Penny';
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

#TextinCard {
    align-items: center;
    justify-content: center;
    display: flex;
    flex-direction: column;
    margin-right: 100px;
    margin-left: 100px;
}


/*Karte im Hintergrund für Spells, Desktopgrösse*/
#cardForSpells {
    background-image: url(img/Pergament_Hintergrund.jpeg);
    background-size: cover;
    width: 664px;
    flex-direction: column;
    flex-shrink: 0;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 30px;
    border-radius: 25px;
    padding-top: 40px;
}


/*Zauberstäbe styling*/
#wandOne {
    display: block;
    object-fit: contain;
    margin-right: auto;
    margin-left: auto;
    max-width: 216.811px;
    max-height: 216.811px;
    width: 100%;
    height: 100%;
    transform: rotate(131.186deg);
    flex-shrink: 0;
    aspect-ratio: 216.81/216.81;
}


/*Styling unseres Headers*/
header {
    position: relative;
    height: 160px;
    width: 100%;
    contain: layout paint;;

    /*Fade in Header*/
    opacity: 0;
    transition-property: opacity;
    transition-duration: 1.2s;
}

header.fade {
    opacity: 1;
}

.hat-img {
    position: relative;
    height:100px;
    width: 90px;
    z-index: 10;
}


/*Animation Hut*/
.hat-animation {
    position: absolute;
    right: 100px;
    top: 10px;
    z-index: 10;
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

@keyframes hatMove {
   
    0% {
        transform: translateX(0) rotate(0deg);
    }

    30% {
        transform: translateX(0) rotate(0deg);
    }

    60% {
        transform: translateX(0) rotate(180deg);
    }

    70% {
        transform: translateX(0) rotate(0deg);
    }

    90% {
        transform: translateX(0) rotate(0deg);
    }
    
    100% {
        transform: translateX(-70px) rotate(0deg);
    }

}

.hatAnimation {
    animation: hatMove 3s ease-in-out forwards, 
               hatReset 1s ease-in-out 5s forwards;
}

@keyframes hatReset {
    0% {
      transform: translateX(-70px) rotate(0deg);
    }
    100% {
      transform: translateX(0) rotate(0deg);
    }
  }


/*Unser Pseudoelement, die Sprechblase, für die Animation des Hutes + Animation*/
.speech-bubble::after {
    content: "";
    position: absolute;
    width: 25px; 
    height: 25px; 
    background-image: url(img/speechbubble.png); 
    background-size: cover; 
    z-index: 1; 
    bottom: -10px;
    left: 10px;
   
}

.speech-bubble {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    top: -2px;
    left: 90%;
    background: white;
    padding: 10px;
    border-radius: 30px;
    font-family: Henny Penny;
    font-size: small;
    color: black;
    z-index: 5;
}

@keyframes showThenHideSpeechBubble {
    0%     { opacity: 0; }
    49.9%  { opacity: 0; }
    55%    { opacity: 0.2; } 
    60%    { opacity: 0.7; }
    65%    { opacity: 1; }   
    83.3%  { opacity: 1; }   
    100%   { opacity: 0; }   
}

.speech-bubble.animate-bubble {
    animation: showThenHideSpeechBubble 6s ease-in-out forwards;
}


/*Unser Hintergrund Bild: Hogwarts*/
body {
    background-image: url(img/hogwarts_02.jpeg);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;             
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden; /* Verhindert horizontales Scrollen */
}


/*Styling unseres Containers*/
main {
    padding: 10px 23px;
    padding-bottom: 50px auto; 
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding-bottom: 30px;
}


.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fade-in-zoom {
    opacity: 0;
    transform: scale(1.2);
    animation: fadeInZoom 0.5s ease forwards;
}

@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: scale(1.2);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/*Fade-in von Text und Button*/
.container {
    opacity: 0;
    transition-property: opacity;
    transition-duration: 1.2s;
    max-width: 800px;
    width: 100%;

}

.container.fade {
    opacity: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}


/*Styling des Divs des Namens*/
#SpellName {
    padding-bottom: 40px;
}


/*------------------------------------------------------   ALLE MEDIA QUERIES   ------------------------------------------------------------------------------------------*/

/*Tablet*/
@media (max-width: 768px) {
    :root {
            --type-size-p2: 21px;
            --type-size-h2: 27px;
            --type-size-p1: 27px;
            --type-size-h1: 52px;
    }
    
    .hat-animation {
        right: 60px;
        top: 8px
    }

    .speech-bubble {
        top: -4px;
        left: 50%;
        size-adjust: 0.5;
        font-size: x-small;
        padding: 10px;

    }

    .speech-bubble {
        top: -2px; /* Anpassen je nach Position*/
        left: 40%; /* Statt 90% – weiter links positionieren */
        transform: translateX(65%); /* Zentriert die Blase relativ zu ihrem Punkt */
        font-size: 10px;
        padding: 10px;
    } 

    .speech-bubble::after {
        left: 20px; /* Den kleinen Pfeil ggf. auch anpassen */
        bottom: -8px;
        width: 20px;
        height: 20px;
    }
    /*Hintergrund: Hogwarts*/
    body {
        background-image: url(img/hogwarts_02.jpeg);
        background-position: center;
        background-size: cover;               
        background-repeat: no-repeat;
        min-height: 105vh;
        overflow: normal;
    }


    /*Styling des Main Contents und Schriften*/
   main {
        padding-top: 20px;
        padding-left: 23px;
        padding-right: 23px;
        padding-bottom: 50px;
    }

    h2 {
        margin-bottom: 15px;
    }

    p {
        padding: 15px;
    }


    /*Styling des Textes, der zu Beginn des Generators angezeigt wird*/
   .TextIntroFull {
        margin-bottom: 30px;
    }


    /*Styling der Karte und des darin enthaltenen Textes*/
   #cardForSpells {
        max-width: 600px;
        width: 100%;
    }

    #TextinCard {
        margin-right: 80px;
        margin-left: 80px;
    }
}


/*Mobile*/
@media (max-width: 480px) {
    :root {
        --type-size-p2: 18px;
        --type-size-h2: 22px;
        --type-size-p1: 22px;
        --type-size-h1: 40px;
    }

    .hat-animation {
        right: 50px;
        top: 12px;
    }

    .speech-bubble {
    top: -2px; /* Anpassen je nach Position */
    left: 35%; /* Statt 90% – weiter links positionieren */
    transform: translateX(55%); /* Zentriert die Blase relativ zu ihrem Punkt */
    font-size: 10px;
    padding: 10px;
  }

  .speech-bubble::after {
    left: 20px; /*Den kleinen Pfeil ggf. auch anpassen */
    bottom: -8px;
    width: 20px;
    height: 20px;
  }

    /*Hintergrund: Hogwarts*/
    body {
        background-image: url(img/hogwarts_02.jpeg);
        background-position: -580px;
        background-size: cover; 
        background-repeat: no-repeat;
        min-height: 130vh;
        overflow: normal;
        flex-direction: column;
    } 


    /*Styling des Main Contents und Schriften*/
    main {
        padding-top: 0px;
        padding-left: 23px;
        padding-right: 23px;
        padding-bottom: 20px;
    }

    h2 {
        margin-bottom: 15px;
    }

    p {
        padding: 15px;
    }


    /*Styling des Textes, der zu Beginn des Generators angezeigt wird*/
    .TextIntroFull {
        margin-bottom: 30px;
    }
    

    /*Button (default) für unser mobile Styling*/
    #APIButton {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='473' height='96' viewBox='0 0 473 96'><path d='M87 0L0 48.5L87 95.5H384.5L473 48.5L384.5 0H87Z' fill='%23634832'/></svg>");
        background-repeat: no-repeat;
        background-size: contain;    
        background-position: center;
        background-color: transparent;
        border: none;
        width: 302px;
        height: 53px;
        flex-shrink: 0;
    }
    

    /*Karte + Text im Hintergrund für Spells, Mobile Styling*/
    #cardForSpells {
        background-image: url(img/Pergament_Hintergrund.jpeg);
        background-color: transparent;
        max-width: 418px;
        width: 100%;
        flex-shrink: 0;
        aspect-ratio: 38/25;
    }

    #TextinCard {
        margin-right: 50px;
        margin-left: 50px;
    }


    /*Styling des Zauberstabs*/
    #wandOne {
        max-width: 150px;
        max-height: 150px;
        width: 100%;
        height: 100%;
    }
}; 