/* #Script 2.5 - includes/777.css - 骰宝游戏 */
* {
    box-sizing: border-box;
}

* {
    border: 0;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: linear-gradient(160deg, #1a472a 0%, #2d5a3d 40%, #1e3d2a 100%);
    min-height: 100vh;
    padding: 20px 10px 40px;
}

/* 主容器：overflow 包住浮动，不限制高度，白框随内容增高、页脚不重叠 */
#mn {
    margin: 0 auto;
    text-align: center;
    max-width: 720px;
    max-height: none;
    background: linear-gradient(180deg, #faf8f3 0%, #f5f0e6 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(212,174,92,0.3);
    padding: 24px 20px 32px;
    overflow: auto;
}

/* 游戏说明 */
#yxp {
    top: 24px;
    left: 24px;
    color: #1a472a;
    font-size: 13px;
    font-weight: bold;
    position: absolute;
    padding: 8px 14px;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    border: 1px solid rgba(26,71,42,0.2);
    transition: background 0.2s, box-shadow 0.2s;
}
#yxp:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

#yxsm {
    display: none;
    top: 52px;
    left: 24px;
    width: 280px;
    color: #444;
    font-size: 13px;
    text-align: left;
    position: absolute;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    border: 1px solid rgba(212,174,92,0.4);
    line-height: 1.6;
    z-index: 100;
}
#yxsm table {
    border: none !important;
}
#yxsm td {
    border: none !important;
    padding: 4px 0 !important;
    vertical-align: top;
}

/* 主表格 */
#mn table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0 auto;
}

#mn table table {
    border: none;
}

/* 游戏牌桌表格：固定列宽，避免鼠标移入移出时卡片左右位移 */
#yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table {
    table-layout: fixed;
    width: 630px;
}
#yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table td {
    overflow: hidden;
}

/* 顶部栏：logo + 骰子 + 余额 */
#yaoshaizi > table > tbody > tr:first-child td table {
    border: none !important;
}
#yaoshaizi > table > tbody > tr:first-child td table td {
    border: none !important;
    vertical-align: middle !important;
}

/* 骰子展示区 */
#mn table.dice-display {
    background: linear-gradient(180deg, #0a6b1a 0%, #089110 50%, #06700e 100%);
    border-radius: 10px;
    padding: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 3px 8px rgba(0,0,0,0.25);
    border: none;
}
#mn table.dice-display td {
    border: none;
    padding: 2px;
}
#mn #num1, #mn #num2, #mn #num3 {
    display: block;
    border-radius: 6px;
    background: #fff;
}

/* 余额与下注 */
#yaoshaizi th {
    font-size: 13px;
    color: #5c4a2a;
    padding: 4px 8px !important;
    border: none !important;
    background: transparent !important;
}
#yaoshaizi input#itotal {
    width: 90px;
    padding: 8px 10px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #d4ae5c;
    border-radius: 8px;
    background: #fff;
    color: #333;
}
#yaoshaizi input#icur {
    min-width: 120px;
    width: 140px;
    padding: 8px 10px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #d4ae5c;
    border-radius: 8px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

/* 投注格：固定宽高 + 筹码绝对定位，避免悬停/选中时卡片上下或左右移动 */
#mn td[id^="wei"], #mn td[id^="he"], #mn td#da, #mn td#xi {
    background: linear-gradient(180deg, #e8d5a3 0%, #d4ae5c 50%, #c49b45 100%) !important;
    border: 2px solid rgba(139,90,43,0.35) !important;
    border-radius: 10px;
    padding: 6px !important;
    width: 90px;
    max-width: 90px;
    min-width: 90px;
    min-height: 100px;
    height: 100px;
    vertical-align: top !important;
    transition: box-shadow 0.2s, background 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    box-sizing: border-box;
}
#mn td[id^="wei"] > div, #mn td[id^="he"] > div, #mn td#da > div, #mn td#xi > div {
    position: relative;
    min-height: 88px;
}
#mn td[id^="wei"]:hover, #mn td[id^="he"]:hover, #mn td#da:hover, #mn td#xi:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    background: linear-gradient(180deg, #f0e2b8 0%, #e0c870 50%, #d4ae5c 100%) !important;
}

