/* ============================================================
   欢乐斗地主 —— 卡通休闲主题（参照腾讯欢乐斗地主视觉）
   渐变蓝色桌面 + 绿色菱形网格桌布 + 红色金纹牌背 + 圆角高光按钮
   ============================================================ */
:root {
    --cw: 74px; --ch: 104px;                 /* 手牌尺寸 */
    --cw-sm: 56px; --ch-sm: 78px;            /* 出牌区尺寸 */
    --pip: 14px; --pip-big: 30px;            /* 牌面花色图案尺寸（2~10 点位 / A·JQK 大花） */
    --rank: 16px;                            /* 四角点数码字号（随断点缩放） */
    --gold: #ffd93b;
    --gold-d: #e8a800;
    --red: #e03131;
    --felt-1: #33a866;
    --felt-2: #12703c;
    --radius: 16px;
    --shadow-lg: 0 14px 34px rgba(0, 0, 0, .38);
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.ddz-body {
    margin: 0;
    font-family: var(--font);
    color: #eaf3ff;
    overflow: hidden;
    background:
        radial-gradient(1100px 620px at 78% -12%, rgba(90, 200, 255, .28), transparent 62%),
        radial-gradient(900px 520px at 8% 108%, rgba(60, 220, 170, .20), transparent 60%),
        linear-gradient(165deg, #0a4b96 0%, #1273d4 42%, #0a3f80 78%, #072f63 100%);
    -webkit-tap-highlight-color: transparent;
}

.ddz-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 粒子特效层 */
.ddz-fx-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
}

/* ---------- 顶栏 ---------- */
.ddz-topbar {
    position: relative;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(180deg, rgba(3, 30, 66, .82), rgba(3, 30, 66, .40));
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 6px 22px rgba(0, 0, 0, .28);
    flex: none;
}

.ddz-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .55);
    background: linear-gradient(180deg, #fff8d8, #ffd93b 60%, #ffa62b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ddz-logo-ic { -webkit-text-fill-color: initial; font-size: 22px; }

.ddz-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    color: #14324f;
    background: linear-gradient(180deg, #eaf6ff, #b9dcff);
    -webkit-text-fill-color: initial;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8);
}

.ddz-top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.ddz-wallet {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 800;
    color: #4b2a00;
    background: linear-gradient(180deg, #ffe98a, #ffc02e);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.ddz-coin { animation: ddzSpin 5s linear infinite; display: inline-block; }
@keyframes ddzSpin { to { transform: rotate(360deg); } }

.ddz-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06));
    color: #fff;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.ddz-icon-btn:hover { transform: translateY(-2px) scale(1.08); background: rgba(255, 255, 255, .32); box-shadow: 0 0 16px rgba(120, 220, 255, .65); }
