* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; font-family: 'Segoe UI', 'PingFang SC', sans-serif; }
body { background: #1a2a2f; color: white; overflow: hidden; width: 100vw; height: 100vh;height: 100svh; display: flex; flex-direction: column; }

#game-container { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }

#direction-indicator {
        position: absolute;
        top: 48%; left: 50%;
        transform: translate(-50%, -50%);
        width: 21.3vh;
        height: 21.3vh;
        background: rgba(0,0,0,0.4); 
        border-radius: 2.5vh; 
        border: 2px solid #5b7f87; 
        overflow: hidden; /* 切除超出圆角的部分 */
        box-shadow: 0 8px 30px rgba(0,0,0,0.8);
        z-index: 15;
        pointer-events: none;
    }

    #direction-indicator::before,
    #direction-indicator::after {
        content: '';
        position: absolute;
        top: 50%; left: 50%;
        width: 150%; height: 2px; 
        background: #1a2a2f; 
        z-index: 5;
    }
    #direction-indicator::before { transform: translate(-50%, -50%) rotate(45deg); }
    #direction-indicator::after { transform: translate(-50%, -50%) rotate(-45deg); }

    .sector {
        position: absolute;
        width: 0; height: 0;
        opacity: 0.3;
        transition: opacity 0.25s, filter 0.25s;
        z-index: 1;
    }
    .sector.active {
        opacity: 1;
        filter: drop-shadow(0 0 10px #f5d742);
    }
    /* 配合 21.3vh 的新尺寸，边框需要设置到 10.65vh */
    .sector-top { border-left: 10.65vh solid transparent; border-right: 10.65vh solid transparent; border-top: 10.65vh solid #c79a5e; top: 0; left: 0; }
    .sector-bottom { border-left: 10.65vh solid transparent; border-right: 10.65vh solid transparent; border-bottom: 10.65vh solid #c79a5e; bottom: 0; left: 0; }
    .sector-left { border-top: 10.65vh solid transparent; border-bottom: 10.65vh solid transparent; border-left: 10.65vh solid #c79a5e; left: 0; top: 0; }
    .sector-right { border-top: 10.65vh solid transparent; border-bottom: 10.65vh solid transparent; border-right: 10.65vh solid #c79a5e; right: 0; top: 0; }

    .sector-top.is-hu { border-top-color: #3ba171; opacity: 0.85; }
    .sector-bottom.is-hu { border-bottom-color: #3ba171; opacity: 0.85; }
    .sector-left.is-hu { border-left-color: #3ba171; opacity: 0.85; }
    .sector-right.is-hu { border-right-color: #3ba171; opacity: 0.85; }

    .center-circle {
        position: absolute;
        width: 6.5vh; height: 6.5vh; 
        background: rgba(0,0,0,0.8);
        border-radius: 50%;
        top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 2.8vh; 
        font-weight: bold;
        color: #f5e7c8;
        border: 2px solid #c79a5e;
        box-shadow: 0 0 12px rgba(0,0,0,0.6);
        z-index: 10;
        text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    }

    /* 升级版中心全能名牌 */
    .player-tag {
        position: absolute;
        background: rgba(20, 46, 51, 0.95);
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        white-space: nowrap;
        box-shadow: 0 4px 10px rgba(0,0,0,0.6);
        border: 1px solid #3a5a62;
        z-index: 25;
        display: flex;
        flex-direction: column;
        align-items: center;
        line-height: 1.3;
        pointer-events: none;
        transition: border-color 0.3s, box-shadow 0.3s;
        /* 直接通过 --tag-rot 变量控制旋转，避免动画冲突 */
        transform: translate(-50%, -50%) rotate(var(--tag-rot, 0deg));
    }

    /* 轮到该玩家行动时，名牌发光 */
    .player-tag.active-turn {
        border-color: #f5d742;
        box-shadow: 0 0 12px rgba(245, 215, 66, 0.8);
    }

    .tag-title { 
        font-size: 1.4vh; 
        font-weight: bold; 
        text-shadow: 0 1px 2px rgba(0,0,0,0.8); 
        color: #e0e0e0; 
        display: flex; 
        align-items: center; 
        justify-content: center; 
        gap: 5px; /* 让名字和缺门图标之间有一点呼吸感 */
    }
    .tag-title.hu-color { color: #f5d742; font-size: 1.5vh; }
    
    .tag-sub { font-size: 1.1vh; color: #a4c9c0; margin-top: 2px; display: flex; align-items: center; gap: 4px; justify-content: center; }
    
    /* 迷你缺门徽章 */
    .que-icon { display: inline-block; padding: 1px 4px; border-radius: 4px; font-weight: bold; font-size: 1.1vh; color: white; text-shadow: 0 1px 1px rgba(0,0,0,0.5); }
    .que-w { background: #b45f5a; } 
    .que-t { background: #3ba171; } 
    .que-b { background: #4da8da; }

    /* 精确定位，完美落座于各自方位（已向外推半个字符距离） */
    .player-tag-top   { top: 2.4vh; left: 10.65vh; --tag-rot: 180deg; }
    .player-tag-bottom{ top: 18.5vh; left: 10.65vh; --tag-rot: 0deg; }
    .player-tag-left  { top: 10.65vh; left: 2.5vh; --tag-rot: 90deg; }
    .player-tag-right { top: 10.65vh; left: 18.5vh; --tag-rot: -90deg; }

    @keyframes pop-in {
            /* 在动画的关键帧里，直接调用我们定义的 --tag-rot 旋转变量，保证动画全过程方向不丢失 */
            0% { transform: translate(-50%, -50%) rotate(var(--tag-rot, 0deg)) scale(0.5); opacity: 0; }
            100% { transform: translate(-50%, -50%) rotate(var(--tag-rot, 0deg)) scale(1); opacity: 1; }
        }

        /* 完美落座于对应的三角形领地内，并实现真实面向旋转 */
        /* 通过定义 CSS 变量 --tag-rot 传递给动画，避免 transform 被覆盖 */
        
        /* top: 对面玩家，文字倒置朝向他 */
        .hu-tag-top { top: 4.35vh; left: 10.65vh; --tag-rot: 180deg; }

        /* bottom: 你的领地，文字正向朝向你 */
        .hu-tag-bottom { top: 16.95vh; left: 10.65vh; --tag-rot: 0deg; }

        /* left: 左侧玩家，顺时针转90度，文字底边朝向左侧外围 */
        .hu-tag-left { top: 10.65vh; left: 4.35vh; --tag-rot: 90deg; }

        /* right: 右侧玩家，逆时针转90度，文字底边朝向右侧外围 */
        .hu-tag-right { top: 10.65vh; left: 16.95vh; --tag-rot: -90deg; }

/* 中间信息区 (隐藏) */
#center-info { display: none; }

.player-area { position: absolute; display: flex; justify-content: center; align-items: center; }
.top-player { 
    top: 2vh; 
    left: 50%; 
    transform: translateX(-50%); 
    /* 限制最大宽度不超过屏幕宽度的 96% */
    width: min(85vh, 96vw); 
}
.left-player { 
    /* 核心修复：抵消掉 85vh 宽度带来的中心偏移，确保只距离左边缘一点点 */
    left: calc(-42.5vh + max(4vw, 25px)); 
    top: 50%; 
    transform: translateY(-50%) rotate(90deg); 
    width: 85vh; 
}
.right-player { 
    /* 同理，固定在右侧边缘 */
    right: calc(-42.5vh + max(4vw, 25px)); 
    top: 50%; 
    transform: translateY(-50%) rotate(-90deg); 
    width: 85vh; 
}
/* 你的手牌区域整体定位 */
.bottom-player { 
    bottom: 2svh; /* vh 改为 svh，确保手牌距离底部菜单栏边缘的留白永远精准固定 */
    left: 50%; 
    transform: translateX(-50%); 
    width: 98vw; 
    flex-direction: column; 
    align-items: stretch; 
    z-index: 20; 
}

.tile { 
    /* 将原本的 3.8vh 改为动态取较小值 */
    width: min(3.8vh, 5.5vw); 
    height: min(5.2vh, 7.5vw); 
    background: transparent; 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    margin: 1px; 
    transition: transform 0.15s, box-shadow 0.15s; 
    cursor: pointer; 
}
.tile img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.4);}
.bottom-player .tile { 
    /* 将单纯的 vw 改为 vh 与 vw 的最小值 */
    width: min(6.5vw, 6vh); 
    height: min(8.5vw, 8.5vh); 
    /* 移除旧的 max-width: 8vw; max-height: 12vw; */
}
.bottom-player .tile.selected { transform: translateY(-20px); filter: drop-shadow(0 8px 8px rgba(0,0,0,0.5)); z-index: 50; }
.bottom-player .tile.selected img { outline: 3px solid #f5d742; outline-offset: -2px; }

.ting-tag { position: absolute; top: -8px; right: -8px; background: #e74c3c; color: white; font-size: 11px; padding: 1px 5px; border-radius: 6px; font-weight: bold; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.5); pointer-events: none; border: 1px solid white; }
.bottom-player .tile.que-tile img { filter: brightness(0.7) sepia(0.15); border: 2px solid #b45f5a; }
.bottom-player .tile.que-tile::after { content: '缺'; position: absolute; bottom: 2px; right: 2px; background: #b45f5a; color: white; font-size: 11px; padding: 1px 4px; border-radius: 4px; font-weight: bold; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

.bottom-player .tile.new-drawn { margin-left: 18px; position: relative; }
.bottom-player .tile.new-drawn::before { content: '摸'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: #c79a5e; color: white; font-size: 10px; padding: 1px 4px; border-radius: 4px; font-weight: bold; z-index: 5; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

.tile.hidden img { display: none; }
.tile.hidden {
    background: url('../assets/images/tiles/牌背.png') center/cover no-repeat;
    /* 核心属性：告诉浏览器保持像素硬边，不要尝试平滑处理 */
    image-rendering: -webkit-optimize-contrast; /* Safari / Chrome */
    image-rendering: crisp-edges;
    image-rendering: pixelated; /* 强制像素对齐，防止出现粗细不均 */
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hand-tiles { display: flex; align-items: center; justify-content: center; }
.meld-tiles { display: flex; gap: 4px; margin-right: 12px; }
/* 增加这一行：专门消除底部本家副牌的向右挤压，保证上下层完美居中对齐 */
.bottom-player .meld-tiles { margin-right: 0; }
.meld-group { display: flex; padding: 3px; border-radius: 6px; box-shadow: inset 0 2px 6px rgba(0,0,0,0.5); }
.meld-group .tile { width: 3.2vh; height: 4.4vh; }

/* 修复弃牌区容器宽度，适配放大后的牌 */
.discard-area { 
    position: absolute; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 2px; 
    z-index: 5; 
    pointer-events: none; 
    /* 将原本的 10 改为 13，并将预留间隙从 20px 增加到 26px */
    width: calc(13 * min(3.2vh, 5.2vw) + 26px);
    justify-content: flex-start; 
    align-content: flex-start; 
}

/* 放大公共区域打出的牌 */
.discard-area .tile { 
    /* 将原本的 4vw 和 5.6vw 提升到 5.2vw 和 7.3vw，在移动端会有明显的放大效果 */
    width: min(3.2vh, 5.2vw); 
    height: min(4.5vh, 7.3vw); 
    margin: 0; 
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5); 
}

/* 底部弃牌区 */
.bottom-discard { 
    bottom: min(20svh, 28vw); /* vh 改为 svh */
    left: 50%; 
    transform: translateX(-50%); 
}

/* 顶部弃牌区 */
.top-discard { 
    top: min(20svh, 28vw); /* vh 改为 svh */
    left: 50%; 
    transform: translateX(-50%) rotate(180deg); 
}

/* 左侧弃牌区：加大负数边距，把变大的容器强行往屏幕外侧拽 */
.left-discard { 
    left: calc(-6.5vh + 1vw); 
    top: 50%; 
    transform: translateY(-50%) rotate(90deg); 
}

/* 右侧弃牌区：同理，加大负数边距强行往右侧拽 */
.right-discard { 
    right: calc(-6.5vh + 1vw); 
    top: 50%; 
    transform: translateY(-50%) rotate(-90deg); 
}

.last-discarded::after {
    content: '▼'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
    color: #f5d742; font-size: 16px; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.9);
    animation: bounce 0.6s infinite; z-index: 10;
}
@keyframes bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 5px); } }
#action-panel { position: absolute; bottom: 180px; left: 52%; transform: translateX(0); gap: 12px; z-index: 100; background: rgba(0,0,0,0.6); padding: 8px 16px; border-radius: 40px; border: 1px solid #4a6b73; }
.action-btn { background: #c79a5e; border: none; padding: 10px 22px; font-size: 16px; font-weight: bold; border-radius: 30px; color: #fff; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 2px 0 #8b6b3b; }
.action-btn.discard { background: #3ba171; box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 2px 0 #226644; }
.action-btn.pass { background: #5f7a82; box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 2px 0 #3a555a; }
.action-btn:active { transform: translateY(2px); box-shadow: none; }

/* 听牌面板容器（更加紧凑） */
#ting-panel { 
    position: absolute; bottom: 180px; left: 48%; transform: translateX(-100%); 
    background: rgba(20, 46, 51, 0.9); padding: 8px 12px; border-radius: 12px; 
    border: 2px solid #f5d742; z-index: 150; display: flex; gap: 8px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.8); align-items: center; 
}

/* 垂直排版的“胡 x 张”标签 */
.ting-label { 
    display: flex; flex-direction: column; align-items: center; 
    color: #f5d742; font-weight: bold; font-size: 1.5vh; line-height: 1.2; 
}
.ting-total-num { 
    color: #fff; background: #b45f5a; padding: 1px 6px; border-radius: 4px; 
    margin: 2px 0; font-family: 'Courier New', Courier, monospace; font-size: 1.4vh; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.5); 
}

/* 轮播视窗限制大小，刚好容纳一张牌 */
.ting-carousel-container { 
    position: relative; width: 4.5vh; height: 6.2vh; 
}

/* 单张听牌及切换时的微小渐显动画 */
.ting-item { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    animation: fade-in 0.3s ease-out; 
}
.ting-item img { 
    width: 100%; height: 100%; border-radius: 4px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.5); object-fit: contain; 
}

/* 右上角圆形红色数字角标 */
.ting-badge { 
    position: absolute; top: -6px; right: -6px; 
    background: #e74c3c; color: white; font-size: 11px; padding: 1px 6px; 
    border-radius: 10px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.5); 
    border: 1px solid white; z-index: 10; line-height: 1.2;
}

@keyframes fade-in { 
    from { opacity: 0; transform: scale(0.9); } 
    to { opacity: 1; transform: scale(1); } 
}

#overlay-panel { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); background: rgba(20, 46, 51, 0.98); z-index: 200; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px 40px; border-radius: 20px; border: 2px solid #c79a5e; box-shadow: 0 20px 50px rgba(0,0,0,0.9); text-align: center; }
.overlay-title { font-size: 18px; color: #f5e7c8; margin-bottom: 20px; font-weight: bold; letter-spacing: 1px; max-width: 320px; line-height: 1.6; }

/* 右上角结束控制栏 */
#end-game-controls { position: absolute; top: 20px; right: 20px; z-index: 350; display: flex; gap: 12px; }

/* 折叠面板核心样式 */
#result-panel { 
    position: absolute; top: 8%; left: 50%; transform: translateX(-50%); 
    width: 90%; max-width: 500px; 
    /* height: 84%;  */
    background: linear-gradient(145deg, #142e33, #0f2226); 
    border: 2px solid #c79a5e; border-radius: 16px; z-index: 300; display: flex; 
    flex-direction: column; padding: 15px 20px; 
    box-shadow: 0 15px 50px rgba(0,0,0,0.9), inset 0 0 20px rgba(199, 154, 94, 0.1); 
    transition: height 0.3s ease, padding 0.3s ease; overflow: hidden; 
}

/* ★ 修复居中：当面板折叠时，清空上下 padding 并使用 flex 完美垂直居中 */
#result-panel.folded { 
    height: 60px !important; 
    padding: 0 20px !important; 
    justify-content: center; 
}
#result-panel.folded #result-scroll-area { display: none !important; }

/* 顶栏与标题布局 */
.rp-top-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #3a5a62; padding-bottom: 12px; margin-top: 5px; }
#result-panel.folded .rp-top-bar { border-bottom: none; padding-bottom: 0; margin-top: 0; }
.result-title { color: #f5d742; letter-spacing: 4px; font-size: 20px; font-weight: bold; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.8); line-height: 1; }
.rp-controls { display: flex; gap: 15px; align-items: center; }

/* ★ 修复重复按钮：顶部的按钮平时隐藏，只有折叠时显示 */
.top-restart-btn { display: none; }
#result-panel.folded .top-restart-btn { display: block; }

/* 流水滚动区 */
#result-scroll-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; margin-top: 15px; }

/* ★ 纯 CSS 绘制的高级折叠箭头 */
#fold-btn { background: none; border: none; cursor: pointer; padding: 5px 10px; outline: none; display: flex; align-items: center; justify-content: center; }
.fold-icon {
    display: inline-block;
    width: 12px; height: 12px;
    border-bottom: 3px solid #c79a5e;
    border-right: 3px solid #c79a5e;
    /* 展开状态：箭头朝上 */
    transform: translateY(3px) rotate(225deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s;
}
#fold-btn:hover .fold-icon { border-color: #f5d742; }
/* 折叠状态：箭头朝下 */
#result-panel.folded .fold-icon { transform: translateY(-3px) rotate(45deg); }

/* 顶栏布局 */
.rp-top-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #3a5a62; padding-bottom: 10px; }
#result-panel.folded .rp-top-bar { border-bottom: none; padding-bottom: 0; }
.result-title { color: #f5d742; letter-spacing: 4px; font-size: 20px; font-weight: bold; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.rp-controls { display: flex; gap: 15px; align-items: center; }
#fold-btn { background: none; border: none; color: #c79a5e; font-size: 22px; cursor: pointer; transition: transform 0.2s, color 0.2s; padding: 0; outline: none; }
#fold-btn:hover { color: #f5d742; }

/* 流水滚动区 */
#result-scroll-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; margin-top: 15px; }
.result-title { text-align: center; color: #f5d742; margin-bottom: 20px; letter-spacing: 4px; font-size: 22px; text-shadow: 0 2px 4px rgba(0,0,0,0.8); font-weight: bold; }
.close-btn { position: absolute; top: 15px; right: 15px; background: transparent; border: none; color: #c79a5e; font-size: 22px; cursor: pointer; transition: transform 0.2s, color 0.2s; padding: 5px; }
.close-btn:hover { transform: scale(1.1); color: #f5d742; }

/* 玩家结算卡片 */
.result-player-card { background: rgba(0,0,0,0.4); border: 1px solid #3a5a62; border-radius: 12px; margin-bottom: 15px; overflow: hidden; display: flex; flex-direction: column; }
.result-player-card.is-human { border-color: #c79a5e; box-shadow: 0 0 15px rgba(199, 154, 94, 0.25); background: rgba(30, 58, 63, 0.7); }

/* 卡片头部 */
.rpc-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: rgba(0,0,0,0.5); border-bottom: 1px solid #2d4a50; }
.rpc-name { font-weight: bold; font-size: 16px; color: #e0e0e0; flex: 1; }
.rpc-name.is-human { color: #f5d742; }
.rpc-status { font-size: 13px; padding: 3px 10px; border-radius: 12px; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,0.4); }
.rpc-status.hu { background: linear-gradient(180deg, #46b883, #3ba171); color: white; }
.rpc-status.wei { background: linear-gradient(180deg, #c76f6a, #b45f5a); color: white; }
.rpc-time { font-size: 11px; color: #bde0e8; margin-left: 6px; font-weight: normal; opacity: 0.8; }
.rpc-score { font-size: 20px; font-weight: bold; color: #fff; font-family: 'Courier New', Courier, monospace; flex: 1; text-align: right; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }

/* 卡片详情流水 */
.rpc-details { padding: 8px 15px; font-size: 13px; color: #a4c9c0; line-height: 1.6; display: flex; flex-direction: column; gap: 4px; }
.rpc-detail-item { display: flex; justify-content: flex-start; border-bottom: 1px dashed rgba(255,255,255,0.08); padding: 6px 0; }
.rpc-detail-item:last-child { border-bottom: none; }

.result-line { display: flex; justify-content: space-between; margin-bottom: 12px; border-bottom: 1px solid #2d4a50; padding-bottom: 8px; }

.toast { position: fixed; top: 22%; left: 50%; transform: translate(-50%, -50%); background: #f5e7c8; color: #1a2a2f; padding: 12px 24px; border-radius: 30px; font-size: 15px; font-weight: bold; pointer-events: none; opacity: 0; transition: opacity 0.3s; z-index: 500; box-shadow: 0 8px 24px rgba(0,0,0,0.5); text-align: center; max-width: 85%; }
.toast.show { opacity: 1; }

#que-hint-text { color: #ff8c8c; font-size: 13px; font-weight: bold; margin-top: 5px; text-align: center; }
.tile.reaction-highlight {
    transform: translateY(-15px);
    filter: drop-shadow(0 0 12px #ffaa00);
    z-index: 30;
    position: relative;
}
.tile.reaction-highlight img {
    outline: 3px solid #ffaa00;
    outline-offset: -2px;
    animation: pulse-gold 0.6s infinite alternate;
}
@keyframes pulse-gold {
    from { box-shadow: 0 0 6px #ffaa00; }
    to { box-shadow: 0 0 18px #ffaa00; }
}
/* 设置面板样式 */
.modal-panel {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 85%; max-width: 380px;
    background: linear-gradient(145deg, #142e33, #0f2226);
    border: 2px solid #c79a5e; border-radius: 16px; z-index: 600;
    padding: 20px 25px; box-shadow: 0 15px 50px rgba(0,0,0,0.9);
    color: #a4c9c0;
}
.settings-content { display: flex; flex-direction: column; gap: 15px; margin-top: 15px;}
.set-row { 
    display: flex; justify-content: space-between; align-items: center; 
    background: rgba(0,0,0,0.3); padding: 10px 15px; 
    border-radius: 8px; border: 1px solid #2d4a50;
}
.set-row label { display: flex; align-items: center; gap: 10px; font-weight: bold; color: #e0e0e0; font-size: 14px;}
.set-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #c79a5e; cursor: pointer; }
.set-row input[type="range"] { width: 110px; accent-color: #c79a5e; cursor: pointer; }
.set-row select { 
    background: #1a2a2f; color: #f5d742; border: 1px solid #4a6b73; 
    padding: 5px 10px; border-radius: 6px; outline: none; font-weight: bold; cursor: pointer;
}
/* 结算面板滚动条美化 - 极细半透明，融入游戏风格 */
#result-panel {
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;                  /* Firefox 滚动条宽度 */
    scrollbar-color: rgba(199, 154, 94, 0.5) transparent; /* Firefox 滚动条颜色 */
}
#result-panel::-webkit-scrollbar {
    width: 4px;                            /* 垂直滚动条宽度 */
    height: 4px;                           /* 水平滚动条高度（备用） */
}
#result-panel::-webkit-scrollbar-track {
    background: transparent;               /* 轨道完全透明 */
}
#result-panel::-webkit-scrollbar-thumb {
    background: rgba(199, 154, 94, 0.5);   /* 滑块颜色，与金色边框呼应 */
    border-radius: 4px;
}
#result-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(199, 154, 94, 0.8);   /* 悬停时加深，便于交互 */
}
/* 设置按钮容器：下移并透明化 */
#settings-btn-container {
    top: 70px !important;        /* 原为 15px，下移避免遮挡对家牌 */
    right: 15px;
    z-index: 350;
}

/* 设置按钮本身：只有半透明齿轮，无背景无边框无文字 */
#settings-btn-container .action-btn {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 5px 8px;
    font-size: 30px;            /* 齿轮大小 */
    color: rgba(255, 255, 255, 0.35); /* 半透明，不刺眼 */
    transition: color 0.2s ease;
    line-height: 1;
}

#settings-btn-container .action-btn:hover {
    color: rgba(255, 255, 255, 0.8); /* 悬停时更亮，便于交互 */
}

/* 如果希望点击区域更大但视觉不扩大，可以用伪元素，但现有 padding 已经足够 */