/* ============================================================
   西游记扑克 · 全局样式 v22
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #a8d8e8;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ============ 竖屏自动旋转 90 度 ============ */
.rotate-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media screen and (orientation: portrait) {
    html, body {
        width: 100vh;
        height: 100vw;
        overflow: hidden;
    }
    body {
        position: fixed;
        top: 0;
        left: 0;
        transform: rotate(90deg) translateY(-100%);
        transform-origin: left top;
        width: 100vh;
        height: 100vw;
    }
    .rotate-wrap { width: 100vh; height: 100vw; }
}

@media screen and (orientation: landscape) {
    .rotate-wrap { width: 100%; height: 100%; }
}

/* ============ 背景装饰（通用） ============ */
.bg-deco {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    color: #fff;
    opacity: 0.85;
    animation: cloudFloat 40s linear infinite;
}
.cloud::before { content: "☁"; font-size: 1em; }
.cloud.c1 { top: 8%; left: -10%; animation-duration: 45s; font-size: 60px; }
.cloud.c2 { top: 18%; left: -10%; animation-duration: 60s; animation-delay: -15s; font-size: 42px; opacity: 0.7; }
.cloud.c3 { top: 5%; left: -10%; animation-duration: 75s; animation-delay: -30s; font-size: 52px; opacity: 0.6; }
.cloud.c4 { top: 30%; left: -10%; animation-duration: 90s; animation-delay: -50s; font-size: 36px; opacity: 0.5; }

@keyframes cloudFloat {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 200px)); }
}

.mountains {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    z-index: 0;
}

.sun-glow {
    position: absolute;
    top: -20%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 240, 180, 0.6) 0%, rgba(255, 240, 180, 0) 70%);
    border-radius: 50%;
    z-index: 0;
    animation: sunPulse 6s ease-in-out infinite;
}
@keyframes sunPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* ============ 角色图（通用） ============ */
.chibi-girl {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    animation: girlBob 3.2s ease-in-out infinite;
    filter: drop-shadow(0 20px 20px rgba(0,0,0,0.25));
    position: relative;
}
@keyframes girlBob {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.02); }
}

/* ============ 登录页 v22 ============ */
.auth-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #7ec8e0 0%, #a8e6f0 40%, #d4f1f7 70%, #f0e8d0 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ★ 角色：绝对定位在左侧，作为背景元素 */
.chibi-girl-login {
    position: absolute;
    left: 2%;
    bottom: 0;
    width: 40%;
    max-width: 380px;
    height: 95%;
    background-image: url('img/222.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left bottom;
    animation: girlBob 3.2s ease-in-out infinite;
    filter: drop-shadow(10px 10px 20px rgba(0,0,0,0.3));
    z-index: 1;
    pointer-events: none;
    opacity: 0.95;
}

/* ★ 中间主区域：标题 + 登录卡片，竖排居中 */
.auth-main {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 20px;
    max-width: 460px;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
}

/* 标题 */
.logo-area {
    text-align: center;
    flex-shrink: 0;
}
.logo-title {
    display: inline-block;
    padding: 10px 28px;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 6px;
    color: #ffd966;
    text-shadow:
        0 0 6px #ffb800,
        0 0 12px #ff8c00,
        0 3px 0 #8b5a0a,
        0 5px 10px rgba(0,0,0,0.5);
    background: rgba(0, 0, 0, 0.75);
    border-radius: 10px;
    transform: rotate(-2deg);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 0 30px rgba(255, 184, 0, 0.2);
    animation: titleGlow 3s ease-in-out infinite;
}
@keyframes titleGlow {
    0%, 100% { box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 0 30px rgba(255, 184, 0, 0.2); }
    50% { box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 0 50px rgba(255, 184, 0, 0.4), 0 0 20px rgba(255, 184, 0, 0.5); }
}
.logo-subtitle {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    opacity: 0.95;
}

/* 登录卡片 */
.auth-card {
    width: 100%;
    background: rgba(255, 252, 245, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.6), 0 0 0 6px rgba(0,0,0,0.08), 0 14px 30px rgba(0,0,0,0.25);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffb800 50%, #ff6b6b 100%);
}
.card-header {
    text-align: center;
    font-size: 15px;
    font-weight: 900;
    color: #5a3e1a;
    letter-spacing: 4px;
    margin-bottom: 2px;
}
.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid #e0d0b0;
    border-radius: 40px;
    padding: 2px 14px;
    transition: all 0.2s;
}
.input-group:focus-within {
    border-color: #ffb800;
    box-shadow: 0 0 0 4px rgba(255, 184, 0, 0.2);
}
.input-icon { font-size: 16px; flex-shrink: 0; }
.input-group input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 700;
    color: #5a3e1a;
    letter-spacing: 1px;
    font-family: inherit;
    min-width: 0;
}
.input-group input::placeholder { color: #b8a070; font-weight: 500; }

.btn-main {
    margin-top: 2px;
    padding: 12px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(180deg, #5bc85b 0%, #3aa83a 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 6px;
    cursor: pointer;
    box-shadow: 0 5px 0 #2a7a2a, 0 6px 12px rgba(0,0,0,0.25), inset 0 1px 2px rgba(255,255,255,0.4);
    transition: all 0.08s;
    font-family: inherit;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-main:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #2a7a2a, 0 2px 6px rgba(0,0,0,0.2);
}
.btn-register {
    padding: 10px;
    border: 2px solid #ffb800;
    border-radius: 40px;
    background: #fff;
    color: #c87a00;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 4px;
    cursor: pointer;
    box-shadow: 0 3px 0 #e09a00, 0 4px 8px rgba(0,0,0,0.15);
    transition: all 0.08s;
    font-family: inherit;
}
.btn-register:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #e09a00;
}
.hint {
    text-align: center;
    font-size: 10px;
    color: #8b6b3a;
    letter-spacing: 1px;
    opacity: 0.85;
}

/* ★ 登录页：右上角规则按钮 */
.rules-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 100;
    padding: 8px 20px;
    border: 2px solid rgba(255,255,255,0.95);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: all 0.15s;
    font-family: inherit;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.rules-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.55);
}

