/* ESTILOS BASE: mesa, cartas, resultados y adaptación móvil */

:root {
    --ink: #f2f1e8;
    --muted: #b0c6b9;
    --green: #123e31;
    --deep: #071e1c;
    --gold: #e7c47e;
    --line: rgba(255, 255, 255, .12)
}

* {
    box-sizing: border-box
}

html {
    min-height: 100%;
    background: var(--deep)
}

body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(ellipse at 50% 15%, #204e3f 0%, #0b2b27 45%, #071d1b 100%);
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif
}

button,
select {
    font: inherit
}

button {
    cursor: pointer;
    transition: transform .15s, background .15s, opacity .15s
}

button:hover:not(:disabled) {
    transform: translateY(-2px)
}

button:disabled {
    opacity: .36;
    cursor: not-allowed
}

button:focus-visible,
select:focus-visible,
.card:focus-visible {
    outline: 3px solid #efd38c;
    outline-offset: 3px
}

.hidden {
    display: none !important
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px clamp(16px, 4vw, 60px);
    border-bottom: 1px solid var(--line);
    gap: 16px
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.brand .logo {
    width: 44px;
    height: 44px;
    border: 1px solid #a9bc94;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 27px;
    color: var(--gold)
}

.brand strong {
    display: block;
    font-family: Georgia, serif;
    font-size: 23px;
    letter-spacing: 5px;
    font-weight: 500
}

.brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--muted)
}

.header-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap
}

.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12px
}

.ghost:hover {
    background: #ffffff16
}

.header-actions a {
    color: var(--gold) !important;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px clamp(12px, 3vw, 40px)
}

.panel {
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #071f1dbd;
    box-shadow: 0 14px 36px #0002
}

.setup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
    overflow: hidden
}

.setup-copy {
    padding: clamp(28px, 6vw, 70px)
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--gold);
    font-weight: 700
}

.setup h1 {
    font: normal clamp(18px, 5vw, 32px)/1.07 Georgia, serif;
    margin: 15px 0 20px;
    max-width: 550px
}

.setup h1 em {
    color: var(--gold)
}

.setup p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--muted);
    max-width: 440px;
    margin-bottom: 30px
}

.setup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 0;
    max-width: 450px;
    font-size: 14px
}

.setup select {
    background: #173e35;
    color: white;
    border: 1px solid #426155;
    padding: 12px;
    border-radius: 8px;
    min-width: 190px
}

.primary,
.gold,
.secondary {
    border-radius: 9px;
    padding: 12px 16px;
    font-weight: 650;
    border: 1px solid transparent
}

.primary {
    background: #efd08b;
    color: #122820
}

.primary:hover {
    background: #ffe2a1
}

.gold {
    background: #f4ead5;
    color: #4c3b16
}

.secondary {
    background: #214c40;
    color: #f2f5ed;
    border-color: #487060
}

.secondary:hover {
    background: #316757
}

.big {
    margin-top: 22px;
    font-size: 16px;
    padding: 16px 23px
}

.big span {
    margin-left: 23px
}

.setup-art {
    position: relative;
    background: radial-gradient(circle, #245c47, #0b342c 72%);
    display: grid;
    place-items: center;
    min-height: 380px
}

.setup-art:after {
    content: "";
    position: absolute;
    inset: 10%;
    border: 2px solid #ffffff16;
    border-radius: 50%
}

.sample-card {
    position: absolute;
    width: 120px;
    height: 186px;
    background: #faf6e9;
    color: #3b3831;
    border-radius: 9px;
    box-shadow: 6px 12px 16px #0005;
    font: 47px Georgia, serif;
    padding: 15px
}

.sample-card span {
    display: block;
    text-align: center;
    font-size: 63px
}

.sample-card.one {
    transform: translate(-95px, 10px) rotate(-22deg)
}

.sample-card.two {
    transform: translate(0, -20px) rotate(-3deg)
}

.sample-card.three {
    transform: translate(105px, 9px) rotate(19deg)
}

.setup-stamp {
    position: absolute;
    bottom: 24px;
    right: 25px;
    letter-spacing: 3px;
    text-align: center;
    font-size: 11px;
    line-height: 1.8;
    color: #e8d4a8;
    z-index: 1
}

.game-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px
}

.game-heading h2 {
    font: normal 29px Georgia, serif;
    margin: 7px 0
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 9px
}

.game-meta span {
    background: #14382f;
    border: 1px solid #ffffff1e;
    border-radius: 30px;
    padding: 9px 12px;
    color: #d4e0d5;
    font-size: 12px
}

.table-scene {
    padding: 13px;
    background: #3b271c;
    border: 6px solid #694b32;
    border-radius: 140px;
    box-shadow: 0 16px 32px #0006, inset 0 1px #b99469
}

.felt {
    position: relative;
    min-height: 570px;
    background: radial-gradient(ellipse at center, #205b46, #124732 57%, #0d372b 100%);
    border-radius: 125px;
    overflow: hidden;
    border: 2px solid #cfaf774a
}

.felt-ring {
    position: absolute;
    inset: 28px;
    border: 2px solid #e1c18b25;
    border-radius: 112px;
    pointer-events: none
}

.opponents {
    display: flex;
    justify-content: space-evenly;
    gap: 8px;
    padding: 24px 55px
}

.opponent {
    min-width: 120px;
    position: relative;
    text-align: center;
    max-width: 31%
}

.opponent.active .opponent-name {
    color: #ffe9ae
}

.opponent-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px
}

.opponent-score {
    color: #bad1c5;
    font-size: 11px;
    margin: 4px
}