/* 中间标题格（骰宝小游戏 / 你赢了·输了）：固定行高，初始不显示“你赢/输了” */
#mn td:not([id]) {
    border: none !important;
    background: transparent !important;
    padding: 4px 2px !important;
    height: 58px;
    min-height: 58px;
    vertical-align: middle !important;
}
/* PC 端：合并后的「骰宝小游戏」单格与其它标题格一致，文字横排居中 */
.shaibao-title-cell {
    border: none !important;
    background: transparent !important;
    padding: 4px 2px !important;
    height: 58px;
    min-height: 58px;
    vertical-align: middle !important;
    text-align: center !important;
}
.shaibao-title-inner {
    display: block;
    text-align: center;
}
.shaibao-title-cell #wely,
.shaibao-title-cell #weli,
.shaibao-title-cell #welc,
.shaibao-title-cell #weld,
.shaibao-title-cell #welo {
    display: inline;
}
#wely, #weli, #welc, #weld, #welo {
    display: block;
    color: #1a472a;
    font-size: 42px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    letter-spacing: 2px;
}
.shaibao-title-cell #wely,
.shaibao-title-cell #weli,
.shaibao-title-cell #welc,
.shaibao-title-cell #weld,
.shaibao-title-cell #welo {
    display: inline !important;
}
/* 初始状态隐藏“你/赢/输/了”，仅摇骰出结果后由 JS 显示 */
#you, #win, #lost, #le {
    display: none;
    font-size: 42px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
#you, #win, #le { color: #1a7a2e; }
#lost { color: #b52a2a; }

/* 投注格内文字 */
.bowei {
    font-size: 24px;
    font-family: inherit;
    width: 80px;
    color: #5c3d1f;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.bobao {
    font-size: 34px;
    font-family: inherit;
    width: 80px;
    color: #5c3d1f;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.bopei {
    font-size: 16px;
    font-family: inherit;
    width: 80px;
    color: #6b4e2a;
    text-align: center;
    font-weight: bold;
}

/* 筹码图：绝对定位，显示时不撑高单元格，避免卡片跳动 */
.ya1 {
    display: none;
    position: absolute;
    right: 6px;
    bottom: 6px;
    border: none;
}

/* 赢时高亮（由 JS 设置 backgroundColor） */
#mn td[id].glow {
    opacity: 0.9;
}

/* Start 按钮区（牌桌下方居中） */
.start-row {
    padding-top: 20px !important;
    text-align: center;
    border: none !important;
    vertical-align: middle !important;
}
.start-row .start-btn,
#mn input[type="image"][name="submit"] {
    border-radius: 12px;
    padding: 4px;
    transition: filter 0.15s;
}
.start-row .start-btn:hover,
#mn input[type="image"][name="submit"]:hover {
    filter: brightness(1.08);
}

/* 电脑端：表格内的 Start 行不显示（仅窄屏用） */
.game-table-start-row {
    display: none;
}

/* 页脚 */
.shaibao-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(212,174,92,0.4);
    font-size: 13px;
    color: #6b5a3a;
}
.shaibao-footer a {
    color: #089110;
    text-decoration: none;
}
.shaibao-footer a:hover {
    text-decoration: underline;
}

/* 表格边框统一（仅非游戏格） */
table, tr, td, th {
    border: none;
}

#mn .board {
    float: left;
}

.glow {
    filter: Alpha(opacity=10);
    -moz-opacity: .1;
    opacity: 0.5;
}