/* 底部标语 */
.footer-notice {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    letter-spacing: 1px;
    color: rgba(90, 62, 26, 0.85);
    font-weight: 700;
    z-index: 10;
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
    padding: 0 10px;
}
.footer-notice span {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 184, 0, 0.4);
}

/* ============ 大厅页 ============ */
.lobby-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #7ec8e0 0%, #a8e6f0 40%, #d4f1f7 70%, #f0e8d0 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lobby-topbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 100%);
    border-bottom: 3px solid rgba(255, 184, 0, 0.6);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd966, #ffb800);
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: #8b5a0a;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.topbar-userinfo { display: flex; flex-direction: column; }
.topbar-name {
    font-size: 14px;
    font-weight: 900;
    color: #ffd966;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    letter-spacing: 1px;
}
.topbar-id {
    font-size: 10px;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}
.topbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 6px;
    color: #ffd966;
    text-shadow:
        0 0 6px #ffb800,
        0 0 12px #ff8c00,
        0 2px 0 #8b5a0a;
    pointer-events: none;
}
.topbar-actions {
    display: flex;
    gap: 8px;
}
.topbar-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 184, 0, 0.7);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #fff;
    font-family: inherit;
}
.topbar-icon-btn:active {
    transform: scale(0.9);
    background: rgba(255, 184, 0, 0.4);
}

.lobby-main {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 20px;
    min-height: 0;
    overflow: hidden;
}
.lobby-girl-wrap {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 10px;
    min-width: 0;
}
.chibi-girl-lobby {
    background-image: url('img/333.png');
    height: 90%;
    width: 100%;
}
.chibi-girl-lobby-right {
    background-image: url('img/111.png');
    height: 90%;
    width: 100%;
    animation-delay: -1.6s;
}

