.layoutMain.gameLayout {
    display: flex;
    height: 100%;
    padding-bottom: 100px;
    min-width: 0;
    background: #13141e;
}

.layoutMain.gameLayout.open {
    /* margin: 60px 0 0 190px; */
}

.gameContainer {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: calc(100% - 356px);
    min-width: 0;
    padding: calc(12px * 2);
    background-color: #13141e;
}

.gameContainer .gamePlayer {
    --ratio-w: 16;
    --ratio-h: 9;
    --game-viewport-offset: 220px;
    --toolbar-height: 48px;

    width: min(100%, calc((100svh - var(--game-viewport-offset)) * var(--ratio-w) / var(--ratio-h)));
    max-height: calc(100svh - var(--game-viewport-offset));
    margin-inline: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: visible;
    background-color: #2a2c3a;
}

.gameContainer .gameFrameWrapper {
    aspect-ratio: var(--ratio-w) / var(--ratio-h);
    width: 100%;
    max-height: calc(100svh - var(--game-viewport-offset) - var(--toolbar-height));
    min-height: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: #2a2c3a;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.gameContainer .gameFrameWrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.gameToolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    height: var(--toolbar-height);
    box-sizing: border-box;
    padding: 0 12px;
    background: #1a1b28;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 10px 10px;
    flex-shrink: 0;
    overflow: visible;
}

.gameToolbarButton {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: #212233;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    overflow: visible;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.gameToolbarButton:hover {
    border-color: var(--brand-colour);
    background: #2a2c3a;
    color: var(--nav-icon-color-active);
}

.gameToolbarButton:focus-visible {
    outline: 2px solid var(--brand-colour);
    outline-offset: 2px;
}

.gameToolbarIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    line-height: 0;
    overflow: visible;
}

.gameToolbarIcon svg {
    display: block;
    width: 18px;
    height: 18px;
    overflow: visible;
}

.gamePlayer.is-fullscreen .gameToolbar {
    display: none;
}

.gameFrameWrapper.is-fullscreen,
.gameFrameWrapper:fullscreen,
.gameFrameWrapper:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: none;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 0;
    background: #0c0d14;
}

.gameSidebar {
    width: 356px;
    padding: calc(8px * 2);
    padding-bottom: 0;
    padding-top: 0;
    background-color: #13141e;
    margin-top: 2px;
}

.gameSidebar .gameBanner1 {
    width: 100%;
    height: 250px;
    background-color: #2a2c3a;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.gameSidebar .moreGamesSidebar {
    padding: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    margin: 15px 0 0 0;
}

.gameSidebar .moreGamesSidebar a {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 10px;
    border: 2px solid #0000;
    box-sizing: border-box;
    display: block;
    z-index: 0;
    background-clip: padding-box;
    overflow: hidden;
}

.gameSidebar .moreGamesSidebar a .thumbNail {
    width: 100%;
    min-height: 85px;
    height: 100%;
    position: relative;
    background-color: #373952;
    overflow: hidden;
    display: block;
}

.gameSidebar .moreGamesSidebar a .thumbNail img {
    position: absolute;
    z-index: 2;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.gameSidebar .moreGamesSidebar a .gameTitle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    color: white;
    padding: 10px 15px;
    font-size: 10px;
    text-align: left;
    display: none;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gameSidebar .moreGamesSidebar a:hover {
    border: 2px solid var(--brand-colour);
    box-sizing: border-box;
    background-clip: border-box;
}

.gameSidebar .moreGamesSidebar a:hover .thumbNail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
    border-radius: 8px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gameSidebar .moreGamesSidebar a:hover .thumbNail::before {
    opacity: 1;
}

.gameSidebar .moreGamesSidebar a:hover .gameTitle {
    display: block;
    opacity: 1;
}

.gameInfoWrapper .gameBanner2 {
    width: 100%;
    height: 110px;
    background-color: #2a2c3a;
    margin: 7px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.gameInfoWrapper .gameInfo {
    margin: 15px 0 0 0;
}

@media (max-width: 1350px) {
    .gameSidebar {
        width: 178px;
    }

    .gameContainer {
        width: calc(100% - 178px);
    }

    .gameSidebar .gameBanner1 {
        display: none;
    }

    .gameSidebar .moreGamesSidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .layoutMain.gameLayout {
        flex-direction: column;
    }

    .gameSidebar {
        width: 100%;
    }

    .gameSidebar .gameBanner1 {
        display: flex;
    }

    .gameContainer {
        width: 100%;
        padding: 12px 12px 8px;
    }

    .gameContainer .gamePlayer {
        --game-viewport-offset: 340px;
    }

    .gameSidebar .moreGamesSidebar {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 100px;
    }
}

@media (max-width: 978px) {
    .layoutMain.gameLayout.open {
        padding: 0 20px 100px;
    }

    .gameContainer {
        padding: 12px 10px 8px;
    }

    .gameContainer .gamePlayer {
        --game-viewport-offset: 300px;
    }

    .gameSidebar .moreGamesSidebar {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 120px;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .gameContainer .gamePlayer {
        --game-viewport-offset: 280px;
    }

    .gameSidebar .moreGamesSidebar {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 140px;
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    .gameContainer .gamePlayer {
        --ratio-w: 4;
        --ratio-h: 3;
        --game-viewport-offset: 260px;
        width: min(100%, calc((100svh - var(--game-viewport-offset)) * var(--ratio-w) / var(--ratio-h)));
    }

    .gameSidebar .moreGamesSidebar {
        grid-auto-rows: 120px;
    }
}

@media (max-width: 480px) and (orientation: portrait) {
    .gameContainer .gamePlayer {
        --ratio-w: 3;
        --ratio-h: 4;
        --game-viewport-offset: 240px;
        width: min(100%, calc((100svh - var(--game-viewport-offset)) * var(--ratio-w) / var(--ratio-h)));
    }
}

/* Landscape phones/tablets: restore side-by-side layout and size from viewport height */
@media (orientation: landscape) and (max-height: 600px) {
    .gameContainer {
        width: 100%;
        padding: 8px;
    }

    .gameContainer .gamePlayer {
        --ratio-w: 16;
        --ratio-h: 9;
        --game-viewport-offset: 80px;
        width: 100%;
        height: calc(100svh - var(--game-viewport-offset));
        max-height: calc(100svh - var(--game-viewport-offset));
    }
}
