html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5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lbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* --- Custom app styles for practice page: gradient background, centering and fixed controls --- */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #3b82f6 35%, #06b6d4 100%);
    color: #e6eef8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #05060a 0%, #0f172a 40%, #06202a 100%);
    }
}

.practice-root {
    /* increased max width so more content fits on wide screens */
    max-width: 1200px;
    /* allow using more of the viewport width */
    width: 90%;
    margin: 2rem auto;
    border-radius: 16px;
    padding: 1.5rem 1.5rem 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
    /* ensure shadows and rounded children are not clipped */
    overflow: visible;
}

.practice-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.practice-root h1 {
    font-size: 2.5rem;
    margin: 0;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.selectors {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.selector {
    /* allow selectors to grow wider on larger screens so options won't be cut */
    min-width: 240px;
    max-width: 520px;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    flex: 1;
}

/* make selector headings very subtle: smaller, lower weight, reduced contrast */
.selector h3 {
    margin: 0 0 0.35rem 0;
    font-size: 0.82rem; /* smaller */
    font-weight: 400; /* lighter */
    color: rgba(230, 238, 248, 0.40); /* reduced opacity for subtle/darker appearance */
    letter-spacing: -0.02em;
}

.options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    /* allow a bit more vertical space for options before scrolling */
    max-height: 18rem;
    overflow: auto;
    padding: 0.25rem;

    /* hide native scrollbars but keep scrolling (for touch and mouse) */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.options::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.option {
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: inherit;
}

.option input[type=radio] {
    accent-color: #60a5fa;
}

.option.selected {
    /* correct selection: green gradient */
    background: linear-gradient(90deg, #16a34a, #4ade80);
    color: #00220a;
}

.option.wrong {
    background: linear-gradient(90deg, #ef4444, #f97316);
    color: #fff;
}

.result .example {
    margin-top: 0.5rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    border-radius: 8px;
    color: #dbeafe;
}

.hint {
    color: rgba(230, 238, 248, 0.8);
}

.fixed-controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 18px;
    display: flex;
    justify-content: center;
    gap: 1rem;
    pointer-events: none; /* allow clicks only on buttons */
    z-index: 9999;
}

.fixed-controls .btn {
    pointer-events: auto;
    min-width: 120px;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    font-weight: 600;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e6eef8;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-controls {
    display: none;
}

/* example overlay shown when user taps the question mark */
.example-toggle {
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.example-overlay {
    position: fixed;
    inset: 0;
    /* make overlay only 10% transparent (90% opaque) so background is darker */
    background: rgba(0, 0, 0, 0.90);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000; /* raised so it's above all UI */
    padding: 1rem;
}

.example-card {
    background: rgba(255, 255, 255, 0.04);
    color: #e6eef8;
    max-width: 820px;
    width: 100%;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 12px 40px rgba(2,6,23,0.7);
    position: relative;
}

.example-close {
    position: absolute;
    right: 0.5rem;
    top: 0.3rem;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
}

.example-content p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
    color: inherit;
}

/* center the example text horizontally and vertically within the card */
.example-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem 0.25rem;
}

/* mobile adjustments */
@media (max-width: 640px) {
    .selectors {
        flex-direction: column;
        gap: 0.5rem;
    }

    .selector {
        flex: none;
        width: 100%;
        padding: 0.5rem;
    }

    .selector:first-child {
        flex: 2;
    }

    .selector:last-child {
        flex: 1;
    }

    .selector:last-child .options {
        max-height: 8rem;
    }

    .practice-root {
        padding: 0.75rem 0.5rem 1.5rem 0.5rem;
        margin: 0.25rem auto;
        width: 98%;
    }

    .practice-inner {
        gap: 0.75rem;
    }

    .header-row {
        margin-bottom: 0.25rem;
    }

    .practice-root h1 {
        font-size: 1.75rem;
    }

    .example-toggle {
        min-width: 32px;
        min-height: 32px;
    }

    .fixed-controls {
        display: none;
    }

    .mobile-controls {
        display: flex;
        gap: 0.75rem;
        width: 100%;
        justify-content: center;
        padding: 0.5rem;
        border-radius: 12px;
        background: transparent;
    }

    .mobile-controls .btn {
        flex: 1;
        min-width: 0;
        border-radius: 999px;
        padding: 0.6rem 0.75rem;
        font-weight: 600;
    }

    .options {
        max-height: 16rem;
        padding: 0.15rem;
        gap: 0.4rem;
    }

    .option {
        padding: 0.4rem 0.55rem;
        font-size: 0.95rem;
    }

    .selector h3 {
        font-size: 0.75rem;
        margin: 0 0 0.25rem 0;
    }
}
