main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

h1 {
    width: fit-content;
    font-size: clamp(24px, 4vw, 48px);
    font-family: MinecraftBold, serif;
}

.solution {
    font-size: clamp(16px, 2vw, 24px);
}

.multiple-choice {
    display: none;
}

.question {
    font-size: clamp(20px, 3vw, 36px);
    text-align: center;
}

.options {
    display: flex;
    flex-direction: column;
}

.option {
    font-size: clamp(16px, 2.5vw, 32px);
    margin: clamp(4px, 1vw, 12px) 0;
    border: none;
    width: 640px;
    max-width: 100%;
    height: 64px;
    background: url("../cdn/images/buttons/button.png") no-repeat center center;
    background-size: cover;
    font-family: MinecraftRegular, serif;
    color: var(--primary-color);
    cursor: pointer;
}
.option:hover {
    background: url("../cdn/images/buttons/button_highlighted.png") no-repeat center center;
    background-size: cover;
}

.text-input {
    display: none;
    align-items: center;
    width: 100%;
    max-width: 640px;
    padding: 0 16px;
    box-sizing: border-box;
}

.showing {
    display: flex;
    flex-direction: column;
}

.answer {
    font-size: clamp(20px, 3vw, 36px);
    font-family: MinecraftBold, serif;
    background: url("../cdn/images/buttons/text_field.png") no-repeat center center;
    background-size: 100% 100%;
    width: 100%;
    max-width: 640px;
    height: 64px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 16px;
    margin: clamp(10px, 2vh, 20px) 0;
    color: var(--primary-color);
    box-sizing: border-box;
    image-rendering: pixelated;
    cursor: text;
    overflow-x: auto;
    overflow-y: hidden;
}

.solution {
    color: #ff0000;
}
.correct {
    color: #00ff00;
}
.hidden {
    display: none;
}
.finished {
    text-align: center;
}

.answer math {
    display: inline math;
}

.math-slot {
    min-width: 16px;
    min-height: 22px;
    padding: 1px 2px;
    border-radius: 2px;
    cursor: pointer;
    vertical-align: middle;
}

.math-slot.empty {
    border: 1px dashed rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.06);
    min-width: 18px;
    min-height: 22px;
    margin: 0 2px;
}

.math-slot.active {
    border-color: #ffffa0;
    background-color: rgba(255, 255, 160, 0.12);
}

.math-placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.input-hint {
    margin: 0 0 12px;
    text-align: center;
    font-size: 14px;
}

.math-cursor {
    background-color: #ffffa0;
    margin: 0 1px;
    vertical-align: middle;
    animation: math-cursor-blink 1s steps(2, start) infinite;
    box-shadow: 0 0 3px #ffffa0;
}

@keyframes math-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.input-wrapper {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 640px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid #3c3c3c;
    border-radius: 6px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7), 0 6px 18px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.input-wrapper button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 52px;
    min-width: 0;
    padding: 0;
    background: url("../cdn/images/buttons/button.png") no-repeat center center;
    background-size: 100% 100%;
    border: none;
    outline: none;
    font-family: MinecraftRegular, sans-serif;
    font-size: clamp(18px, 2.2vw, 24px);
    color: var(--primary-color);
    cursor: pointer;
    text-shadow: 2px 2px 0 #1b1b1b;
    image-rendering: pixelated;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.input-wrapper button:hover {
    background-image: url("../cdn/images/buttons/button_highlighted.png");
    color: #ffffa0;
    text-shadow: 2px 2px 0 #2a2a00;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
}

.input-wrapper button:focus-visible {
    outline: 2px solid #ffffa0;
    outline-offset: 2px;
}

.input-wrapper button {
    font-family: MinecraftBold, sans-serif;
}

.input-wrapper .input-0 {
    grid-column: span 2;
}

.input-wrapper .input-bac,
.input-wrapper .input-ent {
    grid-column: span 3;
    font-size: 1.15em;
}

.input-wrapper button math {
    font-size: 1.15em;
    font-family: inherit;
    line-height: 1;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper button math,
.answer math {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.input-wrapper button math mi,
.input-wrapper button math mo,
.input-wrapper button math mn,
.answer math mi,
.answer math mo,
.answer math mn {
    font-family: inherit;
    font-style: normal;
}

.input-wrapper button math mfrac,
.answer math mfrac {
    font-size: 0.85em;
}

.input-wrapper button math mroot,
.answer math mroot,
.input-wrapper button math msqrt,
.answer math msqrt {
    font-size: 0.9em;
}

.input-wrapper button math msup,
.answer math msup {
    font-size: 0.95em;
}

@media (max-width: 600px) {
    .text-input {
        padding: 0 10px;
    }

    .option {
        width: 100%;
        max-width: 640px;
    }

    .input-wrapper {
        gap: 6px;
        padding: 8px;
    }

    .input-wrapper button {
        height: 48px;
        font-size: 18px;
    }

    .answer {
        height: 54px;
        min-height: 54px;
        font-size: clamp(18px, 4vw, 28px);
    }
}

@media (max-width: 400px) {
    .input-wrapper {
        gap: 4px;
        padding: 6px;
    }

    .input-wrapper button {
        height: 42px;
        font-size: 16px;
    }
}