* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: #14171c;
    color: #e8e8e8;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh
}

header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    background: #0d0f12;
    border-bottom: 1px solid #2a2f37;
    flex-wrap: wrap
}

.title {
    font-weight: 700;
    font-size: 18px
}

.title span {
    font-weight: 400;
    color: #9aa;
    font-size: 14px;
    margin-left: 6px
}

.session {
    flex: 1;
    color: #cfd;
    font-size: 14px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap
}

.session b {
    color: #fff
}

.pos {
    color: #5d5
}

.neg {
    color: #f66
}

button {
    background: #2b313a;
    color: #eee;
    border: 1px solid #3d4550;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px
}

button:hover {
    background: #38404b
}

button:disabled {
    opacity: .35;
    cursor: default
}

main {
    display: flex;
    gap: 12px;
    padding: 12px
}

.tablewrap {
    flex: 1;
    min-width: 0
}

aside {
    width: 300px;
    flex-shrink: 0
}

aside h3 {
    margin: 6px 0;
    font-size: 14px;
    color: #9ab
}

.log {
    background: #0d0f12;
    border: 1px solid #2a2f37;
    border-radius: 6px;
    padding: 8px;
    height: 300px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.55
}

.log.small {
    height: 260px
}

.log .st {
    color: #fc6;
    margin-top: 4px
}

.log .me {
    color: #7cf
}

.table {
    position: relative;
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 1.85;
    margin: 0 auto
}

