@font-face { font-family: "QXPixel"; src: url(assets/fonts/pixel.woff) format("woff"); font-display: swap; }
@font-face { font-family: "QXTitle"; src: url(assets/fonts/title.woff) format("woff"); font-display: swap; }
:root {
  --gold: #f3d27a; --ink: #f0e6d2; --dim: #a89878; --line: rgba(214,170,96,.45);
  --panel: #120e0b; --red: #e84a4a;
  --font: "QXPixel", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --title: "QXTitle", "QXPixel", "STKaiti", "KaiTi", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; font-family: var(--font); color: var(--ink); }
#stage { position: absolute; left: 50%; top: 50%; width: 720px; height: 1280px; transform-origin: center; transform: translate(-50%, -50%); }
#view { position: absolute; inset: 0; width: 720px; height: 1280px; display: block; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.overlay[hidden] { display: none; }

#loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at center, #2a1a10, #070504 70%); }
#loading b { font-family: var(--title); font-size: 72px; color: var(--gold); letter-spacing: 8px; text-shadow: 0 0 30px rgba(243,210,122,.4); }
#loading small { color: var(--dim); font-size: 20px; }

/* 开场页：让出顶栏和底部两块面板 */
#lobby { top: 112px; bottom: 290px; padding: 40px 34px 0; gap: 12px;
  background: linear-gradient(180deg, rgba(8,5,3,.15) 0%, rgba(8,5,3,.82) 10%, rgba(8,5,3,.86) 90%, rgba(8,5,3,.2) 100%); }
