* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background-color: #252626;
    color: #ffffff;
}

nav {
    border-bottom: 1px solid #626363;
}

nav::before {
    content: "CompMaster";
    color: #f0f0f0;
    font-size: 1.2rem;
    font-weight: 700;
}

nav:has(.logo)::before {
    content: none;
}

.menu-icon {
    display: none;
}

.sitesection {
    display: grid;
    min-height: calc(100vh - 57px);
    padding: clamp(2rem, 7vw, 5rem) clamp(1.25rem, 5vw, 4rem);
    background:
        linear-gradient(180deg, rgba(71, 71, 71, 0.42), rgba(37, 38, 38, 0.96)),
        repeating-linear-gradient(90deg, rgba(87, 171, 255, 0.1) 0 1px, transparent 1px 48px);
}

.sitesection > br,
.codebox > br,
.codebox > p:empty {
    display: none;
}

.sitesection center {
    width: 100%;
}

.codebox {
    width: min(100%, 860px);
    min-height: 430px;
    margin: 0 auto;
    overflow: hidden;
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 1px solid #626363;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(37, 38, 38, 0.96), rgba(53, 55, 59, 0.98)),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 34px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    text-align: left;
}

.codebox h1 {
    margin: 1.75rem 0 0.8rem;
    color: #ffffff;
    font-size: clamp(1.8rem, 5vw, 3.4rem);
    line-height: 1.12;
}

.codebox h1::before {
    content: "<h1> ";
    color: #d9670b;
}

.codebox h1::after {
    content: " </h1>";
    color: #d9670b;
}

.codebox > p:not(:empty) {
    max-width: 720px;
    margin-bottom: 1.5rem;
    color: #d8d8d8;
    line-height: 1.7;
}

.codebox > p:not(:empty)::before {
    content: "<p> ";
    color: #57abff;
}

.codebox > p:not(:empty)::after {
    content: " </p>";
    color: #57abff;
}

.codebox h4 {
    display: inline-flex !important;
    align-items: center;
    min-height: 44px;
    margin: 0 !important;
    padding: 0.7rem 1rem !important;
    border: 1px solid #57abff;
    border-radius: 6px !important;
    background-color: #242423 !important;
    color: #57abff !important;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;
}

.codebox h4:hover,
.codebox h4:focus-visible {
    transform: translateY(-2px);
    background-color: #35373b !important;
}

.question,
.statement,
.label,
#algorithmName {
    min-height: 5rem;
    margin: 1rem 0 !important;
    color: #ffffff;
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 600;
    line-height: 1.45;
}

.label,
#algorithmName {
    min-height: auto;
    color: #57abff;
}

#answers,
#choices,
.codebox > div:not(.question):not(.statement):not(.label):not(.result) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
}

.codebox button {
    min-height: 48px;
    margin: 0 !important;
    padding: 0.75rem 1rem;
    border: 1px solid #626363;
    border-radius: 6px;
    background-color: #242423;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.codebox button:hover,
.codebox button:focus-visible {
    transform: translateY(-2px);
    border-color: #57abff;
    background-color: #35373b;
    outline: none;
}

.result {
    min-height: 3.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #626363;
    color: #d8d8d8;
    line-height: 1.5;
}

.result[style*="green"] {
    color: #9ad06d !important;
}

.result[style*="red"] {
    color: #ff8a65 !important;
}

@media (max-width: 800px) {
    nav::before {
        content: "";
    }

    .menu-icon {
        display: block;
    }

    .menu-toggle:checked + .menu-icon + .nav-links {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem 2rem;
        background-color: #242423;
    }

    #answers,
    #choices,
    .codebox > div:not(.question):not(.statement):not(.label):not(.result) {
        grid-template-columns: 1fr;
    }
}
