#logo {
    display: none;
}

#content.nmbr9-content {
    background: #101827;
}

body.fw22 #content.nmbr9-content {
    container: nmbr9-layout / size;
}

#game {
    flex-direction: column;
    align-items: stretch;
    min-height: 100%;
    background: #101827;
    color: #e7eff9;
    font-family: system-ui, sans-serif;
}

#game #playerData {
    display: flex;
    box-sizing: border-box;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 8px 8px 0;
}

#game #board {
    flex: 1 0 320px;
    min-height: 320px;
    overflow: hidden;
}

#canvas-holder,
.nmbr9-board-panel {
    position: absolute;
    inset: 0;
}

.nmbr9-board-panel[aria-hidden="true"] {
    visibility: hidden;
}

.nmbr9-board-panel {
    display: flex;
    flex-direction: column;
}

.nmbr9-board-surface {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

@container nmbr9-layout (max-width: 599px) and (height > 440px) {
    #game .nmbr9-layer-rail {
        position: static;
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        width: 100%;
        max-height: none;
        padding: 4px 6px;
        overflow: auto hidden;
        border: 0;
        border-bottom: 1px solid #40536b;
        border-radius: 0;
    }

    #game .nmbr9-levels,
    #game .nmbr9-layer-modes {
        display: flex;
        flex: 0 0 auto;
    }

    #game .nmbr9-layer-modes {
        margin-top: 0;
        padding: 0 0 0 8px;
        border: 0;
        border-left: 1px solid #40536b;
    }

    #game .nmbr9-layer-rail button {
        min-width: 36px;
    }
}

@container nmbr9-layout (max-height: 440px) {
    #game {
        display: grid;
        grid-template:
            "players board status" auto
            "players board reserve" minmax(0, 1fr)
            / 112px minmax(0, 1fr) 116px;
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    #game #playerData {
        grid-area: players;
        flex-flow: column nowrap;
        overflow: auto;
        padding: 4px;
    }

    #game #playerData .playerData {
        flex: 0 0 auto;
        box-sizing: border-box;
        width: 100%;
        border-radius: 6px;
    }

    #game #playerData .playerData > .playerDataBasic {
        gap: 1px;
        padding: 2px 5px;
        font-size: .82rem;
        line-height: 1.15;
    }

    #game #playerData .playerDataDetail:empty {
        display: none;
    }

    #game #playerData .basicDesc {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #game #board {
        grid-area: board;
        min-height: 0;
    }

    #game .nmbr9-placement-status {
        grid-area: status;
        max-width: none;
        margin: 4px 4px 0;
        padding: 4px;
        font-size: .75rem;
        line-height: 1.2;
    }

    #game .remaining-tiles-info {
        grid-area: reserve;
        align-content: start;
        overflow: auto;
        gap: 4px;
        padding: 5px;
    }

    #game .remaining-tiles-caption {
        width: 100%;
    }

    #game .remaining-tiles-caption h2 {
        font-size: .8rem;
    }

    #game .remaining-tiles-list .tile-preview {
        width: 18px;
        height: 24px;
    }

    #game .nmbr9-layer-icon {
        display: none;
    }

    #game .nmbr9-levels,
    #game .nmbr9-layer-modes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #game .nmbr9-levels [data-view="overview"] {
        grid-column: 1 / -1;
    }
}

@container nmbr9-layout (max-height: 440px) and (max-width: 599px) {
    #game {
        grid-template:
            "players players" auto
            "board status" auto
            "board reserve" minmax(0, 1fr)
            / minmax(0, 1fr) 96px;
    }

    #game #playerData {
        flex-direction: row;
    }

    #game #playerData .playerData {
        width: 94px;
    }

    #game .remaining-tiles-list {
        gap: 2px;
    }

    #game .remaining-tiles-list .tile-block {
        padding: 1px;
    }

    #game .remaining-tiles-list .tile-preview {
        width: 16px;
        height: 22px;
    }
}