#lobby .title { text-align: center; }
#lobby .title span { display: block; font-family: var(--title); font-size: 78px; letter-spacing: 10px; line-height: 1.1;
  background: linear-gradient(180deg, #fff3cf, #f3d27a 55%, #b8822e); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(60,20,0,.8)) drop-shadow(0 0 24px rgba(243,210,122,.35)); }
#lobby .title small { color: #d8c8a8; font-size: 18px; letter-spacing: 2px; }
#lobby .count { font-size: 64px; font-weight: 800; color: #fff; line-height: 1; text-shadow: 0 0 22px rgba(255,220,160,.45); }
#lobby .count small { font-size: 20px; color: var(--dim); margin-left: 8px; font-weight: 400; }
#lobby .chapter { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 26px; border: 2px solid var(--c); border-radius: 14px; background: rgba(0,0,0,.35); }
#lobby .chapter b { font-family: var(--title); font-size: 34px; color: var(--c); }
#lobby .chapter span { font-size: 17px; color: var(--ink); }
#lobby .failnote { color: #ff9a8a; font-size: 17px; }
#lobby .join { font-size: 18px; color: var(--gold); }
#lobby .sects { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; margin-top: 4px; }
#lobby .sects span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; background: rgba(255,255,255,.04); border-top: 3px solid var(--c); }
#lobby .sects b { font-size: 16px; color: var(--c); font-weight: 400; }
#lobby .sects small { font-size: 12px; color: var(--dim); }
#lobby .hint { margin-top: 6px; font-size: 16px; color: #d8c8a8; background: rgba(0,0,0,.4); border: 1px solid var(--line); border-radius: 999px; padding: 7px 18px; }

/* 结算页 */
#result { justify-content: center; background: radial-gradient(ellipse at center, rgba(8,5,3,.92) 35%, rgba(8,5,3,.6) 75%, rgba(8,5,3,.25)); }
#result .win { font-family: var(--title); font-size: 64px; letter-spacing: 6px; }
#result .win.ok { color: #ffe9b8; text-shadow: 0 0 30px #d8902e; }
#result .win.fail { color: #ffc0b8; text-shadow: 0 0 30px #b0302a; }
#result .reason { color: #d8c8a8; font-size: 19px; margin: 6px 0 18px; }
#result .next { margin-top: 18px; color: var(--dim); font-size: 17px; }
.restable { width: 680px; border-collapse: collapse; background: rgba(18,12,8,.92); border-radius: 14px; overflow: hidden; border-top: 4px solid var(--gold); }
.restable th { font-size: 13px; color: var(--dim); font-weight: 400; text-align: left; padding: 8px 8px 6px; border-bottom: 1px solid rgba(255,255,255,.1); }
.restable td { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.restable tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.restable .rkc { width: 36px; text-align: center; }
.restable .rk { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; color: var(--dim); font-size: 15px; }
.restable .rk.r0 { background: #ffd23a; color: #2a1a00; } .restable .rk.r1 { background: #d8dde6; color: #222; } .restable .rk.r2 { background: #d58a4a; color: #2a1000; }
.restable .who { width: 200px; }
.restable .whoin { display: flex; align-items: center; gap: 8px; }
.restable .av { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; flex: none; background: #1a120c; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.restable .nm { display: flex; flex-direction: column; max-width: 150px; font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.restable .nm small { font-size: 12px; color: var(--dim); }
.restable .mer { width: 56px; color: var(--gold); font-size: 17px; text-align: right; }
.restable .lootc { padding-left: 14px; }
.restable .drop { display: flex; align-items: center; gap: 6px; }
.restable .drop + .drop { margin-top: 3px; }
.restable .dn { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.restable .dn b { font-size: 14px; font-weight: 400; }
.restable .dn small { font-size: 12px; color: var(--dim); }
.restable .dn em { font-style: normal; } .restable .dn em.on { color: #7dffb0; }
.restable .tag { font-style: normal; font-size: 11px; color: #1a1200; background: #ffd86b; border-radius: 6px; padding: 0 4px; margin-left: 5px; }
.restable .tag.gift { background: #ff7aa8; color: #2a0012; }
.restable .nodrop { color: rgba(255,255,255,.25); }
.restable .empty { color: var(--dim); padding: 12px; text-align: center; }

/* 主播设置 */
#gear { position: fixed; right: 8px; top: calc(50% - 15px); z-index: 10; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.15);
  background: rgba(20,14,10,.5); color: #d8c8a8; cursor: pointer; padding: 0; opacity: .45; font-size: 16px; transition: opacity .2s, transform .4s; }
#gear:hover { opacity: 1; transform: rotate(60deg); }
#panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(430px, 100vw); z-index: 20; overflow: auto; background: var(--panel);
  border-left: 1px solid var(--line); padding: 0 16px 24px; font-size: 14px; box-shadow: -10px 0 40px rgba(0,0,0,.5); font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
#panel[hidden] { display: none; }
#panel [hidden] { display: none !important; }
#panel header { position: sticky; top: 0; background: var(--panel); display: flex; justify-content: space-between; align-items: center; padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
#panel header span { display: flex; gap: 6px; }
#panel h3 { font-size: 14px; color: var(--gold); margin: 16px 0 8px; }
#panel .row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
#panel .row.wrap { flex-wrap: wrap; }
#panel input[type=number] { width: 78px; background: #080605; color: var(--ink); border: 1px solid #3a2e22; border-radius: 6px; padding: 5px 6px; }
#panel textarea { width: 100%; background: #080605; color: var(--ink); border: 1px solid #3a2e22; border-radius: 6px; padding: 6px; font-family: inherit; }
#panel button { background: #2a1e14; color: var(--ink); border: 1px solid #5a4430; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-family: inherit; }
#panel button:hover { background: #3a2a1a; }
#panel button.primary { background: #9a5a1a; border-color: #d8902e; color: #fff; font-weight: 700; }
#panel button.danger { border-color: #7a2b36; color: #ffb3bd; }
#panel .note { color: var(--dim); font-size: 12px; }
#panel .autosave { margin: 8px 0 0; } #panel .autosave #save-note { color: var(--gold); margin-left: 6px; }
#panel .status { padding: 8px 10px; background: #080605; border-radius: 6px; }
#panel .status .err { color: #ffb3bd; margin-top: 4px; }
#panel .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #666; }
#panel .dot.connected { background: #3ee08f; } #panel .dot.connecting, #panel .dot.reconnecting { background: #ffc94d; } #panel .dot.error { background: #ff5d6c; }
#panel .audio label { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
#panel .audio input[type=range] { width: 100px; }
#save-text { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
#blocked { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.92); font-size: 22px; text-align: center; line-height: 1.7; }
#blocked[hidden] { display: none; }
