:root {
    --hue-neutral: 200;
    --hue-wrong: 0;
    --hue-correct: 145;
}

body {
    background-image: linear-gradient(39deg, rgb(255, 225, 53), rgb(109, 13, 136));
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
    margin: 0;
    display: flex;
    width: 100%;
    height: 100vh;
    justify-content: center;
    align-items: center;
    background-color: hsl(var(--hue), 100%, 20%);
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

body.correct {
    --hue: var(--hue-correct);
}

body.wrong {
    --hue: var(--hue-wrong);
}

.toggle-container {
    display: flex;
    justify-content: end;
    margin-bottom: 20px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

/* Default Slider Dot (Light Theme) */
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #ffffff;
    transition: .4s;
    border-radius: 50%;
    animation: blink 1s 5;
}

/* Slider Dot in Dark Mode */
body.dark-mode .slider:before {
    background-color: #666464;
    animation: blink 1s 5;
}

/* Blinking animation */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

input:checked+.slider {
    background-color: #2196F3;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

body.light-mode {
    background-color: #fff;
    color: #000;
}

body.light-mode .container {
    background-color: rgb(255, 255, 255);
    box-shadow: rgb(2, 2, 2) 0 0 10px 2px;
}

/* Dark Theme */
body.dark-mode {
    background-color: #121212;
    color: #fff;
}

body.dark-mode .container {
    background-color: #333;
    box-shadow: rgb(255, 255, 255) 0 0 10px 2px;
}

.container {
    width: 850px;
    max-width: 80%;
    border-radius: 5px;
    background-color: rgb(255, 255, 255);
    padding: 20px;
    height: auto;
}

h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    margin: 0;
    padding-bottom: 40px;
}

.version {
    font-size: 0.4em;
    margin-left: 5px;
    color: #666464;
}

.btn-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0;
    grid-template-columns: repeat(2, auto);

}

.btn {
    flex: 1 1 auto;
    word-wrap: break-word;
    word-break: break-word;
    border: 1px solid hsl(var(--hue), 100%, 30%);
    background-color: hsl(var(--hue), 100%, 50%);
    border-radius: 5px;
    padding: 5px 10px;
    outline: none;
    cursor: pointer;
    text-align: center;
    --hue: var(--hue-neutral);
}

.btn:hover {
    border-color: black;
    --hue: var(--hue-correct);
}

.btn.correct {
    --hue: var(--hue-correct);
    background-color: hsl(var(--hue), 100%, 50%);
    border-color: hsl(var(--hue), 100%, 30%);
}

.btn.wrong {
    --hue: var(--hue-wrong);
    background-color: hsl(var(--hue), 100%, 50%);
    border-color: hsl(var(--hue), 100%, 30%);
}

.start-btn,
.next-btn {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hide {
    display: none;
}

.question,
.btn-grid {
    font-size: 16px;
    font-weight: bold;
}

.final-score {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 20px;
    text-align: center;
}

.question {
    font-size: 22px;
    font-weight: bold;
}

.answer-button {
    font-size: 17px;
    margin: 10px 0;
    padding: 3px;
}


.subject-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.subject-btn {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    margin-right: 2px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #007bff;
    color: #fff;
    transition: background-color 0.3s ease;
}

.subject-btn:hover {
    background-color: #750351;
    color: gold;
}

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
    .subject-container {
        flex-direction: column;
        align-items: center;
    }

    .subject-btn {
        width: auto;
    }
}

@media (max-width: 600px) {
    .container {
        width: auto;
        padding: 10px;
    }

    .question,
    .btn-grid {
        font-size: 18px;
    }

    .btn {
        font-size: 16px;
        padding: 8px;
    }
}