/* Mobile shell for the original (v1) 1000 table. The board keeps its native
   coordinate system and is only reduced, never enlarged. */
html.thousand-v1-adaptive,
html.thousand-v1-adaptive body.game-1000-v1 {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body.game-1000-v1.thousand-v1-adaptive .wrapper {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    overflow: hidden;
}

body.game-1000-v1.thousand-v1-adaptive .gameField {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 827px;
    height: 530px;
    margin: 0;
    /* The fit scale keeps the board inside the viewport; --table-zoom on top of it is the
       player's own pinch gesture (see /js/games/table-zoom.js). */
    transform: translate(-50%, -50%) translate(var(--table-zoom-x, 0px), var(--table-zoom-y, 0px)) scale(calc(var(--thousand-v1-scale, 1) * var(--table-zoom, 1)));
    transform-origin: center center;
}

@media (max-width: 600px) {
    body.game-1000-v1.thousand-v1-adaptive #text_action {
        top: 293px;
        font-size: 17px;
    }

    body.game-1000-v1.thousand-v1-adaptive #ht .thousand-legacy-prikup {
        left: 165px;
        transform: scale(1.35);
        transform-origin: center center;
    }

    body.game-1000-v1.thousand-v1-adaptive #user {
        top: 390px;
    }

}

body.game-1000-v1.thousand-v1-adaptive .header,
body.game-1000-v1.thousand-v1-adaptive .header-downLine {
    left: 50%;
    margin-right: 0;
    margin-left: -413.5px;
}

body.game-1000-v1.thousand-v1-adaptive .header,
body.game-1000-v1.thousand-v1-adaptive .header-downLine,
body.game-1000-v1.thousand-v1-adaptive .header-shadow {
    transform: scale(var(--thousand-v1-scale, 1));
    transform-origin: center top;
}

body.game-1000-v1.thousand-v1-adaptive .wrapFooter {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    min-width: 0;
    margin: 0;
}

body.game-1000-v1.thousand-v1-adaptive .footer {
    left: 50%;
    width: 827px;
    margin: 0 0 0 -413.5px;
    transform: scale(var(--thousand-v1-scale, 1));
    transform-origin: center bottom;
}

body.game-1000-v1.thousand-v1-adaptive #score_table {
    /* The chat/footer shell is fixed. Keep the results modal above it so the
       current and accumulated scores remain readable on compact screens. */
    z-index: 50;
    top: 50%;
    left: 50%;
    margin: 0;
    transform: translate(-50%, -50%) scale(var(--thousand-v1-scale, 1));
    transform-origin: center center;
}

/* On landscape tablets the legacy player blocks extend beyond the 550px board:
   the opponent score starts above the viewport and the player's score falls behind
   the fixed footer. Keep the avatars in their original places, but move the score
   labels into the two free horizontal strips around the hands. */
@media (max-height: 680px) {
    body.game-1000-v1.thousand-v1-adaptive .position2 .userBlock-name {
        top: 40px;
        left: 70px;
    }

    body.game-1000-v1.thousand-v1-adaptive .position1 .userBlock-name {
        top: -180px;
        left: 70px;
    }
}

body.game-1000-v1 .game-fullscreen-toggle {
    top: max(5px, env(safe-area-inset-top));
    left: max(5px, env(safe-area-inset-left));
    z-index: 40;
}

body.game-1000-v1.thousand-v1-adaptive .game-fullscreen-toggle {
    width: 30px;
    height: 30px;
    border-radius: 6px;
}

body.game-1000-v1.thousand-v1-adaptive .game-fullscreen-toggle::before,
body.game-1000-v1.thousand-v1-adaptive .game-fullscreen-toggle::after {
    width: 17px;
    height: 17px;
    -webkit-mask-size: 17px 17px;
    mask-size: 17px 17px;
}
