@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English+SC&family=Cinzel+Decorative&display=swap');

body {
    background: url('https://www.transparenttextures.com/patterns/paper-fibers.png') repeat, #f5f0e6;
    font-family: 'IM Fell English SC', serif;
    color: #2e1f12;
    padding: 2rem;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Cinzel Decorative', cursive;
    color: #6c4c34;
    text-shadow: 1px 1px 2px #d4af37;
}

form, .question-block {
    background-color: rgba(255, 255, 255, 0.85);
    border: 2px solid #d4af37;
    border-radius: 12px;
    box-shadow: 0 0 10px #bfb061;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    width: 80%;
    max-width: 800px;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.question-block h2 {
    text-align: center;
}

form:hover, .question-block:hover {
    box-shadow: 0 0 15px #f9d923;
}

.question-submit{
    margin-top:20px
}

label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
    color: #3d2e1e;
}

input[type="radio"], input[type="checkbox"] {
    accent-color: #6a5acd;
}

button, input[type="submit"] {
    background-color: #6c4c34;
    color: #f5f0e6;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

input[type="text"] {
    width: 100%;
    margin-bottom: 1rem;
}

button, input[type="submit"] {
    width: 100%;
    font-size: 1rem;
}

button:hover, input[type="submit"]:hover {
    background-color: #6b3f3f;
    box-shadow: 0 0 8px #ffd700;
}

.music-notes::before {
    content: "🎵";
    margin-right: 0.5rem;
    animation: floatNote 3s infinite ease-in-out;
}

@keyframes floatNote {
    0% {
        transform: translateY(0);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 0.8;
    }
}

/* Optionnel : style spécial maison selon choix */
.gryffindor {
    border-color: #ae0001;
    background: rgba(174, 0, 1, 0.05);
}

.ravenclaw {
    border-color: #0e1a40;
    background: rgba(14, 26, 64, 0.05);
}

.hufflepuff {
    border-color: #ecb939;
    background: rgba(236, 185, 57, 0.05);
}

.slytherin {
    border-color: #2a623d;
    background: rgba(42, 98, 61, 0.05);
}


.quiz-container {
    position: relative;
    margin-top: 150px; /* Ajuste selon ton design */
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .quiz-container {
        margin-top: 0;
        padding: 0 1rem;
    }

    form, .question-block {
        width: 95%;
        padding: 1rem;
    }

    h1, h2, h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1, h2, h3 {
        font-size: 1.3rem;
    }

    .quiz-container {
        margin-top: 30px;
    }

    button, input[type="submit"] {
        font-size: 0.95rem;
        padding: 0.7rem;
    }
}


.sorting-hat {
    position: relative;
    height: 300px;
}

.sorting-hat__top {
    position: relative;
    background: #815230;
    height: 40px;
    width: 180px;
    margin: auto;
    border-radius: 40px 40px 50% 50%;
    top: 170px;
    z-index: 13;
    box-shadow: inset 0 -3px 4px 8px rgba(108, 76, 52, 0.4);
    opacity: 1;
}

.sorting-hat__top:before {
    content: "";
    position: absolute;
    background: #815230;
    width: 165px;
    height: 70px;
    bottom: 20px;
    left: 5px;
    border-radius: 50% 50% 120% 10%/130% 130% 25% 25%;
}

.sorting-hat__top:after {
    content: "";
    position: absolute;
    bottom: 65px;
    left: 15px;
    border-left: 80px solid transparent;
    border-right: 65px solid transparent;
    border-bottom: 120px solid #815230;
}

.sorting-hat__base {
    width: 250px;
    background: #815230;
    height: 35px;
    border-radius: 50%;
    margin: auto;
    top: 195px;
    position: relative;
    z-index: 12;
    margin-top: -50px;
    opacity: 1;
}

.sorting-hat__eye {
    z-index: 15;
    background: #6c4c34;
    width: 45px;
    height: 45px;
    position: absolute;
    margin: auto;
    left: 50%;
    bottom: 100px;
    margin-left: -48px;
    border-radius: 100% 0px;
    transform: rotate(50deg);
    box-shadow: inset 2px 1px 10px #815230, inset -2px -3px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
    opacity: 1;
    transition: transform 0.2s ease-in-out;
    transform-origin: center center;
}

.sorting-hat__eye.blinking {
    transform: rotate(50deg) scaleY(0.05);
/ / looks closed
}

.sorting-hat__eye.right.blinking {
    transform: rotate(-50deg) scaleX(-1) scaleY(0.05);
}

.sorting-hat__eye.right {
    margin-left: 3px;
    transform: rotate(-50deg) scaleX(-1);
}

.sorting-hat__mouth {
    width: 150px;
    height: 30px;
    background: #6c4c34;
    position: absolute;
    margin: auto;
    bottom: 70px;
    left: 50%;
    margin-left: -75px;
    z-index: 15;
    border-radius: 0 100%;
    transform: rotate(-3deg);
    box-shadow: inset 2px 1px 10px #815230, inset -2px -3px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 50px;
    opacity: 1;

}

.sorting-hat__answer {
    font: 20px "Lobster Two", sans-serif;
    position: absolute;
    transform: rotate(-15deg);
    left: 50%;
    margin-left: 100px;
    top: 50px;
    display: inline-block;
    z-index: 5;
    width: 300px;
    opacity: 1;
}


@media (max-width: 768px) {

    .sorting-hat__answer {
        transform: rotate(0deg);
        top: 230px;
        left:-50px;
        min-width:400px;
        display: inline-block;
    }
}

.sorting-hat.animate {
    .sorting-hat__mouth {
        animation: mouth-move 2.5s forwards 0.6s;
    }
}


@keyframes mouth-move {
    0% {
        height: 20px;
        border-radius: 50% 100%;
    }
    20% {
        height: 15px;
    }
    60% {
        height: 15px;
        transform: rotate(8deg);
    }
    62% {
        height: 28px;
        border-radius: 100% 0;
        transform: rotate(0deg);
    }
    80% {
        height: 32px;
    }
    100% {
        height: 30px;
        border-radius: 0 100%;
        transform: rotate(-3deg);
    }
}

@keyframes eye-move-left {
    0% {
        transform: rotate(50deg);
    }
    20% {
        height: 35px;
        transform: rotate(58deg);
    }
    50% {
        height: 35px;
        transform: rotate(58deg);
    }
    54% {
        height: 40px;
        transform: rotate(58deg);
    }
    55% {
        height: 45px;
        transform: rotate(51deg);
    }
    80% {
        transform: rotate(45deg);
    }
}

@keyframes eye-move-right {
    0% {
        transform: rotate(-50deg) scaleX(-1);
    }
    20% {
        height: 35px;
        transform: rotate(-58deg) scaleX(-1);
    }
    50% {
        height: 35px;
        transform: rotate(-58deg) scaleX(-1);
    }
    54% {
        height: 40px;
        transform: rotate(-58deg) scaleX(-1);
    }
    55% {
        height: 45px;
        transform: rotate(-49deg) scaleX(-1);
    }
    80% {
        transform: rotate(-45deg) scaleX(-1);
    }
}
