#table-area[data-table-background-ready] #deberc-table::before,
#table-area[data-table-background-ready] .ochko-table-surface::before,
body.poker #table-area[data-table-background-ready],
body.seka #table-area[data-table-background-ready] {
    background-color: var(--yc-table-color);
    background-image:
        var(--yc-table-effect),
        linear-gradient(rgb(0 0 0 / var(--yc-table-dim)), rgb(0 0 0 / var(--yc-table-dim))),
        var(--yc-table-image);
    background-position: var(--yc-table-position, center, center, 0 0);
    background-repeat: var(--yc-table-repeat, no-repeat, no-repeat, repeat);
    /* Match the settings preview: textures are tiles, never a stretched cover image. */
    background-size: var(--yc-table-size, auto, auto, 120px auto);
}

body.poker #table-area[data-table-background-ready],
body.seka #table-area[data-table-background-ready] {
    border-radius: 46% / 40%;
}

/* Стол «Очко» (21) живёт в том же карточном оформлении: продолжаем выбранную
   игроком текстуру на всю комнату вокруг стола. Класс игры на body — «21»,
   поэтому селектор берётся через [class~="21"]: `.21` невалиден в CSS. */
body.table-game[class~="21"][data-game-background-ready] {
    background-color: var(--yc-table-color);
    background-image:
        radial-gradient(ellipse at 50% 46%, transparent 18%, rgba(0,0,0,.22) 62%, rgba(0,0,0,.62) 100%),
        linear-gradient(rgba(0,0,0,.26), rgba(0,0,0,.26)),
        var(--yc-table-effect),
        linear-gradient(rgb(0 0 0 / var(--yc-table-dim)), rgb(0 0 0 / var(--yc-table-dim))),
        var(--yc-table-image);
    background-position: center, center, var(--yc-table-position, center, center, 0 0);
    background-repeat: no-repeat, no-repeat, var(--yc-table-repeat, no-repeat, no-repeat, repeat);
    background-size: cover, cover, var(--yc-table-size, auto, auto, 120px auto);
    background-attachment: fixed;
}

/* The refreshed Atlas source is exported at 3.296x the legacy 71x96 grid. */
.atlas-card-face {
    background-size: 923px 384px !important;
}

/* Match the rounded card silhouette used by Durak and redesigned Deberc in
   every legacy card board, for both face sprites and player-selected backs. */
body[data-game-type="1000"] .card,
body[data-game-type="kozel"] .card,
body[data-game-type="poker"] .card,
body[data-game-type="pref"] .card,
body[data-game-type="king"] .card,
body[data-game-type="seka"] .card,
body[data-game-type="deberc"] .card,
body[data-game-type] #oponent img,
body[data-game-type] #cards img,
body[data-game-type] #left_opon img,
body[data-game-type] #right_opon img,
body[data-game-type] #user img {
    border-radius: 8px;
}

/* Inset the old dotted move slot so its coloured square corners cannot
   protrude behind a rounded card. */
.legacy-card-slot {
    width: 63px !important;
    height: 86px !important;
    transform: translate(3px, 3px);
    border-radius: 6px;
    box-sizing: border-box;
    /* Одна пунктирная линия на текстурном сукне почти не читается: слабая
       затемнённая подложка делает место для карты видимым, но не спорит с картой. */
    background: rgba(0, 0, 0, .18);
}

/* Слоты текущей взятки в «1000» используют те же мягкие контуры, что и
   redesigned Deberc: меньше карты, лёгкий пунктир и без тяжёлой inset-тени. */
body[data-game-type="1000"] .legacy-card-slot--deberc {
    width: 66px !important;
    height: 91px !important;
    transform: translate(2px, 2px);
    border: 2px dashed rgba(255, 255, 255, .28);
    border-radius: 6px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, .12);
    box-shadow: none;
}

/* Ник и счёт на легаси-досках наследовали синий цвет ссылок и на зелёном сукне
   были самым нечитаемым текстом экрана. */
body[data-game-type="1000"] .userBlock-name,
body[data-game-type="kozel"] .userBlock-name,
body[data-game-type="pref"] .userBlock-name,
body[data-game-type="king"] .userBlock-name {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

body[data-game-type="1000"] .userBlock-name a,
body[data-game-type="kozel"] .userBlock-name a,
body[data-game-type="pref"] .userBlock-name a,
body[data-game-type="king"] .userBlock-name a {
    color: #ffe98a;
}

.legacy-small-card {
    position: absolute;
    width: 41px;
    height: 54px;
    margin: 0;
    border-radius: 4px;
    background-image: url('/img/main/flat/game_redesign/cards-small-11.png?v=two-decks-v1');
    background-size: 533px 216px;
    box-shadow: 0 2px 5px rgba(0,0,0,.38);
}

/* Result dialogs lay cards out in a row; legacy table mini-cards are absolute by default. */
.card-game-result-last-trick__cards {
    display: inline-flex;
    gap: 6px;
    margin-left: 6px;
    vertical-align: middle;
}

.card-game-result-last-trick__card {
    position: relative;
    flex: 0 0 41px;
}

.thousand-legacy-comb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transform: scale(.6);
    transform-origin: center top;
}

/* The bottom player's declared marriages used to sit directly on the avatar.
   Keep the shared 40% reduction and move only that row below its old anchor. */
#ht .thousand-legacy-combs--b {
    transform: translateY(55px);
}

