/* 斗地主 · 参考「天天斗地主」蓝色视觉：蓝渐变底 + 金色按钮 + 橘色场次卡 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
img { max-width: 100%; }

body.dz {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: #fff;
    background:
        radial-gradient(120% 60% at 50% -10%, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 55%),
        radial-gradient(60% 40% at 85% 20%, rgba(180,235,255,.55) 0%, rgba(180,235,255,0) 60%),
        radial-gradient(70% 50% at 10% 75%, rgba(120,210,255,.45) 0%, rgba(120,210,255,0) 60%),
        linear-gradient(180deg, #74c8f7 0%, #4aa6e9 26%, #3a90dc 55%, #2f7fd0 78%, #2a70c2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ---------------- 通用 ---------------- */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(9, 48, 96, .38);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px; padding: 6px 14px; font-size: 15px; font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
    backdrop-filter: blur(4px);
}
.pill .ico { font-size: 15px; }
.pill.gold { background: linear-gradient(180deg, #ffe487, #ffc02e); color: #6b3d00; border-color: #fff3c4; }
.pill.blue { background: linear-gradient(180deg, #6fd0ff, #2f9bea); border-color: rgba(255,255,255,.5); }

.btn-gold {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; cursor: pointer; font-family: inherit;
    background: linear-gradient(180deg, #ffe066 0%, #ffc21f 45%, #f5a300 100%);
    color: #6a3a00; font-weight: 800; letter-spacing: 1px;
    border-radius: 14px; padding: 14px 28px; font-size: 20px;
    box-shadow: 0 6px 0 #c97f00, 0 10px 18px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.7);
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.btn-gold:active { transform: translateY(3px); box-shadow: 0 3px 0 #c97f00, 0 6px 12px rgba(0,0,0,.25); }
.btn-gold:disabled { filter: grayscale(.6); opacity: .7; box-shadow: 0 4px 0 #9a7000; }

.btn-pink {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; cursor: pointer; font-family: inherit;
    background: linear-gradient(180deg, #ff9ec4 0%, #ff5fa2 55%, #ef3f8a 100%);
    color: #fff; font-weight: 800; letter-spacing: 1px;
    border-radius: 14px; padding: 14px 26px; font-size: 20px;
    box-shadow: 0 6px 0 #b62e68, 0 10px 18px rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.5);
}
.btn-pink:active { transform: translateY(3px); box-shadow: 0 3px 0 #b62e68; }

.btn-ghost {
    border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.16);
    color: #fff; border-radius: 999px; padding: 8px 16px; font-size: 14px;
    cursor: pointer; font-family: inherit; backdrop-filter: blur(4px);
}
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 大厅 ---------------- */
.lobby { max-width: 1040px; margin: 0 auto; padding: 10px 14px 130px; }

.lobby-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar {
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(180deg, #8fd6ff, #3d8fd6);
    border: 3px solid #ffd95e; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 20px; color: #0d3a63;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.who { line-height: 1.3; }
.who .n { font-size: 17px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.who .tag {
    display: inline-block; margin-top: 3px; font-size: 11px;
    background: linear-gradient(180deg, #ffd95e, #ffb400); color: #5f3300;
    border-radius: 999px; padding: 1px 10px; font-weight: 700;
}
.lobby-top .spacer { flex: 1; }
.lobby-top .pills { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(9,48,96,.35); border: 1px solid rgba(255,255,255,.35); font-size: 17px;
}

.lobby-body { display: grid; grid-template-columns: 132px 1fr; gap: 14px; margin-top: 14px; }
.side-list { display: flex; flex-direction: column; gap: 10px; }
.side-item {
    border-radius: 14px; padding: 10px 8px; text-align: center; font-size: 12.5px; font-weight: 700;
    background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.12));
    border: 1px solid rgba(255,255,255,.4); color: #08406f;
    box-shadow: 0 3px 8px rgba(0,0,0,.14);
}
.side-item .em { display: block; font-size: 22px; margin-bottom: 2px; }
.side-item.gold { background: linear-gradient(180deg, #ffe28a, #ffbe1f); }
.side-item.cyan { background: linear-gradient(180deg, #9df3ff, #37c2ec); }
.side-item.green { background: linear-gradient(180deg, #b6f5a8, #55c96a); }
.side-item.violet { background: linear-gradient(180deg, #d3c2ff, #8f7bf0); color: #2b1c66; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile {
    position: relative; border-radius: 16px; overflow: hidden; min-height: 120px;
    border: 2px solid rgba(255,255,255,.55);
    box-shadow: 0 6px 14px rgba(0,0,0,.18), inset 0 2px 0 rgba(255,255,255,.45);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.35); cursor: pointer;
    transition: transform .12s ease;
}
.tile:active { transform: translateY(3px) scale(.99); }
.tile .em { font-size: 40px; line-height: 1; }
.tile .t { font-size: 17px; font-weight: 800; margin-top: 8px; letter-spacing: 1px; }
.tile .s { font-size: 11.5px; opacity: .9; margin-top: 3px; }
.tile.orange { background: linear-gradient(180deg, #ffb35c, #f2761e 60%, #dd5a0d); }
.tile.red { background: linear-gradient(180deg, #ff8a7a, #ef4b3f 60%, #d32f2f); }
.tile.blue { background: linear-gradient(180deg, #7fc9ff, #2f86e0 60%, #1f63bb); }
.tile.cyan { background: linear-gradient(180deg, #99e9ff, #2fb6e8 60%, #1590c6); }
.tile.pink { background: linear-gradient(180deg, #ffb3d4, #f0438f 60%, #cf2a74); }
.tile.gold { background: linear-gradient(180deg, #ffe58a, #f7b418 60%, #dd9300); color: #5d3400; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.tile.green { background: linear-gradient(180deg, #a8ec9a, #3fbf5a 60%, #249145); }
.tile.big { grid-row: span 2; min-height: 252px; }
.tile.big .em { font-size: 74px; }
.tile.big .t { font-size: 30px; letter-spacing: 4px; }
.tile .badge-new {
    position: absolute; top: 8px; right: 8px; font-size: 10.5px; font-weight: 700;
    background: #fff; color: #e2432f; border-radius: 999px; padding: 1px 8px;
}
.tile .corner {
    position: absolute; left: 8px; top: 8px; font-size: 10.5px;
    background: rgba(0,0,0,.28); border-radius: 999px; padding: 1px 8px;
}

.lobby-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px;
    background: linear-gradient(180deg, rgba(20,70,130,0), rgba(16,58,110,.9));
}
.nav { display: flex; gap: 6px; flex: 1; justify-content: space-around; align-items: center; }
.nav .it { text-align: center; font-size: 11.5px; color: #eaf6ff; opacity: .92; }
.nav .it .em { display: block; font-size: 20px; }
.lobby-bottom .btn-gold { padding: 12px 30px; font-size: 21px; }

/* ---------------- 场次选择 ---------------- */
.room-page { max-width: 1040px; margin: 0 auto; padding: 10px 14px 120px; }
.room-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.back-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45);
    background: rgba(9,48,96,.35); color: #fff; font-size: 18px; cursor: pointer;
}
.room-title { font-size: 19px; font-weight: 800; letter-spacing: 2px; }
.room-title small { display: block; font-size: 10px; letter-spacing: 3px; opacity: .75; font-weight: 400; }
.room-head .spacer { flex: 1; }

.room-body { display: grid; grid-template-columns: 150px 1fr; gap: 16px; margin-top: 16px; }
.mode-list { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.mode-item {
    position: relative; padding: 8px 0 8px 18px; font-size: 15px; font-weight: 700;
    color: #eaf6ff; cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.mode-item::before {
    content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
    width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.75);
}
.mode-item.on {
    background: linear-gradient(180deg, #ffffff, #d9f1ff);
    color: #0d5a96; border-radius: 999px; padding: 9px 16px 9px 26px;
    box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
.mode-item.on::before { left: 12px; background: #2f9bea; }

.room-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.room-card2 {
    position: relative; border-radius: 16px; padding: 18px 18px 14px; min-height: 132px;
    border: 2px solid rgba(255,255,255,.5); overflow: hidden;
    box-shadow: 0 6px 16px rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.5);
    background: linear-gradient(180deg, #ffd76b 0%, #ffb42e 45%, #ff8f18 100%);
    color: #7a3c00;
    transition: transform .12s ease;
}
.room-card2:active { transform: translateY(3px); }
.room-card2.master { background: linear-gradient(180deg, #ffb0a2 0%, #f5604f 45%, #e0382a 100%); color: #6d160c; }
.room-card2.disabled { filter: grayscale(.45) brightness(.92); }
.room-card2 .name { font-size: 26px; font-weight: 900; letter-spacing: 3px; text-align: center; text-shadow: 0 2px 0 rgba(255,255,255,.45); }
.room-card2 .base { text-align: center; font-size: 17px; font-weight: 900; margin-top: 2px; color: #b3400a; }
.room-card2 .base b { font-size: 22px; }
.room-card2.master .base { color: #7d1a10; }
.room-card2 .meta {
    display: flex; justify-content: space-between; gap: 8px; margin-top: 14px;
    font-size: 12px; color: #8a4a05; font-weight: 700;
}
.room-card2.master .meta { color: #7a1b12; }
.room-card2 .meta .x { display: inline-flex; align-items: center; gap: 3px; }
.room-card2 .cur {
    position: absolute; right: 10px; top: 10px; font-size: 11px; font-weight: 700;
    background: #fff; color: #d2550a; border-radius: 999px; padding: 1px 9px;
}
.room-card2.promo {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(180deg, #ff9d6e, #f2542d 60%, #d93b18); color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.35);
}
.room-card2.promo .big { font-size: 26px; font-weight: 900; letter-spacing: 2px; }
.room-card2 .lock { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.35); color: #fff; font-size: 11.5px; padding: 4px 10px; }

.room-bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 16px; justify-content: center; align-items: center; padding: 10px 16px 16px; background: linear-gradient(180deg, rgba(20,70,130,0), rgba(16,58,110,.85)); z-index: 20; }
.room-bottom .btn-pink, .room-bottom .btn-gold { padding: 12px 40px; font-size: 21px; }

/* ---------------- 牌桌 ---------------- */
.table-page { max-width: 1000px; margin: 0 auto; padding: 8px 12px 150px; }
.table-top { display: flex; align-items: flex-start; gap: 12px; }
.table-top .left-ops, .table-top .right-ops { display: flex; gap: 10px; }
.op {
    width: 48px; text-align: center; font-size: 11px; color: #eaf6ff; opacity: .95; cursor: pointer;
}
.op .em { display: block; font-size: 20px; margin-bottom: 1px; }
.table-top .center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bottom-cards { display: flex; gap: 6px; }
.bottom-cards .cb {
    width: 38px; height: 54px; border-radius: 6px;
    background: linear-gradient(135deg, #4aa3ea, #2f7fd0);
    border: 2px solid #cfeaff; box-shadow: 0 3px 8px rgba(0,0,0,.25);
    position: relative;
}
.bottom-cards .cb::after {
    content: '斗'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 900; color: rgba(255,255,255,.75);
}
.table-top .time { font-size: 12px; color: #eaf6ff; opacity: .85; }

.felt {
    position: relative; margin: 10px auto 0; min-height: 380px;
    border-radius: 24px;
    background:
        radial-gradient(80% 60% at 50% 30%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 65%),
        linear-gradient(180deg, #3f97e0 0%, #2f7fd0 55%, #2668b4 100%);
    border: 2px solid rgba(255,255,255,.28);
    box-shadow: inset 0 0 60px rgba(0,0,0,.18), 0 14px 30px rgba(0,0,0,.2);
}

.seat { position: absolute; width: 150px; }
.seat.left { left: 12px; top: 24px; }
.seat.right { right: 12px; top: 24px; text-align: right; }
.seat .row { display: flex; align-items: center; gap: 8px; }
.seat.right .row { flex-direction: row-reverse; }
.seat .ava {
    position: relative; width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(180deg, #cfe9ff, #6fb2e8);
    border: 3px solid #ffd95e; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800; color: #12456f; flex: 0 0 auto;
}
.seat .ava .num {
    position: absolute; right: -6px; bottom: -6px; min-width: 22px; height: 22px; border-radius: 11px;
    background: linear-gradient(180deg, #6ee27a, #2fa845); border: 2px solid #fff;
    font-size: 12px; color: #fff; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.seat .info { min-width: 0; }
.seat .nm { font-size: 13px; font-weight: 700; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .bn { font-size: 12px; color: #ffe9a8; margin-top: 2px; }
.seat .lord {
    display: inline-block; margin-top: 4px; font-size: 10.5px; font-weight: 700;
    background: linear-gradient(180deg, #ffe066, #ffb400); color: #5f3300; border-radius: 4px; padding: 1px 7px;
}
.seat .lord.farmer { background: rgba(255,255,255,.28); color: #fff; }
.seat .act {
    margin-top: 6px; font-size: 12.5px; font-weight: 700; color: #ffe066; min-height: 18px;
}
.seat.turn .ava { box-shadow: 0 0 0 4px rgba(255,224,102,.55); }

.me-row {
    position: absolute; left: 12px; bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.me-row .ava { width: 46px; height: 46px; }
.me-row .nm { font-size: 13px; font-weight: 700; }
.me-row .bn { font-size: 12px; color: #ffe9a8; }

.board {
    position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
    display: flex; gap: 4px; align-items: center;
}
.board .tip {
    font-size: 26px; font-weight: 900; color: #fff;
    text-shadow: 0 3px 8px rgba(0,40,80,.55), 0 0 18px rgba(255,255,255,.55);
    letter-spacing: 3px;
}

/* 扑克牌 */
.card {
    width: 46px; height: 66px; border-radius: 6px; background: #fff; color: #1b1b1b;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-weight: 800; position: relative; user-select: none; flex: 0 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,.28); border: 1px solid #e2e2e2;
}
.card .r { font-size: 17px; line-height: 1; }
.card .s { font-size: 14px; line-height: 1.15; }
.card.red { color: #e02f2f; }
.card.joker .r { font-size: 12px; writing-mode: vertical-rl; letter-spacing: 1px; }
.card.joker .s { display: none; }
.card.mini { width: 36px; height: 52px; }
.card.mini .r { font-size: 13px; }
.card.mini .s { font-size: 11px; }

.hand-area {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: linear-gradient(180deg, rgba(14,60,110,0), rgba(12,52,98,.92));
    padding: 6px 0 8px;
}
.hand-area .inner { max-width: 1000px; margin: 0 auto; padding: 0 12px; }
.hand { display: flex; justify-content: center; align-items: flex-end; min-height: 96px; }
.hand .card {
    width: 52px; height: 76px; margin-left: -14px; cursor: pointer;
    transition: transform .12s ease;
}
.hand .card:first-child { margin-left: 0; }
.hand .card .r { font-size: 20px; }
.hand .card .s { font-size: 17px; }
.hand .card.selected { transform: translateY(-18px); }
.hand .card.selected::after {
    content: ''; position: absolute; inset: 0; border-radius: 6px; box-shadow: 0 0 0 3px #ffe066 inset;
}

.actions { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px 0 2px; }
.actions .btn-ghost { padding: 9px 26px; font-size: 15px; }
.actions .btn-gold { padding: 10px 34px; font-size: 18px; border-radius: 999px; }

.hud {
    display: flex; align-items: center; gap: 10px; justify-content: center; padding: 4px 0 2px; font-size: 12.5px;
}
.hud .k { background: rgba(255,255,255,.22); border-radius: 999px; padding: 3px 12px; font-weight: 700; }
.hud .k b { color: #ffe066; font-size: 15px; }

.feed {
    max-width: 1000px; margin: 12px auto 0; padding: 8px 14px; font-size: 12px; color: rgba(255,255,255,.85);
    background: rgba(10,50,95,.3); border-radius: 12px; line-height: 1.8; max-height: 110px; overflow: auto;
}

/* 结算弹窗 */
.dz-mask { position: fixed; inset: 0; background: rgba(4,26,50,.72); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.dz-mask.show { display: flex; }
.dz-dialog {
    width: 100%; max-width: 460px; border-radius: 20px; padding: 22px;
    background: linear-gradient(180deg, #ffffff, #eaf6ff);
    color: #0d3f6b; border: 3px solid #ffd95e;
    box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.dz-dialog h2 { margin: 0 0 4px; font-size: 22px; text-align: center; }
.dz-dialog .sub { color: #4b7ea8; font-size: 13px; text-align: center; }
.dz-dialog .delta { font-size: 34px; font-weight: 900; text-align: center; margin: 8px 0 0; }
.dz-dialog .delta.plus { color: #e8890a; }
.dz-dialog .delta.minus { color: #4b7ea8; }
.dz-dialog .lines { font-size: 13px; line-height: 2; color: #265e8c; border-top: 1px dashed #b8d8ef; margin-top: 12px; padding-top: 10px; }
.dz-dialog .ops { display: flex; gap: 10px; margin-top: 16px; }
.dz-dialog .ops .btn-gold, .dz-dialog .ops .btn-ghost { flex: 1; text-align: center; font-size: 16px; padding: 11px 0; }
.dz-dialog .ops .btn-ghost { color: #0d3f6b; border-color: #9cc9e8; background: #f2faff; }

.dice { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.5); z-index: 70; font-size: 96px; }
.dice.show { display: flex; }
.dice span { animation: shake .45s infinite; }
@keyframes shake { 0%,100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(12deg) scale(1.12); } }

.toast {
    position: fixed; left: 50%; top: 16%; transform: translateX(-50%);
    background: rgba(8,44,84,.94); border: 1px solid rgba(255,224,102,.65); color: #ffe9a8;
    padding: 10px 20px; border-radius: 999px; font-size: 13.5px; z-index: 80; display: none;
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.toast.show { display: block; }

@media (max-width: 720px) {
    .lobby-body { grid-template-columns: 108px 1fr; }
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .tile.big { grid-column: span 2; grid-row: auto; min-height: 170px; }
    .room-body { grid-template-columns: 116px 1fr; }
    .room-grid { grid-template-columns: 1fr; }
    .room-card2 .name { font-size: 22px; }
    .seat { width: 120px; }
    .hand .card { width: 42px; height: 62px; margin-left: -18px; }
    .hand .card .r { font-size: 16px; }
    .felt { min-height: 320px; }
}
