:root {
    --bg-top: #07111c;
    --bg-bottom: #03070d;
    --panel: rgba(10, 19, 30, 0.82);
    --panel-strong: rgba(14, 25, 39, 0.94);
    --panel-soft: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --text-main: #f5f7fb;
    --text-muted: #9bacbf;
    --gold: #f6c667;
    --green: #2ec27e;
    --green-deep: #0f6c4d;
    --red: #ff6b6b;
    --cyan: #66d9ef;
    --shadow-xl: 0 32px 80px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.28);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    width: 100dvw;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

body {
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(43, 124, 96, 0.28), transparent 28%),
        radial-gradient(circle at top right, rgba(246, 198, 103, 0.14), transparent 24%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.app-shell {
    position: relative;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    width: 100dvw;
    padding: 16px 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ambient {
    position: absolute;
    border-radius: 999px;
    filter: blur(24px);
    opacity: 0.55;
    pointer-events: none;
}

.ambient-left {
    width: 220px;
    height: 220px;
    background: rgba(46, 194, 126, 0.16);
    top: 8%;
    left: -60px;
}

.ambient-right {
    width: 260px;
    height: 260px;
    background: rgba(246, 198, 103, 0.14);
    bottom: 10%;
    right: -70px;
}

.view {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.view-login {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: stretch;
    width: 100%;
    max-width: 1300px;
    margin: auto;
}

.hero-copy,
.join-card,
.table-panel,
.sidebar-card,
.topbar {
    background: var(--panel);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.hero-copy,
.join-card {
    border-radius: var(--radius-xl);
    padding: 36px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
        linear-gradient(140deg, rgba(17, 74, 55, 0.56), rgba(7, 17, 28, 0.82));
}

.eyebrow,
.section-tag,
.highlight-label,
.meta-label,
.hand-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 11px;
    color: var(--text-muted);
}

.hero-copy h1 {
    margin-top: 16px;
    max-width: 12ch;
    font-size: clamp(40px, 5vw, 60px);
    line-height: 0.95;
    font-weight: 800;
}

.hero-text {
    margin-top: 16px;
    max-width: 500px;
    line-height: 1.7;
    color: #d1d8e2;
    font-size: 14px;
}

.hero-highlights {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.highlight-item,
.status-item,
.meta-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
}

.highlight-item strong,
.status-item strong,
.meta-pill strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
    color: #fff;
}

.join-card {
    align-self: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
        var(--panel-strong);
}

.card-heading {
    margin-bottom: 18px;
}

.card-heading h2,
.card-heading h3,
.topbar h2 {
    margin-top: 6px;
    font-size: 26px;
    color: #fff;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #d4dcea;
    font-size: 13px;
}

.form-group input,
#raiseAmount {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
    font-size: 14px;
}

.form-note {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.form-group input:focus,
#raiseAmount:focus {
    border-color: rgba(246, 198, 103, 0.75);
    background: rgba(255, 255, 255, 0.09);
}

.seat-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.seat-btn {
    padding: 12px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #edf1f8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    font-size: 13px;
}

.seat-btn:hover:not(.occupied) {
    transform: translateY(-2px);
    border-color: rgba(246, 198, 103, 0.7);
    background: rgba(246, 198, 103, 0.12);
}

.seat-btn.selected {
    background: linear-gradient(135deg, #f6c667, #c9962d);
    border-color: transparent;
    color: #1b1101;
    font-weight: 700;
}

.seat-btn.occupied {
    background: rgba(255, 107, 107, 0.12);
    color: #ffb7b7;
    cursor: not-allowed;
    border-color: rgba(255, 107, 107, 0.34);
}

.btn {
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    color: #16120b;
    background: linear-gradient(135deg, #f6c667, #e6b14a);
    box-shadow: 0 10px 22px rgba(246, 198, 103, 0.24);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(135deg, #204634, #2f7a56);
}

.inline-message {
    min-height: 20px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.inline-message.success {
    color: #78e2a7;
}

.inline-message.error {
    color: #ff9696;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    margin: 0 auto 12px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.topbar h2 {
    font-size: 22px;
}

.topbar-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-pill {
    padding: 8px 14px;
}

.meta-pill strong {
    font-size: 16px;
    margin-top: 2px;
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 340px;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.table-panel {
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-surface {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(53, 171, 115, 0.26), transparent 35%),
        radial-gradient(circle at 48% 48%, #1d8058 0%, #0f563c 45%, #083121 75%, #03120d 100%);
    border: 8px solid #2c1d14;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06), inset 0 20px 40px rgba(0, 0, 0, 0.22);
}

.table-surface::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.table-center {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: min(80%, 480px);
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(5, 14, 22, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
}

.table-subline {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
}

.community-cards {
    display: flex;
    justify-content: center;
    gap: 6px;
    min-height: 64px;
    margin-top: 12px;
}

.players-container {
    position: absolute;
    inset: 0;
}

.player-seat {
    position: absolute;
    width: 140px;
    transform: translate(-50%, -50%);
}

.player-card {
    padding: 8px;
    border-radius: 14px;
    background: rgba(6, 15, 21, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    text-align: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.player-card.current-turn {
    border-color: rgba(246, 198, 103, 0.9);
    box-shadow: 0 0 0 1px rgba(246, 198, 103, 0.18), 0 12px 30px rgba(246, 198, 103, 0.18);
    transform: translateY(-2px);
}

.player-card.folded {
    opacity: 0.52;
}

.player-card.ready {
    border-color: rgba(46, 194, 126, 0.72);
}

.player-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 700;
    line-height: 1.3;
    font-size: 12px;
}

.dealer-badge,
.ready-badge,
.all-in-badge,
.folded-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
}

.dealer-badge {
    background: var(--gold);
    color: #201505;
}

.ready-badge {
    background: rgba(46, 194, 126, 0.2);
    color: #9cf1c0;
}

.all-in-badge {
    background: rgba(246, 198, 103, 0.16);
    color: #ffe6ad;
}

.folded-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.66);
}

.player-meta,
.player-bet {
    margin-top: 4px;
    font-size: 11px;
    color: #d7dee8;
}

.player-hand-small {
    display: flex;
    justify-content: center;
    gap: 2px;
    min-height: 32px;
    margin-top: 6px;
}

.card {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #edf1f8);
    color: #0b1622;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}

.card.back {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
        linear-gradient(135deg, #132230, #0a1722);
    color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.card.heart,
.card.diamond {
    color: #da3d52;
}

.card.club,
.card.spade {
    color: #111820;
}

.player-hand-small .card {
    width: 22px;
    height: 32px;
    border-radius: 6px;
    font-size: 9px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.sidebar-card {
    border-radius: 20px;
    padding: 16px;
    flex-shrink: 0;
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.turn-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(46, 194, 126, 0.16);
    color: #92f0bc;
    font-size: 11px;
    font-weight: 700;
}

.turn-badge.muted {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.status-copy {
    margin-top: 10px;
    line-height: 1.5;
    color: #d9e0ea;
    font-size: 13px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.status-item {
    padding: 10px;
}

.status-item span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
}

.status-item strong {
    font-size: 16px;
    margin-top: 4px;
}

.chip-summary {
    margin-top: 6px;
    color: var(--gold);
    font-size: 18px;
    font-weight: 800;
}

.action-hint {
    margin-top: 8px;
    min-height: 44px;
    line-height: 1.4;
    color: #d4dcea;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.player-hand-wrap {
    margin-top: 12px;
}

.player-hand {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 96px;
    margin-top: 8px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.player-hand .card {
    width: 64px;
    height: 88px;
    font-size: 22px;
}

.empty-hand {
    align-items: center;
}

.empty-text {
    color: var(--text-muted);
    font-size: 12px;
}

.action-buttons,
.bet-primary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    width: 100%;
    padding: 10px 10px;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-fold {
    background: linear-gradient(135deg, #82403d, #b84c4c);
}

.action-check {
    background: linear-gradient(135deg, #245067, #2c7b93);
}

.action-call,
.action-ante {
    background: linear-gradient(135deg, #1f5a42, #2ec27e);
}

.action-raise {
    background: linear-gradient(135deg, #b17c24, #f6c667);
    color: #201505;
}

.raise-panel {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
}

.raise-head,
.raise-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.raise-head {
    margin-bottom: 8px;
    color: #dce3ed;
    font-size: 12px;
}

#raiseSlider {
    width: 100%;
    accent-color: var(--gold);
}

.raise-row {
    margin-top: 10px;
}

#raiseAmount {
    max-width: 90px;
    padding: 8px;
    font-size: 13px;
}

.toast-host {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 240px;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(8, 18, 27, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.25s ease;
    font-size: 13px;
}

.settlement-modal {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 10, 16, 0.72);
    backdrop-filter: blur(8px);
}

.settlement-dialog {
    width: min(520px, 100%);
    max-height: 75vh;
    max-height: 75dvh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 20px;
    background: rgba(9, 18, 27, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xl);
}

.settlement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settlement-header h3 {
    font-size: 18px;
}

.settlement-close {
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

.settlement-body {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settlement-awards {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.settlement-award {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #e7edf6;
    line-height: 1.5;
    font-size: 12px;
}

.settlement-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.settlement-row.is-winner {
    border: 1px solid rgba(246, 198, 103, 0.45);
    background: rgba(246, 198, 103, 0.08);
}

.settlement-name {
    font-weight: 700;
    font-size: 13px;
}

.settlement-meta {
    color: var(--text-muted);
    font-size: 11px;
}

.settlement-delta {
    font-weight: 800;
    font-size: 14px;
}

.settlement-delta.plus {
    color: #8ff0bc;
}

.settlement-delta.minus {
    color: #ff9b9b;
}

.toast.success {
    border-color: rgba(46, 194, 126, 0.38);
}

.toast.error {
    border-color: rgba(255, 107, 107, 0.38);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 隐藏滚动条但保留功能 */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.settlement-dialog::-webkit-scrollbar {
    width: 4px;
}

.settlement-dialog::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ========== 手机横屏全屏适配 ========== */
@media (max-width: 932px) and (orientation: landscape) {
    html, body {
        height: 100dvh;
        width: 100dvw;
    }

    .app-shell {
        padding: 5px 8px;
        height: 100dvh;
        width: 100dvw;
    }

    .ambient-left,
    .ambient-right {
        display: none;
    }

    /* 登录页面横屏优化 */
    .view-login {
        padding: 5px;
    }

    .hero-card {
        display: flex;
        flex-direction: row;
        gap: 12px;
        max-width: 100%;
        height: 100%;
    }

    .hero-copy {
        display: none;
    }

    .join-card {
        flex: 1;
        padding: 12px 16px;
        max-width: 450px;
        margin: 0 auto;
        overflow-y: auto;
    }

    .card-heading {
        margin-bottom: 10px;
    }

    .card-heading h2 {
        font-size: 20px;
    }

    .section-tag {
        font-size: 9px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .form-group input {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 10px;
    }

    .form-note {
        font-size: 9px;
        margin-top: 4px;
    }

    .seat-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .seat-btn {
        padding: 8px 4px;
        font-size: 11px;
        border-radius: 10px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 10px;
    }

    .inline-message {
        margin-top: 8px;
        font-size: 11px;
        min-height: 16px;
    }

    /* 游戏页面横屏优化 */
    .topbar {
        padding: 6px 12px;
        margin-bottom: 5px;
    }

    .topbar h2 {
        font-size: 16px;
    }

    .topbar .section-tag {
        font-size: 8px;
    }

    .meta-pill {
        padding: 3px 8px;
    }

    .meta-pill strong {
        font-size: 13px;
    }

    .meta-label {
        font-size: 7px;
    }

    .game-layout {
        display: flex;
        flex-direction: row;
        gap: 8px;
        flex: 1;
        min-height: 0;
    }

    .table-panel {
        flex: 1.5;
        padding: 6px;
    }

    .table-surface {
        border-width: 4px;
        border-radius: 20px;
    }

    .table-surface::before {
        inset: 6px;
        border-radius: 14px;
    }

    .table-center {
        width: 88%;
    }

    .stage-badge {
        min-height: 20px;
        padding: 3px 8px;
        font-size: 10px;
    }

    .table-subline {
        font-size: 8px;
        margin-top: 3px;
    }

    .community-cards {
        gap: 3px;
        margin-top: 5px;
    }

    .community-cards .card {
        width: 28px;
        height: 40px;
        font-size: 10px;
        border-radius: 4px;
    }

    .player-seat {
        width: 80px;
    }

    .player-card {
        padding: 4px;
        border-radius: 8px;
    }

    .player-name {
        font-size: 8px;
        gap: 2px;
    }

    .dealer-badge,
    .ready-badge {
        min-width: 10px;
        height: 10px;
        font-size: 6px;
        padding: 0 2px;
    }

    .player-meta,
    .player-bet {
        font-size: 7px;
        margin-top: 1px;
    }

    .player-hand-small {
        margin-top: 2px;
        min-height: 18px;
    }

    .player-hand-small .card {
        width: 13px;
        height: 18px;
        font-size: 6px;
        border-radius: 3px;
    }

    .sidebar {
        flex: 1;
        gap: 6px;
        overflow-y: auto;
    }

    .sidebar-card {
        padding: 8px;
        border-radius: 12px;
    }

    .card-heading h3 {
        font-size: 12px;
    }

    .section-tag {
        font-size: 7px;
    }

    .status-header {
        gap: 4px;
    }

    .turn-badge {
        padding: 2px 5px;
        font-size: 8px;
    }

    .status-copy {
        font-size: 9px;
        margin-top: 4px;
    }

    .status-grid {
        margin-top: 5px;
        gap: 4px;
    }

    .status-item {
        padding: 5px;
    }

    .status-item span {
        font-size: 7px;
    }

    .status-item strong {
        font-size: 11px;
        margin-top: 2px;
    }

    .chip-summary {
        font-size: 13px;
        margin-top: 3px;
    }

    .action-hint {
        min-height: 28px;
        padding: 5px 6px;
        font-size: 9px;
        margin-top: 4px;
    }

    .player-hand-wrap {
        margin-top: 6px;
    }

    .hand-label {
        font-size: 7px;
    }

    .player-hand {
        min-height: 50px;
        padding: 5px;
        margin-top: 3px;
        gap: 4px;
    }

    .player-hand .card {
        width: 36px;
        height: 50px;
        font-size: 14px;
    }

    .action-buttons,
    .bet-primary-actions {
        gap: 3px;
    }

    .action-btn {
        padding: 7px 4px;
        font-size: 10px;
    }

    .bet-controls {
        gap: 6px;
    }

    .raise-panel {
        padding: 6px;
    }

    .raise-head {
        font-size: 9px;
        margin-bottom: 4px;
    }

    #raiseSlider {
        height: 4px;
    }

    #raiseAmount {
        max-width: 55px;
        padding: 4px;
        font-size: 10px;
    }

    .toast-host {
        top: 5px;
        right: 5px;
    }

    .toast {
        min-width: 150px;
        max-width: 220px;
        padding: 5px 7px;
        font-size: 10px;
    }

    .settlement-dialog {
        padding: 12px;
        max-height: 80dvh;
    }

    .settlement-header h3 {
        font-size: 13px;
    }

    .settlement-award {
        font-size: 9px;
        padding: 4px 5px;
    }

    .settlement-row {
        padding: 5px 7px;
    }

    .settlement-name {
        font-size: 10px;
    }

    .settlement-meta {
        font-size: 8px;
    }

    .settlement-delta {
        font-size: 11px;
    }
}

/* ========== 手机竖屏适配 ========== */
@media (max-width: 932px) and (orientation: portrait) {
    html, body {
        height: 100dvh;
        width: 100dvw;
    }

    .app-shell {
        padding: 12px;
        height: 100dvh;
        width: 100dvw;
    }

    .ambient-left,
    .ambient-right {
        display: none;
    }

    /* 登录页面竖屏优化 */
    .view-login {
        padding: 5px;
    }

    .hero-card {
        display: flex;
        flex-direction: column;
        gap: 0;
        height: 100%;
    }

    .hero-copy {
        display: none;
    }

    .join-card {
        flex: 1;
        padding: 20px 16px;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .card-heading {
        margin-bottom: 16px;
        text-align: center;
    }

    .card-heading h2 {
        font-size: 26px;
    }

    .section-tag {
        font-size: 11px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 12px;
    }

    .form-note {
        font-size: 11px;
        margin-top: 5px;
    }

    .seat-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .seat-btn {
        padding: 12px 6px;
        font-size: 13px;
        border-radius: 12px;
    }

    .btn {
        padding: 16px 20px;
        font-size: 16px;
        border-radius: 12px;
    }

    .inline-message {
        margin-top: 12px;
        font-size: 13px;
        text-align: center;
    }

    /* 游戏页面竖屏提示 */
    .game-layout {
        position: relative;
    }

    .game-layout::after {
        content: "📱 请将手机横屏以获得最佳游戏体验";
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.85);
        color: #f6c667;
        padding: 16px 24px;
        border-radius: 40px;
        font-size: 16px;
        font-weight: 700;
        z-index: 100;
        white-space: nowrap;
        border: 2px solid #f6c667;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        animation: pulse 2s infinite;
        pointer-events: none;
    }

    @keyframes pulse {
        0%, 100% { opacity: 0.9; }
        50% { opacity: 1; }
    }

    .topbar {
        padding: 12px 16px;
    }

    .topbar h2 {
        font-size: 18px;
    }

    .table-panel,
    .sidebar {
        opacity: 0.4;
        pointer-events: none;
    }
}

/* iPad 横屏适配 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .game-layout {
        grid-template-columns: minmax(0, 1.3fr) 300px;
    }

    .player-seat {
        width: 120px;
    }
}

/* iPad 竖屏适配 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        display: none;
    }

    .join-card {
        max-width: 500px;
        margin: 0 auto;
    }
}
/* ========== 立体筹码动画效果 ========== */
.chip-throw-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.poker-chip {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f6c667, #d4a040);
    border: 3px solid #e8b850;
    box-shadow:
        0 6px 0 #8b6914,
        0 8px 12px rgba(0, 0, 0, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    color: #5a3a0a;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
    transform-style: preserve-3d;
    animation: throwChip 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.poker-chip::before {
    content: "";
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.poker-chip::after {
    content: "♠";
    position: absolute;
    font-size: 14px;
    color: rgba(90, 58, 10, 0.4);
    transform: rotate(15deg);
}

.poker-chip.value-1 { background: radial-gradient(circle at 30% 30%, #ffffff, #d0d0d0); border-color: #c0c0c0; box-shadow: 0 6px 0 #808080, 0 8px 12px rgba(0,0,0,0.4); }
.poker-chip.value-5 { background: radial-gradient(circle at 30% 30%, #ff6b6b, #c0392b); border-color: #e74c3c; box-shadow: 0 6px 0 #8b1a1a, 0 8px 12px rgba(0,0,0,0.4); }
.poker-chip.value-10 { background: radial-gradient(circle at 30% 30%, #3498db, #2471a3); border-color: #2980b9; box-shadow: 0 6px 0 #1a5276, 0 8px 12px rgba(0,0,0,0.4); }
.poker-chip.value-25 { background: radial-gradient(circle at 30% 30%, #2ecc71, #1e8449); border-color: #27ae60; box-shadow: 0 6px 0 #0e6251, 0 8px 12px rgba(0,0,0,0.4); }
.poker-chip.value-100 { background: radial-gradient(circle at 30% 30%, #1a1a1a, #000000); border-color: #333; box-shadow: 0 6px 0 #000, 0 8px 12px rgba(0,0,0,0.4); }

@keyframes throwChip {
    0% {
        transform: translate(0, 0) scale(0.8) rotate(0deg);
        opacity: 0;
    }
    10% {
        transform: translate(calc(var(--dx) * 0.2), calc(var(--dy) * 0.1 - 30px)) scale(1) rotate(calc(var(--rotate) * 0.2));
        opacity: 1;
    }
    30% {
        transform: translate(calc(var(--dx) * 0.4), calc(var(--dy) * 0.3 - 40px)) scale(1.1) rotate(calc(var(--rotate) * 0.5));
    }
    60% {
        transform: translate(calc(var(--dx) * 0.7), calc(var(--dy) * 0.6 - 20px)) scale(1.05) rotate(calc(var(--rotate) * 0.8));
    }
    85% {
        transform: translate(calc(var(--dx) * 0.9), calc(var(--dy) * 0.85 - 5px)) scale(1) rotate(var(--rotate));
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.9) rotate(var(--rotate));
        opacity: 1;
    }
}

.bet-bubble {
    position: absolute;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #f6c667;
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 900;
    font-size: 20px;
    box-shadow:
        0 6px 0 #0a0a15,
        0 10px 20px rgba(0, 0, 0, 0.5);
    border: 2px solid #f6c667;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    animation: bubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bet-bubble::before {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #f6c667;
    filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.2));
}

.bet-bubble.raise {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 6px 0 #b85e00, 0 10px 20px rgba(0, 0, 0, 0.5);
}
.bet-bubble.raise::before { border-top-color: #fff; }

.bet-bubble.call {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 6px 0 #1a6e35, 0 10px 20px rgba(0, 0, 0, 0.5);
}
.bet-bubble.call::before { border-top-color: #fff; }

.bet-bubble.check {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 6px 0 #1a5276, 0 10px 20px rgba(0, 0, 0, 0.5);
}
.bet-bubble.check::before { border-top-color: #fff; }

.bet-bubble.fold {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 6px 0 #8b1a1a, 0 10px 20px rgba(0, 0, 0, 0.5);
}
.bet-bubble.fold::before { border-top-color: #fff; }

.bet-bubble.allin {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: #fff;
    border-color: #ffd700;
    box-shadow: 0 6px 0 #5a2a7a, 0 10px 20px rgba(0, 0, 0, 0.5);
}
.bet-bubble.allin::before { border-top-color: #ffd700; }

.bet-bubble.ante {
    background: linear-gradient(135deg, #1a1a2e, #2c3e50);
    color: #f6c667;
    border-color: #f6c667;
    box-shadow: 0 6px 0 #0a0a15, 0 10px 20px rgba(0, 0, 0, 0.5);
}
.bet-bubble.ante::before { border-top-color: #f6c667; }

@keyframes bubblePop {
    0% {
        transform: translate(-50%, 20px) scale(0.3);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -110%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -100%) scale(1);
        opacity: 1;
    }
}

.player-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 8px;
    overflow: hidden;
    border: 3px solid rgba(246, 198, 103, 0.8);
    box-shadow:
        0 6px 0 rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #2a4a3a, #1a3a2a);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.player-card.current-turn .player-avatar {
    border-color: #ffd700;
    box-shadow:
        0 6px 0 rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.player-avatar .avatar-placeholder {
    font-size: 28px;
    font-weight: 900;
    color: #f6c667;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.player-seat[data-seat="0"] .player-avatar { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.player-seat[data-seat="1"] .player-avatar { background: linear-gradient(135deg, #2980b9, #3498db); }
.player-seat[data-seat="2"] .player-avatar { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.player-seat[data-seat="3"] .player-avatar { background: linear-gradient(135deg, #f39c12, #f1c40f); }
.player-seat[data-seat="4"] .player-avatar { background: linear-gradient(135deg, #8e44ad, #9b59b6); }
.player-seat[data-seat="5"] .player-avatar { background: linear-gradient(135deg, #d35400, #e67e22); }
.player-seat[data-seat="6"] .player-avatar { background: linear-gradient(135deg, #16a085, #1abc9c); }