/* 3D 大厅（/lobby3d/）和 3D 私人房（/room3d/）共用的样式（第十六版从 index.html 搬出来） */
/* 3D 大厅：木色暖色调。环形按钮 / 准备倒数 / 请离开沿用 2D 大厅（hall.css 的 .hl-rb、.hl-rpill）的形状，只换配色 */
:root { --wood0: #2f2118; --wood1: #4a2e18; --wood2: #6e4423; --cream: #fff3dc; --amber: #e0a22e; --orange: #c8742c; --olive: #7d8a3a; --go: #d9541e; }
html, body { margin: 0; height: 100%; background: var(--wood0); color: var(--cream); font: 14px/1.45 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; overflow: hidden; }
#page { display: flex; flex-direction: column; height: 100dvh; }
#stage { position: relative; flex: 1; min-height: 0; touch-action: none; overflow: clip; }
#stage > canvas { display: block; width: 100%; height: 100%; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#bar { position: absolute; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top)); display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-start; pointer-events: none; z-index: 7; }
#bar button { pointer-events: auto; padding: 7px 9px; border: 2px solid rgba(255, 243, 220, .85); border-radius: 12px; background: rgba(74, 46, 24, .92); color: var(--cream); font-weight: 700; font-size: 12.5px; white-space: nowrap; box-shadow: 0 2px 0 rgba(30, 18, 8, .5); }
#bar button.on { background: var(--orange); }
#btn-line { display: flex; align-items: center; gap: 5px; }
#btn-line::after { content: '▾'; font-size: 11px; opacity: .8; }
#bar .sp { flex: 1; }
#line-list { position: absolute; left: 8px; top: calc(52px + env(safe-area-inset-top)); z-index: 8; width: 220px; max-height: 60%; overflow-y: auto; padding: 8px; border-radius: 14px; background: rgba(47, 33, 24, .96); border: 2px solid rgba(255, 243, 220, .7); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
#line-list[hidden] { display: none; }
#line-list h3 { margin: 2px 4px 6px; font-size: 13px; opacity: .85; }
#line-list p { margin: 6px; font-size: 13px; }
#line-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 5px; padding: 9px 10px; border: 0; border-radius: 10px; background: var(--wood2); color: var(--cream); font-weight: 700; }
#line-list button em { font-style: normal; font-weight: 500; font-size: 12px; opacity: .9; }
#line-list button.cur { background: var(--orange); }
#line-list button:disabled { background: #5b524b; color: #a89c90; cursor: default; }
/* 提示：场景上方中央，让出两边的按钮 */
#note { position: absolute; left: 50%; top: calc(52px + env(safe-area-inset-top)); /* 实际的 top 由 ui.js 量出来：永远在那排按钮的正下方 */ transform: translateX(-50%); z-index: 9; max-width: min(calc(100% - 28px), 460px); padding: 8px 14px; border-radius: 14px; background: rgba(255, 243, 220, .96); color: #4a2e18; font-weight: 700; font-size: 13.5px; text-align: center; box-shadow: 0 3px 0 rgba(74, 46, 24, .45); pointer-events: none; transition: opacity .3s; }
#note[hidden] { display: none; }
#note.out { opacity: 0; }
#net { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 9; padding: 5px 12px; border-radius: 999px; background: rgba(47, 33, 24, .9); font-size: 12px; }
#net[hidden] { display: none; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.ld-box { width: min(260px, 70%); padding: 14px 16px; border-radius: 16px; background: rgba(47, 33, 24, .88); border: 2px solid #e9c58c; text-align: center; }
.ld-box p { margin: 0 0 8px; font-weight: 800; color: #fff3dc; }
.ld-bar { height: 10px; border-radius: 5px; background: rgba(30, 18, 8, .6); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, #ffd23f, #f08a1e); transition: width .25s; }
#nogl { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: #2f2118; }
#nogl[hidden] { display: none; }
#nogl > div { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; border-radius: 18px; background: linear-gradient(#7a4d28, #5d3a1e); border: 3px solid #e9c58c; }
#nogl p { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.5; color: #fff3dc; text-align: center; }
#nogl input { width: 100%; padding: 8px 10px; border-radius: 10px; border: 2px solid #e9c58c; background: #fff3dc; color: #3b2a12; font: inherit; font-size: 13px; }
#nogl button { min-height: 48px; border: 0; border-radius: 14px; font: inherit; font-weight: 800; font-size: 17px; color: #fff; background: linear-gradient(#e8672e, #c94a17); box-shadow: 0 3px 0 rgba(30, 18, 8, .55); cursor: pointer; }
#nogl #nogl-retry { color: #3b2a12; background: linear-gradient(#fff6e4, #f0dfc2); font-size: 15px; min-height: 44px; }
#hud { position: absolute; left: 6px; bottom: 0; z-index: 8; max-width: calc(100% - 12px); padding: 1px 8px; white-space: nowrap; overflow: hidden; border-radius: 8px; background: rgba(40, 28, 20, .78); color: #fff3dc; font-size: 11px; font-variant-numeric: tabular-nums; pointer-events: none; }
#hud[hidden] { display: none; }
/* 角色旁的圆形操作按钮 */
#ring { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.rb { position: absolute; transform: translate(-50%, -50%); width: 54px; height: 54px; padding: 0; border-radius: 50%; border: 2px solid var(--cream); background: rgba(74, 46, 24, .93); color: #fff; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.05; box-shadow: 0 3px 0 rgba(47, 28, 12, .5), 0 0 10px rgba(255, 233, 184, .35); animation: rb-in .18s ease-out; }
@keyframes rb-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
.rb b { font-size: 17px; line-height: 1; }
.rb small { font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.rb.amber { background: #b9811c; }
.rb.olive { background: var(--olive); }
.rb.go { background: var(--go); }
.rb:active { transform: translate(-50%, -50%) scale(.92); }
#btn-ready { left: 50%; top: auto; bottom: calc(46px + env(safe-area-inset-bottom)); transform: translate(-50%, 0) !important; }
#btn-ready, #btn-kick { position: absolute; transform: translate(-50%, -50%); z-index: 6; border: 3px solid var(--cream); color: #fff; font-weight: 900; }
#btn-ready { width: 148px; height: 58px; border-radius: 29px; font-size: 19px; background: var(--go); box-shadow: 0 4px 0 rgba(47, 28, 12, .55), 0 0 16px #f0a04a; animation: rpulse .9s ease-in-out infinite; }
@keyframes rpulse { 50% { box-shadow: 0 4px 0 rgba(47, 28, 12, .55), 0 0 26px 4px #ffd23e; } }
#btn-ready.done { background: #5f8a3a; font-size: 15px; animation: none; box-shadow: 0 3px 0 rgba(47, 28, 12, .5); cursor: default; }
#btn-kick { min-width: 76px; padding: 8px 12px; border-width: 2px; border-radius: 12px; font-size: 14px; font-weight: 800; background: #a8452b; box-shadow: 0 3px 0 rgba(47, 28, 12, .5); }
#btn-ready[hidden], #btn-kick[hidden] { display: none; }
.rb.violet { background: #7a55a8; }
/* 马上玩（底部居中）、等 AI 倒数、表情 */
#btn-quick, #btn-watch { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; min-width: 150px; height: 54px; padding: 0 26px; border: 3px solid var(--cream); border-radius: 27px; background: var(--go); color: #fff; font-weight: 900; font-size: 19px; box-shadow: 0 4px 0 rgba(47, 28, 12, .55), 0 0 14px rgba(240, 160, 74, .8); }
#btn-watch { bottom: calc(84px + env(safe-area-inset-bottom)); }
#btn-quick:active, #btn-watch:active { transform: translateX(-50%) scale(.95); }
#wait { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; max-width: calc(100% - 90px); padding: 8px 14px; border-radius: 14px; background: rgba(74, 46, 24, .94); border: 2px solid var(--cream); font-weight: 700; font-size: 13px; text-align: center; pointer-events: none; }
#btn-emo { position: absolute; left: 10px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 6; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 2px solid var(--cream); background: rgba(74, 46, 24, .93); font-size: 22px; box-shadow: 0 3px 0 rgba(47, 28, 12, .5); }
#emo-list { position: absolute; left: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 8; display: flex; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(47, 33, 24, .96); border: 2px solid rgba(255, 243, 220, .7); }
#emo-list button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: var(--wood2); font-size: 22px; }
#btn-quick[hidden], #btn-watch[hidden], #wait[hidden], #emo-list[hidden] { display: none; }
/* 右上角的游戏桌清单 */
#games { position: absolute; right: 8px; top: calc(52px + env(safe-area-inset-top)); z-index: 8; width: min(300px, calc(100% - 16px)); max-height: 68%; overflow-y: auto; box-sizing: border-box; padding: 8px; border-radius: 14px; background: rgba(47, 33, 24, .96); border: 2px solid rgba(255, 243, 220, .7); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
#games[hidden] { display: none; }
#games h3 { margin: 2px 4px 6px; font-size: 13px; opacity: .85; }
#games button { display: grid; grid-template-columns: 62px 1fr auto; gap: 6px; align-items: center; width: 100%; margin-top: 5px; padding: 8px 10px; border: 0; border-left: 6px solid #b07a45; border-radius: 10px; background: var(--wood2); color: var(--cream); text-align: left; font-size: 13px; }
#games button em { font-style: normal; font-size: 12px; opacity: .95; }
#games button.st-wait { border-left-color: #f08a1e; } #games button.st-wait em { color: #ffc37a; }
#games button.st-full { border-left-color: #d62839; } #games button.st-full em { color: #ff9aa5; }
#games button.st-play { border-left-color: #19ff5e; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); } #games button.st-play em { color: #5dff8f; font-weight: 800; }
/* 木色弹窗：离座确认、邀请、换游戏、开房间 */
#sheet { position: absolute; inset: 0; z-index: 15; display: grid; place-items: center; background: rgba(30, 20, 12, .6); }
#sheet[hidden] { display: none; }
#sheet-card { width: min(88%, 330px); max-height: 84%; overflow-y: auto; box-sizing: border-box; padding: 16px 14px 14px; border-radius: 18px; background: linear-gradient(#7a4d28, #5d3a1e); border: 3px solid #e9c58c; color: var(--cream); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
#sheet-card h3 { margin: 0 0 6px; font-size: 18px; }
#sheet-card .sub { margin: 0 0 10px; font-size: 13px; opacity: .92; }
#sheet-card .tiny { margin: 10px 0 0; font-size: 12px; opacity: .8; }
#sheet-card .link, #sheet-card .code { margin: 0 0 10px; padding: 9px 10px; border-radius: 10px; background: rgba(47, 33, 24, .75); font-size: 13px; word-break: break-all; user-select: all; }
#sheet-card .code { font-size: 26px; font-weight: 900; letter-spacing: 1px; color: #ffe9b8; }
#sheet-card .err { margin: 0 0 8px; color: #ffc0a0; font-size: 13px; font-weight: 700; }
#sheet-card .err[hidden] { display: none; }
#sheet-card .inp { width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 10px; border: 2px solid #e9c58c; border-radius: 10px; background: #fff3dc; color: #3b2a12; font: inherit; font-size: 17px; font-weight: 700; text-align: center; }
#sheet-card .btns { display: flex; gap: 8px; margin-top: 6px; }
#sheet-card .list { display: flex; flex-direction: column; gap: 8px; }
#sheet-card .b { flex: 1; display: block; padding: 11px 8px; border: 0; border-radius: 12px; background: #f6ead8; color: #3b2a12; font-weight: 800; font-size: 14.5px; text-decoration: none; box-sizing: border-box; }
#sheet-card .b.go { background: var(--amber); }
#sheet-card .b.wa { background: #25a35a; color: #fff; }
#sheet-card .b.cur { background: #ffd98a; }
/* 整页提示（已在别处打开、挂机、线都满了） */
#ov { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(30, 20, 12, .72); }
#ov[hidden] { display: none; }
#ov > div { width: min(86%, 320px); padding: 18px 16px; border-radius: 16px; background: var(--cream); color: #4a2e18; text-align: center; }
#ov h2 { margin: 0 0 6px; font-size: 18px; }
#ov p { margin: 0 0 14px; font-size: 14px; }
#ov button { padding: 10px 22px; border: 0; border-radius: 12px; background: var(--orange); color: #fff; font-weight: 800; font-size: 15px; }
/* 换装 / 创建角色面板（跟 /lab3d 同一个，多一栏昵称） */
#look { background: #2c211b; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); max-height: 58dvh; overflow-y: auto; box-sizing: border-box; }
#look[hidden] { display: none; }
#look-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
#look-prev { width: 96px; height: 112px; border-radius: 12px; background: #4a3a30; flex: none; }
#look-top .side { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
#look-top p { margin: 0; font-size: 12px; opacity: .85; }
#look-name { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 2px solid #6e4423; border-radius: 10px; background: #fff3dc; color: #3b2a12; font: inherit; font-weight: 700; }
#look-err { color: #ffb08a; font-size: 12px; opacity: 1; }
#look-err[hidden] { display: none; }
#look-top .btns { display: flex; gap: 8px; }
#look-top button { flex: 1; padding: 8px 0; border: 0; border-radius: 10px; background: #f6ead8; color: #3b2a12; font-weight: 700; }
#look-top #look-done { background: var(--amber); }
.row { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.row .lab { width: 34px; flex: none; font-size: 12px; opacity: .85; }
.row .opts { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.row button { padding: 5px 8px; border: 2px solid transparent; border-radius: 9px; background: #4a3a30; color: #f6ead8; font-size: 12.5px; }
.row button.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border-color: rgba(255, 255, 255, .25); }
.row button.on { border-color: #ffd23f; box-shadow: 0 0 0 2px rgba(255, 210, 63, .35); }
.row button:disabled { opacity: .28; cursor: default; }
@media (min-width: 900px) {
  #look { position: absolute; right: 10px; top: 54px; width: 340px; max-height: calc(100dvh - 90px); border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); z-index: 10; }
  #look-prev { width: 120px; height: 140px; }
}

/* ---------- 第十六版：3D 私人房（/room3d/）多出来的东西 ---------- */
#room-tag { pointer-events: none; padding: 7px 10px; border: 2px solid rgba(255, 243, 220, .85); border-radius: 12px; background: rgba(110, 68, 35, .95); color: #ffe9b8; font-weight: 800; font-size: 13px; white-space: nowrap; box-shadow: 0 2px 0 rgba(30, 18, 8, .5); }
#bar button.off { opacity: .6; }
#strips { position: absolute; left: 50%; top: calc(104px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 8; width: min(calc(100% - 20px), 420px); display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.strip { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 12px; background: rgba(74, 46, 24, .95); border: 2px solid rgba(255, 243, 220, .8); font-size: 13px; }
.strip span { flex: 1; min-width: 0; }
.strip button { padding: 6px 10px; border: 0; border-radius: 9px; background: var(--amber); color: #3b2a12; font-weight: 800; font-size: 12.5px; }
.strip button.ghost { background: #f6ead8; }
.strip button.on { box-shadow: 0 0 0 2px #fff; }
.rb.dim { filter: grayscale(.7); opacity: .7; }
#sheet-card .b.dis { opacity: .45; }
#sheet-card .b small { font-weight: 600; opacity: .7; }

/* 第十七版：大厅的背景音乐开关（表情按钮右边） */
#btn-music { position: absolute; left: 64px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 6; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 2px solid var(--cream); background: rgba(74, 46, 24, .93); font-size: 20px; box-shadow: 0 3px 0 rgba(47, 28, 12, .5); }
#btn-music.off { opacity: .6; filter: grayscale(1); }
#btn-music.off::after { content: ""; position: absolute; left: 9px; right: 9px; top: 50%; height: 2.5px; border-radius: 2px; background: #ff8a70; transform: rotate(-40deg); }

/* v24 画质按钮 HD / LD */
#bar #btn-q { min-width: 40px; padding: 7px 7px; font-size: 12px; letter-spacing: .5px; }
#bar #btn-q.ld { background: #5b7a3a; }

#btn-solo { background: linear-gradient(#ffd45a, #f0a21c); color: #4a2a06; font-weight: 900; border-color: #fff3c4; min-height: 44px; }
