body {
    background-color: grey;
    margin: 0;
    padding: 0;
    caret-color: black;
}

#mainContainer {
    display: flex;
    flex-direction: row;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}


#ProofImgs {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    box-sizing: border-box;
}

#ProofImgs img {
    width: 100%;       
    height: auto;      
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    will-change: transform;
    transform: translateZ(0);
}

#ProofImgs img:hover {
    transform: scale(1.02);
}

/* right: calculator */
#Calculator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    background-color: darkgrey;
    overflow-y: auto;
}

/* equation  */
#equation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#numerator {
    width: min(120px, 20cqw);
    height: min(120px, 20cqw);
    text-align: center;
    font-size: clamp(1rem, 3cqw, 2rem);
    border-radius: 5px;
    background: transparent;
    color: black;
    margin-bottom: 1vh;
}

input::placeholder {
    font-size: clamp(0.7rem, 2cqw, 1.2rem);
    color: #e8e8e8;
}

#numerator::-webkit-outer-spin-button,
#numerator::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#divisionBar {
    width: 50%;
    height: 3px;
    background-color: black;
    border: none;
    margin: 1vh 0;
}

#Num81 {
    font-size: clamp(2rem, 8cqw, 5rem);
    margin: 0.5vh 0;
}

#submitBtn {
    font-size: clamp(0.8rem, 2cqw, 1.2rem);
    padding: 0.6em 1.5em;
    margin-top: 1.5vh;
    cursor: pointer;
}


.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 90%;
    margin-top: 2vh;
}

.box {
    background-color: #ffffff;
    border: 2px solid #cccccc;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-size: clamp(0.9rem, 2cqw, 1.4rem);
    color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    word-break: break-all;
}

.impossibleNumber { background-color: #ffdddd; }
.actualAnswer     { background-color: #ddddff; }

#explaination {
    text-align: center;
    margin: 0;
    font-size: clamp(0.75rem, 1.5cqw, 1rem);
}

@media (max-width: 768px) {
    #mainContainer {
        flex-direction: column;
    }

    #ProofImgs, #Calculator {
        flex: none;
        width: 100%;
        height: 50vh;
    }
}