.ddz-icon-btn:active { transform: scale(.95); }
.ddz-icon-btn.ddz-icon-on { background: linear-gradient(180deg, #ffe98a, #ffc02e); color: #4b2a00; box-shadow: 0 0 16px rgba(255, 210, 90, .8); }

/* ---------- 牌桌 ---------- */
.ddz-table {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ddz-felt {
    position: absolute;
    inset: 3% 2% 2%;
    border-radius: 46% / 40%;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .07) 0 13px, transparent 13px 26px),
        repeating-linear-gradient(-45deg, rgba(0, 0, 0, .08) 0 13px, transparent 13px 26px),
        radial-gradient(ellipse at 50% 38%, var(--felt-1), var(--felt-2) 62%, #0b5430 100%);
    box-shadow: inset 0 0 90px rgba(0, 0, 0, .45), 0 26px 60px rgba(0, 0, 0, .34),
        inset 0 0 0 4px rgba(255, 255, 255, .07), inset 0 0 0 10px rgba(0, 0, 0, .16);
}

/* 底牌 */
.ddz-bottom-row {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 12;
}
.ddz-bottom-label {
    font-size: 13px;
    font-weight: 700;
    color: #ffeaa7;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.ddz-bottom-cards { display: flex; gap: 6px; }
.ddz-bottom-card { animation: ddzBottomIn .42s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes ddzBottomIn { from { transform: translateY(-26px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ddz-bottom-open .ddz-card { box-shadow: 0 0 16px rgba(255, 217, 59, .75), 0 4px 10px rgba(0, 0, 0, .4); }

/* 信息条 */
.ddz-info {
    position: absolute;
    left: 14px;
    top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 12;
}
.ddz-info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    background: rgba(0, 0, 0, .32);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(6px);
}

/* ---------- 座位 ---------- */
.ddz-seat {
    position: absolute;
    z-index: 14;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(6, 30, 60, .66), rgba(6, 30, 60, .38));
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.ddz-seat-left { left: 2.2%; top: 11%; }
.ddz-seat-right { right: 2.2%; top: 11%; flex-direction: row-reverse; padding: 8px 8px 8px 14px; }
.ddz-seat-self { left: 2.2%; bottom: 4%; }
.ddz-seat.ddz-turn {
    border-color: rgba(255, 217, 59, .9);
    box-shadow: 0 0 0 2px rgba(255, 217, 59, .55), 0 0 26px rgba(255, 200, 60, .75);
    transform: scale(1.045);
}
.ddz-seat.ddz-is-landlord { border-color: rgba(255, 190, 60, .6); }

.ddz-avatar {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: radial-gradient(circle at 32% 26%, #8fd6ff, #2b7fd4 62%, #17518e);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .65), 0 4px 12px rgba(0, 0, 0, .38);
    flex: none;
}
.ddz-seat.ddz-turn .ddz-avatar { animation: ddzAvatarPulse 1.1s ease-in-out infinite; }
@keyframes ddzAvatarPulse {
    0%, 100% { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .65), 0 0 0 0 rgba(255, 217, 59, .7); }
    50% { box-shadow: inset 0 0 0 3px #fff, 0 0 0 12px rgba(255, 217, 59, 0); }
}
.ddz-crown {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45));
    animation: ddzFloat 2.4s ease-in-out infinite;
}
@keyframes ddzFloat { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }

.ddz-seat-meta { display: flex; flex-direction: column; line-height: 1.25; }
.ddz-name { font-size: 14px; font-weight: 800; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddz-left { font-size: 12px; color: #bcd9f5; }
.ddz-left b { color: var(--gold); font-size: 15px; }
.ddz-left.ddz-left-warn b { color: #ff6b6b; animation: ddzBlink .8s ease-in-out infinite; }
@keyframes ddzBlink { 50% { opacity: .35; } }

/* 气泡 */
.ddz-bubble {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translate(-50%, 6px) scale(.6);
    opacity: 0;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    color: #17324f;
    background: linear-gradient(180deg, #fff, #dfeeff);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
    pointer-events: none;
    transition: transform .22s cubic-bezier(.2, 1.4, .4, 1), opacity .22s ease;
    z-index: 20;
}
.ddz-bubble.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.ddz-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    margin-left: -7px;
    border: 7px solid transparent;
    border-top-color: #dfeeff;
    border-bottom: 0;
}
.ddz-bubble-gold { background: linear-gradient(180deg, #fff6c9, #ffcf3d); color: #5a3400; }
.ddz-bubble-gold::after { border-top-color: #ffcf3d; }
.ddz-bubble-gray { background: linear-gradient(180deg, #f2f5f9, #cbd5e1); color: #3c4a5a; }
.ddz-bubble-bomb { background: linear-gradient(180deg, #ffe08a, #ff5a3c); color: #3d0d00; font-size: 16px; }
.ddz-bubble-play { background: linear-gradient(180deg, #ffffff, #cfe9ff); }

/* 倒计时圆环 */
.ddz-timer { position: absolute; right: -14px; top: -14px; width: 44px; height: 44px; z-index: 22; }
.ddz-seat-right .ddz-timer { right: auto; left: -14px; }
.ddz-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ddz-t-ring { fill: rgba(4, 24, 48, .72); stroke: rgba(255, 255, 255, .18); stroke-width: 4; }
.ddz-t-fg { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
.ddz-t-fg.ddz-t-urgent { stroke: #ff4d4f; }
.ddz-t-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}

.ddz-info-item b { color: var(--gold); font-size: 15px; }
#roleLabel.ddz-role-ll { color: #ffd93b; }
#roleLabel.ddz-role-fm { color: #9fe8c4; }
.ddz-info-strong { color: #d8ecff; }

/* ---------- 卡牌 ---------- */
.ddz-card {
    position: relative;
    width: var(--cw);
    height: var(--ch);
    border-radius: 9px;
    flex: none;
    background: linear-gradient(158deg, #ffffff 0%, #f4f7fb 62%, #e7edf6 100%);
    color: #17202b;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(20, 30, 50, .16),
        inset 0 -2px 0 rgba(0, 0, 0, .06);
    user-select: none;
    -webkit-user-select: none;
    transition: transform .15s ease, box-shadow .15s ease;
    will-change: transform;
}
.ddz-card-sm { width: var(--cw-sm); height: var(--ch-sm); border-radius: 7px; }
.ddz-card-mini { width: 42px; height: 58px; border-radius: 6px; }
.ddz-card-red { color: #d8232a; }

.ddz-card-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    top: 3px;
    left: 4px;
}
.ddz-card-corner i { font-style: normal; font-size: var(--rank); font-weight: 900; letter-spacing: -.5px; }
.ddz-card-corner.ddz-corner-two i { font-size: calc(var(--rank) * .8); letter-spacing: -1.2px; }
.ddz-card-corner em { font-style: normal; font-size: 12px; margin-top: 1px; }
.ddz-corner-br { top: auto; left: auto; bottom: 3px; right: 4px; transform: rotate(180deg); }
/* 花色图案：仿真实扑克牌（2~10 经典点位 / A 单枚大图 / JQK 人脸大花） */
.ddz-card-pips {
    position: absolute;
    inset: 7% 15%;
    font-size: var(--pip);
    line-height: 1;
    opacity: .95;
    pointer-events: none;
}
.ddz-card-pips > span {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    font-size: inherit;
    line-height: 1;
}
.ddz-card-pips .ddz-pip-big,
.ddz-card-pips .ddz-pip-face {
    left: 50%;
    top: 50%;
    font-size: var(--pip-big);
}
.ddz-card-pips .ddz-pip-face { opacity: .92; }
/* J/Q/K：中心大花背后加一层淡淡的花色光晕，作为“人脸牌”的区分（不画线框，避免擦到角标） */
.ddz-card-pips .ddz-pip-face::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    width: 1.7em;
    height: 2.4em;
    transform: translate(-50%, -50%);
    border-radius: 50% 50% 46% 46% / 42% 42% 50% 50%;
    background: radial-gradient(circle at 50% 45%, transparent 0 30%, currentColor 42%, transparent 68%);
    opacity: .15;
}
.ddz-card-sm .ddz-card-corner i { font-size: calc(var(--rank) * .8); }
.ddz-card-sm .ddz-card-corner em { font-size: 10px; }
.ddz-card-sm .ddz-card-pips { font-size: calc(var(--pip) * .78); inset: 8% 16%; }
.ddz-card-sm .ddz-card-pips .ddz-pip-big,
.ddz-card-sm .ddz-card-pips .ddz-pip-face { font-size: calc(var(--pip-big) * .72); }

/* 「10」等双字符点数：点数码收紧、图案向中间收拢，避免压住角标 */
.ddz-card-sm .ddz-card-corner.ddz-corner-two i { font-size: calc(var(--rank) * .62); }
.ddz-card-wide .ddz-card-pips { inset: 7% 20%; font-size: calc(var(--pip) * .9); }
.ddz-card-wide .ddz-card-pips > span { left: calc(50% + (var(--x) - 50%) * .78); }
.ddz-card-sm.ddz-card-wide .ddz-card-pips { inset: 8% 24%; font-size: calc(var(--pip) * .68); }
.ddz-card-sm.ddz-card-wide .ddz-card-pips > span { left: calc(50% + (var(--x) - 50%) * .7); }

/* 大小王 */
.ddz-card-joker { background: linear-gradient(158deg, #fffdf3, #fff2cf 55%, #ffe6a8 100%); color: #b8141c; }
.ddz-card-joker.ddz-joker-small { color: #24313f; }
.ddz-joker-txt {
    position: absolute;
    inset: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 2px;
}
.ddz-joker-star { position: absolute; right: 5px; bottom: 4px; font-size: 11px; opacity: .5; }
.ddz-card-sm .ddz-joker-txt { font-size: 13px; }

/* 牌背：红金花纹 */
.ddz-card-back {
    background:
        repeating-linear-gradient(45deg, rgba(255, 235, 180, .18) 0 5px, transparent 5px 10px),
        repeating-linear-gradient(-45deg, rgba(255, 235, 180, .12) 0 5px, transparent 5px 10px),
        radial-gradient(circle at 50% 50%, #e14b4b, #a51f28 70%, #7c141c 100%);
    box-shadow: 0 3px 9px rgba(0, 0, 0, .42), inset 0 0 0 2px rgba(255, 219, 128, .8);
}
.ddz-back-inner {
    position: absolute;
    inset: 5px;
    border-radius: 6px;
    border: 1px solid rgba(255, 226, 150, .6);
    background: radial-gradient(circle at 50% 50%, rgba(255, 230, 160, .22), transparent 68%);
}
.ddz-back-inner::before {
    content: '🀄';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: .5;
}
.ddz-card-mini .ddz-back-inner::before { font-size: 14px; }

/* ---------- 手牌区 ---------- */

/* ---------- 出牌区 ---------- */
.ddz-play-zone {
    position: absolute;
    z-index: 16;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-height: calc(var(--ch-sm) + 22px);
    opacity: .78;
    transition: opacity .25s ease, transform .25s ease;
}
.ddz-play-zone.ddz-play-active { opacity: 1; }
.ddz-play-left { left: 17%; top: 32%; }
.ddz-play-right { right: 17%; top: 32%; }
.ddz-play-self { left: 50%; transform: translateX(-50%); bottom: 16%; }

.ddz-play-cards { display: flex; align-items: flex-end; }
.ddz-play-cards .ddz-card { animation: ddzCardIn .36s cubic-bezier(.2, 1.35, .42, 1) both; }
@keyframes ddzCardIn {
    0% { transform: translateY(-46px) scale(.55) rotate(-6deg); opacity: 0; }
    62% { transform: translateY(5px) scale(1.09) rotate(1deg); opacity: 1; }
    100% { transform: none; opacity: 1; }
}
.ddz-play-type {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 999px;
    color: #123047;
    background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(200, 228, 255, .9));
    box-shadow: 0 3px 9px rgba(0, 0, 0, .32);
}
.ddz-play-pass {
    font-size: 17px;
    font-weight: 900;
    padding: 6px 20px;
    border-radius: 999px;
    color: #ffe9a8;
    background: rgba(0, 0, 0, .42);
    border: 1px dashed rgba(255, 255, 255, .35);
    animation: ddzBottomIn .3s ease both;
}
.ddz-play-shine {
    position: absolute;
    inset: -10px;
    border-radius: 14px;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 34%, rgba(255, 255, 255, .55) 50%, transparent 66%);
    animation: ddzShine .85s ease-out 1 both;
}
@keyframes ddzShine {
    0% { transform: translateX(-130%); opacity: 0; }
    35% { opacity: .95; }
    100% { transform: translateX(130%); opacity: 0; }
}

/* ---------- 底部控制栏 ---------- */
.ddz-controls {
    position: relative;
    z-index: 35;
    flex: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 16px;
    min-height: 74px;
}
.ddz-ctrl-group { display: flex; align-items: center; gap: 12px; }
.ddz-ctrl-group[hidden] { display: none; }
.ddz-ctrl-tip {
    font-size: 14px;
    font-weight: 700;
    color: #d6e9ff;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .3);
    border: 1px solid rgba(255, 255, 255, .14);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.ddz-btn {
    position: relative;
    border: 0;
    border-radius: 999px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 5px 0 rgba(0, 0, 0, .28), 0 10px 20px rgba(0, 0, 0, .3),
        inset 0 1px 0 rgba(255, 255, 255, .55);
    transition: transform .16s cubic-bezier(.2, 1.3, .4, 1), box-shadow .16s ease, filter .16s ease;
}
.ddz-btn::after {                       /* 顶部高光 */
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    top: 3px;
    height: 38%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, 0));
    pointer-events: none;
}
.ddz-btn:hover { transform: translateY(-3px) scale(1.06); filter: brightness(1.08) saturate(1.12); }
.ddz-btn:active { transform: translateY(2px) scale(.97); box-shadow: 0 2px 0 rgba(0, 0, 0, .28); }
.ddz-btn:disabled { opacity: .42; cursor: not-allowed; transform: none; filter: grayscale(.3); }
.ddz-btn:disabled:hover { transform: none; }

.ddz-btn-gold {
    background: linear-gradient(180deg, #ffe98a 0%, #ffc02e 52%, #e08a00 100%);
    color: #5a3400;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
    box-shadow: 0 5px 0 #a56200, 0 10px 22px rgba(255, 180, 40, .38), inset 0 1px 0 rgba(255, 255, 255, .75);
}
.ddz-btn-gold:hover { box-shadow: 0 6px 0 #a56200, 0 0 30px rgba(255, 210, 90, .9), inset 0 1px 0 #fff; }
.ddz-btn-ghost {
    background: linear-gradient(180deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, .10));
    border: 1px solid rgba(255, 255, 255, .45);
    backdrop-filter: blur(8px);
}
.ddz-btn-ghost:hover { box-shadow: 0 6px 0 rgba(0, 0, 0, .22), 0 0 26px rgba(140, 220, 255, .8); }
.ddz-btn-gray {
    background: linear-gradient(180deg, #a9b4c2, #6b7684);
    box-shadow: 0 5px 0 #47505c, 0 10px 20px rgba(0, 0, 0, .3);
}
.ddz-btn-lg { padding: 14px 40px; font-size: 18px; }
.ddz-btn-on { background: linear-gradient(180deg, #9ff0c4, #22b573) !important; border-color: rgba(255, 255, 255, .6) !important; color: #05301d !important; }

/* ---------- 记牌器 ---------- */
.ddz-counter {
    position: absolute;
    right: 12px;
    top: 62px;
    width: 268px;
    max-height: calc(100% - 90px);
    overflow-y: auto;
    z-index: 45;
    padding: 12px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(8, 34, 66, .94), rgba(6, 24, 48, .92));
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    animation: ddzSlideIn .25s ease both;
}
@keyframes ddzSlideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ddz-counter[hidden] { display: none; }
.ddz-counter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 900;
    font-size: 15px;
    color: var(--gold);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.ddz-counter-x, .ddz-modal-x {
    border: 0;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.ddz-counter-x:hover, .ddz-modal-x:hover { background: rgba(255, 90, 90, .8); transform: scale(1.1); }
.ddz-counter-sec { margin-top: 10px; }
.ddz-counter-title { font-size: 12px; color: #a9c7e6; margin-bottom: 6px; font-weight: 700; }
.ddz-counter-big { display: flex; gap: 6px; }
.ddz-cb-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 2px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .14);
}
.ddz-cb-rank { font-size: 12px; font-weight: 800; }
.ddz-cb-num { font-size: 17px; font-weight: 900; color: var(--gold); }
.ddz-cb-none { opacity: .38; }
.ddz-cb-none .ddz-cb-num { color: #8fa6bd; text-decoration: line-through; }

.ddz-counter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.ddz-cg-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
}
.ddz-cg-rank { font-size: 12px; font-weight: 800; }
.ddz-cg-dots { font-size: 7px; letter-spacing: .5px; color: #7fd8a5; }
.ddz-cg-none { opacity: .3; }
.ddz-cg-none .ddz-cg-dots { color: #ff8080; }
.ddz-cg-three { border-color: rgba(255, 200, 80, .6); }
.ddz-cg-four { border-color: rgba(255, 110, 110, .8); box-shadow: inset 0 0 12px rgba(255, 80, 80, .35); }
.ddz-cg-four .ddz-cg-dots { color: #ff8a8a; }

.ddz-counter-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.ddz-flag {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
}

/* ---------- 弹窗 ---------- */
.ddz-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 14, 30, .62);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .22s ease;
}
.ddz-modal.show { opacity: 1; }
.ddz-modal[hidden] { display: none; }
.ddz-modal-box {
    width: min(460px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(180deg, #10406f, #0a2748);
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    transform: translateY(18px) scale(.96);
    transition: transform .26s cubic-bezier(.2, 1.3, .4, 1);
}
.ddz-modal.show .ddz-modal-box { transform: none; }
.ddz-modal-wide { width: min(620px, 100%); }
.ddz-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 17px;
    font-weight: 900;
    color: var(--gold);
    background: linear-gradient(180deg, rgba(255, 255, 255, .10), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.ddz-modal-body { padding: 16px 18px; overflow-y: auto; }
.ddz-modal-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .18);
}
.ddz-modal-foot-center { justify-content: center; }

.ddz-field { margin-bottom: 16px; }
.ddz-field > label { display: block; font-size: 13px; color: #a9c7e6; margin-bottom: 7px; font-weight: 700; }
.ddz-field-row { display: flex; align-items: center; justify-content: space-between; }
.ddz-field-row > label { margin-bottom: 0; }
.ddz-seg {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, .28);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
}
.ddz-seg button {
    flex: 1;
    border: 0;
    padding: 8px 6px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    color: #cfe4fa;
    background: transparent;
    cursor: pointer;
    transition: all .16s ease;
}
.ddz-seg button:hover { background: rgba(255, 255, 255, .12); }
.ddz-seg button.on {
    background: linear-gradient(180deg, #ffe98a, #ffc02e);
    color: #5a3400;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}
.ddz-switch {
    width: 54px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(0, 0, 0, .35);
    position: relative;
    cursor: pointer;
    transition: background .2s ease;
}
.ddz-switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff, #c9d6e4);
    transition: transform .2s cubic-bezier(.2, 1.3, .4, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.ddz-switch.on { background: linear-gradient(180deg, #67e8a8, #22b573); }
.ddz-switch.on span { transform: translateX(24px); }
.ddz-range { width: 100%; accent-color: #ffc02e; }

.ddz-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.ddz-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
}
.ddz-stat b { color: var(--gold); font-size: 15px; }


/* ---------- 结算 ---------- */
.ddz-modal-result .ddz-modal-box { width: min(420px, 100%); background: linear-gradient(180deg, #16558f, #092646); }
.ddz-result { padding: 26px 22px 10px; text-align: center; }
.ddz-result-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 6px;
    animation: ddzResultIn .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes ddzResultIn { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.ddz-result-title.ddz-win {
    background: linear-gradient(180deg, #fff8d8, #ffd93b 55%, #ff9f1a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 3px 10px rgba(255, 190, 40, .6));
}
.ddz-result-title.ddz-lose { color: #9fc0e0; }
.ddz-result-sub { font-size: 13px; color: #a9c7e6; margin-bottom: 14px; }
.ddz-result-score { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-bottom: 16px; }
.ddz-result-score span { font-size: 38px; font-weight: 900; animation: ddzDeltaIn .6s ease both; }
.ddz-result-score small { font-size: 13px; color: #a9c7e6; }
@keyframes ddzDeltaIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.ddz-delta-up { color: #4ade80; text-shadow: 0 0 18px rgba(74, 222, 128, .55); }
.ddz-delta-down { color: #ff6b6b; text-shadow: 0 0 18px rgba(255, 107, 107, .5); }
.ddz-result-lines { text-align: left; display: flex; flex-direction: column; gap: 6px; }
.ddz-result-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 13px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .1);
}
.ddz-result-line b { color: var(--gold); }

/* ---------- 轻提示 ---------- */
.ddz-toast {
    position: fixed;
    left: 50%;
    top: 16%;
    transform: translate(-50%, -14px) scale(.94);
    opacity: 0;
    z-index: 90;
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    color: #2a1a00;
    background: linear-gradient(180deg, #fff6c9, #ffcf3d);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
    transition: opacity .22s ease, transform .22s cubic-bezier(.2, 1.3, .4, 1);
    pointer-events: none;
    max-width: 82vw;
    text-align: center;
}
.ddz-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.ddz-toast[hidden] { display: none; }

/* ---------- 震屏 ---------- */
.ddz-shake-1 { animation: ddzShake1 .42s ease; }
.ddz-shake-2 { animation: ddzShake2 .5s ease; }
.ddz-shake-3 { animation: ddzShake3 .6s ease; }
.ddz-shake-4 { animation: ddzShake4 .7s ease; }
@keyframes ddzShake1 { 25% { transform: translate(-3px, 2px) rotate(-.2deg); } 75% { transform: translate(3px, -2px) rotate(.2deg); } }
@keyframes ddzShake2 {
    20% { transform: translate(-7px, 4px) rotate(-.4deg); }
    45% { transform: translate(6px, -5px) rotate(.4deg); }
    70% { transform: translate(-4px, 3px); }
}
@keyframes ddzShake3 {
    15% { transform: translate(-12px, 7px) rotate(-.7deg); }
    35% { transform: translate(11px, -8px) rotate(.7deg); }
    55% { transform: translate(-8px, 5px) rotate(-.4deg); }
    78% { transform: translate(5px, -3px); }
}
@keyframes ddzShake4 {
    10% { transform: translate(-18px, 10px) rotate(-1deg) scale(1.01); }
    28% { transform: translate(16px, -12px) rotate(1deg) scale(1.01); }
    48% { transform: translate(-13px, 8px) rotate(-.7deg); }
    68% { transform: translate(9px, -6px) rotate(.5deg); }
    86% { transform: translate(-4px, 3px); }
}

/* ---------- 自适应 ---------- */
@media (max-width: 1180px) {
    :root { --cw: 64px; --ch: 90px; --cw-sm: 48px; --ch-sm: 68px; --pip: 13px; --pip-big: 27px; --rank: 15px; }
    .ddz-seat-left, .ddz-seat-right { top: 9%; }
    .ddz-play-left { left: 14%; }
    .ddz-play-right { right: 14%; }
    .ddz-counter { width: 244px; }
}
@media (max-width: 900px) {
    :root { --cw: 56px; --ch: 80px; --cw-sm: 42px; --ch-sm: 60px; --pip: 11px; --pip-big: 24px; --rank: 14px; }
    .ddz-seat { padding: 6px 10px 6px 6px; gap: 7px; }
    .ddz-avatar { width: 44px; height: 44px; font-size: 22px; }
    .ddz-name { font-size: 13px; max-width: 80px; }
    .ddz-info { gap: 6px; }
    .ddz-info-item { font-size: 11px; padding: 4px 9px; }
    .ddz-play-left { left: 6%; top: 30%; }
    .ddz-play-right { right: 6%; top: 30%; }
    .ddz-play-self { bottom: 14%; }
    .ddz-btn { padding: 10px 18px; font-size: 14px; }
    .ddz-topbar { padding: 8px 10px; gap: 8px; }
    .ddz-logo-txt { display: none; }
    .ddz-icon-btn { width: 36px; height: 36px; }
    .ddz-counter { width: min(232px, 72vw); top: 56px; }
    .ddz-hand-wrap { padding: 4px 8px 2px; }
}
@media (max-width: 620px) {
    :root { --cw: 46px; --ch: 66px; --cw-sm: 36px; --ch-sm: 52px; --pip: 9px; --pip-big: 20px; --rank: 12px; }
    .ddz-seat-left { top: 8%; }
    .ddz-seat-right { top: 8%; }
    .ddz-bottom-label { display: none; }
    .ddz-play-type { font-size: 10px; }
    .ddz-play-left { left: 3%; top: 28%; }
    .ddz-play-right { right: 3%; top: 28%; }
    .ddz-play-self { bottom: 12%; }
    .ddz-controls { gap: 8px; padding: 6px 8px 10px; min-height: 62px; }
    .ddz-ctrl-group { gap: 8px; }
    .ddz-btn { padding: 9px 14px; font-size: 13px; letter-spacing: 0; }
    .ddz-card-corner em { font-size: 10px; }
    /* 牌面花色大小在各断点由 --pip / --pip-big / --rank 变量统一缩放 */
    .ddz-joker-txt { font-size: 13px; }
    .ddz-timer { width: 36px; height: 36px; }
    .ddz-t-num { font-size: 12px; }
    .ddz-seat-self { bottom: 2%; }
}
@media (max-height: 640px) {
    .ddz-hand-wrap { min-height: calc(var(--ch) + 18px); }
    .ddz-controls { min-height: 58px; padding-bottom: 8px; }
    .ddz-seat-left, .ddz-seat-right { top: 6%; }
}

.ddz-rules-body h4 { color: var(--gold); margin: 14px 0 6px; font-size: 15px; }
.ddz-rules-body h4:first-child { margin-top: 0; }
.ddz-rules-body p, .ddz-rules-body li { font-size: 13.5px; line-height: 1.8; color: #d5e6f8; margin: 0 0 4px; }
.ddz-rules-body ul { margin: 0; padding-left: 20px; }

.ddz-flag-warn { background: rgba(255, 170, 40, .28); border-color: rgba(255, 200, 90, .6); color: #ffe6a8; }
.ddz-flag-out { background: rgba(90, 100, 115, .45); color: #b9c6d4; text-decoration: line-through; }

.ddz-pulse { animation: ddzBtnPulse .5s ease-in-out 3; }
@keyframes ddzBtnPulse {
    0%, 100% { transform: none; box-shadow: 0 5px 0 rgba(0, 0, 0, .28); }
    50% { transform: scale(1.12); box-shadow: 0 0 30px rgba(255, 217, 59, .95); }
}

.ddz-hand-wrap {
    position: relative;
    flex: none;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 6px 16px 4px;
    min-height: calc(var(--ch) + 30px);
    z-index: 30;
}
.ddz-hand {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: 26px;
    max-width: 100%;
}
.ddz-hand .ddz-card { cursor: pointer; }
.ddz-hand .ddz-card:hover { transform: translateY(-12px); box-shadow: 0 10px 20px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(20, 30, 50, .2); }
.ddz-hand .ddz-card.ddz-card-sel {
    transform: translateY(-24px);
    box-shadow: 0 0 0 3px rgba(255, 217, 59, .95), 0 12px 22px rgba(0, 0, 0, .45);
}
.ddz-hand .ddz-card.ddz-card-sel:hover { transform: translateY(-28px); }

.ddz-pop { animation: ddzPop .5s ease; }
@keyframes ddzPop { 0% { transform: scale(1); } 40% { transform: scale(1.6); color: #ff6b35; } 100% { transform: scale(1); } }