.mini-hand {
    display: flex;
    justify-content: center;
    padding-top: 5px;
    height: 75px
}

.mini-card {
    width: 32px;
    height: 54px;
    margin-left: -13px;
    background: repeating-linear-gradient(45deg, #18385a, #18385a 4px, #2b577c 4px, #2b577c 8px);
    border: 2px solid #f9edcf;
    border-radius: 5px;
    box-shadow: 0 3px 5px #0006
}

.mini-card:first-child {
    margin-left: 0
}

.table-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 45px;
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%)
}

.pile-wrap {
    text-align: center
}

.pile {
    width: 82px;
    height: 118px;
    border: 3px solid #f7f1df;
    border-radius: 7px;
    background: repeating-linear-gradient(45deg, #184b67, #184b67 5px, #326f83 5px, #326f83 10px);
    display: grid;
    place-items: center;
    box-shadow: 3px 5px 10px #0019;
    cursor: pointer
}

.pile:hover {
    transform: translateY(-4px)
}

.back-design {
    color: #f9eec3;
    font: 60px Georgia, serif
}

.pile.discard {
    background: #e8dbc0;
    border: 2px dashed #b2a483
}

.pile-caption {
    margin-top: 10px;
    font-size: 10px;
    letter-spacing: 2px
}

.center-badge {
    position: absolute;
    left: 20%;
    top: 45%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: #d5b67f71;
    letter-spacing: 6px;
    font: 12px Georgia, serif
}

.human-seat {
    position: absolute;
    bottom: 20px;
    left: 18px;
    right: 18px;
    text-align: center
}

.seat-name {
    font-size: 13px;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 14px
}

.seat-name span:last-child {
    margin-left: 12px;
    color: #b5d0bd;
    font-weight: 400;
    letter-spacing: 0
}

.turn-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e3c881;
    margin-right: 6px
}

.hand {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: nowrap;
    min-height: 136px;
    gap: clamp(2px, .6vw, 8px)
}

.card {
    position: relative;
    background: linear-gradient(145deg, #fffcf4, #f1e6cf);
    color: #332e26;
    border-radius: 8px;
    border: 2px solid #e0cda7;
    width: clamp(45px, 7.2vw, 86px);
    height: clamp(78px, 11vw, 124px);
    box-shadow: 0 5px 9px #0005;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
    flex-shrink: 0
}

.card .rank {
    position: absolute;
    top: 4px;
    left: 7px;
    font: 700 clamp(15px, 2vw, 22px) Georgia, serif
}

.card .symbol {
    font-size: clamp(22px, 3.8vw, 42px);
    line-height: 1.2
}

.card .suit {
    font-size: clamp(8px, 1vw, 10px);
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: .3px
}

.card .corner {
    position: absolute;
    bottom: 4px;
    right: 7px;
    font-size: 12px
}

.card.selected {
    transform: translateY(-20px);
    border-color: #f9ce59;
    box-shadow: 0 0 0 3px #f2bf4599, 0 14px 15px #0007
}

.card.meld-mark {
    border-bottom: 6px solid #63ae7a
}

.card.joker {
    background: linear-gradient(140deg, #e9dcff, #fff5e9)
}

.card.red .rank {
    color: #bd3434
}

.pile .card {
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none
}

.actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px;
    margin-top: 16px;
    flex-wrap: wrap
}

.action-copy {
    font-size: 14px;
    color: #d3dfd3;
    max-width: 320px;
    line-height: 1.5
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.actions button {
    font-size: 12px;
    padding: 11px
}

.below {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 16px
}

.scoreboard,
.log-panel {
    padding: 18px;
    min-height: 190px
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px
}

.section-title h3 {
    font: normal 21px Georgia, serif;
    margin: 0
}

.section-title span {
    font-size: 11px;
    color: var(--muted)
}

.score-row {
    display: grid;
    grid-template-columns: 1fr 100px 75px;
    gap: 10px;
    padding: 9px 6px;
    border-bottom: 1px solid #ffffff16;
    font-size: 13px
}

.score-row b {
    text-align: right
}

.score-row .out {
    color: #d7a4a4
}

.score-row .living {
    color: #bfe2c0
}

.log-line {
    font-size: 12px;
    color: #c8d7cb;
    padding: 6px 0;
    border-bottom: 1px solid #ffffff0e
}

footer {
    text-align: center;
    color: #aec5b9;
    font-size: 13px;
    padding: 25px;
}

footer.site-signature span {
    display: block;
    margin-bottom: 5px;
}

footer.site-signature span:last-child {
    margin-bottom: 0;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 16px
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: #031a18d9;
    backdrop-filter: blur(7px)
}

.modal-card {
    background: #10382e;
    border: 1px solid #d5b47880;
    box-shadow: 0 23px 80px #0009;
    border-radius: 18px;
    position: relative;
    width: min(780px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: clamp(24px, 4vw, 36px)
}

.close-modal {
    position: absolute;
    right: 13px;
    top: 13px;
    border: 0;
    color: white;
    background: transparent;
    font-size: 30px
}

.modal-card h2 {
    font: normal 34px Georgia, serif;
    color: #f1d89f;
    margin: 0 0 14px
}

.modal-card h3 {
    font: normal 21px Georgia, serif;
    color: #f1d89f
}

.modal-card p,
.modal-card li {
    font-size: 14px;
    line-height: 1.65;
    color: #d9e4dc
}

.modal-card ul {
    padding-left: 21px
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 25px;
    flex-wrap: wrap
}

.reveal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 16px 0
}

.reveal-player {
    border: 1px solid #ffffff24;
    padding: 12px;
    border-radius: 10px;
    background: #ffffff08
}

.reveal-player h4 {
    margin: 0 0 8px
}

.reveal-player p {
    font-size: 12px;
    margin: 8px 0
}

.reveal-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 4px
}

.reveal-cards .card {
    width: 33px;
    height: 53px;
    border-radius: 4px;
    cursor: default
}

.reveal-cards .card .rank {
    font-size: 12px;
    top: 2px;
    left: 3px
}

.reveal-cards .card .symbol {
    font-size: 18px
}

.reveal-cards .card .suit,
.reveal-cards .card .corner {
    display: none
}

.winner {
    color: #ffe5a6;
    font-size: 18px
}

.hint {
    color: #f0d8a7 !important
}

.meld-list {
    font-size: 12px;
    color: #b5d4c1;
    line-height: 1.5;
    margin-top: 5px
}

@media(max-width:780px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start
    }

    .header-actions {
        width: 100%
    }

    .ghost {
        font-size: 11px;
        padding: 7px
    }

    .setup {
        grid-template-columns: 1fr
    }

    .setup-art {
        min-height: 240px
    }

    .sample-card {
        transform: scale(.7) !important
    }

    .setup h1 {
        font-size: 32px
    }

    .felt {
        min-height: 470px;
        border-radius: 45px
    }

    .table-scene {
        border-radius: 60px;
        padding: 7px;
        border-width: 4px
    }

    .felt-ring {
        border-radius: 40px;
        inset: 12px
    }

    .opponents {
        padding: 15px 15px
    }

    .opponent {
        min-width: 65px
    }

    .mini-hand {
        height: 55px
    }

    .mini-card {
        width: 23px;
        height: 42px;
        margin-left: -13px
    }

    .opponent-name {
        font-size: 10px
    }

    .pile {
        width: 58px;
        height: 84px
    }

    .table-center {
        gap: 25px;
        top: 44%
    }

    .center-badge {
        top: 65%;
        letter-spacing: 2px
    }

    .below {
        grid-template-columns: 1fr
    }

    .actions {
        width: 100%
    }

    .actions button {
        flex: 1 1 130px
    }

    .game-heading {
        flex-direction: column;
        align-items: flex-start
    }

    .card {
        width: clamp(39px, 10vw, 70px);
        height: clamp(70px, 16vw, 105px)
    }

}

