/* 中式八球 3D —— 界面样式（深色半透明面板，悬浮在三维画面上） */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0806; color: #e8e2d6;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif; user-select: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.hidden { display: none !important; }

:root { --glass: rgba(14, 11, 9, 0.62); --line: rgba(255, 230, 190, 0.14); --gold: #e7c27d; --green: #4ade80; --blue: #60a5fa; --orange: #fb923c; }

/* ---------- 比赛信息 ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.player { position: absolute; top: 16px; left: 18px; width: 330px; padding: 12px 14px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color .3s, box-shadow .3s; }
.player.right { left: auto; right: 18px; }
.player.active { border-color: rgba(231, 194, 125, 0.8); box-shadow: 0 0 22px rgba(231, 194, 125, 0.25); }
.player .top { display: flex; align-items: center; gap: 10px; }
.player .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.player .nm { font-weight: 700; font-size: 15px; }
.player .tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.08); color: #cfc6b6; }
.player .turn { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--gold); color: #2a1a08; font-weight: 700; display: none; }
.player.active .turn { display: block; }
.player .balls { display: flex; gap: 4px; margin-top: 9px; min-height: 20px; align-items: center; font-size: 12px; color: #a99f8f; }
.mini { width: 19px; height: 19px; border-radius: 50%; position: relative; box-shadow: inset -3px -3px 5px rgba(0,0,0,0.35), inset 2px 2px 4px rgba(255,255,255,0.35);
  display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #111; overflow: hidden; }
.mini i { width: 10px; height: 10px; border-radius: 50%; background: #f7f5ee; display: grid; place-items: center; font-style: normal; }
.mini.stripe::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: #f4f1e6; }
.mini.stripe::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: #f4f1e6; }
.mini.gone { opacity: 0.18; }

#status { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); padding: 10px 22px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--gold); white-space: nowrap;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#banner { position: absolute; top: 74px; left: 50%; transform: translate(-50%, -10px); opacity: 0; padding: 11px 26px; border-radius: 24px;
  background: rgba(14, 11, 9, 0.8); border: 1px solid var(--line); font-size: 15px; font-weight: 700; transition: opacity .35s, transform .35s; white-space: nowrap; }
#banner.show { opacity: 1; transform: translate(-50%, 0); }

#power { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; }
#power .bar { width: 22px; height: 300px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); position: relative; overflow: hidden; }
#power .fill { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 0; border-radius: 9px;
  background: linear-gradient(to top, #22c55e, #facc15 55%, #ef4444); transition: height .05s; }
#power .fill.pull { background: linear-gradient(to top, #94a3b8, #e2e8f0); }
#power .mark { position: absolute; left: 0; right: 0; height: 2px; background: #fff; bottom: 0; opacity: 0; }
#power b { font-size: 13px; }

#tipbox { position: absolute; left: 18px; bottom: 18px; width: 130px; padding: 10px; border-radius: 16px; text-align: center;
  background: var(--glass); border: 1px solid var(--line); pointer-events: auto; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#tipbox .ttl { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
#tipcv { width: 110px; height: 110px; cursor: grab; }
#elevcv { width: 110px; height: 45px; margin-top: 4px; }
#tiptext { font-size: 12px; color: var(--gold); font-weight: 700; }
#elevtext { font-size: 11px; color: #cfc6b6; }

#hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 8px 20px; border-radius: 16px; background: rgba(14, 11, 9, 0.55);
  font-size: 12.5px; color: #d6cebf; text-align: center; line-height: 1.7; max-width: calc(100% - 360px); }
#lockmsg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 14px 26px; border-radius: 20px; background: rgba(14, 11, 9, 0.7);
  border: 1px solid var(--line); font-size: 15px; font-weight: 600; display: none; }
#menuBtn { position: absolute; right: 18px; bottom: 18px; pointer-events: auto; }

/* ---------- 菜单与弹窗 ---------- */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(0,0,0,0.15), rgba(0,0,0,0.6)); }
.panel { width: 520px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow: auto; padding: 26px 30px; border-radius: 26px;
  background: rgba(16, 12, 10, 0.86); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: pop .45s cubic-bezier(.2,.9,.3,1.2); }
