* {
    box-sizing: border-box;
}

body {
    color: #1a1a1a;
    font-family: sans-serif;
    max-width: 900px;
    margin: 0 auto;
}

h2 {
    color: #e63946;
}

.levels {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.level {
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.level h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.level h2 code {
    background-color: #faf6f0;
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

.level .concept {
    margin-bottom: 1.25rem;
    /* max-width: 65ch; */
}

.level .prompt {
    margin-bottom: 1rem;
}

.unit-choice {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed #e0e0e0;
}

.choice-question {
    font-weight: bold;
    margin-bottom: 0.75rem;
}

.unit-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.unit-btn {
    font-family: monospace;
    font-size: 1rem;
    font-weight: bold;
    background-color: #faf6f0;
    color: #1a1a1a;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.unit-btn:hover:not(:disabled) {
    border-color: #2a9d8f;
}

.unit-btn:disabled {
    cursor: default;
}

.unit-btn.correct {
    border-color: #2a9d8f;
    background-color: #2a9d8f;
    color: #ffffff;
}

.unit-btn.incorrect {
    border-color: #e63946;
    background-color: #fdeceb;
    color: #e63946;
}

.unit-feedback {
    margin: 0;
    min-height: 1.2em;
    font-weight: bold;
}

.unit-feedback.state-correct {
    color: #2a9d8f;
}

.unit-feedback.state-incorrect {
    color: #e63946;
}

.value-stage {
    padding-top: 0.25rem;
}

.next-btn {
    margin-top: 1.25rem;
    background-color: #e63946;
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.next-btn:hover:not(:disabled) {
    background-color: #d62828;
}

.next-btn:disabled {
    background-color: #e0e0e0;
    color: #9a9a9a;
    cursor: not-allowed;
}

.controls {
    margin-bottom: 1rem;
}

.scene {
    display: block;
    width: 100%;
    height: 150px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fffdf9;
    margin-bottom: 0.75rem;
    max-width: 100%;
}

.sweep-control {
    margin-bottom: 1rem;
}

.sweep-control label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.sweep-control output {
    font-family: monospace;
    color: #2a9d8f;
}

.sweep-input {
    display: block;
    width: 100%;
    margin: 0;
}

.code-blank {
    font-family: monospace;
    font-size: 0.95rem;
    background-color: #1a1a1a;
    color: #f4f4f4;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0 0 0.5rem;
}

.code-sel {
    color: #e9c46a;
}

.code-prop {
    color: #8ecae6;
}

.value-input {
    font-family: monospace;
    font-size: 0.95rem;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    width: 12ch;
}

.value-input:focus {
    outline: 2px solid #2a9d8f;
    outline-offset: 1px;
}

.feedback {
    margin: 0.5rem 0 0;
    min-height: 1.2em;
    font-weight: bold;
}

.feedback.state-empty {
    color: #6b6b6b;
    font-weight: normal;
}

.feedback.state-invalid {
    color: #e63946;
}

.feedback.state-partial {
    color: #b98900;
}

.feedback.state-correct {
    color: #2a9d8f;
}

.completion-overlay[hidden] {
    display: none;
}

.completion-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: rgba(26, 26, 26, 0.55);
    z-index: 10;
}

.completion-card {
    max-width: 420px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.completion-card h2 {
    margin: 0 0 0.75rem;
    color: #2a9d8f;
    font-size: 1.4rem;
}

.completion-card p {
    margin: 0 0 1rem;
    color: #1a1a1a;
}

.completion-card code {
    background-color: #faf6f0;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.completion-close {
    margin-top: 0.5rem;
    background-color: #e63946;
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.completion-close:hover {
    background-color: #d62828;
}