/* v1.1: orden manual de la mano y grupos visuales. */
#hand .draggable-card {
    touch-action: none;
    cursor: grab;
    transition: transform .13s ease, margin .13s ease, box-shadow .13s ease
}

#hand .draggable-card:active {
    cursor: grabbing
}

#hand .group-start:not(:first-child) {
    margin-left: clamp(9px, 1.7vw, 24px)
}

#hand .grouped-card {
    border-bottom: 5px solid #70c897
}

#hand .drop-before {
    box-shadow: -7px 0 0 #f9ce59, 0 5px 9px #0005
}

#hand .drop-after {
    box-shadow: 7px 0 0 #f9ce59, 0 5px 9px #0005
}

.drag-ghost {
    position: fixed !important;
    z-index: 1000;
    pointer-events: none;
    transform: translate(-50%, -65%) rotate(-5deg) scale(1.08) !important;
    opacity: .92;
    box-shadow: 0 17px 27px #0008 !important;
    width: 75px !important;
    height: 110px !important
}

.drag-count {
    position: absolute;
    right: -12px;
    top: -13px;
    border-radius: 12px;
    padding: 4px 7px;
    background: #e8c988;
    color: #17382d;
    font: bold 11px sans-serif;
    white-space: nowrap
}

.dragging-cards,
.dragging-cards * {
    cursor: grabbing !important;
    user-select: none !important
}

/* Conga 1.2: acomodo público y descarte por arrastre */
#discardPile.discard-target {
    outline: 2px dashed rgba(243, 207, 124, .65);
    outline-offset: 5px
}

#discardPile.drop-ready {
    outline: 4px solid #f4d48b;
    outline-offset: 6px;
    box-shadow: 0 0 26px #e4bb6577
}

.layoff-top {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 16px 0
}

.layoff-track {
    flex: 1;
    min-width: 160px;
    height: 10px;
    background: #092b25;
    border-radius: 30px;
    overflow: hidden
}

.layoff-track>div {
    background: #f3d48d;
    height: 100%;
    transition: width 1s linear
}

.layoff-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0
}

.layoff-player {
    padding: 14px;
    border: 1px solid #557569;
    border-radius: 12px;
    background: #173e33;
    min-width: 0
}

.layoff-player h3 {
    margin: 0 0 12px;
    color: #f4d68e;
    font-size: 17px
}

.layoff-label {
    color: #c2d5ce;
    font-size: 12px;
    margin: 8px 0 5px
}

.layoff-groups,
.layoff-loose {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 50px;
    align-items: flex-start
}

.layoff-group {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 8px;
    border: 2px dashed #6d957d;
    border-radius: 10px;
    min-height: 74px;
    align-items: flex-start;
    position: relative
}

.layoff-group small {
    width: 100%;
    color: #d4e3d9;
    font-size: 10px
}

.layoff-group.targeted {
    border-color: #f7d48e;
    background: #31614c
}

.layoff-loose-card {
    touch-action: none;
    cursor: grab;
    user-select: none
}

.layoff-loose-card .card,
.layoff-group .card {
    width: 43px;
    height: 64px;
    min-width: 43px;
    font-size: 12px
}

.layoff-loose-card .card .symbol,
.layoff-group .card .symbol {
    font-size: 17px
}

.layoff-loose-card .card .suit,
.layoff-group .card .suit {
    font-size: 7px
}

