body {
    background-color: #222d40;
    margin: 0;
    padding: 20px 0;
}

html, body {
    min-width: 1050px;
    overflow-x: auto;
}

#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;
    }

/* ===================== Haupt-Container ===================== */

.tetracairo-container {
    max-width: fit-content;
    margin: 0 auto;
    padding: 20px;
    background-color: #e8e8e8;
    border: 2px solid #999;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 0;
}

    .header h1 {
        margin-top: 10px;
    }

/* ===================== Haupt-Zeile: Grid + Sidebar ===================== */

.main-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

/* ===================== Sidebar (rechts) ===================== */

.sidebar {
    flex-shrink: 0;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
}

    .sidebar-section h3 {
        margin-top: 0;
        margin-bottom: 8px;
        font-size: 16px;
        text-align: center;
    }

/* ===================== Controls ===================== */

.controls {
    align-items: center;
    gap: 10px;
}

.field-counter {
    font-size: 32px;
    font-weight: bold;
    width: 120px;
    text-align: center;
    margin-top: -5px;
    margin-bottom: -5px;
}

    .field-counter.counter-valid {
        color: #2E7D32;
    }

    .field-counter.counter-invalid {
        color: #D32F2F;
    }

.control-button {
    width: 120px;
    height: 35px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #333;
    border-radius: 5px;
}

.reset-button {
    background-color: #222d40;
    color: white;
}

    .reset-button:hover {
        background-color: #4a5f7f;
    }

    .reset-button:disabled,
    .nav-button:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

.start-button {
    background-color: #4CAF50;
    color: white;
}

    .start-button:hover {
        background-color: #45a049;
    }

    .start-button.start-disabled {
        background-color: #CCCCCC;
        color: #333;
        cursor: not-allowed;
    }

    .start-button.start-running {
        background-color: #FFEB3B;
        color: #000;
    }

.solution-info {
    font-size: 14px;
    text-align: center;
}

.navigation-buttons {
    display: flex;
    gap: 10px;
}

.nav-button {
    width: 55px;
    height: 35px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #333;
    background-color: white;
    border-radius: 5px;
}

    .nav-button:hover {
        background-color: #e0e0e0;
    }

/* ===================== Manual + Back ===================== */

.short-manual {
    margin: 10px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 230px;
}

    .short-manual p {
        margin: 5px 0;
        font-size: 12px;
        line-height: 1.4;
    }

.back-row {
    margin-top: 10px;
}

.back-button {
    display: inline-block;
    background-color: #ffffff;
    color: #222d40;
    font-size: 16px;
    font-weight: bold;
    padding: 5px 10px;
    text-decoration: none;
    border: 2px solid #222d40;
    border-radius: 5px;
    transition: all 0.3s;
}

    .back-button:hover {
        background-color: #222d40;
        color: #ffffff;
        text-decoration: none;
    }

.back-icon {
    font-size: 24px;
    margin-right: 8px;
}

.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");
    }

/* ===================== Beispielfiguren ===================== */

.example-grid {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    gap: 3px;
    justify-items: center;
}

.example-button {
    width: 56px;
    height: 56px;
    padding: 3px;
    cursor: pointer;
    border: 2px solid #333;
    background-color: white;
    border-radius: 3px;
    font-size: 18px;
    font-weight: bold;
}

    .example-button:disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }

    .example-button:hover {
        background-color: #f0f0f0;
        border-color: #4CAF50;
    }

    .example-button img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
