html,body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    text-transform: lowercase;
    overflow-x: hidden;
}

.center {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 2rem 1rem;
}

.center > h1, .center > h2 {
    text-align: center;
    padding: 0;
    margin: 0 0 1rem 0;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    word-wrap: break-word;
}

h1 {
    text-transform: uppercase;
}

button {
    border: 3px dashed #333;
    outline: none;
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    color: white;
    font-size: 1.5rem;
    padding: 1rem 2rem;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    transition: all .2s;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    text-transform: lowercase;
    font-weight: bold;
    border-radius: 20px;
}

button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

button:active {
    transform: scale(0.95);
}

button#startbutton {
    border: 3px dashed #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    color: white;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    padding: 1rem 2rem;
}

button#startbutton:hover {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    color: white;
    transform: scale(1.5);
}

button#submitbutton,
button#nextbutton {
    border: 3px dashed #4ecdc4;
    background: linear-gradient(135deg, #4ecdc4, #44b393);
    color: white;
    margin-top: 2rem;
}

button#restartbutton {
    border: 3px dashed #ffd93d;
    background: linear-gradient(135deg, #ffd93d, #ffc93c);
    color: #333;
    margin-top: 2rem;
}

.boom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
}
.boom > img {
    width: 100vw;
    height: 100vh;
}

.transi-full-to-none {
    transition: opacity 0.5s ease;
    opacity: 1;
    animation: fadeout 1s;
}

@keyframes fadeout {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

span.rainbow {
    animation: rainbow 1s infinite;
}

@keyframes rainbow {
    0% {
        color: red;
    }
    16% {
        color: orange;
    }
    33% {
        color: yellow;
    }
    50% {
        color: green;
    }
    66% {
        color: blue;
    }
    83% {
        color: indigo;
    }
    100% {
        color: violet;
    }
}

#quizcontainer {
    background: white;
    border: 4px dashed #333;
    border-radius: 30px;
    padding: clamp(1.5rem, 5vw, 3rem);
    max-width: 600px;
    width: min(90%, 600px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

#progressbar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 2px solid #333;
}

#progress {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44b393);
    width: 0%;
    transition: width 0.3s ease;
}

#scoreinfo {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: #667eea;
    font-weight: bold;
}

#question {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    line-height: 1.4;
}

#answercontainer {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px dotted #667eea;
    width: 100%;
    box-sizing: border-box;
}

#answercontainer label {
    display: flex;
    align-items: flex-start;
    margin: 0.8rem 0;
    padding: 0.8rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: clamp(1rem, 2vw, 1.1rem);
    word-wrap: break-word;
}

#answercontainer label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

#answercontainer input[type="radio"],
#answercontainer input[type="checkbox"] {
    cursor: pointer;
    margin-right: 0.8rem;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

#answercontainer input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    font-size: clamp(1rem, 2vw, 1.1rem);
    border: 2px solid #667eea;
    border-radius: 10px;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
    text-transform: lowercase;
    box-sizing: border-box;
}

#feedbackcontainer {
    background: #f8f9fa;
    border: 2px dashed #333;
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

#feedbackmessage {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: bold;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    line-height: 1.4;
}

.feedback-correct {
    color: white;
    background: linear-gradient(135deg, #4ecdc4, #44b393);
    animation: bounceIn 0.5s ease;
}

.feedback-incorrect {
    color: white;
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    animation: shake 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

#resultframe {
    background: white;
    border: 4px dashed #333;
    border-radius: 30px;
    padding: clamp(1.5rem, 5vw, 3rem);
    max-width: 600px;
    width: min(90%, 600px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    margin: 0 auto;
}

#resultframe h1 {
    color: #667eea;
    margin-bottom: 2rem;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

#finalresult {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #333;
    margin: 2rem 0;
    font-weight: bold;
    line-height: 1.4;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .center {
        padding: 1rem;
        min-height: auto;
    }

    #quizcontainer {
        padding: clamp(1rem, 3vw, 1.5rem);
        border-radius: 20px;
        max-width: 100%;
    }

    button {
        padding: 0.7rem 1.2rem;
        font-size: 1rem;
    }

    button#startbutton {
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }

    #answercontainer label {
        margin: 0.6rem 0;
        padding: 0.7rem;
        font-size: 1rem;
    }

    #feedbackmessage {
        font-size: 1.1rem;
        padding: 0.8rem;
    }
}