.layoff-empty {
    font-size: 12px;
    color: #bfd6c9
}

@media(max-width:700px) {
    .layoff-grid {
        grid-template-columns: 1fr
    }

    .layoff-player {
        padding: 10px
    }

}

/* Versión 1.3: detección inmediata de figuras por proximidad */
#hand .auto-group {
    border-bottom-width: 7px;
    box-shadow: 0 7px 13px #0007;
}

#hand .auto-group-0 {
    border-bottom-color: #6de6a7 !important
}

#hand .auto-group-1 {
    border-bottom-color: #e8aa52 !important
}

#hand .auto-group-2 {
    border-bottom-color: #ad8dff !important
}

#hand .auto-group-3 {
    border-bottom-color: #60d6ea !important
}

#hand .auto-group-4 {
    border-bottom-color: #ed88a7 !important
}

#hand .auto-group-5 {
    border-bottom-color: #e9e16d !important
}

#hand .auto-group.selected {
    outline: 2px solid #f9ce59
}

#hand .joker-assignment {
    position: absolute;
    bottom: 17px;
    left: 2px;
    right: 2px;
    background: #381b61;
    color: #fff;
    font-size: 8px;
    line-height: 1.15;
    border-radius: 3px;
    padding: 2px;
    max-height: 28px;
    overflow: hidden;
    text-align: center
}

/* v1.4: superficie amplia de acomodo, con cartas legibles */
.table-scene.layoff-mode {
    border-radius: 32px;
    padding: 22px;
    background: #124533
}

.table-scene.layoff-mode .felt {
    display: none
}

.table-layoff {
    background: radial-gradient(ellipse at center, #205b46, #0d372b);
    color: #f3efe2;
    border-radius: 22px;
    padding: clamp(12px, 2.5vw, 30px);
    min-height: 540px
}

.table-layoff h2 {
    font: normal clamp(28px, 3vw, 38px) Georgia, serif;
    color: #f6d997;
    margin: 8px 0
}

.table-layoff p {
    color: #d4e5db;
    line-height: 1.5
}

.table-layoff .layoff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px
}

.table-layoff .layoff-player {
    padding: 20px;
    background: #ffffff0b;
    border-color: #9ec4a775
}

.table-layoff .layoff-player h3 {
    font-size: 22px
}

.table-layoff .layoff-label {
    font-size: 14px
}

.table-layoff .layoff-group {
    gap: 6px;
    padding: 10px;
    min-height: 115px
}

.table-layoff .layoff-loose-card .card,
.table-layoff .layoff-group .card {
    width: clamp(57px, 6vw, 82px);
    height: clamp(87px, 9vw, 118px);
    min-width: 57px
}

.table-layoff .layoff-loose-card .card .symbol,
.table-layoff .layoff-group .card .symbol {
    font-size: clamp(25px, 3vw, 36px)
}

.table-layoff .layoff-loose-card .card .rank,
.table-layoff .layoff-group .card .rank {
    font-size: 21px
}

.table-layoff .layoff-loose-card .card .suit,
.table-layoff .layoff-group .card .suit {
    font-size: 10px
}

.table-layoff-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px
}

.table-layoff-buttons button {
    font-size: 16px;
    padding: 14px 22px
}

@media(max-width:850px) {
    .table-layoff .layoff-grid {
        grid-template-columns: 1fr
    }

    .table-scene.layoff-mode {
        padding: 8px
    }

    .table-layoff {
        padding: 12px
    }

}

/* v1.6: arte original, 12 columnas y celdas de 70 × 107. */
.card.image-card {
    background: #fff;
    border: 0;
    overflow: visible;
    aspect-ratio: 420/640;
    height: auto;
}

.card-art {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    border-radius: 5px;
    pointer-events: none;
    background: #fff;
}

.card.selected {
    outline: 3px solid #f9ce59;
    outline-offset: 2px;
}

#hand .image-card.auto-group {
    border-bottom: 7px solid #6de6a7;
}

.pile:not(.discard) {
    background: transparent;
    border: 0;
}

.pile .image-card {
    width: 100%;
    height: 100%;
}

.mini-hand .mini-card {
    width: 32px;
    height: 49px;
    min-width: 32px;
    margin-left: -13px;
    border: 0;
    background: transparent;
    box-shadow: 0 3px 5px #0006;
}

.mini-hand .mini-card:first-child {
    margin-left: 0;
}

.sample-card {
    padding: 0;
    background: transparent;
    aspect-ratio: 70/107;
    height: auto;
}

.sample-card .card-art {
    height: 100%;
}

.bot-flight {
    position: fixed !important;
    z-index: 25;
    pointer-events: none !important;
    margin: 0 !important;
    box-shadow: 0 12px 22px #0006;
}

.hand-help {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
    margin: 12px 10px;
}

.reveal-cards .image-card {
    width: 55px;
    height: auto;
}

#hand {
    gap: clamp(2px, .6vw, 8px);
}

@media(max-width:780px) {
    .mini-hand .mini-card {
        width: 23px;
        min-width: 23px;
        height: 35px;
    }

}

@media(max-width:480px) {
    #hand {
        gap: 2px;
    }

    #hand .image-card {
        width: calc((100vw - 92px)/8);
    }

    #hand .group-start:not(:first-child) {
        margin-left: 5px;
    }

    .human-seat {
        left: 8px;
        right: 8px;
    }

}

.setup input {
    font: inherit;
    background: #173e35;
    color: white;
    border: 1px solid #426155;
    padding: 12px;
    border-radius: 8px;
    min-width: 0;
    width: 190px;
    max-width: 100%;
}

