/* Pinch-to-zoom layer for the legacy (v1) tables: 1000, kozel, pref.
   The board itself is scaled; header, footer and chat keep their normal size. */

body[data-table-zoom] .gameField {
    transform: translate(var(--table-zoom-x, 0px), var(--table-zoom-y, 0px)) scale(var(--table-zoom, 1));
    transform-origin: center center;
}

/* Over the board the controller owns two-finger gestures, so the browser's own pinch
   must not zoom the page on top of it; one finger still scrolls. Outside the board
   (chat, menu, header) the native gesture is left untouched. The class is set from JS:
   without the script the page keeps its previous behaviour everywhere. */
body.table-zoom-ready .gameField {
    touch-action: pan-x pan-y;
}

body.table-zoom-active {
    overscroll-behavior: none;
}

.table-zoom-reset {
    position: fixed;
    top: max(5px, env(safe-area-inset-top));
    right: max(5px, env(safe-area-inset-right));
    z-index: 40;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 8px;

    background-color: rgba(0, 0, 0, 0.45);
    color: #fff;
    color-scheme: only light;
    forced-color-adjust: none;
    font: bold 13px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.table-zoom-reset[hidden] {
    display: none;
}

.table-zoom-reset:hover,
.table-zoom-reset:focus {
    background-color: rgba(0, 0, 0, 0.75);
    outline: none;
}