.lobby-buttons {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 5;
}
.game-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 26px;
    border: 3px solid #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: left;
    min-width: 290px;
    position: relative;
    overflow: hidden;
}
.game-btn::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%);
    animation: btnShine 3s linear infinite;
    pointer-events: none;
}
@keyframes btnShine {
    from { transform: translateX(-100%) translateY(-100%); }
    to { transform: translateX(100%) translateY(100%); }
}
.game-btn-join {
    background: linear-gradient(180deg, #4a9eff 0%, #2a6eff 100%);
    box-shadow: 0 8px 0 #1a4aad, 0 12px 20px rgba(0,0,0,0.3);
}
.game-btn-join:active {
    transform: translateY(5px);
    box-shadow: 0 3px 0 #1a4aad, 0 6px 10px rgba(0,0,0,0.3);
}
.game-btn-create {
    background: linear-gradient(180deg, #ffa500 0%, #ff7b00 100%);
    box-shadow: 0 8px 0 #b35600, 0 12px 20px rgba(0,0,0,0.3);
}
.game-btn-create:active {
    transform: translateY(5px);
    box-shadow: 0 3px 0 #b35600, 0 6px 10px rgba(0,0,0,0.3);
}
.game-btn-icon {
    font-size: 38px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.game-btn-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.game-btn-main {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.game-btn-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.9);
    letter-spacing: 1px;
}

/* ============ 弹窗（通用） ============ */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-box {
    background: linear-gradient(180deg, #fef7e0 0%, #f5e6c8 100%);
    border-radius: 24px;
    border: 3px solid #ffb800;
    box-shadow: 0 0 0 6px rgba(255, 184, 0, 0.25), 0 20px 40px rgba(0,0,0,0.5);
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.lobby-modal-box {
    width: 560px;
    max-width: 92%;
    max-height: 85%;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(180deg, #ffb800 0%, #ff8c00 100%);
    color: #fff;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: 3px;
    border-bottom: 3px solid #cc8800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.lobby-modal-header {
    text-align: center;
    justify-content: center;
    position: relative;
}
.modal-close {
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    padding: 0 10px;
    line-height: 1;
    color: #fff;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}
.modal-close:active { transform: translateY(-50%) scale(0.85); }
.modal-body {
    padding: 14px 18px;
    overflow-y: auto;
    background: #fef7e0;
    flex: 1;
}
.lobby-modal-body { padding: 14px 18px; }

.room-list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px dashed #e0d0a0;
}
.room-list-hint {
    font-size: 12px;
    color: #8b6b3a;
    font-weight: 700;
}
.refresh-btn-sm {
    padding: 6px 14px;
    border: 2px solid #ffb800;
    background: #fff;
    color: #c87a00;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    font-family: inherit;
}
.refresh-btn-sm:active { transform: scale(0.95); }
.room-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 4px;
}
.room-list::-webkit-scrollbar { width: 6px; }
.room-list::-webkit-scrollbar-thumb { background: #ffb800; border-radius: 3px; }
.empty-room {
    text-align: center;
    padding: 30px 10px;
    color: #b8a070;
    font-size: 13px;
    letter-spacing: 1px;
}
.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 2px solid #e0d0b0;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: all 0.15s;
}
.room-item:hover {
    border-color: #ffb800;
    box-shadow: 0 4px 12px rgba(255, 184, 0, 0.25);
}
.room-item-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.room-item-name {
    font-size: 14px;
    font-weight: 900;
    color: #5a3e1a;
    letter-spacing: 1px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.room-item-id {
    font-size: 10px;
    color: #b8a070;
    font-weight: 700;
}
.room-item-meta { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.room-count-badge {
    background: linear-gradient(180deg, #ffb800, #ff8c00);
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.room-status-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    background: #ffe9b0;
    color: #8b5a0a;
}
.room-status-tag.playing { background: #b8e6b8; color: #2a6a2a; }
.room-status-tag.finished { background: #e0e0e0; color: #666; }
.room-join-btn {
    padding: 8px 18px;
    background: linear-gradient(180deg, #5bc85b, #3aa83a);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 0 #2a7a2a, 0 4px 8px rgba(0,0,0,0.2);
    letter-spacing: 1px;
    flex-shrink: 0;
    margin-left: 8px;
    font-family: inherit;
    transition: all 0.1s;
}
.room-join-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2a7a2a; }
.room-join-btn:disabled {
    background: #ccc; color: #888; border-color: #aaa;
    box-shadow: 0 3px 0 #999; cursor: not-allowed;
}

/* ============ 创建房间表单 ============ */
.create-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-label {
    font-size: 13px;
    font-weight: 900;
    color: #8b5a0a;
    letter-spacing: 2px;
}
.form-input {
    padding: 12px 18px;
    border: 2px solid #e0d0b0;
    border-radius: 40px;
    background: #fff;
    color: #5a3e1a;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
}
.form-input:focus {
    border-color: #ffb800;
    box-shadow: 0 0 0 4px rgba(255, 184, 0, 0.2);
}
.form-input::placeholder { color: #b8a070; font-weight: 500; }
.create-count-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.count-btn {
    padding: 10px 4px;
    background: #fff;
    border: 2px solid #e0d0b0;
    border-radius: 12px;
    color: #8b5a0a;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.count-btn:active { transform: scale(0.95); }
.count-btn.active {
    background: linear-gradient(180deg, #ffb800, #ff8c00);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 3px 0 #cc8800, 0 4px 8px rgba(0,0,0,0.2);
}

/* ============ 房间页 ============ */
.game-room {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #7ec8e0 0%, #a8e6f0 40%, #d4f1f7 70%, #f0e8d0 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 100%);
    border-bottom: 3px solid rgba(255, 184, 0, 0.6);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.game-header-room {
    font-size: 14px;
    font-weight: 900;
    color: #ffd966;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.room-status {
    font-size: 11px;
    font-weight: 900;
    padding: 3px 12px;
    border-radius: 12px;
    background: #ffd966;
    color: #8b5a0a;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.room-status.playing { background: #5bc85b; color: #fff; }
.room-status.finished { background: #a0a0a0; color: #fff; }

.top-players {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px 0;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.player-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid #ffd966;
    border-radius: 14px;
    min-width: 72px;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
.player-seat.active {
    background: linear-gradient(180deg, #ffd966 0%, #ffb800 100%);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 184, 0, 0.9), 0 3px 8px rgba(0,0,0,0.2);
    transform: translateY(3px) scale(1.05);
}
.player-seat .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5bc85b, #3aa83a);
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.player-seat.active .avatar {
    background: linear-gradient(135deg, #ff6b6b, #d63030);
}
.player-seat .pname {
    font-size: 10px;
    font-weight: 900;
    color: #5a3e1a;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.player-seat.active .pname { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.player-seat .pmeta {
    font-size: 9px;
    font-weight: 900;
    color: #8b5a0a;
}
.player-seat.active .pmeta { color: #fff; }
.player-seat .host-crown {
    position: absolute;
    top: -8px;
    right: -6px;
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.player-seat .ready-mark {
    position: absolute;
    top: -8px;
    left: -6px;
    font-size: 13px;
    color: #5bc85b;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.card-count {
    display: inline-block;
    background: linear-gradient(180deg, #ff6b6b, #d63030);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 900;
}
.card-count.finished { background: linear-gradient(180deg, #5bc85b, #3aa83a); }

.msg-bar {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #ffd966;
    padding: 5px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 20;
    border: 2px solid #ffd966;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.center-table {
    position: relative;
    z-index: 3;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-height: 90px;
    overflow: hidden;
}
.table-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(180deg, rgba(45, 90, 45, 0.9), rgba(25, 60, 25, 0.95));
    border-radius: 20px;
    border: 3px dashed rgba(255, 217, 102, 0.6);
    max-height: 100%;
    overflow-y: auto;
    max-width: 95%;
    min-height: 90px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3), inset 0 2px 6px rgba(0,0,0,0.3);
}
.table-inner .empty-hint {
    color: rgba(255, 217, 102, 0.4);
    font-size: 15px;
    letter-spacing: 8px;
    font-weight: 900;
}
.card-hand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 12px;
    transition: all 0.3s;
    position: relative;
}
.card-hand-history {
    opacity: 0.5;
    transform: scale(0.7);
    transform-origin: center;
}
.card-hand-current {
    opacity: 1;
    transform: scale(1);
    background: rgba(255, 217, 102, 0.2);
    border: 2px solid #ffd966;
    box-shadow: 0 0 20px rgba(255, 217, 102, 0.6), inset 0 0 10px rgba(255, 217, 102, 0.2);
    animation: currentHandPulse 1.5s infinite alternate;
}
@keyframes currentHandPulse {
    from { box-shadow: 0 0 12px rgba(255, 217, 102, 0.5), inset 0 0 8px rgba(255, 217, 102, 0.1); }
    to { box-shadow: 0 0 24px rgba(255, 217, 102, 0.9), inset 0 0 14px rgba(255, 217, 102, 0.3); }
}
.hand-player {
    font-size: 10px;
    font-weight: 900;
    color: #5a3e1a;
    background: #ffd966;
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.card-hand-current .hand-player {
    background: linear-gradient(180deg, #ffd966, #ffb800);
    color: #8b5a0a;
    font-size: 11px;
    padding: 3px 12px;
}
.hand-cards {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
}
.card-hand-current .card {
    box-shadow: 0 5px 0 #3a2a0a, 0 8px 14px rgba(0, 0, 0, 0.6);
}
.hand-arrow {
    font-size: 18px;
    color: #ffd966;
    font-weight: 900;
    align-self: center;
    margin: 0 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.bottom-me {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.65) 100%);
    border-top: 3px solid rgba(255, 184, 0, 0.6);
    flex-shrink: 0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
}
.my-info-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.my-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    background: linear-gradient(180deg, #5bc85b, #3aa83a);
    border-radius: 14px;
    border: 2px solid #fff;
    min-width: 72px;
    box-shadow: 0 4px 0 #2a7a2a, 0 6px 12px rgba(0,0,0,0.3);
}
.my-info.active {
    box-shadow: 0 0 24px rgba(255, 217, 102, 1), 0 4px 0 #2a7a2a, 0 6px 12px rgba(0,0,0,0.3);
    animation: pulseMe 1.2s infinite alternate;
    background: linear-gradient(180deg, #ffd966, #ffb800);
}
@keyframes pulseMe {
    from { box-shadow: 0 0 12px rgba(255, 217, 102, 0.7), 0 4px 0 #2a7a2a, 0 6px 12px rgba(0,0,0,0.3); }
    to { box-shadow: 0 0 28px rgba(255, 217, 102, 1), 0 4px 0 #2a7a2a, 0 6px 12px rgba(0,0,0,0.3); }
}
.my-info .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #5a3e1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: #5a3e1a;
}
.my-info .myname {
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.my-info.active .myname { color: #8b5a0a; text-shadow: none; }
.pocket-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 14px;
    background: linear-gradient(180deg, #ffd966, #ffb800);
    border-radius: 20px;
    border: 2px solid #fff;
    box-shadow: 0 3px 0 #cc8800, 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    transition: all 0.1s;
}
.pocket-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #cc8800;
}
.pocket-icon { font-size: 18px; line-height: 1; }
.pocket-count {
    background: linear-gradient(180deg, #ff6b6b, #d63030);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 900;
    min-width: 22px;
    text-align: center;
}
.my-hand {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding: 10px 6px;
    min-height: 100px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    border: 2px solid rgba(255, 217, 102, 0.4);
    min-width: 0;
}
.my-hand::-webkit-scrollbar { height: 5px; }
.my-hand::-webkit-scrollbar-thumb { background: #ffb800; border-radius: 3px; }
.hand-empty-hint {
    color: rgba(255, 217, 102, 0.4);
    padding: 20px;
    font-size: 13px;
    letter-spacing: 3px;
    white-space: nowrap;
    font-weight: 700;
}
.my-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 84px;
    flex-shrink: 0;
}
.my-actions .btn {
    padding: 9px 6px;
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 20px;
    font-weight: 900;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(180deg, #ffb800, #ff8c00);
    box-shadow: 0 4px 0 #cc8800;
    border: 2px solid #fff;
    -webkit-user-select: none;
    user-select: none;
    font-family: inherit;
    transition: all 0.08s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.my-actions .btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #cc8800;
}
.my-actions .btn.success { background: linear-gradient(180deg, #5bc85b, #3aa83a); box-shadow: 0 4px 0 #2a7a2a; }
.my-actions .btn.secondary { background: linear-gradient(180deg, #6f9edf, #4a7aaf); box-shadow: 0 4px 0 #2a4a7a; }
.my-actions .btn.danger { background: linear-gradient(180deg, #ff6b6b, #d63030); box-shadow: 0 4px 0 #8a1a1a; }
.my-actions .btn.warning { background: linear-gradient(180deg, #ffa500, #ff7b00); box-shadow: 0 4px 0 #b35600; }

/* ============ 扑克牌 ============ */
.card {
    width: 60px;
    height: 84px;
    background: linear-gradient(145deg, #fffef8, #f5edd6);
    border-radius: 8px;
    border: 2px solid #2a2a2a;
    box-shadow: 0 4px 0 #3a2a0a, 0 6px 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    overflow: hidden;
    flex-shrink: 0;
}
.card:active { transform: translateY(3px); }
.card.selected {
    transform: translateY(-10px);
    box-shadow: 0 10px 0 #3a2a0a, 0 14px 22px rgba(255, 184, 0, 0.7);
    border-color: #ffb800;
}
.card .corner { position: absolute; top: 2px; left: 4px; font-weight: 900; line-height: 1; text-align: center; }
.card .corner .rank { font-size: 13px; }
.card .corner .suit { font-size: 11px; }
.card .corner-bottom { position: absolute; bottom: 2px; right: 4px; font-weight: 900; line-height: 1; text-align: center; transform: rotate(180deg); }
.card .corner-bottom .rank { font-size: 13px; }
.card .corner-bottom .suit { font-size: 11px; }
.card .center-content { display: flex; flex-direction: column; align-items: center; }
.card .center-char { font-size: 14px; font-weight: 900; color: #b22222; text-align: center; line-height: 1.1; }
.card .center-suit { font-size: 16px; opacity: 0.6; }
.card.red .corner, .card.red .corner-bottom, .card.red .center-suit { color: #b22222; }
.card.black .corner, .card.black .corner-bottom, .card.black .center-suit { color: #1a1a1a; }
.card.joker { background: linear-gradient(145deg, #fff5d0, #f0d89a 50%, #e0c070); border-color: #8b6914; }
.card.joker .center-char { color: #5a3e0a; font-size: 12px; }

/* ============ 收藏弹窗 ============ */
.modal-footer {
    padding: 8px 16px;
    background: linear-gradient(180deg, #ffe9b0, #ffd966);
    color: #8b5a0a;
    text-align: center;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 2px;
    border-top: 2px solid #ffb800;
}
.collection-group { margin-bottom: 14px; }
.collection-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px dashed #ffb800;
}
.cg-rank { font-size: 16px; font-weight: 900; color: #8b5a0a; }
.cg-count { font-size: 12px; font-weight: 900; color: #d63030; }
.collection-group-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mini-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 60px;
    background: linear-gradient(145deg, #fffef8, #f5edd6);
    border-radius: 6px;
    border: 1.5px solid #2a2a2a;
    box-shadow: 0 2px 0 #3a2a0a;
    position: relative;
    font-weight: 900;
}
.mini-card.red { color: #b22222; }
.mini-card.black { color: #1a1a1a; }
.mini-card.joker { background: linear-gradient(145deg, #fff5d0, #f0d89a); border-color: #8b6914; color: #5a3e0a; }
.mini-rank { font-size: 12px; line-height: 1; }
.mini-suit { font-size: 11px; line-height: 1; }
.mini-char {
    font-size: 8px;
    color: #5a3e1a;
    margin-top: 2px;
    text-align: center;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}
.empty-collection {
    text-align: center;
    padding: 30px 20px;
    color: #b8a070;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 700;
}

/* ============ 游戏结束结算面板 ============ */
.game-over-box {
    max-width: 520px;
    width: 90%;
}
.game-over-header {
    background: linear-gradient(180deg, #5bc85b 0%, #3aa83a 100%) !important;
    color: #fff !important;
    font-size: 18px !important;
    letter-spacing: 6px;
    text-align: center;
    justify-content: center !important;
    padding: 14px 20px !important;
    border-bottom: 3px solid #2a7a2a !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.game-over-footer {
    background: linear-gradient(180deg, #ffe9b0, #ffd966) !important;
    padding: 14px 18px !important;
}
.game-over-tip {
    font-size: 13px;
    margin-bottom: 10px;
    color: #8b5a0a;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
}
.result-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 8px;
    border: 2px solid #ffd966;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}
.result-row.result-first {
    background: linear-gradient(180deg, #fff7d6, #ffd966);
    border-color: #ffb800;
    box-shadow: 0 3px 0 #ffb800, 0 6px 14px rgba(255, 184, 0, 0.4);
}
.result-row.result-me {
    border-color: #5bc85b;
    box-shadow: 0 3px 0 #3aa83a, 0 6px 14px rgba(91, 200, 91, 0.3);
}
.result-rank {
    font-size: 30px;
    text-align: center;
    line-height: 1;
}
.result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.result-name {
    font-size: 15px;
    font-weight: 900;
    color: #5a3e1a;
    letter-spacing: 1px;
}
.result-total {
    font-size: 17px;
    font-weight: 900;
    color: #fff;
    text-align: right;
    white-space: nowrap;
    padding: 7px 14px;
    background: linear-gradient(180deg, #ff6b6b, #d63030);
    border-radius: 14px;
    border: 2px solid #fff;
    box-shadow: 0 3px 0 #8a1a1a;
    letter-spacing: 1px;
}
.result-row.result-first .result-total {
    background: linear-gradient(180deg, #ffb800, #ff8c00);
    box-shadow: 0 3px 0 #cc8800;
}
.result-joker-line {
    margin-top: 2px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.joker-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.5px;
    border: 1px solid;
}
.joker-tag-big {
    background: linear-gradient(180deg, #ffe9b0, #ffd966);
    color: #8b5a0a;
    border-color: #ffb800;
    box-shadow: 0 0 8px rgba(255, 217, 102, 0.9), 0 2px 0 #ff8c00;
    animation: jokerBigPulse 1.2s infinite alternate;
}
@keyframes jokerBigPulse {
    from { box-shadow: 0 0 6px rgba(255, 217, 102, 0.7), 0 2px 0 #ff8c00; }
    to { box-shadow: 0 0 16px rgba(255, 217, 102, 1), 0 2px 0 #ff8c00; }
}
.joker-tag-small {
    background: linear-gradient(180deg, #e0d0ff, #c0a0e0);
    color: #4a2a6a;
    border-color: #8b5a9a;
    box-shadow: 0 0 8px rgba(180, 140, 220, 0.7), 0 2px 0 #6a4a8a;
}
.joker-tag-none {
    background: rgba(0,0,0,0.05);
    color: #b0a070;
    border-color: rgba(201,161,83,0.3);
    opacity: 0.7;
    font-weight: 700;
}

/* ============ 自定义确认弹窗 ============ */
.confirm-box {
    max-width: 380px;
    width: 88%;
    border-radius: 20px;
    border: 3px solid #ffb800;
    box-shadow: 0 0 0 6px rgba(255, 184, 0, 0.25), 0 20px 50px rgba(0,0,0,0.7);
    animation: rulesPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.confirm-header {
    background: linear-gradient(180deg, #ffb800, #ff8c00) !important;
    color: #fff !important;
    font-size: 16px !important;
    letter-spacing: 3px;
    text-align: center;
    justify-content: center !important;
    padding: 14px 16px !important;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border-bottom: 3px solid #cc8800;
}
.confirm-body {
    padding: 22px 24px !important;
    background: #fef7e0 !important;
    color: #5a3e1a !important;
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    max-height: none !important;
    letter-spacing: 1px;
}
.confirm-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px !important;
    background: linear-gradient(180deg, #ffe9b0, #ffd966) !important;
    border-top: 2px solid #ffb800;
}
.confirm-btn {
    flex: 1;
    padding: 12px 8px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.08s;
    font-family: inherit;
    border: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.confirm-btn:active { transform: translateY(3px); }
.confirm-btn-cancel {
    background: linear-gradient(180deg, #6f9edf, #4a7aaf);
    color: #fff;
    box-shadow: 0 4px 0 #2a4a7a;
    border: 2px solid #fff;
}
.confirm-btn-cancel:active { box-shadow: 0 1px 0 #2a4a7a; }
.confirm-btn-ok {
    background: linear-gradient(180deg, #5bc85b, #3aa83a);
    color: #fff;
    box-shadow: 0 4px 0 #2a7a2a;
    border: 2px solid #fff;
}
.confirm-btn-ok:active { box-shadow: 0 1px 0 #2a7a2a; }

/* ============ 发牌特效 ============ */
.deal-deck {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 84px;
    z-index: 100;
    pointer-events: none;
}
.deal-deck-card {
    position: absolute;
    width: 60px;
    height: 84px;
    background: linear-gradient(145deg, #2d4e2d, #1a3a1a);
    border-radius: 8px;
    border: 2px solid #ffd966;
    box-shadow: 0 4px 0 #0f2a0f, 0 6px 10px rgba(0,0,0,0.5);
    top: 0; left: 0;
}
.deal-deck-card:nth-child(2) { transform: translate(3px, -3px) rotate(3deg); opacity: 0.8; }
.deal-deck-card:nth-child(3) { transform: translate(-3px, -6px) rotate(-3deg); opacity: 0.6; }
.deal-fly-card {
    position: fixed;
    width: 60px;
    height: 84px;
    background: linear-gradient(145deg, #fffef8, #f5edd6);
    border-radius: 8px;
    border: 2px solid #2a2a2a;
    box-shadow: 0 4px 0 #3a2a0a, 0 6px 10px rgba(0,0,0,0.5);
    z-index: 9999;
    pointer-events: none;
    transition: transform 0.65s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.65s ease-in;
    transform-origin: center center;
    background-image:
        linear-gradient(135deg, transparent 40%, rgba(255,184,0,0.3) 40%, rgba(255,184,0,0.3) 60%, transparent 60%),
        linear-gradient(45deg, transparent 40%, rgba(255,184,0,0.3) 40%, rgba(255,184,0,0.3) 60%, transparent 60%);
}

/* ============ 出牌特效 ============ */
.card-hand-current.just-played {
    animation: justPlayedPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes justPlayedPop {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============ 收牌特效 ============ */
.collect-fly-card {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transition: transform 0.65s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.65s ease-in;
    transform-origin: center center;
    border-radius: 8px;
    box-shadow: 0 4px 0 #3a2a0a, 0 6px 10px rgba(0,0,0,0.5);
}
.pocket-bounce {
    animation: pocketBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pocketBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ============ 幸运 2/4 ============ */
.lucky-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 34px;
    background: linear-gradient(180deg, #fef7e0 0%, #ffe9b0 100%);
    border-radius: 24px;
    border: 3px solid #ffb800;
    box-shadow: 0 0 0 8px rgba(255, 184, 0, 0.4), 0 0 60px rgba(255, 217, 102, 0.9), 0 20px 40px rgba(0,0,0,0.6);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    max-width: 80%;
}
.lucky-toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: luckyPulse 0.8s infinite alternate;
}
@keyframes luckyPulse {
    from { box-shadow: 0 0 0 8px rgba(255,184,0,0.4), 0 0 60px rgba(255, 217, 102, 0.9), 0 20px 40px rgba(0,0,0,0.6); }
    to { box-shadow: 0 0 0 12px rgba(255,184,0,0.2), 0 0 80px rgba(255, 217, 102, 1), 0 20px 40px rgba(0,0,0,0.6); }
}
.lucky-emoji {
    font-size: 60px;
    line-height: 1;
    animation: luckyBounce 0.6s ease infinite alternate;
}
@keyframes luckyBounce {
    from { transform: translateY(0) rotate(-8deg); }
    to { transform: translateY(-8px) rotate(8deg); }
}
.lucky-title {
    font-size: 16px;
    font-weight: 900;
    color: #d63030;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.4;
}
.lucky-sub {
    font-size: 12px;
    font-weight: 900;
    color: #8b5a0a;
    letter-spacing: 2px;
}

/* ============ Toast ============ */
.toast-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    pointer-events: none;
    background: rgba(0,0,0,0.25);
}
.toast-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #fef7e0 0%, #f5e6c8 100%);
    padding: 20px 28px;
    border-radius: 24px;
    border: 2px solid #c9a153;
    box-shadow: 0 0 0 4px rgba(201,161,83,0.3), 0 14px 30px rgba(0,0,0,0.6);
    min-width: 180px;
    max-width: 80%;
    animation: toastPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}
@keyframes toastPop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.toast-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.toast-icon-success { background: linear-gradient(180deg, #6fcf6f, #3a8a3a); border: 2px solid #2e7a2e; }
.toast-icon-error { background: linear-gradient(180deg, #e05a5a, #a03030); border: 2px solid #601818; }
.toast-icon-info { background: linear-gradient(180deg, #6f9edf, #3a6aaf); border: 2px solid #2a4a7a; }
.toast-text {
    font-size: 15px;
    font-weight: 900;
    color: #5a3e1a;
    text-align: center;
    letter-spacing: 1px;
    line-height: 1.4;
}

/* ============ 规则弹窗 ============ */
.rules-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: rulesFadeIn 0.25s ease;
}
@keyframes rulesFadeIn { from { opacity: 0; } to { opacity: 1; } }
.rules-box {
    background: linear-gradient(180deg, #fef7e0 0%, #f5e6c8 100%);
    border-radius: 24px;
    border: 3px solid #ffb800;
    box-shadow: 0 0 0 6px rgba(255, 184, 0, 0.25), 0 20px 50px rgba(0,0,0,0.7);
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: rulesPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rulesPopIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: linear-gradient(180deg, #ffb800, #ff8c00);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 4px;
    border-bottom: 3px solid #cc8800;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.rules-close {
    cursor: pointer;
    font-size: 24px;
    font-weight: 900;
    padding: 0 8px;
    line-height: 1;
    color: #fff;
}
.rules-close:active { transform: scale(0.85); }
.rules-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
    color: #5a3e1a;
    font-size: 14px;
    line-height: 1.7;
}
.rules-body::-webkit-scrollbar { width: 6px; }
.rules-body::-webkit-scrollbar-thumb { background: #ffb800; border-radius: 3px; }
.rules-section {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #e0d0a0;
}
.rules-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.rules-section-title {
    font-size: 16px;
    font-weight: 900;
    color: #8b5a0a;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.rules-content {
    font-size: 14px;
    color: #5a3e1a;
    line-height: 1.8;
}
.rules-content b {
    color: #d63030;
    font-weight: 900;
    padding: 0 2px;
}
.rules-table {
    width: 100%;
    margin: 8px 0;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}
.rules-table td {
    padding: 6px 10px;
    border: 1px solid #e0d0a0;
    color: #5a3e1a;
    font-weight: 700;
}
.rules-table tr:nth-child(even) td { background: #fdf5e0; }
.rules-table td:first-child,
.rules-table td:nth-child(3) {
    color: #d63030;
    font-weight: 900;
    text-align: center;
    width: 60px;
}
.rules-table td:nth-child(2),
.rules-table td:nth-child(4) {
    text-align: center;
    width: auto;
}
.rules-table-beat td { text-align: center; }
.rules-table-beat td.beat-key {
    background: linear-gradient(180deg, #ffb800, #ff8c00);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    width: 60px;
    border: 1px solid #cc8800;
}
.rules-table-beat td:nth-child(2) {
    color: #8b6b3a;
    font-weight: 600;
    width: 50px;
    font-size: 12px;
}
.rules-table-beat td.beat-val {
    color: #d63030;
    font-weight: 900;
    text-align: left;
    padding-left: 16px;
}
.rules-footer {
    padding: 12px 22px;
    background: linear-gradient(180deg, #ffb800, #ff8c00);
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 3px;
    border-top: 3px solid #cc8800;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ============ 房间内 Toast ============ */
.message-toast {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 700;
    z-index: 2000;
    border-left: 5px solid #ffb800;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    max-width: 90%;
    text-align: center;
    pointer-events: none;
}

.hidden { display: none !important; }

/* ============ 小屏适配 ============ */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* 登录页 */
    .chibi-girl-login { width: 38%; height: 90%; }
    .auth-main { max-width: 400px; gap: 10px; padding: 8px 16px; }
    .logo-title { font-size: 24px; padding: 8px 20px; letter-spacing: 4px; }
    .logo-subtitle { font-size: 10px; letter-spacing: 4px; margin-top: 4px; }
    .auth-card { padding: 12px 14px; gap: 8px; border-radius: 16px; }
    .card-header { font-size: 13px; letter-spacing: 3px; }
    .input-group { padding: 2px 10px; }
    .input-group input { padding: 8px 0; font-size: 13px; }
    .input-icon { font-size: 14px; }
    .btn-main { padding: 10px; font-size: 14px; letter-spacing: 4px; }
    .btn-register { padding: 8px; font-size: 12px; letter-spacing: 3px; }
    .hint { font-size: 9px; }
    .rules-btn { padding: 6px 16px; font-size: 11px; letter-spacing: 1px; top: 8px; right: 10px; }
    .footer-notice { font-size: 9px; bottom: 4px; }
    .footer-notice span { padding: 2px 8px; }
    .cloud { font-size: 30px !important; }

    /* 大厅 */
    .topbar-avatar { width: 36px; height: 36px; font-size: 17px; }
    .topbar-name { font-size: 12px; }
    .topbar-title { font-size: 17px; letter-spacing: 4px; }
    .topbar-icon-btn { width: 32px; height: 32px; font-size: 14px; }
    .game-btn { padding: 12px 20px; min-width: 220px; gap: 10px; border-radius: 14px; }
    .game-btn-icon { font-size: 30px; }
    .game-btn-main { font-size: 17px; letter-spacing: 3px; }
    .game-btn-sub { font-size: 10px; }
    .lobby-buttons { gap: 12px; }

    /* 弹窗 */
    .lobby-modal-box { width: 480px; }
    .modal-header { font-size: 13px; padding: 10px 16px; }
    .room-item { padding: 8px 10px; }
    .room-item-name { font-size: 13px; }
    .room-join-btn { padding: 6px 12px; font-size: 11px; }
    .form-input { padding: 9px 14px; font-size: 13px; }
    .count-btn { padding: 7px 3px; font-size: 11px; }
    .rules-header { font-size: 15px; padding: 10px 16px; letter-spacing: 3px; }
    .rules-body { font-size: 12px; padding: 10px 16px; line-height: 1.6; }
    .rules-section { margin-bottom: 12px; padding-bottom: 10px; }
    .rules-section-title { font-size: 14px; margin-bottom: 5px; }
    .rules-content { font-size: 12px; line-height: 1.6; }
    .rules-table { font-size: 11px; margin: 5px 0; }
    .rules-table td { padding: 4px 8px; }
    .rules-footer { font-size: 11px; padding: 8px 16px; letter-spacing: 2px; }
    .rules-close { font-size: 20px; }

    /* 房间 */
    .game-header { padding: 5px 12px; }
    .game-header-room { font-size: 12px; }
    .room-status { font-size: 10px; padding: 2px 8px; }
    .top-players { padding: 6px 8px 0; gap: 6px; }
    .player-seat { min-width: 62px; padding: 4px 6px; }
    .player-seat .avatar { width: 30px; height: 30px; font-size: 15px; border-width: 2px; }
    .player-seat .pname { font-size: 9px; max-width: 62px; }
    .player-seat .pmeta { font-size: 9px; }
    .msg-bar { top: 52px; font-size: 11px; padding: 4px 14px; }
    .card { width: 46px; height: 66px; }
    .card .center-char { font-size: 11px; }
    .card .corner .rank { font-size: 10px; }
    .card .corner .suit { font-size: 8px; }
    .card .corner-bottom .rank { font-size: 10px; }
    .card .corner-bottom .suit { font-size: 8px; }
    .card .center-suit { font-size: 12px; }
    .bottom-me { padding: 5px 8px; gap: 6px; }
    .my-info { min-width: 58px; padding: 4px 6px; }
    .my-info .avatar { width: 30px; height: 30px; font-size: 16px; }
    .my-info .myname { font-size: 9px; max-width: 58px; }
    .pocket-btn { padding: 3px 10px; font-size: 12px; }
    .pocket-icon { font-size: 15px; }
    .pocket-count { font-size: 10px; padding: 1px 6px; }
    .my-hand { min-height: 80px; padding: 8px 4px; gap: 4px; }
    .my-actions { min-width: 72px; gap: 4px; }
    .my-actions .btn { padding: 7px 4px; font-size: 11px; letter-spacing: 0; }
    .table-inner { padding: 8px 12px; gap: 6px; min-height: 80px; }
    .card-hand-history { transform: scale(0.6); }
    .card-hand-current { transform: scale(0.9); }
    .hand-player { font-size: 9px; padding: 1px 8px; }
    .card-hand-current .hand-player { font-size: 10px; padding: 2px 10px; }
    .hand-arrow { font-size: 14px; }
    .lucky-toast { padding: 16px 24px; gap: 4px; }
    .lucky-emoji { font-size: 42px; }
    .lucky-title { font-size: 14px; }
    .lucky-sub { font-size: 11px; }
    .confirm-box { max-width: 320px; }
    .confirm-header { font-size: 14px !important; padding: 10px 14px !important; letter-spacing: 2px; }
    .confirm-body { padding: 16px 18px !important; font-size: 13px !important; }
    .confirm-footer { padding: 10px 14px !important; gap: 8px; }
    .confirm-btn { padding: 10px 6px; font-size: 13px; letter-spacing: 2px; }
    .game-over-header { font-size: 16px !important; padding: 12px 16px !important; letter-spacing: 4px; }
    .result-row { grid-template-columns: 34px 1fr auto; gap: 8px; padding: 8px 12px; }
    .result-rank { font-size: 24px; }
    .result-name { font-size: 13px; }
    .result-total { font-size: 15px; padding: 5px 10px; }
    .joker-tag { padding: 1px 8px; font-size: 10px; }
}

/* ============================================================
   v23 新增：计酒规则 & 结算酒数展示
   ============================================================ */

/* ============ 创建房间 - 计酒规则框 ============ */
.drink-rule-box {
    background: #fff;
    border: 2px solid #e0d0b0;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.drink-rule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5a3e1a;
    font-weight: 700;
    flex-wrap: wrap;
}
.drink-rule-label {
    color: #8b5a0a;
    font-weight: 900;
    letter-spacing: 0.5px;
}
.drink-rule-input {
    width: 58px;
    padding: 6px 8px;
    border: 2px solid #e0d0b0;
    border-radius: 10px;
    background: #fffcf0;
    color: #5a3e1a;
    font-size: 14px;
    font-weight: 900;
    text-align: center;
    outline: none;
    font-family: inherit;
}
.drink-rule-input:focus {
    border-color: #ffb800;
    box-shadow: 0 0 0 3px rgba(255,184,0,0.2);
}
.drink-rule-tip {
    font-size: 11px;
    color: #b8a070;
    line-height: 1.5;
    padding-top: 6px;
    border-top: 1px dashed #e0d0b0;
}

/* ============ 结算面板 - 计酒规则横幅 ============ */
.drink-rule-banner {
    background: linear-gradient(180deg, #fff7d6, #ffe9b0);
    border: 2px solid #ffb800;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 900;
    color: #8b5a0a;
    text-align: center;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* ============ 结算面板 - 酒数展示 ============ */
.result-drink-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}
.result-drink {
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    text-align: right;
    white-space: nowrap;
    padding: 7px 14px;
    background: linear-gradient(180deg, #ffa500, #ff7b00);
    border-radius: 14px;
    border: 2px solid #fff;
    box-shadow: 0 3px 0 #b35600;
    letter-spacing: 1px;
}
.result-row.result-first .result-drink {
    background: linear-gradient(180deg, #ff6b6b, #d63030);
    box-shadow: 0 3px 0 #8a1a1a;
    animation: drinkPulse 1.2s infinite alternate;
}
@keyframes drinkPulse {
    from { box-shadow: 0 3px 0 #8a1a1a, 0 0 8px rgba(255,107,107,0.6); }
    to { box-shadow: 0 3px 0 #8a1a1a, 0 0 18px rgba(255,107,107,1); }
}
.result-drink-detail {
    font-size: 10px;
    color: #8b6b3a;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding-right: 2px;
}
.result-card-line {
    font-size: 11px;
    color: #8b6b3a;
    font-weight: 700;
    margin-top: 2px;
}

/* ============ 结算面板 - 布局微调（适配酒数宽度） ============ */
.result-row {
    grid-template-columns: 44px 1fr auto;
}

/* ============ 小屏 - 计酒规则样式 ============ */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .drink-rule-box { padding: 8px 10px; gap: 6px; }
    .drink-rule-item { font-size: 11px; gap: 6px; }
    .drink-rule-input { width: 48px; padding: 4px 6px; font-size: 12px; }
    .drink-rule-tip { font-size: 10px; padding-top: 4px; }
    .drink-rule-banner { font-size: 10px; padding: 6px 10px; margin-bottom: 8px; }
    .result-drink { font-size: 13px; padding: 5px 10px; }
    .result-drink-detail { font-size: 9px; }
    .result-card-line { font-size: 10px; }
}