.felt {
    position: absolute;
    left: 7%;
    right: 7%;
    top: 12%;
    bottom: 12%;
    border-radius: 50%/50%;
    background: radial-gradient(ellipse at center, #2f7d4a 0%, #1d5a33 65%, #164427 100%);
    border: 14px solid #5a3a22;
    box-shadow: 0 0 0 4px #2e1d10, inset 0 0 40px rgba(0, 0, 0, .5)
}

.center {
    position: absolute;
    left: 50%;
    top: 47%;
    transform: translate(-50%, -50%);
    text-align: center
}

.board {
    display: flex;
    gap: 6px;
    justify-content: center;
    min-height: 74px
}

.pot {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #ffe9a8
}

.msg {
    margin-top: 4px;
    font-size: 14px;
    color: #fff;
    min-height: 20px;
    max-width: 440px
}

.card {
    width: 50px;
    height: 70px;
    border-radius: 8px;
    background: linear-gradient(165deg, #FFFEF8 0%, #F7F3E8 55%, #EFE8D8 100%);
    color: #1a1a1a;
    display: block;
    position: relative;
    font-weight: 700;
    box-shadow: 0 3px 7px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .65);
    border: 1px solid #2c2c2c;
    box-sizing: border-box;
    line-height: 1;
    overflow: hidden;
    font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif
}

.card .corner {
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1
}

.card .corner.tl { top: 3px; left: 3px }
.card .corner.br { right: 3px; bottom: 3px; transform: rotate(180deg) }

.card .r {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.04em
}

.card .s {
    font-size: 11px
}

.card .pip {
    position: absolute;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none
}

.card.red {
    color: #C41E3A
}

.card.blue {
    color: #1B4F9C
}

.card.green {
    color: #0F7A3A
}

.card.back {
    color: transparent;
    border: 2.5px solid #F4F1E6;
    background-color: #0C2340;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, .22) 0 7%, transparent 8%),
        repeating-linear-gradient(45deg, transparent 0 4px, rgba(255, 255, 255, .1) 4px 5px),
        repeating-linear-gradient(-45deg, transparent 0 4px, rgba(212, 175, 55, .12) 4px 5px),
        linear-gradient(160deg, #143868 0%, #0C2340 55%, #08182e 100%);
    box-shadow: 0 3px 7px rgba(0, 0, 0, .5), inset 0 0 0 1.5px rgba(255, 255, 255, .3), inset 0 0 0 3px #0C2340
}

.card.back .corner,
.card.back .pip,
.card.back .r,
.card.back .s { display: none }

.card.slot {
    background: rgba(0, 0, 0, .15);
    box-shadow: none;
    border: 1px dashed rgba(255, 255, 255, .15)
}

.seat {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 132px;
    text-align: center
}

.seat .cards {
    display: flex;
    gap: 3px;
    justify-content: center;
    height: 58px
}

.seat .card {
    width: 40px;
    height: 56px;
    border-radius: 7px
}

.seat .card .r { font-size: 11px }
.seat .card .s { font-size: 9px }
.seat .card .pip { font-size: 22px }

.seat.hero .cards {
    height: 76px
}

.seat.hero .card {
    width: 54px;
    height: 76px;
    border-radius: 8px
}

.seat.hero .card .r { font-size: 14px }
.seat.hero .card .s { font-size: 12px }
.seat.hero .card .pip { font-size: 32px }

.seat .plate {
    background: #0d0f12e6;
    border: 2px solid #3a414c;
    border-radius: 10px;
    padding: 3px 6px;
    margin-top: -10px;
    position: relative
}

.seat .nm {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.seat .nm i {
    color: #9ab;
    font-style: normal;
    font-size: 11px;
    margin-left: 3px
}

.seat .stk {
    font-size: 14px;
    font-weight: 700;
    color: #ffe9a8
}

.seat .sty {
    font-size: 11px;
    color: #c9a
}

.seat.toact .plate {
    border-color: #ffd54a;
    box-shadow: 0 0 12px #ffd54a
}

.seat.folded {
    opacity: .42
}

.seat.win .plate {
    border-color: #4ade80;
    box-shadow: 0 0 14px #4ade80
}

.seat .badge {
    position: absolute;
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
    background: #ffd54a;
    color: #111;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9px;
    white-space: nowrap;
    z-index: 3
}

.seat .badge.fold {
    background: #888
}

.seat .badge.raise {
    background: #ff7a59
}

.seat .badge.win {
    background: #4ade80
}

.seat .hn {
    font-size: 11px;
    color: #8f8
}

.bet {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #00000080;
    border-radius: 10px;
    padding: 1px 8px;
    white-space: nowrap
}

.bet:before {
    content: "●";
    color: #e33;
    margin-right: 4px
}

.dealer {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-weight: 800;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px #000
}

.controls {
    max-width: 1000px;
    margin: 6px auto 0;
    background: #0d0f12;
    border: 1px solid #2a2f37;
    border-radius: 10px;
    padding: 10px
}

.quick {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px
}

.quick button {
    flex: 1;
    min-width: 64px;
    padding: 6px 4px
}

.raiserow {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px
}

.raiserow input[type=range] {
    flex: 1
}

.raiserow input[type=number] {
    width: 90px;
    background: #1c2128;
    color: #fff;
    border: 1px solid #3d4550;
    border-radius: 6px;
    padding: 6px;
    font-size: 15px
}

.mainbtns {
    display: flex;
    gap: 10px
}

.act {
    flex: 1;
    padding: 14px 6px;
    font-size: 17px;
    font-weight: 700;
    border: none
}

.act kbd {
    font-size: 10px;
    opacity: .6;
    font-family: inherit;
    margin-left: 4px
}

.act.fold {
    background: #5b2630
}

.act.call {
    background: #22543a
}

.act.raise {
    background: #7a4a14
}

.act.next {
    background: #24496e;
    width: 100%
}

.nexthand {
    margin-top: 8px
}

.modal {
    position: fixed;
    inset: 0;
    background: #000a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10
}

.modal[hidden] {
    display: none
}

.modal .box {
    background: #1b1f26;
    border: 1px solid #3d4550;
    border-radius: 10px;
    padding: 18px;
    width: 360px
}

.modal label {
    display: block;
    margin: 10px 0
}

.modal input[type=number],
.modal select {
    float: right;
    width: 150px;
    background: #0d0f12;
    color: #fff;
    border: 1px solid #3d4550;
    border-radius: 5px;
    padding: 3px
}

.modal .row {
    display: flex;
    gap: 8px;
    margin-top: 14px
}

.hint {
    font-size: 12px;
    color: #9ab
}

.modal .save-status {
    margin: 8px 0 0;
    font-size: 13px;
    color: #7dcea0;
    min-height: 1.2em
}

.primary {
    background: #2563eb;
    border-color: #2563eb
}

.danger {
    background: #7f1d1d
}

@media (max-width:900px) {
    main {
        flex-direction: column
    }

    aside {
        width: 100%
    }

    .seat {
        width: 96px
    }

    .seat .card {
        width: 30px;
        height: 42px
    }

    .seat .card .r {
        font-size: 9px
    }

    .seat .card .s {
        font-size: 8px
    }

    .seat .card .pip {
        font-size: 16px
    }

    .seat .card .corner.br {
        display: none
    }

    .seat .cards {
        height: 44px
    }

    .seat.hero .card {
        width: 44px;
        height: 62px
    }

    .seat.hero .cards {
        height: 62px
    }

    .card {
        width: 38px;
        height: 54px
    }

    .card .r {
        font-size: 11px
    }

    .card .s {
        font-size: 9px
    }

    .card .pip {
        font-size: 20px
    }

    .board {
        min-height: 56px
    }

    .seat .nm,
    .seat .stk {
        font-size: 11px
    }
}

.modal .box {
    width: 560px;
    max-height: min(75vh, 640px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 12px;
    box-sizing: border-box
}
.modal .box > h3 {
    flex: 0 0 auto;
    margin: 0 0 4px
}
.modal .box > label {
    flex: 0 0 auto;
    margin: 5px 0
}
.modal .box > .lineup {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 34vh;
    overflow: auto;
    margin: 4px 0;
    padding-right: 4px
}
.modal .box > .hint,
.modal .box > .save-status {
    flex: 0 0 auto
}
.modal .box > .row {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    margin-top: 8px;
    padding-top: 8px;
    background: linear-gradient(180deg, transparent, #1b1f26 30%);
    z-index: 2
}

.seatpick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
    margin: 6px 0
}

.seatpick label {
    margin: 2px 0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px
}

.seatpick select {
    float: none !important;
    width: 170px !important
}

.warn {
    font-size: 12px;
    color: #fbbf24;
    background: #3a2e10;
    border-radius: 6px;
    padding: 6px 8px
}

.imit {
    font-size: 11px;
    color: #fbbf24;
    margin-top: 4px;
    opacity: .85
}

.seat .nm .fake {
    color: #fbbf24;
    font-size: 10px;
    margin-left: 2px
}

/* ================= 3D 牌桌 / 动画 (v2) ================= */
body {
    background: radial-gradient(ellipse at 50% 30%, #1f2733 0%, #0e1116 70%)
}

.table {
    perspective: 1500px;
    perspective-origin: 50% 30%
}

.table .shadow {
    position: absolute;
    left: 9%;
    right: 9%;
    top: 22%;
    bottom: 4%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(14px);
    transform: translateY(16px)
}

.felt {
    left: 6%;
    right: 6%;
    top: 11%;
    bottom: 11%;
    border: none;
    border-radius: 50%;
    transform: rotateX(24deg);
    transform-origin: 50% 55%;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 30%, rgba(0, 0, 0, .35) 100%),
        repeating-linear-gradient(97deg, #6e3f1d 0 5px, #5b3216 5px 9px, #7d4a24 9px 14px, #663a1b 14px 20px);
    box-shadow: 0 0 0 2px #2a1709, 0 2px 0 3px #1a0e05, 0 18px 30px rgba(0, 0, 0, .6), inset 0 3px 4px rgba(255, 255, 255, .25), inset 0 -6px 10px rgba(0, 0, 0, .5)
}

.felt .cloth {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 55%),
        repeating-radial-gradient(circle at 30% 40%, rgba(255, 255, 255, .018) 0 1px, rgba(0, 0, 0, .018) 1px 2px),
        radial-gradient(ellipse at center, #2f8a50 0%, #1f6a3a 55%, #154a29 100%);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35), inset 0 0 0 9px rgba(255, 255, 255, .035), inset 0 0 0 11px rgba(255, 255, 255, .07), inset 0 10px 40px rgba(0, 0, 0, .55)
}

.felt .cloth:after {
    content: "♠ ♥ JASON 练习桌 ♦ ♣";
    position: absolute;
    left: 50%;
    top: 70%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, .07);
    font-weight: 800;
    white-space: nowrap
}

/* 卡牌 */
.card {
    position: relative;
    background: linear-gradient(165deg, #FFFEF8 0%, #F7F3E8 55%, #EFE8D8 100%);
    box-shadow: 0 3px 7px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 0 0 1px rgba(0, 0, 0, .08);
    transform-style: preserve-3d
}

.card.back {
    color: transparent;
    border: 2.5px solid #F4F1E6;
    background-color: #0C2340;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, .22) 0 7%, transparent 8%),
        repeating-linear-gradient(45deg, transparent 0 4px, rgba(255, 255, 255, .1) 4px 5px),
        repeating-linear-gradient(-45deg, transparent 0 4px, rgba(212, 175, 55, .12) 4px 5px),
        linear-gradient(160deg, #143868 0%, #0C2340 55%, #08182e 100%);
    box-shadow: 0 3px 7px rgba(0, 0, 0, .5), inset 0 0 0 1.5px rgba(255, 255, 255, .3), inset 0 0 0 3px #0C2340
}

.card.slot {
    background: rgba(0, 0, 0, .18);
    border: 1px dashed rgba(255, 255, 255, .18);
    box-shadow: none
}

.card.deal {
    animation: dealIn .38s cubic-bezier(.2, .8, .3, 1) both
}

@keyframes dealIn {
    from {
        transform: translate(var(--fx), var(--fy)) rotate(-25deg) scale(.6);
        opacity: 0
    }

    15% {
        opacity: 1
    }

    to {
        transform: none;
        opacity: 1
    }
}

.card.boardin {
    animation: boardIn .5s cubic-bezier(.2, .8, .3, 1) both
}

@keyframes boardIn {
    from {
        transform: translateY(-60px) rotateY(180deg) scale(.7);
        opacity: 0
    }

    40% {
        opacity: 1
    }

    to {
        transform: none;
        opacity: 1
    }
}

.card.flip {
    animation: flipIn .6s ease-out both
}

.card.flip span,
.card.boardin span {
    backface-visibility: hidden
}

.card.flip:after,
.card.boardin:after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background-color: #0C2340;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, .22) 0 7%, transparent 8%),
        repeating-linear-gradient(45deg, transparent 0 4px, rgba(255, 255, 255, .1) 4px 5px),
        repeating-linear-gradient(-45deg, transparent 0 4px, rgba(212, 175, 55, .12) 4px 5px),
        linear-gradient(160deg, #143868 0%, #0C2340 55%, #08182e 100%);
    border: 2.5px solid #F4F1E6;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28), inset 0 0 0 3px #0C2340;
    box-sizing: border-box;
    transform: rotateY(180deg);
    backface-visibility: hidden
}

@keyframes flipIn {
    from {
        transform: rotateY(180deg)
    }

    to {
        transform: rotateY(0)
    }
}

/* 座位 */
.seat {
    width: 164px
}

.seat .plate {
    display: flex;
    align-items: center;
    gap: 7px;
    text-align: left;
    padding: 4px 8px 4px 4px;
    border-radius: 32px;
    margin-top: -8px;
    background: linear-gradient(180deg, rgba(30, 36, 46, .96), rgba(12, 14, 18, .96));
    border: 1px solid #3a414c;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .55)
}

.seat .info {
    min-width: 0;
    flex: 1;
    line-height: 1.25
}

.seat .avatar {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #0b0d10, 0 0 0 3px #4b5563
}

.seat .avatar>svg:first-child {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: block
}

.seat .tag {
    display: inline-block;
    font-size: 10px;
    line-height: 14px;
    padding: 0 5px;
    border-radius: 7px;
    background: #3a2e10;
    color: #fbbf24;
    border: 1px solid #a16207
}

.seat .nm {
    font-size: 13px;
    font-weight: 600
}

.seat .stk {
    font-size: 14px
}

.seat.toact .plate {
    border-color: #ffd54a;
    box-shadow: 0 0 0 1px #ffd54a, 0 0 18px rgba(255, 213, 74, .55)
}

.seat.toact .avatar {
    animation: pulse 1.2s ease-in-out infinite
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px #0b0d10, 0 0 0 3px #ffd54a, 0 0 8px #ffd54a
    }

    50% {
        box-shadow: 0 0 0 2px #0b0d10, 0 0 0 3px #ffd54a, 0 0 20px #ffd54a
    }
}

.seat .ring {
    position: absolute;
    inset: -5px;
    width: 56px;
    height: 56px;
    transform: rotate(-90deg);
    pointer-events: none
}

.seat .ring circle {
    fill: none;
    stroke: #ffd54a;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    animation-name: ringRun;
    animation-timing-function: linear;
    animation-fill-mode: both
}

@keyframes ringRun {
    from {
        stroke-dashoffset: 0;
        stroke: #4ade80
    }

    60% {
        stroke: #ffd54a
    }

    to {
        stroke-dashoffset: 100;
        stroke: #ef4444
    }
}

.seat.win .plate {
    border-color: #4ade80;
    box-shadow: 0 0 0 1px #4ade80, 0 0 22px rgba(74, 222, 128, .6)
}

.seat.folded {
    opacity: .45;
    filter: grayscale(.6)
}

.seat .badge {
    top: -12px;
    left: 60%
}

.seat.hero .plate {
    border-color: #60a5fa
}

/* 筹码 */
.chips {
    position: relative;
    width: 24px;
    display: inline-block;
    vertical-align: bottom
}

.chip {
    position: absolute;
    left: 0;
    width: 24px;
    height: 11px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%), var(--c);
    border: 2px dashed rgba(255, 255, 255, .85);
    box-sizing: border-box;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .45), 0 3px 3px rgba(0, 0, 0, .3)
}

.bet {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    background: none;
    padding: 0
}

.bet:before {
    content: none
}

.bet span {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    border-radius: 9px;
    padding: 0 7px;
    line-height: 18px
}

#potchips {
    display: flex;
    justify-content: center;
    min-height: 42px;
    margin-top: 6px
}

.potchips {
    display: flex;
    gap: 5px;
    align-items: flex-end
}

.sweep {
    position: absolute;
    transform: translate(-50%, -50%);
    transition: left .75s cubic-bezier(.4, 0, .2, 1), top .75s cubic-bezier(.4, 0, .2, 1), opacity .4s ease .65s;
    z-index: 6;
    pointer-events: none
}

.dealer {
    background: radial-gradient(circle at 40% 35%, #fff, #d4d4d4);
    border: 2px solid #9ca3af;
    width: 26px;
    height: 26px;
    z-index: 4
}

.center {
    z-index: 2
}

@media (max-width:900px) {
    .seat {
        width: 112px
    }

    .seat .avatar,
    .seat .avatar>svg:first-child {
        width: 32px;
        height: 32px
    }

    .seat .ring {
        width: 42px;
        height: 42px
    }

    .seat .plate {
        gap: 4px;
        padding: 2px 6px 2px 2px
    }
}

@media (prefers-reduced-motion:reduce) {

    .card.deal,
    .card.boardin,
    .card.flip,
    .seat.toact .avatar {
        animation: none
    }
}

/* Internal browser build: separate compact and tablet layouts. Device QA pending. */
body {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)
}

@media(max-width:1100px) {
    main {
        flex-direction: column
    }

    aside {
        width: 100%
    }
}

@media(max-width:600px) {
    header {
        gap: 10px;
        padding: 10px
    }

    .title {
        font-size: 16px
    }

    .title span {
        display: block;
        margin: 4px 0 0;
        font-size: 12px
    }

    .session {
        font-size: 12px;
        gap: 8px
    }

    main {
        padding: 10px;
        gap: 12px
    }

    .table {
        aspect-ratio: .7
    }

    .seat {
        width: 84px
    }

    .seat .plate {
        padding: 3px;
        border-radius: 9px
    }

    .seat .avatar {
        display: none
    }

    .seat .nm {
        font-size: 10px
    }

    .seat .stk {
        font-size: 12px
    }

    .seat .tag,
    .imit {
        display: none
    }

    .seat .card {
        width: 26px;
        height: 38px
    }

    .seat .cards {
        height: 40px
    }

    .seat.hero .card {
        width: 40px;
        height: 56px
    }

    .seat.hero .cards {
        height: 58px
    }

    .center .card {
        width: 28px;
        height: 42px
    }

    .center .card .r {
        font-size: 9px
    }

    .center .card .s {
        font-size: 8px
    }

    .center .card .pip {
        font-size: 15px
    }

    .center .card .corner.br {
        display: none
    }

    .board {
        gap: 3px;
        min-height: 44px
    }

    .pot {
        font-size: 13px
    }

    .msg {
        font-size: 11px;
        max-width: 170px
    }

    #potchips {
        min-height: 26px
    }

    .controls {
        padding: 10px 8px
    }

    .quick button,
    button {
        min-height: 44px
    }

    .raiserow input {
        min-height: 44px;
        font-size: 16px
    }

    .mainbtns {
        gap: 6px
    }

    .act {
        font-size: 16px
    }

    .act kbd {
        display: none
    }

    .modal .box {
        width: calc(100vw - 20px);
        max-height: min(78dvh, 640px);
        padding: 12px
    }
    .modal .box > .lineup {
        max-height: 28dvh
    }

    .seatpick {
        grid-template-columns: 1fr
    }

    .modal input,
    .modal select {
        font-size: 16px
    }

    .log {
        height: 220px
    }

    .log.small {
        height: 180px
    }
}

@media(orientation:landscape) and (max-height:500px) {
    .table {
        aspect-ratio: 1.8
    }

    .controls {
        margin-top: 32px
    }
}

.controls {
    margin-top: 32px
}

.hbtns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%
}