.setup input::placeholder {
    color: #b0c6b9
}

input:focus-visible {
    outline: 3px solid #efd38c;
    outline-offset: 3px
}

.opponent-name {
    overflow-wrap: anywhere
}

.seat-name #humanName {
    margin: 0;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 1px
}

/* Planilla de rondas: acumulado y aporte de cada ronda. */
.seat-name .human-score {
    display: inline-block;
    margin-left: 12px;
    color: #bad1c5;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
}

.scoreboard {
    min-width: 0;
}

.score-sheet-wrap {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid #799f8866;
    border-radius: 8px;
}

.score-sheet {
    border-collapse: collapse;
    width: 100%;
    min-width: 400px;
    font-size: 13px;
    background: #f5f1e6;
    color: #22382e;
}

.score-sheet caption {
    caption-side: top;
    text-align: left;
    font-size: 11px;
    line-height: 1.5;
    padding: 10px;
    background: #153d32;
    color: #dce7dd;
}

.score-sheet th,
.score-sheet td {
    border: 1px solid #b8c5b5;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

.score-sheet thead th {
    background: #e0e8d9;
    overflow-wrap: anywhere;
    min-width: 80px;
}

.score-sheet th:first-child {
    min-width: 55px;
}

.score-sheet small {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
}

.score-sheet tbody tr:nth-child(even) {
    background: #ebeede;
}

.score-sheet strong {
    font-variant-numeric: tabular-nums;
}

.score-sheet tfoot {
    background: #d6e1cc;
    font-size: 15px;
}

.score-eliminated {
    color: #8b3737;
}

.score-pending {
    font-size: 11px;
    color: #66715e;
}

.layoff-turn {
    padding: 12px;
    background: #f1d59a;
    color: #12382a;
    border-radius: 8px;
    font-weight: 700
}

.layoff-player.layoff-active {
    outline: 3px solid #efd08b;
    outline-offset: 2px
}

.layoff-group .layoff-added {
    outline: 3px solid #69e3ae;
    outline-offset: 1px
}

.added-by {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    font-size: 9px;
    background: #165c44;
    color: white;
    padding: 3px;
    line-height: 1.2;
    border-radius: 4px;
    overflow-wrap: anywhere;
    pointer-events: none
}

.layoff-events {
    font-size: 12px;
    line-height: 1.8;
    padding: 10px;
    background: #082f26;
    border-radius: 8px
}

.layoff-group .joker-assignment {
    bottom: 8px;
    max-height: none;
    font-size: 10px
}

/* Resultados amplios; el resto de diálogos conserva su tamaño. */
.modal.round-results .modal-card {
    width: min(1600px, 96vw);
    max-height: 90vh;
}

.modal.round-results .reveal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.modal.round-results .reveal-player {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media(max-width:1150px) {
    .modal.round-results .reveal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media(max-width:620px) {
    .modal.round-results .modal-card {
        width: 100%;
    }

    .modal.round-results .reveal-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

}

.final-standings {
    margin: 0 0 24px;
}

.final-standings table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.final-standings th,
.final-standings td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ffffff30;
}

.final-standings tbody tr:first-child {
    background: #ead09622;
    color: #ffe4a4;
}

body.layoff-open {
    overflow: hidden;
}

.table-scene.layoff-mode {
    position: fixed;
    inset: 12px;
    z-index: 20;
    border-radius: 24px;
    padding: 8px;
}

.table-scene.layoff-mode .table-layoff {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    overflow: hidden;
}

#tableLayoffBody {
    min-height: 0;
}

.layoff-mode #tableLayoffBody {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.table-layoff .eyebrow {
    font-size: 10px;
}

.table-layoff h2 {
    font-size: 26px;
    margin: 4px 0;
}

.table-layoff p {
    font-size: 12px;
    margin: 4px 0;
}

.table-layoff .layoff-turn {
    padding: 7px 10px;
}

.table-layoff .layoff-top {
    margin: 7px 0;
    gap: 12px;
    font-size: 12px;
}

.table-layoff .layoff-grid {
    flex: 1;
    min-height: 0;
    margin: 8px 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 12px;
}

.table-layoff .layoff-player {
    padding: 9px 12px;
    overflow: auto;
}

.table-layoff .layoff-player h3 {
    font-size: 16px;
    margin: 0 0 4px;
}

.table-layoff .layoff-label {
    font-size: 11px;
    margin: 4px 0;
}

