@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: Inter, sans-serif;
    user-select: none;
}

body span {
    display: block;
    width: 100%;
    border-top: 1px solid #ddd;
    margin: 20px auto;
}

button {
    background: #fcfeff;
    border: 1px solid #9ed4ff;
    cursor: pointer;
    box-shadow: 2px 2px 3px #e3e3e3;
}

button:hover {
    background: #eaf8ff;
    box-shadow: 1px 1px 2px #e3e3e3;
}

#headline {
    text-align: center;
}

#subtitle {
    text-align: center;
    margin: 0 auto 40px auto;
}

input {
    width: 45px;
    text-align: center;
    font-size: 17px;
}

#top-container {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 20px auto 0 auto;
}

#properties-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    width: 215px;
    height: fit-content;
}

.property {
    display: flex;
    margin-bottom: 10px;
    justify-content: space-between;
    width: 100%;
}

#property label {
    margin: 0;
    text-align: left;
}

.property-input-container {
    display: flex;
    width: fit-content;
}

#expert-properties {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

#expert-properties > :last-child {
    margin-bottom: 0;
}

summary {
    cursor: pointer;
    text-align: center;
    padding: 10px 0 10px 0;
}

#top-right-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-right: 50px;
}

#grid-container {
    display: flex;
    justify-content: left;
    gap: 23px;
}

#grid {
    display: grid;
    grid-template-columns: repeat(var(--size), 1fr);
    grid-template-rows: repeat(var(--size), 1fr);
    grid-gap: 4px;
    width: 250px;
    height: 250px;
    padding: 4px 6px 6px 4px;
    border: 3px solid #53a8f2;
    border-radius: 13px;
    background-color: #eaeaea;
    box-shadow: 10px 10px 9px -3px #d0d0d0;
    margin-bottom: 22px;
}

#field-types {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 240px;
}

#grid-size-input {
    display: flex;
}

#grid-size {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

#grid-size p {
    margin: 0;
    text-align: center;
    align-content: center;
    font-size: 18px;
}

#grid-size-value {
    width: 36px;
    border: 1px solid #ffd600;
    border-radius: 0;
    height: 32px;
}

#field-types-box {
    border-radius: 10px;
    border: 1px solid #ddd;
}

#field-description {
    font-size: 0.9em;
    color: #888;
    width: 215px;
}

.cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    font-size: 18px;
    position: relative;
    border-radius: 7px;
    background-color: white;
}

.cell.hidden {
    background: #828282 !important;
    border: 1px solid #8e8e8e !important;
    width: 100% !important;
    height: 100% !important;
}

.start {
    background: #b3e5fc !important;
    border: 2px dashed #57a6ca !important;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
}

.goal {
    background: #c8e6c9;
    border: 2px dashed #6fa75a;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
}

.obstacle {
    background: #ff8a65;
    border: 2px solid #ce4a20;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
}

.agent {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 999;
}

#agent-img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    z-index: 999;
}

.cell-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: width 0.2s, height 0.2s;
}

#controls {
    display: flex;
    width: 265px;
    height: 60px;
    gap: 20px;
}

.ctrl-btn {
    display: flex;
    color: #000000;
    font-size: 14px;
    letter-spacing: 1px;
    width: 50%;
    border: 1px solid #9ed4ff;
    border-radius: 12px;
    cursor: pointer;
    gap: 8px;
    grid-template-rows: 45px 1fr;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: 2px 2px 4px #00000066;
}

.ctrl-btn:hover {
    background: #d7efff;
    box-shadow: 1px 1px 3px #00000066;
}

.ctrl-btn-img {
    width: 35px;
}

.ctrl-btn p {
    margin: 0;
}

#startBtn {
    background: linear-gradient(122deg, #f2f8ff 36%, #cde6ff 100%);
    border: 1px solid #6eb2f7;
}

#startBtn:hover {
    background: #b4defd;
}

#pauseBtn {
    background: #a3d4ee;
    color:  #053851;
    border: 1px solid #054b6e;
}

#restartBtn img {
    width: 30px;
}

#summary-stats {
    font-size: 20px;
    background: aliceblue;
    border-radius: 10px;
    width: 480px;
    margin: 10px auto 0 auto;
    padding: 5px;
    border: 1px solid #53a8f2;
}