.hbtns>a {
    display: inline-flex;
    align-items: center;
    min-height: 44px
}

.hbtns>label {
    display: inline-flex;
    align-items: center;
    min-height: 44px
}

/* === VIEWPORT FIT one-screen play (regular) === */
html.play-fit,
body.play-page {
    height: 100%;
}

body.play-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding: 0;
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

body.play-page>header {
    flex: 0 0 auto;
    gap: 8px;
    padding: 4px 12px;
    min-height: 0;
}

body.play-page .title {
    font-size: 15px
}

body.play-page .title span {
    font-size: 12px;
    margin-left: 4px
}

body.play-page .session {
    font-size: 12px;
    gap: 8px
}

body.play-page .hbtns {
    gap: 6px
}

body.play-page .hbtns>a,
body.play-page .hbtns>label {
    min-height: 32px
}

body.play-page .hbtns button {
    padding: 4px 10px;
    min-height: 32px
}

body.play-page>.audio-panel {
    flex: 0 0 auto;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    max-width: none;
    padding: 2px 12px
}

body.play-page>main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    gap: 8px;
    padding: 6px 10px 8px;
}

body.play-page .tablewrap {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.play-page .tablewrap>.table,
body.play-page .poker-surface>.table {
    flex: 1 1 auto;
    min-height: 0;
    width: auto;
    max-width: min(1000px, 100%);
    height: 100%;
    max-height: 100%;
    aspect-ratio: 1.85;
    margin: 0 auto;
}

body.play-page .controls {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin: 4px auto 0;
    padding: 8px;
    max-width: 1000px;
    width: 100%;
    background: #0d0f12f2;
    border: 1px solid #2a2f37;
    border-radius: 10px;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .35);
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

body.play-page .controls .raiserow {
    margin-bottom: 6px
}

body.play-page .controls .quick {
    margin-bottom: 6px
}

body.play-page .controls .act {
    padding: 10px 6px;
    font-size: 16px
}

body.play-page .nexthand {
    margin-top: 6px
}

body.play-page aside {
    width: 260px;
    flex-shrink: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.play-page aside h3 {
    margin: 4px 0;
    font-size: 12px
}

body.play-page aside .log {
    flex: 1 1 auto;
    min-height: 80px;
    height: auto;
    max-height: none
}

body.play-page aside .log.small {
    flex: 0 1 38%;
    min-height: 70px;
    height: auto
}

@media (max-width:1100px) {
    body.play-page>main {
        flex-direction: column
    }

    body.play-page aside {
        width: 100%;
        max-height: 22vh;
        flex-direction: row;
        gap: 8px
    }

    body.play-page aside h3 {
        display: none
    }

    body.play-page aside .log {
        height: 100%;
        max-height: 22vh
    }

    body.play-page aside .log.small {
        flex: 1;
        max-height: 22vh
    }
}

@media (max-height:820px) {
    body.play-page .seat {
        width: 140px
    }

    body.play-page .seat .avatar,
    body.play-page .seat .avatar>svg:first-child {
        width: 36px;
        height: 36px
    }

    body.play-page .seat .ring {
        width: 46px;
        height: 46px
    }
}

@media (max-height:720px) {
    body.play-page>header .session {
        display: none
    }

    body.play-page .controls .act {
        padding: 8px 4px;
        font-size: 15px
    }

    body.play-page .quick button {
        padding: 4px;
        min-height: 32px
    }
}

@media (max-width:600px) {
    body.play-page {
        overflow: hidden
    }

    body.play-page aside {
        max-height: 18vh
    }

    body.play-page .tablewrap>.table,
    body.play-page .poker-surface>.table {
        aspect-ratio: 1.15;
        height: 100%;
        width: auto;
        max-width: 100%
    }
}


/* === UI POLISH 2026-11: controls + interaction === */
.controls {
    background: linear-gradient(180deg, #12161cdf, #0d0f12f5);
    border: 1px solid #343c48;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px
}

.quick button {
    flex: 1;
    min-width: 68px;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: 650;
    border-radius: 10px;
    border: 1px solid #3d4756;
    background: linear-gradient(180deg, #2a313c, #222831);
    color: #e8eef5;
    transition: background .12s, border-color .12s, transform .1s, box-shadow .12s;
}

.quick button:hover {
    background: linear-gradient(180deg, #343c49, #2a313c);
    border-color: #5b6a7d
}

.quick button:active {
    transform: scale(.97);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35)
}

.quick button:focus-visible {
    outline: 3px solid #b9dfc2;
    outline-offset: 2px
}

.raiserow {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid #2a3140;
}

.raise-meta {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    color: #9ab0c0;
    text-transform: none;
    min-width: 2.8em;
}

.raiserow input[type=range] {
    flex: 1;
    min-height: 28px;
    accent-color: #f0b35a;
    cursor: pointer;
}

.raiserow input[type=number],
.raiserow .raise-amt {
    width: 108px;
    min-height: 44px;
    background: linear-gradient(180deg, #1e2630, #171c24);
    color: #ffe9a8;
    border: 1px solid #6b5630;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    box-shadow: inset 0 0 0 1px rgba(255, 213, 74, .12), 0 2px 8px rgba(0, 0, 0, .25);
}

.raiserow .raise-amt:focus {
    outline: none;
    border-color: #ffd54a;
    box-shadow: 0 0 0 3px rgba(255, 213, 74, .25), inset 0 0 0 1px rgba(255, 213, 74, .2);
}

.mainbtns {
    display: flex;
    gap: 10px
}

.act {
    flex: 1;
    min-height: 52px;
    padding: 14px 8px;
    font-size: 17px;
    font-weight: 750;
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
    transition: transform .1s, filter .12s, box-shadow .12s, background .12s;
}

.act kbd {
    display: inline-block;
    font-size: 10px;
    opacity: .7;
    font-family: inherit;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(0, 0, 0, .18);
    vertical-align: middle;
}

.act:hover:not(:disabled) {
    filter: brightness(1.08)
}

.act:active:not(:disabled) {
    transform: translateY(1px) scale(.985);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35), inset 0 2px 6px rgba(0, 0, 0, .28);
}

.act:focus-visible {
    outline: 3px solid #b9dfc2;
    outline-offset: 3px
}

.act.fold {
    background: linear-gradient(180deg, #7a3340, #5a2530);
    border-color: #9a4a56;
    color: #ffe8ec;
}

.act.call {
    background: linear-gradient(180deg, #2f7a52, #1f5a3a);
    border-color: #3f9a68;
    color: #e8fff2;
}

.act.raise {
    background: linear-gradient(180deg, #b87828, #8a5414);
    border-color: #d49a3a;
    color: #fff6e6;
}

.act.next {
    background: linear-gradient(180deg, #2f5f8a, #24496e);
    border-color: #4a7eae;
    color: #e8f4ff;
    width: 100%;
}

.nexthand {
    margin-top: 8px
}

.decision-ack {
    width: 100%;
    min-height: 46px;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #2d5a72, #254a60);
    color: #dcf3ff;
    border: 1px solid #8ab4cd;
    padding: 12px;
    font-size: 14px;
    font-weight: 650;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.decision-ack:not([hidden]):focus-visible {
    outline: 3px solid #b9dfc2;
    outline-offset: 3px
}

body.play-page .controls {
    background: linear-gradient(180deg, #12161cf5, #0d0f12f8);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 -8px 22px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .05);
}

body.play-page .controls .act {
    min-height: 48px;
    padding: 12px 6px;
    font-size: 16px;
    border-radius: 11px
}

body.play-page .controls .raiserow {
    margin-bottom: 8px;
    padding: 6px 8px
}

body.play-page .controls .raise-amt {
    min-height: 40px;
    font-size: 18px;
    width: 100px
}

body.play-page .quick button {
    min-height: 36px
}

@media (max-height:720px) {
    body.play-page .controls .act {
        min-height: 40px;
        padding: 8px 4px;
        font-size: 15px
    }

    body.play-page .quick button {
        min-height: 32px;
        padding: 4px
    }

    body.play-page .controls .raise-amt {
        min-height: 36px;
        font-size: 16px
    }
}

@media (max-width:600px) {
    .act kbd {
        display: none
    }

    .raise-meta {
        display: none
    }

    .raiserow .raise-amt {
        width: 92px;
        font-size: 18px
    }

    .quick button,
    .act {
        min-height: 48px
    }
}

@media (prefers-reduced-motion:reduce) {

    .act,
    .quick button {
        transition: none
    }

    .act:active:not(:disabled),
    .quick button:active {
        transform: none
    }
}


/* === UI POLISH 2026-11: table toact / felt (non-prefixed twin) === */
.felt .cloth {
    background:
        radial-gradient(ellipse at 50% 32%, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, 0) 52%),
        repeating-radial-gradient(circle at 28% 42%, rgba(255, 255, 255, .022) 0 1px, rgba(0, 0, 0, .02) 1px 2px),
        radial-gradient(ellipse at center, #34985a 0%, #217544 52%, #165530 100%);
}

.felt .cloth:after {
    content: "♠  名人德扑课  ♦";
    letter-spacing: 5px;
    color: rgba(255, 255, 255, .09)
}

.seat.toact {
    z-index: 5
}

.seat.toact .plate {
    border-color: #ffe082;
    box-shadow: 0 0 0 2px rgba(255, 224, 130, .85), 0 0 0 5px rgba(255, 213, 74, .18), 0 0 28px rgba(255, 213, 74, .65), 0 8px 18px rgba(0, 0, 0, .5);
    animation: toactGlow 1.4s ease-in-out infinite;
}

.seat.toact .avatar {
    box-shadow: 0 0 0 2px #0b0d10, 0 0 0 4px #ffd54a, 0 0 16px rgba(255, 213, 74, .7);
}

.seat.toact .nm {
    color: #fff8d6
}

@keyframes toactGlow {

    0%,
    100% {
        filter: brightness(1)
    }

    50% {
        filter: brightness(1.08)
    }
}

.card.deal {
    animation: dealIn .42s cubic-bezier(.18, .85, .28, 1) both
}

.card.boardin {
    animation: boardIn .55s cubic-bezier(.18, .85, .28, 1) both
}

@media (prefers-reduced-motion:reduce) {
    .seat.toact .plate {
        animation: none
    }
}

/* === 2026-11-05 polish: fly chips, hand result, nav, allin, shortcuts, avatars === */
.fly {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: left .42s cubic-bezier(.4, 0, .2, 1), top .42s cubic-bezier(.4, 0, .2, 1), opacity .35s ease .12s;
  z-index: 8;
  pointer-events: none;
}

.hand-result {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.hand-result.show {
  opacity: 1;
  pointer-events: auto;
}
.hand-result[hidden] { display: none !important; }
.hand-result-card {
  min-width: min(86vw, 320px);
  max-width: 420px;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 24, 30, .94), rgba(10, 12, 16, .96));
  border: 1px solid rgba(255, 213, 74, .35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  text-align: center;
  pointer-events: auto;
}
.hand-result-net {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.hand-result-net.pos { color: #7dffb2; }
.hand-result-net.neg { color: #ff8f9d; }
.hand-result-net.flat { color: #d7e0ea; }
.hand-result-detail {
  font-size: 13px;
  color: #b7c4cf;
  line-height: 1.45;
  margin-bottom: 12px;
  max-height: 3.2em;
  overflow: hidden;
}
.hand-result-skip {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #4a7eae;
  background: linear-gradient(180deg, #2f5f8a, #24496e);
  color: #e8f4ff;
  font-weight: 650;
  cursor: pointer;
}

.nav-pill {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px !important;
  border-radius: 999px;
  border: 1px solid #3d4f46;
  background: linear-gradient(180deg, #24352e, #1a2721);
  color: #d7ebe1 !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.nav-pill:hover {
  filter: brightness(1.08);
  border-color: #5f8a76;
}
.audio-mute-btn {
  min-width: 36px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.audio-mute-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #3a2a2e, #2a1c20);
  border-color: #7a4a55;
  color: #ffd0d8 !important;
}

.act.allin {
  background: linear-gradient(180deg, #8a3d2a, #642716);
  border-color: #c86a48;
  color: #ffe8df;
}

.shortcut-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: #9eb0a8;
  font-size: 12px;
}
.shortcut-hint button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #496058;
  background: #24372f;
  color: #dfece5;
  cursor: pointer;
}

.tablewrap { position: relative; }

@media (max-width: 600px) {
  .seat .avatar,
  .poker-surface .seat .avatar {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
  }
  .seat .avatar > svg:first-child,
  .poker-surface .seat .avatar > svg:first-child {
    width: 28px !important;
    height: 28px !important;
  }
  .seat .ring,
  .poker-surface .seat .ring {
    width: 36px;
    height: 36px;
    inset: -4px;
  }
  body.play-page .seat .avatar,
  body.play-page .seat .avatar > svg:first-child {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
  }
  .act kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fly, .hand-result { transition: none; }
}


.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  overflow: visible;
}


a.review-cta {
  display: inline-block; margin-top: 8px; padding: 8px 12px;
  border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 13px;
  color: #e8fff4; background: linear-gradient(180deg, #2a6f4e, #1d5239);
  border: 1px solid #3d9a6a;
}
a.review-cta[hidden] { display: none !important; }

/* === 2026-11-05: hero seat clear of controls bar === */
/* Sticky+z-index was painting the action bar over the bottom nameplate.
   Keep controls in document flow under the table; lift oval seats slightly. */
body.play-page .tablewrap {
    justify-content: flex-start;
    align-items: center;
}
body.play-page .poker-surface > .table,
body.play-page .tablewrap > .table {
    overflow: visible;
    margin-bottom: 8px;
}
body.play-page .controls {
    position: relative;
    bottom: auto;
    z-index: 2;
    margin-top: 8px;
    flex: 0 0 auto;
}
body.play-page .poker-surface .seat {
    z-index: 6;
}
body.play-page .poker-surface .seat.hero {
    z-index: 7;
}
body.play-page .poker-surface .bet {
    z-index: 5;
}
/* Extra lift for the south seat so plate+stack sit fully above the bar */
body.play-page .poker-surface .seat.hero {
    transform: translate(-50%, calc(-50% - 22px));
}
@media (max-height: 720px) {
    body.play-page .poker-surface .seat.hero {
        transform: translate(-50%, calc(-50% - 16px));
    }
    body.play-page .controls {
        margin-top: 4px;
        padding: 8px;
    }
}