.table-layoff .layoff-group {
    min-height: 0;
    padding: 6px;
    gap: 0;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.table-layoff .layoff-group small {
    display: none;
}

.table-layoff .layoff-groups,
.table-layoff .layoff-loose {
    gap: 10px;
    min-height: 0;
}

.table-layoff .layoff-loose {
    gap: 0;
}

.table-layoff .layoff-group .card,
.table-layoff .layoff-loose-card .card {
    width: 62px;
    min-width: 62px;
    height: 94px;
}

.table-layoff .layoff-group .card+.card {
    margin-left: -34px;
}

.table-layoff .layoff-loose-card+.layoff-loose-card {
    margin-left: -34px;
}

.layoff-card-index {
    position: absolute;
    left: 0;
    top: 20px;
    width: 24px;
    padding: 3px 1px;
    border-radius: 3px;
    background: #fffef4f5;
    color: #173c30;
    text-align: center;
    font: bold 11px/1.2 system-ui;
    pointer-events: none;
}

.table-layoff .joker-assignment {
    left: 0;
    right: auto;
    bottom: 3px;
    width: 27px;
    font-size: 8px;
    overflow-wrap: anywhere;
}

.table-layoff .added-by {
    width: 27px;
    right: auto;
    font-size: 7px;
    max-height: 20px;
    overflow: hidden;
}

.table-layoff .layoff-events {
    max-height: 32px;
    overflow: auto;
    padding: 3px 8px;
    font-size: 10px;
    flex-shrink: 0;
}

.table-layoff-buttons {
    margin-top: 5px;
    flex-shrink: 0;
}

.table-layoff-buttons button {
    padding: 9px 15px;
    font-size: 14px;
}

@media(max-height:760px) {

    .table-layoff .layoff-group .card,
    .table-layoff .layoff-loose-card .card {
        width: 48px;
        min-width: 48px;
        height: 73px;
    }

    .table-layoff .layoff-group .card+.card,
    .table-layoff .layoff-loose-card+.layoff-loose-card {
        margin-left: -22px;
    }

    .table-layoff h2 {
        font-size: 21px;
    }

    .table-layoff>div>p {
        font-size: 10px;
    }

}

@media(max-width:650px) {
    .table-scene.layoff-mode {
        inset: 4px;
    }

    .table-scene.layoff-mode .table-layoff {
        padding: 8px;
    }

    .table-layoff .layoff-grid {
        gap: 7px;
    }

    .table-layoff .layoff-player {
        padding: 6px;
    }

    .table-layoff .layoff-player h3 {
        font-size: 13px;
    }

    .table-layoff .layoff-group .card,
    .table-layoff .layoff-loose-card .card {
        width: 42px;
        min-width: 42px;
        height: 64px;
    }

    .table-layoff .layoff-group .card+.card,
    .table-layoff .layoff-loose-card+.layoff-loose-card {
        margin-left: -18px;
    }

}

/* Cartas completas en la mesa de acomodo. */
.table-layoff .layoff-group {
    flex-wrap: wrap;
    gap: 5px;
}

.table-layoff .layoff-loose {
    gap: 5px;
}

.table-layoff .layoff-group .card+.card,
.table-layoff .layoff-loose-card+.layoff-loose-card {
    margin-left: 0;
}

.table-layoff .layoff-card-index {
    display: none;
}

.table-layoff .joker-assignment {
    left: 2px;
    right: 2px;
    bottom: 3px;
    width: auto;
    font-size: 9px;
}

.table-layoff .added-by {
    left: 0;
    right: 0;
    width: auto;
    font-size: 8px;
}

.layoff-no-moves {
    padding: 7px 10px;
    margin-top: 5px;
    background: #e9d8ab;
    color: #273d30;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.site-signature {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1.5;
    letter-spacing: .06em;
    padding: 12px 18px;
    text-align: center;
}

.site-signature a,
.credits a {
    color: var(--gold, #f0d38d);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-signature .ghost {
    font-size: 12px;
    letter-spacing: normal;
}

.credits {
    line-height: 1.65;
}

.credits ul {
    padding-left: 22px;
}

.credits li {
    margin: 8px 0;
}

/* Mobile table: use the available visual viewport instead of a scaled desktop. */
.mobile-only,
.mobile-layoff-tabs,
.mobile-layoff-tray {
    display: none;
}

.bot-flight {
    will-change: transform;
    backface-visibility: hidden;
    box-shadow: 0 3px 7px #0004;
}

@media (max-width: 900px) {
    .site-signature {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        padding: 14px 12px 18px;
        font-size: 13px;
        line-height: 1.5;
        letter-spacing: normal;
        text-align: center;
    }

    .site-signature>span {
        max-width: 100%;
    }

    .site-signature a {
        white-space: nowrap;
    }

}

@media(max-width:900px), (pointer:coarse) and (max-height:650px) {
    body.in-game {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    body.in-game .topbar {
        height: 44px;
        min-height: 44px;
        padding: 4px 6px;
        display: block;
        overflow: hidden;
    }

    body.in-game .topbar .brand {
        display: none;
    }

    body.in-game .header-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        height: 36px;
        align-items: center;
        gap: 4px;
        scrollbar-width: none;
    }

    body.in-game .header-actions>* {
        flex-shrink: 0;
        font-size: 11px;
        padding: 7px;
        min-height: 32px;
    }

    body.in-game .mobile-only {
        display: inline-block;
    }

    body.in-game main {
        padding: 3px 5px;
        margin: 0;
        height: calc(100dvh - 44px);
        max-width: none;
    }

    body.in-game #game {
        height: 100%;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    body.in-game .game-heading {
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
        margin: 0;
        min-height: 30px;
    }

    body.in-game .game-heading .eyebrow,
    body.in-game #resetInfo {
        display: none;
    }

    body.in-game .game-heading h2 {
        font-size: 12px;
        line-height: 1.2;
        margin: 0;
        max-width: 45vw;
    }

    body.in-game .game-meta {
        gap: 3px;
        font-size: 10px;
    }

    .game-meta span {
        white-space: normal;
    }

    body.in-game .game-meta span {
        padding: 4px 6px;
    }

    body.in-game #nextRoundBtn {
        font-size: 11px;
        padding: 6px;
    }

    body.in-game .table-scene:not(.layoff-mode) {
        flex: 1;
        min-height: 0;
        padding: 3px;
        border-width: 3px;
        border-radius: 26px;
    }

    body.in-game .felt {
        height: 100%;
        min-height: 0;
        border-radius: 20px;
    }

    body.in-game .felt-ring {
        inset: 7px;
        border-radius: 18px;
    }

    body.in-game .opponents {
        padding: 9px 5px;
        gap: 3px;
    }

    body.in-game .opponent {
        min-width: 0;
        flex: 1;
    }

    .opponent-name {
        line-height: 1.2;
    }

    body.in-game .opponent-name {
        font-size: 11px;
    }

    body.in-game .opponent-score {
        font-size: 10px;
        margin: 3px 0;
    }

    body.in-game .mini-hand {
        height: 34px;
    }

    body.in-game .mini-hand .mini-card {
        width: 23px;
        min-width: 23px;
        height: 35px;
        margin-left: -14px;
    }

    body.in-game .mini-hand .mini-card:first-child {
        margin-left: 0;
    }

    body.in-game .table-center {
        top: 43%;
        gap: 26px;
    }

    body.in-game .pile {
        width: clamp(48px, 15vw, 70px);
        height: auto;
        aspect-ratio: 420/640;
    }

    body.in-game .pile-caption {
        font-size: 9px;
        letter-spacing: 1px;
    }

    body.in-game .center-badge {
        display: none;
    }

    body.in-game .human-seat {
        bottom: 9px;
        left: 5px;
        right: 5px;
    }

    body.in-game .seat-name {
        font-size: 12px;
        margin-bottom: 10px;
    }

    body.in-game .seat-name .human-score {
        font-size: 11px;
        margin-left: 5px;
    }

    body.in-game #hand {
        min-height: 0;
        gap: 3px;
    }

    body.in-game #hand .image-card {
        width: clamp(32px, calc((100vw - 56px)/8), 76px);
        height: auto;
        aspect-ratio: 420/640;
    }

    body.in-game #hand .group-start:not(:first-child) {
        margin-left: 3px;
    }

    body.in-game .actionbar {
        flex-shrink: 0;
        margin: 0;
        padding: 5px;
        gap: 4px;
        border-radius: 10px;
    }

    body.in-game .action-copy {
        font-size: 11px;
        line-height: 1.25;
        width: 100%;
    }

    body.in-game .actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
    }

    body.in-game .actions button {
        font-size: 11px;
        padding: 7px 3px;
        min-height: 34px;
        line-height: 1.2;
    }

    body.in-game .hand-help,
    body.in-game .below,
    body.in-game>footer {
        display: none;
    }

    /* Layoff: one participant's groups at a time and a separate human tray. */
    body.in-game .table-scene.layoff-mode {
        inset: 3px;
        padding: 3px;
        border-width: 2px;
        border-radius: 15px;
    }

    body.in-game .table-scene.layoff-mode .table-layoff {
        padding: 7px;
        border-radius: 10px;
    }

    .table-layoff .eyebrow,
    .table-layoff h2,
    .table-layoff #tableLayoffBody>p,
    .table-layoff .layoff-events {
        display: none;
    }

    .table-layoff .layoff-turn {
        font-size: 12px;
        padding: 6px;
    }

    .table-layoff .layoff-no-moves {
        font-size: 10px;
        padding: 4px;
        margin-top: 3px;
    }

    .table-layoff .layoff-top {
        font-size: 11px;
        margin: 4px 0;
    }

    .mobile-layoff-tabs {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        flex-shrink: 0;
        padding: 3px 0;
    }

    .mobile-layoff-tabs button {
        flex: 1;
        min-width: 70px;
        background: #153e32;
        color: #f3efe2;
        border: 1px solid #638b75;
        border-radius: 6px;
        font-size: 11px;
        padding: 7px 4px;
    }

    .mobile-layoff-tabs .chosen {
        background: #efd08b;
        color: #12382a;
    }

    .table-layoff .layoff-grid {
        display: block;
        overflow: auto;
        flex: 1;
        min-height: 0;
        margin: 4px 0;
    }

    .table-layoff .layoff-player {
        display: none;
        padding: 7px;
        min-height: 100%;
        overflow: visible;
    }

    .table-layoff .layoff-player.mobile-visible {
        display: block;
    }

    .table-layoff .layoff-player h3 {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .table-layoff .layoff-player>.layoff-loose,
    .table-layoff .layoff-player>.layoff-label {
        display: none;
    }

    .table-layoff .layoff-groups {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
    }

    .table-layoff .layoff-group {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: 100%;
        padding: 5px;
        gap: 4px;
    }

    .table-layoff .layoff-group .card {
        width: 54px;
        min-width: 54px;
        height: 82px;
        margin-left: 0 !important;
    }

    .mobile-layoff-tray {
        display: block;
        flex-shrink: 0;
        background: #082f26;
        border-radius: 8px;
        padding: 6px;
        font-size: 11px;
    }

    .mobile-loose-cards {
        display: flex;
        gap: 5px;
        overflow-x: auto;
        margin-top: 5px;
        min-height: 20px;
        padding: 3px;
    }

    .mobile-loose-cards button {
        padding: 0;
        border: 0;
        border-radius: 5px;
        background: transparent;
        flex-shrink: 0;
    }

    .mobile-loose-cards .card {
        width: 47px;
        min-width: 47px;
        height: 72px;
        pointer-events: none;
    }

    .mobile-loose-cards .chosen {
        outline: 3px solid #efd08b;
        outline-offset: 1px;
    }

    .table-layoff-buttons {
        margin: 4px 0 0;
    }

    .table-layoff-buttons button {
        width: 100%;
        padding: 8px;
        font-size: 12px;
        min-height: 34px;
    }

    .modal-card {
        max-height: 92dvh;
        overflow: auto;
    }

}