#charts {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 10px;
}

#charts div {
    width: 270px;
}

#charts p {
    width: 100%;
    text-align: center;
}

#stats {
    display: flex;
    justify-content: space-evenly;
    width: 1115px;
    border: 1px solid #c8c4c4;
    border-radius: 10px;
    background-color: #eaeaea;
    margin: 20px auto 30px auto;
}

.input-container {
    display: flex;
    align-items: center;
}

.input-container input {
    border: 1px solid #ffd600;
    border-radius: 0;
    height: 30px;
}

.input-btn {
    height: 12px;
    background-color: #ffd600;
    cursor: pointer;
}

.input-btn:hover {
    background-color: #ffc107;
}

.input-btn.minus {
    border-radius: 8px 0 0 8px;
    padding: 10px 5px 10px 8px;
    border: 1px solid #ffd600;
}

.input-btn.plus {
    border-radius: 0 8px 8px 0;
    padding: 10px 8px 10px 7px;
    border: 1px solid #ffd600;
}

.disabled-input-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

:root {
/* Slider-Dimensionen */
--slider-width: 80vw;            /* Breite relativ zum Viewport */
--slider-max-width: 600px;       /* Maximalbreite */
--slider-height: 8px;            /* Höhe der Track-Leiste */
--thumb-size: 20px;              /* Durchmesser des runden Thumbs */

/* Farben */
--track-color: #ddd;             /* Farbe der Track-Leiste */
--thumb-color: #ffffff;          /* Hintergrund des Thumbs */
--thumb-hover-color: #f1f1f1;     /* Hover-Farbe (optional) */

/* Übergänge */
--transition-duration: 0.2s;      /* Für sanfte Animationen */

/* Wertebereich & Startwert */
--min-value: 0;                   /* minimaler Wert */
--max-value: 100;                 /* maximaler Wert */
--initial-value: 50;              /* Start-/Anfangswert */
--step: 1;                        /* Schrittweite pro Button-Klick */
}

#speed-container {
    display: flex;
    align-items: start;
}

.speed-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;

}

.speed-btn-container p {
    font-size: 13px;
    text-align: center;
}

#slower-btn-container {
    margin-right: 15px;
}

#faster-btn-container, #turbo-btn-container {
    margin-left: 15px;
}

.speed-btn {
    width: 60px;
    height: 60px;
    padding: 5px;
    border-radius: 10px;
}

.speed-btn img {
    width: 45px;
}

#turbo-btn {
    width: 75px;
    background: linear-gradient(102deg, #fff, #fffaec);
    border-color: #ffd86c;
}

#turbo-btn:hover {
    background: linear-gradient(102deg, #fffaec, #fff1cc);
    border-color: #f5c84f;
}

.wrapper {
    width: var(--slider-width);
    max-width: var(--slider-max-width);
    margin: 0 auto;
}

.slider-container {
    position: relative;
    width: 100%;
    height: var(--thumb-size);
    user-select: none;
    top: 20px
}

/* 3.1 Track (Hintergrund) */
.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: var(--slider-height);
    background-color: var(--track-color);
    border-radius: calc(var(--slider-height) / 2);
    transform: translateY(-50%);
}

/* 3.2 Fill (von links bis aktuellem Wert) */
.slider-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: var(--slider-height);
    background-color: #ffd600;
    border-radius: calc(var(--slider-height) / 2);
    transform: translateY(-50%);
    /* Initiale Breite über CSS-Variable gesetzt,
        wird später von JS überschrieben. */
    width: calc(
        ((var(--initial-value) - var(--min-value)) / (var(--max-value) - var(--min-value)))
        * 100%
    );
    transition: width var(--transition-duration);
}

/* 3.3 Thumb (runder Punkt, nur Anzeige) */
.slider-thumb {
    position: absolute;
    top: 50%;
    left: calc(
        ((var(--initial-value) - var(--min-value)) / (var(--max-value) - var(--min-value)))
        * 100%
    );
    width: var(--thumb-size);
    height: var(--thumb-size);
    background-color: var(--thumb-color);
    border: 2px solid #ffbf00;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: left var(--transition-duration);
    box-shadow: 0 0 2px rgba(0,0,0,0.2);
    z-index: 2; /* Über Track & Fill liegen */
}