/* ========== 手机端（≤768px）游戏页：单列、不重叠、顺序固定 ========== */
@media (max-width: 768px) {
    /* 防止字体被放大导致错位 */
    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    /* 主容器：占满视口，页脚固定底部，牌桌区可滚动不重叠 */
    #mn {
        max-width: 100%;
        min-height: 100vh;
        padding: 12px 10px 16px;
        padding-bottom: 16px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        box-sizing: border-box;
    }
    /* 取消所有表格布局与固定宽高，避免乱序 */
    #mn table,
    #mn table table,
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table {
        table-layout: auto !important;
        width: 100% !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table td {
        overflow: visible !important;
    }
    #mn .board {
        float: none !important;
    }
    /* 游戏说明：进入文档流 */
    .shaibao-mobile-top {
        order: 1;
        flex: 0 0 auto;
        margin-bottom: 8px;
    }
    #yxp {
        position: static !important;
        left: auto !important;
        top: auto !important;
        margin: 0 auto 12px;
        display: block;
        text-align: center;
    }
    #yxsm {
        position: fixed !important;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
        max-height: 80vh;
        overflow: auto;
        z-index: 100;
    }
    /* 表单区：占据中间空间并可滚动，页脚始终在底部不重叠 */
    .shaibao-mobile-bar {
        order: 0;
        flex: 1 1 0;
        min-height: 0;
        width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }
    /* 牌桌网格/JS wrap 最小高度，避免白框只盖第一行、卡片被裁切 */
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid {
        min-height: 520px;
    }
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row {
        min-height: 54px;
    }
    #yaoshaizi,
    #yaoshaizi .shaibao-main {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    #yaoshaizi .shaibao-main > tbody {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        width: 100% !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) {
        flex: 1 1 0 !important;
        min-height: 280px !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td {
        height: 100% !important;
    }
    /* 顶部栏：第1行 红色LOGO(左)+骰子(中)+游戏说明(右)，第2行 您的余额+当前下注 */
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table,
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody {
        display: block !important;
        width: 100% !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr,
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    /* 第1行：LOGO 左，骰子 中，游戏说明 右 */
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr > td:nth-child(1),
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr > td:nth-child(1) {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        display: block !important;
        text-align: left;
        padding: 4px 6px !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr > td:nth-child(2),
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr > td:nth-child(2) {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 4px 6px !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr > td:nth-child(3),
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr > td:nth-child(3) {
        flex: 0 0 auto !important;
        display: block !important;
        text-align: right;
        padding: 4px 6px !important;
        vertical-align: middle !important;
    }
    /* 余额区换行到下一行 */
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr > td:nth-child(4),
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr > td:nth-child(4) {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        box-sizing: border-box !important;
        order: 10 !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr > td:nth-child(5),
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr > td:nth-child(5) {
        display: none !important;
    }
    /* 手机端：红色主 LOGO（原位置） */
    #yaoshaizi .shaibao-main > tbody > tr:first-child .shaibao-logo-img {
        filter: brightness(0.92) saturate(2) hue-rotate(-25deg);
    }
    /* 游戏说明缩小放在骰子右侧 */
    .shaibao-game-help-btn {
        font-size: 12px;
        color: #5c4a2a;
        cursor: pointer;
        text-decoration: underline;
        white-space: nowrap;
    }
    /* 隐藏顶部大块“游戏说明”，改用第一行右侧小入口 */
    .shaibao-mobile-top #yxp {
        display: none !important;
    }
    /* 顶部栏与牌桌之间留足空，避免余额/下注数字与牌卡重叠；余额区与骰子之间留空 */
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td {
        margin-bottom: 20px !important;
        padding-bottom: 0 !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr > td.shaibao-balance-cell,
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr > td.shaibao-balance-cell,
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tbody > tr > td:nth-child(4),
    #yaoshaizi .shaibao-main > tbody > tr:first-child > td > table > tr > td:nth-child(4) {
        margin-top: 10px !important;
        padding-top: 6px !important;
        border-top: 1px solid rgba(212,174,92,0.25) !important;
    }
    /* 余额/下注：手机端第一行两句话，第二行两个显示区，节省空间 */
    #mn .shaibao-balance-cell {
        text-align: left !important;
        padding: 10px 12px 0 12px !important;
        max-width: none !important;
        display: block !important;
    }
    #mn .shaibao-balance-table {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        width: 100% !important;
        margin-bottom: 4px !important;
        gap: 2px 12px !important;
    }
    #mn .shaibao-balance-table tbody {
        display: contents !important;
    }
    #mn .shaibao-balance-table tr {
        display: contents !important;
    }
    #mn .shaibao-balance-table th:nth-child(1) { grid-row: 1; grid-column: 1; }
    #mn .shaibao-balance-table th:nth-child(2) { grid-row: 1; grid-column: 2; }
    #mn .shaibao-balance-table td:nth-child(1) { grid-row: 2; grid-column: 1; }
    #mn .shaibao-balance-table td:nth-child(2) { grid-row: 2; grid-column: 2; }
    #mn .shaibao-balance-table th,
    #mn .shaibao-balance-table td {
        display: block !important;
        text-align: left !important;
        padding: 2px 0 6px 0 !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
    }
    #mn .shaibao-balance-table th {
        font-size: 14px;
        color: #333;
    }
    #mn .shaibao-balance-table tr:last-child td {
        padding-top: 0 !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:first-child a img {
        max-width: 120px;
        height: auto;
    }
    /* 三个骰子保持在一个绿框内，不拆开 */
    #mn .dice-display {
        display: table !important;
        margin: 8px auto;
        width: 140px !important;
        border-collapse: collapse;
    }
    #mn .dice-display tbody {
        display: table-row-group !important;
    }
    #mn .dice-display tr {
        display: table-row !important;
    }
    #mn .dice-display td {
        display: table-cell !important;
        vertical-align: middle;
        padding: 4px !important;
    }
    #mn #num1, #mn #num2, #mn #num3 {
        width: 36px !important;
        max-width: 40px;
        height: auto;
        display: block !important;
    }
    #yaoshaizi input#itotal,
    #yaoshaizi input#icur {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 10px 12px !important;
        font-size: 15px !important;
        box-sizing: border-box !important;
    }
    #mn .shaibao-balance-table input#itotal,
    #mn .shaibao-balance-table input#icur {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }
    /* 窄屏：隐藏主表 Start 行，使用表格内 Start（在 10、11 中间） */
    #yaoshaizi .shaibao-main > tbody > tr.start-row {
        display: none !important;
    }
    .game-table-start-row {
        display: contents !important;
    }
    /* JS 构建的 9×3 网格（窄屏时用，避免 display:contents 不生效） */
    #shaibao-board-mobile-wrap {
        display: none;
        width: 100%;
        margin-bottom: 12px;
    }
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
        margin-bottom: 0;
      }
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-cell {
        flex: 1;
        min-width: 0;
        padding: 0;
        margin: -2px;
      }
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:first-child .shaibao-grid-cell,
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(2) .shaibao-grid-cell,
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(3) .shaibao-grid-cell,
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(5) .shaibao-grid-cell,
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(6) .shaibao-grid-cell,
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(7) .shaibao-grid-cell,
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(8) .shaibao-grid-cell,
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(9) .shaibao-grid-cell { flex: 0 0 33.333%; }
    #shaibao-board-mobile-wrap.shaibao-board-mobile-grid .shaibao-grid-row:nth-child(4) .shaibao-grid-cell { flex: 0 0 20%; }
    /* 第二行：牌桌一屏内显示全部 9 行，无内部滚动条 */
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td {
        display: block !important;
        width: 100% !important;
        overflow: hidden !important;
        flex: 1 1 0 !important;
        min-height: 260px !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        padding-bottom: 8px !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table > tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: repeat(9, minmax(36px, 1fr));
        row-gap: 10px !important;
        column-gap: 10px !important;
        height: 100% !important;
        min-height: 0 !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table > tr {
        display: contents !important;
    }
    /* 每格：独立一层，避免与相邻格重叠 */
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table > tbody > tr > td {
        display: block !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        position: relative !important;
    }
    /* 手机端牌卡：一屏内显示，无卡片内滚动条 */
    #mn td[id^="wei"],
    #mn td[id^="he"],
    #mn td#da,
    #mn td#xi {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        min-height: 0 !important;
        padding: 4px 6px !important;
        border-width: 2px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        background: linear-gradient(180deg, #e8d5a3 0%, #d4ae5c 50%, #c49b45 100%) !important;
        border-color: rgba(139,90,43,0.35) !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
        isolation: isolate !important;
    }
    /* 行1：111,222,333 */
    #mn td#wei1 { grid-row: 1; grid-column: 1; }
    #mn td#wei2 { grid-row: 1; grid-column: 2; }
    #mn td#wei3 { grid-row: 1; grid-column: 3; }
    /* 行2：444,555,666 */
    #mn td#wei4 { grid-row: 2; grid-column: 1; }
    #mn td#wei5 { grid-row: 2; grid-column: 2; }
    #mn td#wei6 { grid-row: 2; grid-column: 3; }
    /* 行3：大,全围,小 */
    #mn td#da { grid-row: 3; grid-column: 1; }
    #mn td#wei { grid-row: 3; grid-column: 2; }
    #mn td#xi { grid-row: 3; grid-column: 3; }
    /* 行4：骰宝小游戏（单格跨整行、居中） */
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td.shaibao-title-cell {
        grid-row: 4;
        grid-column: 1 / -1;
    }
    /* 行5：4,5,6 */
    #mn td#he4 { grid-row: 5; grid-column: 1; }
    #mn td#he5 { grid-row: 5; grid-column: 2; }
    #mn td#he6 { grid-row: 5; grid-column: 3; }
    /* 行6：7,8,9 */
    #mn td#he7 { grid-row: 6; grid-column: 1; }
    #mn td#he8 { grid-row: 6; grid-column: 2; }
    #mn td#he9 { grid-row: 6; grid-column: 3; }
    /* 行7：10,Start,11 */
    #mn td#he10 { grid-row: 7; grid-column: 1; }
    #mn td#he11 { grid-row: 7; grid-column: 3; }
    /* 行8：12,13,14 */
    #mn td#he12 { grid-row: 8; grid-column: 1; }
    #mn td#he13 { grid-row: 8; grid-column: 2; }
    #mn td#he14 { grid-row: 8; grid-column: 3; }
    /* 行9：15,16,17 */
    #mn td#he15 { grid-row: 9; grid-column: 1; }
    #mn td#he16 { grid-row: 9; grid-column: 2; }
    #mn td#he17 { grid-row: 9; grid-column: 3; }
    /* 第1、2、3、5、6、7、8、9行只占前3列，第4行占5列：用 grid-column 已指定 */
    /* 标题格、Start 格高度与卡片行一致 */
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table > tbody > tr > td:not([id]):not(.start-in-table) {
        height: 100%;
        min-height: 28px;
    }
    /* 骰宝小游戏：整行居中（占满网格整行） */
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table > tbody > tr > td.shaibao-title-cell {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 0 4px !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table .shaibao-title-inner {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 0 2px !important;
    }
    #wely, #weli, #welc, #weld, #welo {
        font-size: 14px;
        font-weight: bold;
    }
    /* 你赢了/你输了：与卡片行高一致 */
    #you, #win, #lost, #le {
        font-size: 10px !important;
    }
    /* Start 与其它卡片同风格：红底银框、圆角，占一格 */
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table .start-in-table {
        grid-column: 2 !important;
        grid-row: 7 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
        align-self: stretch !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        background: linear-gradient(180deg, #c62828 0%, #b71c1c 50%, #8e0000 100%) !important;
        border: 2px solid #e0e0e0 !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 6px rgba(0,0,0,0.15) !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }
    #yaoshaizi .shaibao-main > tbody > tr:nth-child(2) > td > table .start-in-table .start-card-btn {
        width: 100% !important;
        height: 100% !important;
        min-height: 28px !important;
        margin: 0 !important;
        padding: 0 4px !important;
        background: transparent !important;
        border: none !important;
        color: #fff !important;
        font-size: 11px !important;
        font-weight: bold !important;
        cursor: pointer !important;
    }
    /* 投注格内：单行居中、不出现滚动条 */
    #mn td[id^="wei"] > div,
    #mn td[id^="he"] > div,
    #mn td#da > div,
    #mn td#xi > div {
        position: relative !important;
        min-height: 22px !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 6px 0 0 !important;
        box-sizing: border-box !important;
        min-width: 0 !important;
        overflow: hidden !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
    }
    #mn td[id^="wei"] .board,
    #mn td[id^="he"] .board,
    #mn td#da .board,
    #mn td#xi .board {
        float: none !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    #mn td[id^="wei"] .board .bowei,
    #mn td[id^="wei"] .board .bopei,
    #mn td[id^="he"] .board .bobao,
    #mn td[id^="he"] .board .bopei,
    #mn td#da .board .bobao,
    #mn td#da .board .bopei,
    #mn td#xi .board .bobao,
    #mn td#xi .board .bopei {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }
    #mn td[id^="wei"] .ya1,
    #mn td[id^="he"] .ya1,
    #mn td#da .ya1,
    #mn td#xi .ya1 {
        position: absolute !important;
        right: 1px !important;
        bottom: 1px !important;
        max-width: 16px !important;
        max-height: 16px !important;
    }
    .bowei, .bobao { font-size: 11px !important; font-weight: bold !important; color: #5c3d1f !important; text-shadow: 0 1px 0 rgba(255,255,255,0.5) !important; }
    .bopei { font-size: 9px !important; font-weight: bold !important; color: #6b4e2a !important; }
    .shaibao-footer {
        order: 2;
        flex: 0 0 auto;
        margin-top: 0;
        padding: 16px 0 0;
        border-top: 1px solid rgba(212,174,92,0.4);
        clear: both;
    }
}