@media(orientation:landscape) and (max-height:600px) and (pointer:coarse), (orientation:landscape) and (max-height:600px) and (max-width:900px) {
    body.in-game .topbar {
        height: 35px;
        min-height: 35px;
        padding: 1px 5px;
    }

    body.in-game main {
        height: calc(100dvh - 35px);
    }

    body.in-game .game-heading {
        min-height: 23px;
    }

    body.in-game .opponents {
        padding: 4px 5px;
    }

    body.in-game .opponent-score {
        margin: 1px;
    }

    .mini-hand {
        height: 26px;
    }

    body.in-game .mini-hand .mini-card {
        height: 25px;
        width: 17px;
        min-width: 17px;
        margin-left: -10px;
    }

    body.in-game .table-center {
        top: 47%;
    }

    .pile-caption {
        display: none;
    }

    body.in-game .pile {
        width: 40px;
    }

    body.in-game .human-seat {
        bottom: 5px;
        left: 23%;
        right: 23%;
    }

    body.in-game .seat-name {
        font-size: 10px;
        margin: 0 0 3px;
    }

    body.in-game #hand .image-card {
        width: clamp(28px, calc((100dvh - 160px)*.48), 51px);
    }

    body.in-game .actions {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    body.in-game .actions button {
        min-height: 29px;
        padding: 5px 2px;
        font-size: 10px;
    }

    body.in-game .action-copy {
        font-size: 10px;
    }

    body.in-game .table-center {
        left: 11%;
        top: 62%;
        gap: 10px;
    }

    .mobile-layoff-tray {
        padding: 3px 5px;
    }

    .mobile-loose-cards {
        margin: 1px;
        padding: 2px;
    }

    .mobile-loose-cards .card {
        width: 35px;
        min-width: 35px;
        height: 54px;
    }

    .table-layoff .layoff-group .card {
        width: 40px;
        min-width: 40px;
        height: 61px;
    }

    .table-layoff .layoff-player h3 {
        display: none;
    }

    .mobile-layoff-tabs button {
        padding: 4px;
    }

    .table-layoff .layoff-no-moves {
        display: none;
    }

}