/* Lift the compact top-player marriages clear of the opponent's hand. */
#ht .thousand-legacy-combs--t {
    transform: translateY(-46px);
}

/* Мини-карты марьяжей мельче игральных, а лежат на текстурном сукне: тёмная
   подложка возвращает им контраст, не увеличивая сам значок. */
#ht .thousand-legacy-comb {
    padding: 3px 5px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .34);
}

.thousand-legacy-comb-pair { display: inline-flex; }

/* The legacy board declares `#ht div {position:absolute}`, which outranks a plain
   class selector and collapsed every declared marriage into one spot. Match that
   id specificity so the pair lays out as a flex row again. */
#ht .thousand-legacy-comb-pair .legacy-small-card {
    position: relative;
    flex: 0 0 auto;
}
/* Keep both ranks readable: the king may cover the queen, never hide her. */
#ht .thousand-legacy-comb-pair .legacy-small-card + .legacy-small-card { margin-left: -14px; }

/* Legacy Thousand keeps its deck at x=580 and the right-hand player's cards at
   x=708, so the trump marker goes under the deck rather than beside it: at the
   old x=670 it sat on the fourth player's stack. Badge itself is the compact
   suit chip used by the redesigned Deberc table. */
.thousand-legacy-trump {
    position: absolute;
    top: 300px;
    left: 594px;
    z-index: 20;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255,255,255,.76);
    border-radius: 50%;
    background: rgba(247,243,231,.9);
    box-shadow: 0 1px 0 rgba(255,255,255,.72) inset, 0 3px 7px rgba(0,0,0,.32);
}

.thousand-legacy-trump::before {
    content: '';
    display: block;
    width: 42px;
    height: 42px;
    background: linear-gradient(155deg, #555 10%, #141414 82%);
    -webkit-mask: url(/img/main/flat/game_redesign/card-suits.svg) 0 0 / 168px 42px no-repeat;
    mask: url(/img/main/flat/game_redesign/card-suits.svg) 0 0 / 168px 42px no-repeat;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
}

.thousand-legacy-trump.card-deck__trump-mast1::before,
.thousand-legacy-trump.card-deck__trump-mast2::before {
    background: linear-gradient(155deg, #ff5d68, #cc1531 82%);
}
.thousand-legacy-trump.card-deck__trump-mast1::before { transform: translateY(3px); }
.thousand-legacy-trump.card-deck__trump-mast2::before { -webkit-mask-position: -42px 0; mask-position: -42px 0; }
.thousand-legacy-trump.card-deck__trump-mast3::before { -webkit-mask-position: -84px 0; mask-position: -84px 0; }
.thousand-legacy-trump.card-deck__trump-mast4::before { -webkit-mask-position: -126px 0; mask-position: -126px 0; }

/* Статус хода в шапке легаси-досок был тонким голубым 18px на чёрной панели и
   при беглом взгляде терялся. */
body[data-game-type="1000"] .header #txt,
body[data-game-type="kozel"] .header #txt,
body[data-game-type="pref"] .header #txt,
body[data-game-type="king"] .header #txt {
    color: #7fd4ff;
    font-weight: 600;
    font-size: 20px;
}

/* Games without a separate table surface use the player's background directly. */
body[data-game-background-ready][data-game-type="1000"], .wrapper[data-game-background-ready][data-game-type="1000"],
body[data-game-background-ready][data-game-type="kozel"], .wrapper[data-game-background-ready][data-game-type="kozel"],
body[data-game-background-ready][data-game-type="pref"], .wrapper[data-game-background-ready][data-game-type="pref"],
body[data-game-background-ready][data-game-type="king"], .wrapper[data-game-background-ready][data-game-type="king"] {
    background-color: var(--yc-table-color) !important;
    background-image:
        var(--yc-table-effect),
        linear-gradient(rgb(0 0 0 / var(--yc-table-dim)), rgb(0 0 0 / var(--yc-table-dim))),
        var(--yc-table-image) !important;
    background-position: var(--yc-table-position, center, center, 0 0) !important;
    background-repeat: var(--yc-table-repeat, no-repeat, no-repeat, repeat) !important;
    background-size: var(--yc-table-size, auto, auto, 120px auto) !important;
    background-attachment: fixed !important;
}

/* Poker and Seka have a visible oval table. Repeat the same selected material
   outside it, but quieten the room so the playing surface remains distinct. */
body[data-game-background-ready][data-game-type="poker"], .wrapper[data-game-background-ready][data-game-type="poker"],
body[data-game-background-ready][data-game-type="seka"], .wrapper[data-game-background-ready][data-game-type="seka"] {
    background-color: var(--yc-table-color) !important;
    background-image:
        radial-gradient(ellipse at 50% 46%, transparent 18%, rgba(0,0,0,.22) 62%, rgba(0,0,0,.62) 100%),
        linear-gradient(rgba(0,0,0,.26), rgba(0,0,0,.26)),
        var(--yc-table-effect),
        linear-gradient(rgb(0 0 0 / var(--yc-table-dim)), rgb(0 0 0 / var(--yc-table-dim))),
        var(--yc-table-image) !important;
    background-position: center, center, var(--yc-table-position, center, center, 0 0) !important;
    background-repeat: no-repeat, no-repeat, var(--yc-table-repeat, no-repeat, no-repeat, repeat) !important;
    background-size: cover, cover, var(--yc-table-size, auto, auto, 120px auto) !important;
    background-attachment: fixed !important;
}
