.board {
    width: 400px;
    margin: auto
}

.info {
    width: 400px;
    margin: auto;
}

.move-history {
    max-height: 100px;
    overflow-y: scroll;
}

/* Responsive chess layout */
*, *::before, *::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    padding: 16px 12px 24px;
}

.board {
    max-width: 400px;
    width: min(400px, calc(100vw - 24px));
}

#board {
    margin-top: 16px !important;
}

.info {
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 400px;
    padding-top: 10px;
    width: min(400px, calc(100vw - 24px));
}

.move-history {
    max-height: min(28vh, 140px);
}

select,
button,
input {
    font-size: 16px;
}

@media (max-width: 700px), (pointer: coarse) {
    #search-depth {
        border-radius: 8px;
        margin: 6px 4px;
        min-height: 48px;
        min-width: 72px;
        padding: 8px 12px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #search-depth {
        border-radius: 8px;
        margin: 6px 4px;
        min-height: 48px;
        min-width: 72px;
        padding: 8px 12px;
    }

    body {
        align-items: flex-start;
        display: flex;
        gap: 12px;
        justify-content: center;
        padding: 8px;
    }

    .board {
        flex: 0 0 min(calc(100svh - 16px), calc(100vw - 260px), 400px);
        margin: 0;
        max-width: 400px;
        width: min(calc(100svh - 16px), calc(100vw - 260px), 400px) !important;
    }

    #board {
        margin-top: 0 !important;
    }

    .info {
        flex: 0 1 220px;
        margin: 0;
        max-height: calc(100svh - 16px);
        max-width: 220px;
        overflow-y: auto;
        padding-top: 0;
        width: auto;
    }

    .move-history {
        max-height: 120px;
    }
}