@media(max-width:900px), (pointer:coarse) and (max-height:650px) {
    .table-layoff .layoff-player.mobile-visible:not(.mobile-human)>.layoff-loose {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 4px;
        padding: 4px 0;
    }

    .table-layoff .layoff-player.mobile-visible:not(.mobile-human)>.layoff-label {
        display: block;
    }

    .table-layoff .layoff-player:not(.mobile-human) .layoff-loose-card .card {
        width: 38px;
        min-width: 38px;
        height: 58px;
    }

}

/* Larger human cards on phones: four per row in portrait, no overlap. */
@media(max-width:900px), (pointer:coarse) and (max-height:650px) {
    body.in-game .felt {
        display: flex;
        flex-direction: column;
        overflow: auto;
        overscroll-behavior: contain;
    }

    body.in-game .opponents {
        flex-shrink: 0;
    }

    body.in-game .table-center {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        flex-shrink: 0;
        margin: 5px auto 10px;
    }

    body.in-game .human-seat {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        margin-top: auto;
        padding: 4px 5px 10px;
        flex-shrink: 0;
    }

    body.in-game .seat-name {
        margin-bottom: 7px;
    }

    body.in-game #hand {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        justify-items: center;
        align-items: end;
        gap: 7px 4px;
        width: min(100%, 350px);
        margin: auto;
        min-height: 0;
        padding: 3px;
    }

    body.in-game #hand .image-card {
        width: clamp(58px, 18vw, 82px);
        max-width: 100%;
        height: auto;
        aspect-ratio: 420/640;
    }

    body.in-game #hand .group-start:not(:first-child) {
        margin-left: 0;
    }

    body.in-game #hand .joker-assignment {
        font-size: 10px;
    }

}

@media(orientation:landscape) and (max-height:600px) and (pointer:coarse), (orientation:landscape) and (max-height:600px) and (max-width:900px) {
    body.in-game .felt {
        position: relative;
    }

    body.in-game .table-center {
        position: absolute;
        left: 75px;
        top: 60%;
        transform: translate(-50%, -50%);
        margin: 0;
    }

    body.in-game .human-seat {
        width: calc(100% - 155px);
        margin-left: 155px;
        padding: 3px 6px 7px;
        margin-top: auto;
    }

    body.in-game #hand {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        width: 100%;
        max-width: none;
    }

    body.in-game #hand .image-card {
        width: clamp(54px, min(9vw, calc((100dvh - 145px)*.42)), 78px);
        max-width: 100%;
    }

    body.in-game .seat-name {
        font-size: 11px;
        margin-bottom: 5px;
    }

}

.mobile-attach {
    display: none;
}

@media (max-width:900px),
(pointer:coarse) and (max-height:650px) {
    .mobile-loose-cards {
        touch-action: pan-x;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-loose-cards button {
        touch-action: pan-x;
    }

    .mobile-loose-cards .card,
    .layoff-group .card {
        width: 62px !important;
        height: auto !important;
        aspect-ratio: 420/640;
        flex-shrink: 0;
    }

    .layoff-group {
        flex-wrap: wrap !important;
        align-content: flex-start;
    }

    .mobile-attach {
        display: block;
        flex-basis: 100%;
        width: 100%;
        order: -1;
        padding: 9px 12px;
        background: #efd38f;
        color: #123d31;
        font-weight: bold;
        min-height: 40px;
    }

    body.table-expanded.in-game .topbar {
        height: 38px;
        min-height: 38px;
    }

    body.table-expanded.in-game main {
        height: calc(100dvh - 38px);
    }

}

@media (pointer:coarse) and (orientation:landscape) and (max-height:650px) {

    .mobile-loose-cards .card,
    .layoff-group .card {
        width: 48px !important;
    }

}