.panel.wide { width: 760px; }
@keyframes pop { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.logo { display: grid; place-items: center; }
.ball8 { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #111;
  background: radial-gradient(circle at 35% 30%, #555 0, #111 45%, #000 100%); position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.6); }
.ball8::before { content: ""; position: absolute; width: 32px; height: 32px; border-radius: 50%; background: #f7f5ee; }
.ball8 { z-index: 0; } .ball8::before { z-index: -1; }
h1 { text-align: center; margin: 10px 0 2px; font-size: 32px; letter-spacing: 4px; color: #f5ecd9; }
h2 { margin: 6px 0 14px; font-size: 19px; color: var(--gold); }
.sub { text-align: center; margin: 0 0 18px; color: #a99f8f; font-size: 13px; }
button { font-family: inherit; color: #f2ead9; background: rgba(255,255,255,0.07); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 14px; cursor: pointer; transition: background .2s, transform .15s, border-color .2s; font-size: 13px; }
button:hover { background: rgba(255,255,255,0.13); border-color: rgba(231,194,125,0.45); }
button:active { transform: scale(.97); }
.big { display: block; width: 100%; padding: 13px 16px; margin: 10px 0; font-size: 16px; font-weight: 700; text-align: center; border-radius: 16px; }
.big small { display: block; font-size: 12px; font-weight: 400; color: #bfb5a3; margin-top: 2px; }
.big.small { font-size: 14px; padding: 10px 14px; text-align: center; }
.big.primary { background: linear-gradient(135deg, #1f7a46, #15603a); border-color: rgba(120, 220, 160, 0.4); }
.big.primary:hover { background: linear-gradient(135deg, #25904f, #187043); }
.two { display: flex; gap: 12px; } .two > * { flex: 1; }
.row { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 13px; color: #cfc6b6; }
.row .k { width: 76px; flex: none; }
.row label { display: flex; align-items: center; gap: 6px; cursor: pointer; margin-right: 18px; }
.chips { display: flex; gap: 6px; }
.chips button { padding: 6px 14px; border-radius: 10px; }
.chips button.on { background: var(--gold); color: #2a1a08; border-color: var(--gold); font-weight: 700; }
input[type=range] { flex: 1; accent-color: #e7c27d; }
input[type=checkbox] { accent-color: #22c55e; width: 16px; height: 16px; }
/* 主菜单：模式卡片 + 底部小按钮 */
.modes { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.modes .two { gap: 10px; }
.mode { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 14px 16px; border-radius: 16px; text-align: left;
  font-size: 13px; cursor: pointer; background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: #f2ead9;
  transition: background .2s, transform .15s, border-color .2s; }
.mode:hover { background: rgba(255,255,255,0.1); border-color: rgba(231,194,125,0.45); }
.mode:active { transform: scale(.98); }
.mode:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mode .ic { font-size: 22px; width: 30px; text-align: center; flex: none; }
.mode .tx { flex: 1; min-width: 0; }
.mode b { display: block; font-size: 16px; }
.mode small { display: block; font-size: 12px; color: #bfb5a3; margin-top: 2px; }
.mode .go { font-size: 24px; color: rgba(255,255,255,0.45); flex: none; line-height: 1; }
.mode.online, .mode.ai { background: linear-gradient(135deg, #1f7a46, #15603a); border-color: rgba(120, 220, 160, 0.4); }
.mode.online:hover, .mode.ai:hover { background: linear-gradient(135deg, #25904f, #187043); }
.mode.online small, .mode.ai small { color: #cde8d6; }
.chips.lv { flex: none; gap: 4px; padding: 3px; border-radius: 11px; background: rgba(0,0,0,0.25); }
.chips.lv button { padding: 4px 10px; font-size: 12px; border-radius: 8px; background: transparent; border-color: transparent; }
.chips.lv button:hover { background: rgba(255,255,255,0.12); }
.chips.lv button.on { background: var(--gold); color: #2a1a08; border-color: var(--gold); }
.foot { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.foot button { flex: 1; padding: 9px 6px; font-size: 13px; background: transparent; white-space: nowrap; }
.foot button:hover { background: rgba(255,255,255,0.08); }
#menu .sub { margin-bottom: 14px; }
#menu #resume, #menu #toHall { margin: 0 0 10px; text-align: center; }
#menu #resume { background: var(--gold); border-color: var(--gold); color: #2a1a08; }
#menu #resume:hover { background: #f0d095; }
.row .v { width: 44px; text-align: right; flex: none; }
.note { font-size: 12px; color: #8f8574; margin: 6px 0 0; }
@media (max-width: 520px) {
  .panel { padding: 22px 18px; }
  .mode.ai { flex-wrap: wrap; }
  .mode.ai .tx { flex: 1 1 calc(100% - 50px); }
  .mode.ai .chips.lv { order: 3; margin-left: 42px; }
  .mode.ai .go { display: none; }
  .modes .two { flex-direction: column; }
  .foot button { font-size: 12px; }
}
#overName { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.07); color: #fff; font-size: 15px; font-family: inherit; outline: none; }
#overName:focus { border-color: var(--gold); }
#overTitle { text-align: center; font-size: 26px; }
#overWhy { text-align: center; color: #cfc6b6; }
#overStats { display: flex; justify-content: center; gap: 30px; margin: 14px 0; font-size: 13px; color: #cfc6b6; text-align: center; }
#overStats b { display: block; font-size: 30px; color: var(--gold); }
.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.keys td { padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
.keys td:first-child { color: var(--gold); white-space: nowrap; width: 250px; }
.rules { margin: 0 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.8; color: #d6cebf; }

#loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: #0b0806; font-size: 15px; color: #cfc6b6; z-index: 10; transition: opacity .6s; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--gold); animation: spin 1s linear infinite; will-change: transform; }
.loadTrack { width: 180px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.1); overflow: hidden; }
#loadBar { width: 0; height: 100%; background: var(--gold); transition: width .25s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 在线对战 ---------- */
.txt { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.07); color: #fff; font-size: 15px; font-family: inherit; outline: none; }
.txt:focus { border-color: var(--gold); }
.joinbox { display: flex; gap: 8px; align-items: center; }
.joinbox .txt { width: 0; text-align: center; letter-spacing: 3px; }
.joinbox .big { width: auto; flex: none; margin: 10px 0; }
#onlineStatus { min-height: 22px; margin: 8px 0 2px; text-align: center; color: #e7c27d; font-size: 14px; }
#onlineStatus .code { display: block; font-size: 34px; letter-spacing: 8px; color: #fff; margin: 6px 0; font-weight: 800; }
#onlineStatus.err { color: #f87171; }
.hidden { display: none !important; }
#clock { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #cfc6b6; pointer-events: none; }
#clock.warn { color: #f87171; font-weight: 700; }
#emotes { position: fixed; right: 66px; bottom: 70px; pointer-events: auto; display: flex; flex-direction: column; gap: 6px; }
#emotes button { padding: 6px 12px; border-radius: 12px; font-size: 13px; opacity: 0.75; }
#emotes button:hover { opacity: 1; }
#emoteShow { position: fixed; top: 110px; left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 16px; background: rgba(0,0,0,0.55); color: #fff; font-size: 16px; opacity: 0; transition: opacity .3s; pointer-events: none; }
#emoteShow.show { opacity: 1; }

/* ---------- 多人游戏：登录、房间列表、房间内、邀请 ---------- */
.panel.mp { width: 560px; }
.tabs { margin: 0 0 6px; }
.tabs button { flex: 1; padding: 9px 14px; }
.mpmsg { min-height: 20px; margin: 6px 0; text-align: center; font-size: 13.5px; color: #e7c27d; }
.mpmsg.err { color: #f87171; }
input, textarea { user-select: text; }
.userbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.05); margin-bottom: 8px; font-size: 13px; }
.userbar .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #16a34a; color: #fff; font-weight: 700; flex: none; }
.userbar b { display: block; font-size: 15px; color: #f5ecd9; }
.userbar .meStat { color: #a99f8f; font-size: 12px; }
.userbar .logoutBtn { margin-left: auto; padding: 6px 12px; font-size: 12px; }
h2 small { font-size: 13px; color: #a99f8f; font-weight: 400; margin-left: 10px; }
#hallList { display: grid; gap: 10px; }
.hall { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 16px; text-align: left; }
.hall .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; font-weight: 800; color: #fff; flex: none; }
.hall .nm { font-size: 16px; font-weight: 700; }
.hall .ds { font-size: 12px; color: #a99f8f; margin-top: 2px; }
.hall .cnt { margin-left: auto; text-align: right; font-size: 13px; color: #cfc6b6; }
.hall .cnt b { display: block; font-size: 20px; color: var(--gold); }
.hall .bar { height: 4px; width: 80px; border-radius: 2px; background: rgba(255,255,255,0.1); margin-top: 4px; overflow: hidden; }
.hall .bar i { display: block; height: 100%; background: var(--green); }
.hall.full { opacity: .5; cursor: not-allowed; }
#inviteBox { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 20; width: 360px; max-width: calc(100% - 32px); padding: 16px 18px; border-radius: 18px;
  background: rgba(16, 12, 10, 0.94); border: 1px solid rgba(231,194,125,0.7); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(231,194,125,0.2); animation: pop .4s; }
#inviteBox .itext { font-size: 15px; text-align: center; }
#inviteBox .itext b { color: var(--gold); }
#inviteRec { display: block; font-size: 12px; color: #a99f8f; margin-top: 3px; }
#inviteBox .ibtns { display: flex; gap: 10px; margin-top: 12px; }
#inviteBox .ibtns button { flex: 1; padding: 10px; font-size: 14px; font-weight: 700; }
#inviteBox .ibtns .yes { background: linear-gradient(135deg, #1f7a46, #15603a); border-color: rgba(120,220,160,0.4); }
#inviteMore { font-size: 12px; color: #a99f8f; text-align: center; margin-top: 6px; }
#inviteMore:empty { display: none; }

/* ---------- 房间大厅：左边球桌，右上在线玩家，右下聊天 ---------- */
.panel.mp.lobbyMode { width: 1240px; height: 860px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 18px 20px; }
.lobby { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.lobby.hidden { display: none; }
.lobbyTop { display: flex; align-items: center; gap: 16px; }
.lobbyTop h2 { margin: 0; flex: 1; }
.lobbyTop .userbar { margin: 0; padding: 6px 10px; }
.lobbyMain { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
.tables { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; align-content: start;
  padding: 12px; border-radius: 16px; background: rgba(0,0,0,0.22); border: 1px solid var(--line); }

/* 一张球桌 */
.tb { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 10px 8px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05); background: rgba(255,255,255,0.025); outline: none; transition: background .2s, border-color .2s; }
.tb:hover, .tb:focus-within { background: rgba(255,255,255,0.05); border-color: var(--line); }
.tb.mine { border-color: rgba(231,194,125,0.6); background: rgba(231,194,125,0.07); }
.seats { display: flex; align-items: center; gap: 6px; min-width: 0; }
.seats .vs { flex: none; font-size: 10px; font-weight: 800; color: #5f574c; letter-spacing: 1px; }
.seat { display: flex; align-items: center; gap: 5px; height: 22px; flex: 1 1 0; min-width: 0; font-size: 12.5px; }
.seats .seat:last-child { justify-content: flex-end; }
.seat .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .nm em { font-style: normal; color: var(--gold); font-size: 11px; margin-left: 3px; }
.seat.empty { color: #5f574c; font-size: 12px; }
.seats .seat.empty:first-child::before { content: "○ "; }
.seats .seat.empty:last-child::after { content: " ○"; }
.avt { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.felt { position: relative; width: 100%; aspect-ratio: 2.1 / 1; border-radius: 9px; border: 5px solid #6b3f22;
  background: radial-gradient(ellipse at center, #1f9a58, #137a40 75%); box-shadow: inset 0 0 10px rgba(0,0,0,0.45), 0 6px 14px rgba(0,0,0,0.4); }
.felt::before { content: ""; position: absolute; inset: -4px; border-radius: 6px; pointer-events: none;
  background: radial-gradient(circle at 0 0, #0b0806 4px, transparent 5px), radial-gradient(circle at 100% 0, #0b0806 4px, transparent 5px),
    radial-gradient(circle at 0 100%, #0b0806 4px, transparent 5px), radial-gradient(circle at 100% 100%, #0b0806 4px, transparent 5px),
    radial-gradient(circle at 50% 0, #0b0806 3.5px, transparent 4.5px), radial-gradient(circle at 50% 100%, #0b0806 3.5px, transparent 4.5px); }
.felt .no { position: absolute; left: 6px; top: 4px; font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 700; }
.felt .eye { position: absolute; right: 6px; top: 3px; font-size: 11px; color: rgba(255,255,255,0.8); }
.st.watching { background: rgba(192,132,252,0.16); color: #d8b4fe; }
.felt .ballz i { position: absolute; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset -1px -1px 2px rgba(0,0,0,0.4); }
.felt .lbl { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); font-size: 11px; padding: 1px 8px; border-radius: 8px; white-space: nowrap;
  background: rgba(0,0,0,0.4); color: #d6f5e0; }
.felt .lbl.play { color: #fca5a5; } .felt .lbl.wait { color: #fde68a; } .felt .lbl.prac { color: #93c5fd; }
.felt .acts { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 4px;
  background: rgba(0,0,0,0.55); opacity: 0; pointer-events: none; transition: opacity .15s; }
.tb:hover .acts, .tb:focus-within .acts { opacity: 1; pointer-events: auto; }
.acts button { padding: 5px 9px; font-size: 12px; border-radius: 9px; background: rgba(20,16,12,0.85); }
.acts button.go { background: linear-gradient(135deg, #1f7a46, #15603a); border-color: rgba(120,220,160,0.5); }

/* 右侧：在线玩家 + 聊天 */
.side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.box { display: flex; flex-direction: column; min-height: 0; flex: 1 1 50%; border-radius: 16px; background: rgba(0,0,0,0.22); border: 1px solid var(--line); overflow: hidden; }
.boxh { padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--gold); border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.03); flex: none; }
.boxh span { font-weight: 400; color: #a99f8f; margin-left: 8px; font-size: 12px; }
#plist { flex: 1; overflow: auto; padding: 4px; }
.pl { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; font-size: 13px; }
.pl:nth-child(odd) { background: rgba(255,255,255,0.03); }
.pl .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .nm em { font-style: normal; color: var(--gold); font-size: 11px; margin-left: 3px; }
.pl .rec { font-size: 11px; color: #a99f8f; flex: none; }
.pl .st { font-size: 11px; padding: 1px 7px; border-radius: 9px; flex: none; }
.st.idle { background: rgba(74,222,128,0.16); color: #86efac; }
.st.practice { background: rgba(96,165,250,0.16); color: #93c5fd; }
.st.matching, .st.waiting { background: rgba(250,204,21,0.14); color: #fde68a; }
.st.playing, .st.dropped { background: rgba(248,113,113,0.14); color: #fca5a5; }
.pl button { padding: 3px 9px; font-size: 12px; flex: none; border-radius: 9px; }
.pl button.inv { background: linear-gradient(135deg, #1f7a46, #15603a); border-color: rgba(120,220,160,0.4); }
.pl button:disabled { opacity: .45; cursor: default; }
#plist .empty { text-align: center; color: #8f8574; padding: 16px 10px; font-size: 12px; line-height: 1.7; }
/* 点玩家名字可以看生涯信息 */
.pl[data-prof], .seat[data-prof] { cursor: pointer; }
.pl[data-prof]:hover { background: rgba(231,194,125,0.08); }
.seat[data-prof]:hover .nm, .userbar .meName:hover { text-decoration: underline; text-underline-offset: 3px; }
.userbar .meName, .userbar .meAv { cursor: pointer; }
#onlineStatus .linkTxt { display: block; width: min(520px, 100%); margin: 6px auto 0; padding: 6px 10px; border-radius: 9px; font: 12px/1.4 monospace;
  color: #e8e0d0; background: rgba(0,0,0,0.35); border: 1px solid var(--line); text-align: center; user-select: all; }
#onlineStatus .hint { display: block; color: #a99f8f; font-size: 12px; margin-top: 3px; }

/* 生涯信息弹窗 */
#profile { z-index: 15; background: rgba(0,0,0,0.55); }
.panel.profile { width: 480px; padding: 22px 24px; }
.profHead { display: flex; align-items: center; gap: 14px; }
.profHead .big { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff; flex: none; }
.profHead .who { flex: 1; min-width: 0; }
.profHead .who b { display: block; font-size: 20px; color: #f6eedd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profHead .who b em { font-style: normal; font-size: 12px; color: var(--gold); margin-left: 6px; }
.profHead .who span { font-size: 12px; color: #a99f8f; }
.profHead .who .on { color: #86efac; }
.ring { width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), rgba(248,113,113,0.55) 0); }
.ring.none { background: rgba(255,255,255,0.08); }
.ring div { width: 60px; height: 60px; border-radius: 50%; background: #15110e; display: grid; place-content: center; text-align: center; }
.ring b { font-size: 17px; color: #f6eedd; line-height: 1.1; }
.ring small { font-size: 10px; color: #a99f8f; }
.profGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 12px; }
.profGrid div { padding: 9px 6px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); text-align: center; }
.profGrid b { display: block; font-size: 18px; color: var(--gold); }
.profGrid b.w { color: #86efac; } .profGrid b.l { color: #fca5a5; }
.profGrid span { font-size: 11px; color: #a99f8f; }
.profVs { padding: 8px 12px; border-radius: 12px; background: rgba(231,194,125,0.08); border: 1px solid rgba(231,194,125,0.25); font-size: 13px; text-align: center; margin-bottom: 12px; }
.profVs b { color: var(--gold); }
.profH { font-size: 13px; font-weight: 700; color: var(--gold); margin: 4px 0 6px; }
.profRec { max-height: 220px; overflow: auto; }
.profRec .g { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; font-size: 13px; }
.profRec .g:nth-child(odd) { background: rgba(255,255,255,0.03); }
.profRec .g i { font-style: normal; font-size: 11px; font-weight: 800; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.profRec .g i.w { background: rgba(74,222,128,0.18); color: #86efac; } .profRec .g i.l { background: rgba(248,113,113,0.16); color: #fca5a5; }
.profRec .g .o { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profRec .g .why { color: #a99f8f; font-size: 12px; flex: none; }
.profRec .g time { color: #6f675b; font-size: 11px; flex: none; width: 58px; text-align: right; }
.profEmpty { color: #8f8574; font-size: 12px; text-align: center; padding: 14px; }
.profBtns { display: flex; gap: 10px; margin-top: 14px; }
.profBtns button { flex: 1; padding: 10px; font-size: 14px; }
#profInv { background: linear-gradient(135deg, #1f7a46, #15603a); border-color: rgba(120,220,160,0.5); font-weight: 700; }
@media (max-width: 520px) {
  .profGrid { grid-template-columns: repeat(2, 1fr); }
  .ring { width: 64px; height: 64px; } .ring div { width: 50px; height: 50px; }
  .profRec .g .why { display: none; }
}

#chatLog { flex: 1; overflow: auto; padding: 8px 12px; font-size: 13px; line-height: 1.6; user-select: text; }
#chatLog .msg { word-break: break-all; margin: 2px 0; }
#chatLog .msg b { color: #93c5fd; font-weight: 600; }
#chatLog .msg.me b { color: var(--gold); }
#chatLog .msg time { color: #6f675b; font-size: 11px; margin-right: 5px; }
#chatLog .sys { color: #7d7466; font-size: 12px; text-align: center; margin: 3px 0; }
#chatLog .empty { color: #6f675b; font-size: 12px; text-align: center; padding-top: 20px; }
#chatForm { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); flex: none; }
#chatForm .txt { padding: 7px 10px; font-size: 13px; }
#chatForm button { flex: none; padding: 7px 14px; }

/* 底部：状态提示 + 按钮 */
.lobbyBar { position: relative; display: flex; align-items: center; gap: 8px; flex: none; }
.lobbyBar #onlineStatus { flex: 1; min-height: 0; margin: 0; text-align: left; font-size: 13px; }
.lobbyBar #onlineStatus:empty::before { content: "提示：鼠标移到空桌上可以练习或坐下等对手；有人的桌子可以邀请、加入或观战。"; color: #7d7466; }
.lobbyBar #onlineStatus .code { display: inline; font-size: 18px; letter-spacing: 3px; margin: 0 6px; }
.lobbyBar > button { flex: none; padding: 8px 14px; }
#friendBox { position: absolute; right: 100px; bottom: 44px; display: flex; flex-direction: column; gap: 8px; padding: 12px; width: 260px; border-radius: 14px;
  background: rgba(16,12,10,0.96); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,0.5); z-index: 2; }
#friendBox.hidden { display: none; }
#friendBox .joinbox .txt { padding: 7px 10px; font-size: 14px; }
#friendBox button { padding: 8px 12px; }

@media (max-width: 900px) {
  .panel.mp.lobbyMode { display: block; height: auto; padding: 16px 14px; }
  .lobby > * { flex: none; }
  .lobbyMain { display: flex; flex-direction: column; }
  .tables { max-height: 60vh; padding: 8px; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .lobbyTop h2 { flex-basis: 100%; }
  .lobbyTop .userbar { flex: 1; }
  .side .box { height: 280px; flex: none; }
  .lobbyTop, .lobbyBar { flex-wrap: wrap; }
  .lobbyBar #onlineStatus { flex-basis: 100%; }
  #friendBox { right: 0; }
  .acts { flex-direction: column; gap: 3px !important; }
  .acts button { padding: 3px 8px; }
}

/* ================= 触屏（手机、平板） ================= */
/* body.touch：触屏设备打开时就加上；电脑上第一次触摸屏幕时也会加上 */
.tonly { display: none; }
#view { touch-action: none; -webkit-tap-highlight-color: transparent; }
button, .mode, .tb { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.panel { max-height: calc(100vh - 32px); max-height: calc(100dvh - 24px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body.touch .txt, body.touch #overName { font-size: 16px; }          /* iPhone 上小于 16px 的输入框一点就会放大页面 */
@keyframes readyPulse { 50% { box-shadow: 0 0 18px rgba(231,194,125,0.55); } }

/* 比赛画面：信息面板缩小，留出球台 */
body.touch .player { width: 216px; padding: 7px 10px; border-radius: 12px; top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); }
body.touch .player.right { left: auto; right: max(8px, env(safe-area-inset-right)); }
body.touch .player .top { gap: 7px; }
body.touch .player .av { width: 28px; height: 28px; font-size: 12px; }
body.touch .player .nm { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.touch .player .tag, body.touch .player .turn { font-size: 10px; padding: 1px 6px; }
body.touch .player .balls { margin-top: 5px; gap: 2px; min-height: 15px; font-size: 11px; flex-wrap: wrap; }
body.touch .mini { width: 15px; height: 15px; font-size: 7px; }
body.touch .mini i { width: 8px; height: 8px; }
body.touch .mini.stripe::before, body.touch .mini.stripe::after { height: 4px; }
body.touch #status { top: max(8px, env(safe-area-inset-top)); padding: 6px 14px; font-size: 12px; max-width: calc(100% - 470px); overflow: hidden; text-overflow: ellipsis; }
body.touch #clock { top: 42px; font-size: 12px; }
body.touch #banner { top: 64px; padding: 8px 16px; font-size: 13px; white-space: normal; text-align: center; width: max-content; max-width: max(300px, calc(100% - 470px)); }
body.touch #emoteShow { top: 96px; font-size: 14px; }
body.touch #lockmsg { display: none !important; }
body.touch #hint { bottom: max(10px, env(safe-area-inset-bottom)); padding: 6px 12px; font-size: 11.5px; line-height: 1.5; max-width: calc(100% - 360px); }
body.touch #hint:empty { display: none; }

/* 右侧力度条：往下拉、松手出杆 */
body.touch #power { pointer-events: auto; touch-action: none; right: max(8px, env(safe-area-inset-right)); top: 80px; bottom: 64px; transform: none; gap: 4px; width: 60px; }
body.touch #power .bar { flex: 1; height: auto; width: 48px; border-radius: 16px; }
body.touch #power .fill { top: 3px; bottom: auto; background: linear-gradient(to bottom, #22c55e, #facc15 55%, #ef4444); }
body.touch #power .fill.pull { background: linear-gradient(to bottom, #94a3b8, #e2e8f0); }
body.touch #power .lbl { font-size: 11px; white-space: nowrap; color: #cfc6b6; }
body.touch #power.ready .lbl { color: var(--gold); font-weight: 700; }
body.touch #power.ready .bar { border-color: rgba(231,194,125,0.75); animation: readyPulse 1.6s ease-in-out infinite; }
body.touch #power.ready .bar::before { content: "⇣"; position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-size: 20px; color: var(--gold); opacity: 0.85; }
body.touch #power.on .bar { border-color: #fff; }

/* 微调方向、俯视、放下白球、表情、全屏 */
body.touch #tAim { display: flex; gap: 8px; position: absolute; right: 78px; bottom: max(10px, env(safe-area-inset-bottom)); pointer-events: auto; transition: opacity .2s; }
body.touch #tAim button { width: 54px; height: 46px; padding: 0; font-size: 18px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); touch-action: none; }
body.touch #tAim button:active { background: rgba(231,194,125,0.35); }
body.touch #tAim.off { opacity: 0.3; pointer-events: none; }
body.touch #tTop { display: block; position: absolute; left: max(8px, env(safe-area-inset-left)); bottom: 196px; pointer-events: auto; padding: 9px 14px; background: var(--glass); }
body.touch #tTop.on { background: var(--gold); color: #2a1a08; border-color: var(--gold); font-weight: 700; }
body.touch #tPlace { display: block; position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); pointer-events: auto; padding: 12px 28px; font-size: 16px; font-weight: 700;
  border-radius: 16px; background: linear-gradient(135deg, #1f7a46, #15603a); border-color: rgba(120,220,160,0.5); box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
body.touch #tBar { display: flex; gap: 8px; position: absolute; left: max(8px, env(safe-area-inset-left)); top: 82px; pointer-events: auto; }
body.touch #tBar button { width: 42px; height: 40px; padding: 0; font-size: 17px; background: var(--glass); }
body.touch #menuBtn { right: max(8px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); padding: 12px 6px; font-size: 13px; width: 60px; }
body.touch #emotes { left: max(8px, env(safe-area-inset-left)); right: auto; top: 130px; bottom: auto; }
body.touch #emotes:not(.open) { display: none; }
body.touch #emotes button { opacity: 0.92; padding: 8px 14px; }

/* 左下角击球点：缩小 */
body.touch #tipbox { left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); width: 100px; padding: 6px; border-radius: 14px; touch-action: none; }
body.touch #tipbox .ttl { font-size: 11px; margin-bottom: 2px; }
body.touch #tipcv { width: 84px; height: 84px; }
body.touch #elevcv { width: 84px; height: 34px; margin-top: 2px; }
body.touch #tiptext { font-size: 11px; padding: 2px 0; text-decoration: underline dotted; }
body.touch #elevtext { font-size: 10px; }

/* 竖屏手机：两个信息面板各占一半，状态往下放 */
@media (orientation: portrait) {
  body.touch .player { width: calc(50% - 12px); }
  body.touch #status { top: 86px; max-width: calc(100% - 24px); }
  body.touch #clock { top: 118px; }
  body.touch #banner { top: 168px; max-width: calc(100% - 24px); }
  body.touch #emoteShow { top: 210px; }
  body.touch #tBar { top: 124px; }
  body.touch #emotes { top: 172px; }
  body.touch #power { top: 130px; bottom: 70px; }
  body.touch #hint { display: none; }
}
/* 很矮的横屏（小手机）：再紧凑一些 */
@media (max-height: 380px) {
  body.touch .player .balls { display: none; }
  body.touch #tTop { bottom: 180px; }
  body.touch #tipcv { width: 72px; height: 72px; }
  body.touch #elevcv { width: 72px; height: 29px; }
  body.touch #tipbox { width: 88px; }
  body.touch #power { top: 60px; }
  body.touch #tBar { top: 56px; }
  body.touch #emotes { top: 102px; }
  body.touch #banner { top: 48px; }
}

/* 建议横屏的动画提示：手机图标从竖着转成横着 */
#rotateHint { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(8, 6, 5, 0.9);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: rhIn .4s ease-out; }
@media (orientation: landscape) { #rotateHint { display: none !important; } }
.rh { text-align: center; padding: 24px; }
.rhPhone { position: relative; width: 66px; height: 116px; margin: 16px auto 30px; border: 4px solid #f5ecd9; border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: rhTurn 2.6s cubic-bezier(.6,0,.3,1) infinite; }
.rhPhone i { position: absolute; left: 5px; right: 5px; top: 8px; bottom: 14px; border-radius: 4px; overflow: hidden;
  background: radial-gradient(ellipse at center, #1f9a58, #137a40 75%); }
.rhPhone i::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #f7f5ee; left: 50%; top: 70%; margin: -4.5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4); animation: rhBall 2.6s ease-in-out infinite; }
.rhPhone b { position: absolute; left: 50%; bottom: 4px; width: 14px; height: 3px; margin-left: -7px; border-radius: 2px; background: #f5ecd9; }
.rhArrow { font-size: 26px; line-height: 1; color: var(--gold); margin-top: -14px; animation: rhPulse 2.6s ease-in-out infinite; }
.rhT { margin: 14px 0 6px; font-size: 21px; font-weight: 700; color: #f5ecd9; letter-spacing: 2px; }
.rhS { margin: 0 0 22px; font-size: 13px; color: #a99f8f; }
#rotateOk { padding: 10px 22px; font-size: 14px; background: transparent; }
@keyframes rhIn { from { opacity: 0; } }
@keyframes rhTurn { 0%, 18% { transform: rotate(0deg); } 48%, 78% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
@keyframes rhBall { 0%, 48% { top: 70%; } 63% { top: 30%; } 78%, 100% { top: 70%; } }
@keyframes rhPulse { 0%, 100% { opacity: 0.35; transform: scale(.9); } 40% { opacity: 1; transform: scale(1.05); } }

/* 菜单和弹窗：矮屏幕（手机横屏）时紧凑一些 */
@media (max-height: 520px) {
  .panel { padding: 14px 20px; border-radius: 20px; }
  .logo { display: none; }
  h1 { font-size: 24px; margin-top: 0; }
  #menu .sub { margin-bottom: 8px; }
  .mode { padding: 10px 14px; }
  .modes { gap: 8px; }
  .foot { margin-top: 10px; padding-top: 10px; }
  .big { padding: 10px 14px; margin: 8px 0; }
  .side .box { height: 220px; }
}
@media (max-width: 600px) {
  .keys td:first-child { width: auto; white-space: normal; }
  .panel.wide { padding: 18px 14px; }
}

/* 房间：触屏没有"鼠标移上去"，点一下球桌显示按钮 */
body.touch .tb:hover .acts, body.touch .tb:focus-within .acts { opacity: 0; pointer-events: none; }
body.touch .tb.open .acts { opacity: 1; pointer-events: auto; }
body.touch .tb.open { background: rgba(255,255,255,0.06); border-color: var(--line); }
body.touch .acts button { padding: 7px 10px; font-size: 13px; }
body.touch .lobbyBar #onlineStatus:empty::before { content: "提示：点一下球桌显示按钮。空桌可以练习或坐下等对手；有人的桌子可以邀请、加入或观战。"; }

/* ================= 滚动条：细、深色，和界面统一（替代浏览器默认的白色滚动条） ================= */
* { scrollbar-width: thin; scrollbar-color: rgba(231,194,125,0.35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(231,194,125,0.28); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(231,194,125,0.5); }
::-webkit-scrollbar-corner, ::-webkit-scrollbar-button { display: none; background: transparent; }

/* ================= 弹窗（设置 / 规则 / 排行榜）：固定标题和按钮，只有中间内容滚动 ================= */
.panel.sheet { display: flex; flex-direction: column; height: min(680px, calc(100vh - 32px)); height: min(680px, calc(100dvh - 24px)); overflow: hidden; padding: 20px 24px 16px; }
.panel.sheet.narrow { width: 540px; height: auto; max-height: min(680px, calc(100dvh - 24px)); }
.sheetHead { display: flex; align-items: center; gap: 10px; flex: none; margin-bottom: 12px; }
.sheetHead h2 { margin: 0; flex: 1; font-size: 20px; }
.x { width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 15px; line-height: 1; flex: none; color: #cfc6b6; background: rgba(255,255,255,0.06); }
.x:hover { color: #fff; }
.sheetBody { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 -10px; padding: 2px 10px; }
.sheet > .big { flex: none; margin: 14px 0 0; }
/* 分段选择（标签页） */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,0.3); border: 1px solid var(--line); flex: none; margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px 6px; border: none; border-radius: 10px; background: transparent; color: #bfb5a3; font-size: 13px; white-space: nowrap; }
.seg button:hover { background: rgba(255,255,255,0.07); color: #f2ead9; }
.seg button.on { background: var(--gold); color: #2a1a08; font-weight: 700; }

/* 规则与操作 */
.lead { margin: 0 0 12px; font-size: 13px; color: #cfc6b6; line-height: 1.7; }
.lead b { color: var(--gold); }
kbd { display: inline-block; padding: 2px 8px; margin: 1px 2px; border-radius: 7px; font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; color: #f2ead9; white-space: nowrap;
  background: linear-gradient(#2c241d, #1d1712); border: 1px solid rgba(255,230,190,0.18); border-bottom-width: 2px; }
.keylist { display: flex; flex-direction: column; gap: 6px; }
.keylist > div { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,0.035); }
.keylist > div > span { flex: 0 0 255px; }
.keylist p { margin: 0; font-size: 13px; color: #d6cebf; }
.keylist .hl { background: rgba(231,194,125,0.09); border: 1px solid rgba(231,194,125,0.25); }
.keylist .hl b { color: var(--gold); }
h3 { margin: 18px 0 8px; font-size: 14px; color: var(--gold); }
.keygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 13px; color: #d6cebf; }
.keygrid > div { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.035); }
.rulecards { display: grid; gap: 8px; }
.rulecards > div { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.035); border: 1px solid transparent; }
.rulecards i { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 14px;
  color: #2a1a08; background: var(--gold); }
.rulecards .win { border-color: rgba(231,194,125,0.3); background: rgba(231,194,125,0.07); }
.rulecards .win i { background: radial-gradient(circle, #f2eee3 0 45%, #111 47%); color: #111; font-size: 12px; }
.rulecards p { margin: 0; font-size: 13px; line-height: 1.7; color: #d6cebf; }
.rulecards p b { display: block; color: #f6eedd; font-size: 14px; margin-bottom: 1px; }

/* 设置 */
.setGroup { border-radius: 16px; background: rgba(255,255,255,0.035); border: 1px solid var(--line); margin-bottom: 10px; overflow: hidden; }
.setRow { display: flex; align-items: center; gap: 14px; padding: 13px 16px; }
.setRow + .setRow { border-top: 1px solid rgba(255,255,255,0.05); }
.setRow .lab { flex: 1; min-width: 0; }
.setRow .lab b { display: block; font-size: 14px; color: #f2ead9; font-weight: 600; }
.setRow .lab small { display: block; font-size: 11.5px; color: #8f8574; margin-top: 2px; }
.setRow .ctl { display: flex; align-items: center; gap: 10px; width: 210px; flex: none; }
.setRow .v { width: 42px; text-align: right; font-size: 13px; color: var(--gold); font-variant-numeric: tabular-nums; }
.switch { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 13px; background: rgba(255,255,255,0.15); transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #f2ead9; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.switch input:checked + i { background: #22a35a; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 排行榜 */
.rankNote { margin: -4px 0 10px; font-size: 12px; color: #8f8574; text-align: center; flex: none; min-height: 16px; }
#rankList { display: flex; flex-direction: column; gap: 5px; }
#rankList .r { display: grid; grid-template-columns: 34px minmax(0, 1fr) 66px 62px 84px; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.035); font-size: 13.5px; }
#rankList .r .no { font-weight: 800; color: #a99f8f; text-align: center; font-size: 14px; }
#rankList .r.top .no { font-size: 20px; }
#rankList .r.p1 { background: linear-gradient(90deg, rgba(250,204,21,0.16), rgba(255,255,255,0.03)); }
#rankList .r.p2 { background: linear-gradient(90deg, rgba(203,213,225,0.13), rgba(255,255,255,0.03)); }
#rankList .r.p3 { background: linear-gradient(90deg, rgba(217,119,6,0.15), rgba(255,255,255,0.03)); }
#rankList .r.me { outline: 1px solid rgba(231,194,125,0.6); }
#rankList .r .nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
#rankList .r .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rankList .r .nm em { font-style: normal; font-size: 11px; color: var(--gold); flex: none; }
#rankList .r .sc { text-align: right; color: var(--gold); font-weight: 700; }
#rankList .r .sc small, #rankList .r .fl small { font-weight: 400; color: #8f8574; font-size: 11px; margin-left: 1px; }
#rankList .r .fl { text-align: right; color: #cfc6b6; }
#rankList .r time { text-align: right; color: #6f675b; font-size: 11.5px; }
#rankList .head { background: none; padding: 0 12px 2px; font-size: 11px; color: #6f675b; }
#rankList .head .sc, #rankList .head .fl { color: #6f675b; font-weight: 400; }
#rankList .empty { text-align: center; color: #a99f8f; padding: 36px 10px; font-size: 13px; line-height: 1.8; }
#rankMe { flex: none; margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 13px; text-align: center; color: #cfc6b6;
  background: rgba(231,194,125,0.08); border: 1px solid rgba(231,194,125,0.25); }
#rankMe:empty { display: none; }
#rankMe b { color: var(--gold); }
#overCloud { margin: 2px 0 10px; padding: 10px 14px; border-radius: 12px; text-align: center; font-size: 14px; color: #cfc6b6;
  background: rgba(231,194,125,0.08); border: 1px solid rgba(231,194,125,0.25); }
#overCloud b { color: var(--gold); font-size: 16px; }
#overCloud.new { border-color: rgba(250,204,21,0.7); box-shadow: 0 0 24px rgba(250,204,21,0.18); }

@media (max-width: 600px) {
  .keylist > div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .keylist > div > span { flex: none; }
  .keygrid { grid-template-columns: 1fr; }
  .seg button { font-size: 12px; padding: 7px 4px; }
  .setRow { flex-wrap: wrap; }
  .setRow .ctl { width: 100%; }
  #rankList .r { grid-template-columns: 28px minmax(0, 1fr) 58px 52px; }
  #rankList .r time { display: none; }
}
@media (max-height: 520px) {
  .panel.sheet { padding: 12px 18px 10px; }
  .sheetHead { margin-bottom: 8px; }
  .seg { margin-bottom: 8px; }
  .sheet > .big { margin-top: 8px; padding: 9px; }
}
#rankList .head .no { font-size: 11px; font-weight: 400; color: #6f675b; }
@media (max-height: 520px) { .rankNote { display: none; } #rankMe { margin-top: 6px; padding: 6px 10px; } }
