/* 俄罗斯轮盘（欧式轮盘赌）：casino 复古风格
   布局：押注屏/转盘屏 双屏结构
   - 手机竖屏：押注屏整屏一屏看全（竖版押注桌 6列×16行），点开始跳入转盘屏
   - 手机横屏：标准赌场排版——左侧 3D 转盘常驻 + 右侧押注区（LED/横版押注桌 14列×5行/筹码+操作键）
   - 电脑端(≥900px)：与手机横屏同款排版（左 3D 转盘常驻 + 右押注区三行网格）
   - 横屏/电脑通用：顶栏"全屏"键切浏览器全屏（隐藏地址栏）；"投注/开奖/同屏"键三态独显切换——
     押注独显=押注区撑满整屏（押注格放大好按），轮盘独显=左侧大轮盘 + 右侧我的记录栏 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #04180b radial-gradient(circle at 50% 0%, #0d3a1d, #031207 70%);
  color: #ffe9b0;
  user-select: none;
  overflow: hidden;
}
.view { min-height: 100%; }

/* ---------- 登录 / 注册 ---------- */
#loginView { display: flex; align-items: center; justify-content: center; padding: 24px 16px; min-height: 100vh; min-height: 100dvh; overflow-y: auto; }
.login-box {
  width: 100%; max-width: 360px;
  background: linear-gradient(160deg, #12452a, #072415);
  border: 2px solid #d4a017; border-radius: 16px;
  padding: 28px 22px; text-align: center;
  box-shadow: 0 0 30px rgba(212, 160, 23, .25);
}
.logo { font-size: 30px; color: #ffd75e; text-shadow: 0 2px 8px #000; }
.logo-sub { font-size: 12px; color: #c9a25e; margin: 6px 0 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button {
  flex: 1; padding: 9px 0; border: 1px solid #8a6a1f; border-radius: 8px;
  background: #072415; color: #c9a25e; font-size: 15px;
}
.tabs button.on { background: #d4a017; color: #072415; font-weight: 700; }
.login-box input, .modal-box input {
  width: 100%; padding: 11px 12px; margin-bottom: 10px;
  border: 1px solid #8a6a1f; border-radius: 8px;
  background: #031207; color: #ffe9b0; font-size: 15px; outline: none;
}
.btn-big {
  width: 100%; padding: 12px 0; border: none; border-radius: 10px;
  background: linear-gradient(180deg, #ff5f4d, #c21807); color: #fff;
  font-size: 17px; font-weight: 700; letter-spacing: 4px;
  box-shadow: 0 3px 0 #7a0e02;
}
.btn-big:active { transform: translateY(2px); box-shadow: none; }
.msg { min-height: 20px; font-size: 13px; color: #ffb3a7; margin-top: 8px; }
.tip { font-size: 11px; color: #8a6a1f; margin-top: 10px; }

/* ---------- 顶栏 ---------- */
#gameView {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}
.topbar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: #072415; border-bottom: 1px solid #8a6a1f;
}
.me-avatar { font-size: 22px; }
.me-name { font-size: 14px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-btns { display: flex; gap: 6px; }
.btn-mini {
  padding: 6px 10px; border: 1px solid #8a6a1f; border-radius: 6px;
  background: #0d3a1d; color: #ffe9b0; font-size: 12px;
}
.btn-mini:active { background: #d4a017; color: #072415; }

/* ---------- 双屏容器 ---------- */
#screens { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- 押注屏：整屏一屏看全，零滚动 ---------- */
#betScreen { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* LED 记分条（押注屏顶部） */
#ledBar {
  flex: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px;
  margin: 6px 8px 0; padding: 5px 12px;
  background: #050505; border: 1px solid #442; border-radius: 10px;
  box-shadow: inset 0 0 12px #000;
}
.led-cell { flex: 1; display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.led-cell label { font-size: 11px; color: #888; flex: none; }
.led-cell span {
  font-family: "Courier New", monospace; font-weight: 700;
  font-size: clamp(14px, 4.5vw, 20px); color: #ff3b30;
  text-shadow: 0 0 8px rgba(255, 59, 48, .8);
  white-space: nowrap; overflow: hidden;
}
#ledWin { color: #3dff6e; text-shadow: 0 0 8px rgba(61, 255, 110, .8); }
.led-msg {
  min-height: 15px; font-size: 11px; color: #ffd75e; text-align: center;
  text-shadow: 0 0 6px rgba(255, 215, 94, .6);
}
#ledBar .led-msg { width: 100%; }

/* 筹码 */
#chips { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 10px 2px; }
.chips-label { font-size: 12px; color: #c9a25e; }
.chip {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: 3px dashed rgba(255, 255, 255, .75);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff;
  box-shadow: 0 2px 4px #000;
}
.chip.c1 { background: #666; } .chip.c5 { background: #c21807; }
.chip.c10 { background: #0b5ed7; } .chip.c50 { background: #0f8a3d; }
.chip.c100 { background: #7b2fbe; }
.chip.on { outline: 3px solid #ffd75e; transform: scale(1.1); }

/* ---------- 押注桌（绿呢面）：竖版/横版两套网格，按屏幕方向切换 ---------- */
#betTable { flex: 1; min-height: 0; padding: 4px 8px; }
.bt-grid {
  display: grid; gap: 2px; height: 100%;
  background: #0b4d24;             /* 绿呢面 */
  border: 2px solid #d4a017; border-radius: 10px;
  padding: 4px;
}
/* 竖版（手机竖屏）：6 列 × 16 行
   第1行=0（通跨6列）；第2~13行=1~36（每行3个数字，每格跨2列）；
   第14行=3个打注；第15行=3个列注；第16行=6个外围注 */
.bt-grid-v { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(16, 1fr); }
/* 横版（手机横屏/电脑）：经典 14 列 × 5 行 */
.bt-grid-h { grid-template-columns: repeat(14, 1fr); grid-template-rows: repeat(5, 1fr); }
.bt-grid-h { display: none; }       /* 默认竖屏：只显示竖版 */
.bet-cell {
  position: relative; min-height: 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 233, 176, .45); border-radius: 4px;
  color: #fff; font-weight: 800; font-size: clamp(10px, 3.2vw, 15px);
  touch-action: none;              /* 长按连押：禁止浏览器长按弹菜单/滚动手势 */
  -webkit-user-select: none; user-select: none;
  text-shadow: 0 1px 2px #000; overflow: hidden;
}
.bet-cell:active { filter: brightness(1.6); }
.bet-cell .bc-text { pointer-events: none; white-space: nowrap; }
.bc-red { background: #a41212; }
.bc-black { background: #161616; }
.bc-green { background: #0f8a3d; }
.bc-out { background: #0b4d24; font-size: clamp(9px, 2.6vw, 12px); font-weight: 700; }
.bc-out.bc-red { background: #a41212; }
.bc-out.bc-black { background: #161616; }
/* 已押金额角标（data-bet 标识押注类型，双网格共存不冲突） */
.bet-badge {
  position: absolute; top: -2px; right: -2px; z-index: 2;
  min-width: 18px; padding: 0 4px;
  background: #ffd75e; color: #7a0e02; border-radius: 9px;
  font-size: 10px; font-weight: 800; text-align: center;
  display: none; pointer-events: none;
}
.bet-badge.show { display: block; }

/* 操作键 */
#actions {
  flex: none; display: flex; gap: 8px;
  padding: 6px 10px calc(10px + env(safe-area-inset-bottom));
}
.btn-act {
  flex: 1; padding: 12px 0; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 800; letter-spacing: 3px; color: #fff;
}
.btn-act:active { transform: translateY(2px); }
.btn-red { background: linear-gradient(180deg, #ff5f4d, #c21807); box-shadow: 0 3px 0 #7a0e02; flex: 2; }
.btn-gold { background: linear-gradient(180deg, #ffd75e, #d4a017); box-shadow: 0 3px 0 #8a6a1f; color: #4a2c00; }
.btn-green { background: linear-gradient(180deg, #3dff6e, #0f8a3d); box-shadow: 0 3px 0 #075c26; color: #043015; }
.btn-gray { background: linear-gradient(180deg, #888, #555); box-shadow: 0 3px 0 #333; }
.btn-blue { background: linear-gradient(180deg, #4da3ff, #0b5ed7); box-shadow: 0 3px 0 #07408f; }
.btn-act:disabled { opacity: .45; }

/* ---------- 转盘屏：3D 真实轮盘（Three.js WebGL 实时渲染） ----------
   盘面为 js 程序化建模的 3D 轮盘：木质轮缘木碗 → 象牙色滚珠通道（外高内低，球在此飞转）→
   斜坡锥面 → 37 个数字袋（按真实轮序，金属隔板分隔）→ 内锥木面 → 金色中央转塔。
   开奖号码与提示语放在盘外上方 LED 横条，盘面以内无任何 DOM 动态文字；
   滚珠从盘外抛进最外圈通道飞转减速、螺旋掉进里圈、弹跳落袋。 */
#wheelScreen {
  display: none;                     /* 默认隐藏；js 按 手机/电脑 布局控制显隐 */
  flex: 1; min-height: 0;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 8px;
}
#wheelCol {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-width: 0; min-height: 0; max-width: 100%;
}
/* 盘外 LED 横条：开奖号码 + 提示语（从圆心移出盘面） */
#wheelLed {
  flex: none; display: flex; align-items: center; gap: 12px;
  max-width: 100%; padding: 4px 14px;
  background: #050505; border: 1px solid #442; border-radius: 10px;
  box-shadow: inset 0 0 12px #000;
}
.led-result {
  font-family: "Courier New", monospace; font-weight: 900;
  font-size: clamp(22px, 6.5vw, 36px); line-height: 1;
  color: #ffd75e; text-shadow: 0 0 10px rgba(255, 215, 94, .8);
  min-width: 1.2em; text-align: center;
}
.led-result.red { color: #ff5147; text-shadow: 0 0 10px rgba(255, 81, 71, .9); }
.led-result.black { color: #e8e8e8; text-shadow: 0 0 10px rgba(255, 255, 255, .7); }
.led-result.green { color: #3dff6e; text-shadow: 0 0 10px rgba(61, 255, 110, .9); }
#wheelMsg { flex: 1; min-width: 0; font-size: 11px; text-align: left; }
/* 木质轮缘（盘面外圈木框） */
#wheelWrap {
  flex: none;
  width: min(92vw, calc(100dvh - 216px));
  aspect-ratio: 1;
  padding: 8px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 42%),
    radial-gradient(circle, #7a5322 0%, #5d3d14 55%, #3d2808 100%);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(212, 160, 23, .35),
    inset 0 2px 6px rgba(255, 230, 160, .25), inset 0 -4px 10px #000;
}
/* 3D 盘面挂载容器：圆形裁切 WebGL 画布（3D 场景建模/贴图/灯光全部由 js 程序化生成） */
#wheel {
  position: relative; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  border: 2px solid #d4a017;
  background: radial-gradient(circle, #12351c 0%, #07210f 70%, #04140a 100%);
  box-shadow: inset 0 0 30px #000;
}
#wheel canvas {
  display: block; width: 100% !important; height: 100% !important;
  touch-action: none;              /* 单指拖转/双指捏合缩放 3D 视角，不触发页面滚动缩放手势 */
  cursor: grab;
}
#wheel canvas:active { cursor: grabbing; }
#btnBackBet { flex: none; width: min(92vw, 320px); }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-box {
  width: 100%; max-width: 360px; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(160deg, #12452a, #072415);
  border: 2px solid #d4a017; border-radius: 16px;
  padding: 20px 18px; text-align: center;
}
.modal-box h3 { color: #ffd75e; margin-bottom: 12px; }
.modal-box .btn-act { margin-top: 12px; width: 100%; flex: none; }

/* 比倍（紧凑自适应：小屏零横向滚动，一屏看全所有按钮） */
#doubleModal { padding: 10px; }
#doubleModal .modal-box {
  max-width: 340px; padding: 14px 12px; max-height: 96vh; max-height: 96dvh;
}
#doubleModal .modal-box h3 { margin-bottom: 6px; font-size: 16px; }
.dbl-amount { font-size: 15px; } .dbl-amount b { color: #3dff6e; font-size: 20px; }
.dbl-times { font-size: 12px; color: #c9a25e; margin: 4px 0 6px; }
/* 比倍双骰舞台：3D CSS 立方体骰子（26-08-16 整改，gemini-code 同款效果，与 777 老虎机比倍同款），
   白骰子深色点（1 点/4 点为红色），开滚后多圈 3D 翻滚定格，下方亮出点数之和 */
.dbl-dice { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 8px auto 4px; min-height: 84px; }
/* 待开状态：灰色小问号（未猜大小时显示，3D 舞台隐藏） */
.dice.idle { font-size: clamp(28px, 9vw, 36px); font-weight: 900; color: rgba(255, 255, 255, .3); line-height: 1; user-select: none; }
/* 3D 舞台：--d 统一控制骰子尺寸（横屏弹窗内缩小），perspective 产生景深 */
.dice3d-stage { display: flex; justify-content: center; align-items: center; gap: 26px; perspective: 700px; }
.dice3d-box { --d: 64px; width: var(--d); height: var(--d); position: relative; }
.dice3d {
  width: 100%; height: 100%; position: absolute;
  transform-style: preserve-3d;
  transition: transform 1.5s cubic-bezier(.2, .8, .3, 1.1);  /* 翻滚定格缓冲（带回弹感） */
}
.face3d {
  position: absolute; width: var(--d); height: var(--d);
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  border-radius: calc(var(--d) * .18);
  box-shadow: inset 0 0 calc(var(--d) * .12) rgba(0, 0, 0, .15), 0 0 12px rgba(0, 0, 0, .35);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: calc(var(--d) * .1);
  border: 1px solid rgba(0, 0, 0, .08);
}
.pip {
  width: calc(var(--d) * .17); height: calc(var(--d) * .17);
  background: #1e293b; border-radius: 50%;
  align-self: center; justify-self: center;
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .4);
}
.pip.red { background: #ef4444; }
/* 立方体六面定位（translateZ = 边长一半） */
.f1 { transform: rotateY(0deg) translateZ(calc(var(--d) / 2)); }
.f2 { transform: rotateX(-90deg) translateZ(calc(var(--d) / 2)); }
.f3 { transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); }
.f4 { transform: rotateY(90deg) translateZ(calc(var(--d) / 2)); }
.f5 { transform: rotateX(90deg) translateZ(calc(var(--d) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
/* 各点数布局（1 居中 / 2、3 对角 / 4 四角 / 5 四角+中 / 6 两列） */
.f1 .pip:nth-child(1) { grid-area: 2 / 2; }
.f2 .pip:nth-child(1) { grid-area: 1 / 1; } .f2 .pip:nth-child(2) { grid-area: 3 / 3; }
.f3 .pip:nth-child(1) { grid-area: 1 / 1; } .f3 .pip:nth-child(2) { grid-area: 2 / 2; } .f3 .pip:nth-child(3) { grid-area: 3 / 3; }
.f4 .pip:nth-child(1) { grid-area: 1 / 1; } .f4 .pip:nth-child(2) { grid-area: 1 / 3; } .f4 .pip:nth-child(3) { grid-area: 3 / 1; } .f4 .pip:nth-child(4) { grid-area: 3 / 3; }
.f5 .pip:nth-child(1) { grid-area: 1 / 1; } .f5 .pip:nth-child(2) { grid-area: 1 / 3; } .f5 .pip:nth-child(3) { grid-area: 2 / 2; } .f5 .pip:nth-child(4) { grid-area: 3 / 1; } .f5 .pip:nth-child(5) { grid-area: 3 / 3; }
.f6 .pip:nth-child(1) { grid-area: 1 / 1; } .f6 .pip:nth-child(2) { grid-area: 2 / 1; } .f6 .pip:nth-child(3) { grid-area: 3 / 1; } .f6 .pip:nth-child(4) { grid-area: 1 / 3; } .f6 .pip:nth-child(5) { grid-area: 2 / 3; } .f6 .pip:nth-child(6) { grid-area: 3 / 3; }
/* 点数之和：金色；开小蓝色 / 开大红色 */
.dbl-sum {
  min-height: 38px; margin: 2px auto 0;
  font-family: "Courier New", monospace; font-weight: 900;
  font-size: clamp(24px, 8vw, 34px); color: #ffd75e;
  text-shadow: 0 0 8px rgba(255, 215, 94, .6);
}
.dbl-sum.small-n { color: #4da3ff; text-shadow: 0 0 8px rgba(77, 163, 255, .6); }
.dbl-sum.big-n { color: #ff5f4d; text-shadow: 0 0 8px rgba(255, 95, 77, .6); }
.dbl-btns { display: flex; gap: 8px; margin-top: 8px; width: 100%; }
.dbl-btns .btn-act {
  margin-top: 0; flex: 1 1 0; min-width: 0;   /* 等宽且允许压缩，绝不溢出 */
  padding: 12px 0; font-size: 15px; letter-spacing: 1px; white-space: nowrap;
}
.dbl-tip { font-size: 11px; color: #c9a25e; margin-top: 6px; }

/* 记录 */
.stat-line { font-size: 12px; color: #c9a25e; margin-bottom: 10px; line-height: 1.7; }
.history-list { max-height: 46vh; overflow-y: auto; text-align: left; font-size: 12px; }
.history-item {
  display: flex; gap: 6px; align-items: center;
  padding: 6px 4px; border-bottom: 1px dashed #552;
}
.history-item .h-t { color: #888; width: 86px; flex: none; }
.history-item .h-b { flex: 1; }
.history-item .h-w { font-weight: 700; }
.h-w.win { color: #3dff6e; } .h-w.lose { color: #888; }
.history-empty { text-align: center; color: #888; padding: 20px 0; }

/* 设置 */
.fld-label { display: block; text-align: left; font-size: 12px; color: #c9a25e; margin: 10px 0 4px; }
.fld-row { display: flex; gap: 8px; }
.fld-row input { flex: 1; margin-bottom: 0; }
.fld-row .btn-mini { flex: none; padding: 0 16px; }
.avatar-row { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-row span {
  font-size: 24px; padding: 4px; border: 2px solid transparent; border-radius: 8px; cursor: pointer;
}
.avatar-row span.on { border-color: #ffd75e; background: #0d3a1d; }

/* ---------- 右侧记录栏（默认隐藏；仅"轮盘独显"时由 js 显示：左大轮盘 + 右我的记录） ---------- */
#sidePanel {
  display: none; min-height: 0; overflow-y: auto;
  background: linear-gradient(160deg, #12452a, #072415);
  border: 2px solid #d4a017; border-radius: 16px;
  padding: 16px 14px;
}
#sidePanel h3 { color: #ffd75e; font-size: 16px; margin-bottom: 10px; }
#sidePanel .history-list { max-height: none; overflow-y: visible; font-size: 13px; }
#sidePanel .stat-line { font-size: 13px; }

/* ========== 手机横屏：标准赌场横屏排版（与竖屏完全不同）==========
   左侧 3D 转盘常驻（开奖原地开转，不再整屏跳转盘屏）＋ 右侧押注区三行网格：
   顶行 LED 记分条（积分/押注/中奖 + 提示语）→ 中行经典横版押注桌（14列×5行，
   0 在左端通跨、右端 2:1 列注、打注行、外围注行）→ 底行左筹码档、右操作键 */
@media (orientation: landscape) and (max-width: 899px) {
  #screens {
    flex-direction: row; align-items: stretch; gap: 6px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  }
  /* 左栏：3D 转盘（横屏与押注桌同屏常驻，高度撑满、宽度随盘方自动） */
  #wheelScreen { flex: 0 0 auto; padding: 0; gap: 0; }
  #wheelCol { height: 100%; gap: 4px; }
  #wheelLed { padding: 3px 10px; gap: 8px; }
  .led-result { font-size: clamp(16px, 5vh, 24px); }
  #wheelMsg { font-size: 10px; }
  #wheelWrap {
    width: auto; max-width: 46vw;             /* 方形盘，宽随高走且不超屏宽 46% */
    flex: 1; min-height: 0; aspect-ratio: 1;
    padding: 6px;
  }
  #btnBackBet { display: none !important; }   /* 横屏双区同屏，无需"返回押注" */
  /* 右栏：押注区（LED / 押注桌 / 筹码+操作键 三行） */
  #betScreen {
    flex: 1; min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 3px 6px;
  }
  #ledBar { grid-column: 1 / -1; grid-row: 1; margin: 0; padding: 3px 8px; gap: 1px 8px; }
  #ledBar .led-msg { min-height: 12px; font-size: 10px; }
  #betTable { grid-column: 1 / -1; grid-row: 2; padding: 0; min-height: 0; }
  .bt-grid-v { display: none; }
  .bt-grid-h { display: grid; }
  .bt-grid-h .bet-cell { font-size: clamp(9px, 3.4vh, 14px); }
  .bt-grid-h .bc-out { font-size: clamp(8px, 2.8vh, 12px); }
  /* 底行：左筹码档横排、右操作键横排（标准赌场底栏样式） */
  #chips { grid-column: 1; grid-row: 3; padding: 2px 0 0; gap: 5px; align-self: center; }
  .chips-label { font-size: 11px; }
  .chip { width: 30px; height: 30px; font-size: 11px; border-width: 2px; }
  #actions { grid-column: 2; grid-row: 3; padding: 2px 0 0; gap: 6px; align-self: center; }
  #actions .btn-act { flex: none; padding: 8px 14px; font-size: 13px; letter-spacing: 1px; }
  /* 独显切换（顶栏"投注/开奖/同屏"键，显隐由 js 控制，这里只管排版尺寸）：
     押注独显 = 押注区撑满整屏（押注格随整屏放大，数字更好点）；
     轮盘独显 = 左侧大轮盘 + 右侧我的记录栏（押注按键整屏不显示） */
  #screens.solo-bet #betScreen { flex: 1 1 auto; }
  #screens.solo-wheel #wheelScreen { flex: 1; min-width: 0; }
  #screens.solo-wheel #wheelCol { width: 100%; }
  #screens.solo-wheel #wheelWrap {
    flex: none; width: min(calc(100dvh - 104px), 100%); max-width: none;
  }
  #screens.solo-wheel #sidePanel { flex: 0 0 148px; padding: 8px; border-radius: 10px; }
  #screens.solo-wheel #sidePanel h3 { font-size: 12px; margin-bottom: 6px; }
  #screens.solo-wheel #sidePanel .stat-line { font-size: 10px; margin-bottom: 6px; line-height: 1.5; }
  #screens.solo-wheel #sidePanel .history-list { font-size: 10px; }
  #screens.solo-wheel .history-item .h-t { width: 62px; }
}

/* ========== 电脑端（≥900px）：与手机横屏同款排版——左侧 3D 转盘常驻 +
   右侧押注区三行网格（顶 LED / 中横版押注桌 / 底栏左筹码右操作键）；
   同样支持独显切换：押注独显=押注区撑满整屏，轮盘独显=左侧大轮盘 + 右侧我的记录栏 ========== */
@media (min-width: 900px) {
  #screens {
    flex-direction: row; align-items: stretch; gap: 12px;
    width: 100%; max-width: 1440px; margin: 0 auto; padding: 10px 14px;
  }
  /* 左栏：3D 转盘常驻（高撑满、宽随盘方自动，与手机横屏同一套排法） */
  #wheelScreen {
    display: flex;                     /* 电脑端转盘常驻，不隐藏 */
    flex: 0 0 auto; padding: 0; gap: 0;
  }
  #wheelCol { height: 100%; gap: 6px; }
  #wheelWrap {
    width: auto; max-width: 44vw;      /* 方形盘，宽随高走且不超屏宽 44% */
    flex: 1; min-height: 0; aspect-ratio: 1;
    padding: 8px;
  }
  #btnBackBet { display: none !important; }   /* 电脑端同屏，无需返回 */
  /* 右栏：押注区三行网格（LED / 押注桌 / 筹码+操作键，与手机横屏完全一致） */
  #betScreen {
    flex: 1; min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 6px 10px;
  }
  #ledBar { grid-column: 1 / -1; grid-row: 1; margin: 0; }
  #betTable { grid-column: 1 / -1; grid-row: 2; padding: 0; min-height: 0; }
  .bt-grid-v { display: none; }
  .bt-grid-h { display: grid; }
  .bt-grid-h .bet-cell { font-size: 14px; }
  .bt-grid-h .bc-out { font-size: 12px; }
  /* 底行：左筹码档横排、右操作键横排（标准赌场底栏样式） */
  #chips { grid-column: 1; grid-row: 3; padding: 4px 0 0; align-self: center; }
  #actions { grid-column: 2; grid-row: 3; padding: 4px 0 0; gap: 10px; align-self: center; }
  #actions .btn-act { flex: none; padding: 12px 24px; }
  /* 独显切换（显隐由 js 控制，这里只管排版尺寸）：
     押注独显 = 押注区撑满整屏；轮盘独显 = 左侧大轮盘 + 右侧我的记录栏 */
  #screens.solo-bet #betScreen { flex: 1 1 auto; }
  #screens.solo-wheel #wheelScreen { flex: 1; min-width: 0; }
  #screens.solo-wheel #wheelCol { width: 100%; }
  #screens.solo-wheel #wheelWrap {
    flex: none; width: min(calc(100dvh - 150px), 100%); max-width: none;
  }
  #screens.solo-wheel #sidePanel { flex: 0 0 290px; }
}

/* ---------- 手机横屏（26-08-16 新增）：比倍弹窗左右双栏排布——
   左栏 3D 双骰+点数之和，右栏 奖金/连击/消息/猜大小/收分返回，一屏看全不滚动 ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  #doubleModal .modal-box {
    max-width: 620px; max-height: 98vh; max-height: 98dvh; padding: 6px 16px 10px;
    display: grid; grid-template-columns: auto 1fr; column-gap: 22px; align-items: center;
    grid-template-areas:
      "h3    h3"
      "dice  amount"
      "dice  times"
      "dice  msg"
      "sum   guess"
      "sum   tip"
      "sum   act";
  }
  #doubleModal .modal-box h3 { grid-area: h3; margin-bottom: 2px; font-size: 14px; }
  #doubleModal .dbl-amount { grid-area: amount; font-size: 13px; }
  #doubleModal .dbl-amount b { font-size: 16px; }
  #doubleModal .dbl-times { grid-area: times; margin: 2px 0; }
  #doubleModal .dbl-dice { grid-area: dice; margin: 4px 0 2px; min-height: 0; }
  #doubleModal .dice3d-stage { gap: 20px; }
  #doubleModal .dice3d-box { --d: 50px; }             /* 横屏骰子缩小，保证弹窗一屏看全 */
  #doubleModal .dbl-sum { grid-area: sum; min-height: 26px; font-size: 22px; }
  #doubleModal .msg { grid-area: msg; margin-top: 0; min-height: 16px; font-size: 12px; }
  #doubleModal .dbl-guess { grid-area: guess; }
  #doubleModal .dbl-tip { grid-area: tip; margin-top: 2px; }
  #doubleModal .dbl-act { grid-area: act; }
  #doubleModal .dbl-btns { margin-top: 4px; }
  #doubleModal .dbl-btns .btn-act { padding: 9px 0; font-size: 14px; }
}
