.room-layout .room-toolbar [data-room-switch]{background:#eeb500}
.room-layout .room-toolbar [data-room-scratch]{background:#fa4046}
.room-layout .room-toolbar [data-go="充值"]{background:#11a64e}
.room-layout .room-toolbar [data-go="提现"]{background:#f26300}
.room-tool-dialog{padding:0;border:0;color:#333;box-sizing:border-box;max-width:100vw;max-height:100dvh}
.room-tool-dialog::backdrop{background:#000a}
.room-tool-dialog button{cursor:pointer;font:inherit}
.room-switch-dialog{margin:auto 0 0;width:100%;height:60dvh;border-radius:20px 20px 0 0;background:white;overflow:auto}
.room-switch-dialog header{display:flex;align-items:center;justify-content:center;position:sticky;top:0;background:#fff;padding:18px 48px;border-bottom:1px solid #eee;z-index:1}
.room-switch-dialog h2{margin:0;font-size:22px}.room-switch-dialog header button{position:absolute;right:18px;top:10px;border:0;background:none;font-size:32px;color:#999}
.room-switch-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;padding:20px}
.room-switch-item{display:flex;gap:12px;align-items:center;position:relative;border:1px solid #e8edf4;border-radius:12px;background:#f7f9fc;padding:16px;text-align:left;min-width:0;color:#333}
.room-switch-item.selected{background:#eaf3ff;border-color:#5798ff}.room-switch-item img{width:64px;height:64px;object-fit:contain}.room-switch-item b{display:block;font-size:16px}.room-switch-item small{display:block;color:#7690af;margin-top:8px}.room-switch-item i{position:absolute;right:8px;bottom:6px;color:#2a83ff}
.room-scratch-dialog {
  width:min(620px, 100vw); margin:auto; padding:10px;
  overflow:auto; overscroll-behavior:contain; background:transparent;
}
.room-scratch-dialog::backdrop { background:rgba(24,12,30,.9); }
.room-scratch-card {
  position:relative; box-sizing:border-box; min-width:0; text-align:center;
  padding:clamp(32px,6vh,54px) clamp(10px,3vw,24px) 20px;
  border:2px solid #b93675; border-radius:14px;
  color:#852854; background:linear-gradient(150deg,#fff9fc,#ffedf5 62%,#ffe5f0);
  box-shadow:inset 0 0 0 4px #fff9;
}
.room-scratch-card h2 { margin:0 0 18px; font-size:clamp(19px,5vw,29px); font-weight:700; color:#9c2358; }
.room-scratch-card .scratch-dismiss {
  position:absolute; top:2px; right:4px; width:34px; height:32px;
  border:0; background:transparent; color:#8c4a68; font-size:22px;
}
.room-scratch-surface {
  position:relative; aspect-ratio:2 / 1; display:grid; place-items:center;
  border:3px solid #b93675; background:#fff9fc; overflow:hidden; user-select:none;
}
.room-scratch-surface canvas { position:absolute; inset:0; width:100%; height:100%; touch-action:none; cursor:crosshair; }
.room-scratch-surface [data-scratch-result] {
  display:flex; align-items:center; justify-content:center; white-space:nowrap;
  gap:clamp(2px,.9vw,7px); color:#472a4a; font-variant-numeric:tabular-nums;
}
.room-scratch-surface .draw-ball {
  width:clamp(33px,10.4vw,62px); height:clamp(33px,10.4vw,62px); border-radius:50%;
  color:white; background:linear-gradient(145deg,#8940b6,#55217d);
  font-size:clamp(19px,5.6vw,35px); font-weight:600; line-height:1;
}
.room-scratch-surface .draw-total { background:linear-gradient(145deg,#6545ee,#3523a5); }
.room-scratch-surface .draw-operator,.room-scratch-surface .draw-label { color:#533b52; font-size:clamp(14px,4vw,24px); }
.room-scratch-surface .draw-label { margin-left:3px; }
.room-scratch-card > p { font-size:clamp(16px,4.6vw,24px); line-height:1.5; margin:0; font-variant-numeric:tabular-nums; }
.room-scratch-card [data-scratch-current] { margin-top:clamp(16px,3vh,28px); }
.room-scratch-card [data-scratch-clock] { margin-top:4px; font-weight:650; }
.scratch-slogans { display:grid; justify-items:center; gap:5px; margin:clamp(20px,4vh,32px) 0 18px; font-weight:bold; font-size:clamp(14px,3.9vw,21px); }
.scratch-slogans span { background:linear-gradient(100deg,#a52966,#ad551e 50%,#177650 74%,#2869a6); color:transparent; background-clip:text; -webkit-background-clip:text; }
.room-scratch-card footer { display:grid; gap:10px; }
.room-scratch-card footer button { border:0; border-radius:9px; min-height:46px; font-weight:650; font-size:16px; }
.room-scratch-card [data-scratch-refresh] { color:#fff; background:#334fc5; }
.room-scratch-card footer [data-room-tool-close] { color:#57281d; background:#efae92; }
@media(max-width:700px){.room-switch-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px}.room-switch-item{flex-direction:column;padding:14px 8px;text-align:center}.room-switch-item img{width:56px;height:56px}.room-switch-item b{font-size:14px}.room-layout .room-toolbar{top:30%;gap:8px}}
@media(max-height:540px){.room-layout .room-toolbar{top:70px;gap:5px}.room-layout .room-toolbar button{width:40px;height:40px;font-size:12px}}

/* Keep the original five shortcuts in place until the user expands the list. */
.room-layout .room-toolbar-list,.room-layout .room-toolbar-extra:not([hidden]){display:contents}
.room-layout .room-toolbar-extra[hidden]{display:none}
.room-layout .room-toolbar .room-toolbar-toggle{
  position:absolute;right:0;bottom:100%;width:100%;height:30px;padding:0;
  display:grid;place-items:center;border-radius:18px;background:#fff;color:#366bc6;
}
.room-toolbar-toggle span{width:9px;height:9px;border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-2px) rotate(45deg)}
.room-toolbar-toggle[aria-expanded="true"] span{transform:translateY(2px) rotate(225deg)}
.room-layout .room-toolbar.expanded{
  --shortcut-size:clamp(34px,calc(9dvh - 20px),54px);
  top:clamp(84px,22dvh,178px);bottom:calc(92px + env(safe-area-inset-bottom,0px));width:var(--shortcut-size);pointer-events:none;
}
.room-layout .room-toolbar.expanded .room-toolbar-toggle{pointer-events:auto}
.room-layout .room-toolbar.expanded .room-toolbar-list{
  display:flex;flex-direction:column;align-items:center;gap:5px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;pointer-events:auto;
}
.room-toolbar-list::-webkit-scrollbar{display:none}
.room-layout .room-toolbar.expanded .room-toolbar-list button{flex:none;width:var(--shortcut-size);height:var(--shortcut-size);padding:0}
.room-layout .room-toolbar-extra [data-go="红包聊天室"]{background:#c83786}
.room-layout .room-toolbar-extra [data-go="客服"]{background:#168bd6}
.room-layout .room-toolbar-extra [data-go="代理中心"]{background:#6863a4}
.room-layout .room-toolbar-extra [data-room-trend]{background:#b87739}
.room-layout .room-toolbar-extra [data-room-shortcuts-back]{background:#666887}
.service-header .service-room-back{width:36px;height:100%;border:0;background:transparent;color:inherit;font-size:26px;cursor:pointer}
@media(max-height:450px){.room-layout .room-toolbar.expanded{top:65px;bottom:62px}}

.room-tool-dialog.room-trend-dialog{position:fixed;inset:0;margin:auto;width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;overflow:hidden;border-radius:0;background:white;color:#323641}
.room-trend-dialog .trend-view{display:flex;flex-direction:column;height:100%;max-width:850px;margin:auto;background:#fff;font:15px/1.35 "Microsoft YaHei",system-ui,sans-serif;box-sizing:border-box}
.room-trend-dialog .trend-heading{position:relative;flex:none;display:grid;place-items:center;min-height:48px;box-sizing:content-box;padding:env(safe-area-inset-top,0px) 46px 0;background:#fff;color:#242633}
.trend-heading h2{margin:0;font-size:18px;font-weight:600}
.room-trend-dialog .trend-heading button{position:absolute;left:max(2px,env(safe-area-inset-left,0px));bottom:0;width:44px;height:46px;border:0;background:transparent;color:#316ec1;font-size:30px;line-height:1}
.trend-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom,0px)}
.trend-scroll table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:100%;font-variant-numeric:tabular-nums}
.trend-scroll thead{position:sticky;top:0;z-index:1}
.trend-scroll th,.trend-scroll td{padding:6px 0;text-align:center;vertical-align:middle;font-size:clamp(12px,3.2vw,15px)}
.trend-scroll th{height:27px;background:#e9be3f;color:#493d18;font-weight:600}
.trend-scroll th:first-child{width:22%}.trend-scroll th:nth-child(2){width:9%}
.trend-scroll .trend-gaps td{background:#f4db7c;color:#493d18}
.trend-scroll tbody td{height:27px}
.trend-scroll tbody td:nth-child(2){color:#355faa;font-weight:650}
.trend-scroll tbody tr:nth-child(even){background:#edf0ef}
.trend-mark{display:inline-block;box-sizing:border-box;max-width:100%;border-radius:1em;padding:3px min(.8vw,6px);white-space:nowrap;font-size:clamp(11px,2.8vw,14px);line-height:1.2;color:white}
.trend-warm{background:#bd414c}.trend-cool{background:#376ec2}
.trend-status{padding:16px;text-align:center;color:#5c6370}
.trend-status button{margin-left:8px;border:1px solid #c7d4e5;border-radius:4px;background:white;padding:4px 9px;color:#32619c}

.room-layout .local-header {
  display: grid;
  grid-template-columns: minmax(36px, 1fr) minmax(0, auto) minmax(max-content, 1fr);
  gap: 8px;
  align-items: center;
  height: auto;
  min-height: 46px;
  padding-inline: 8px;
}
.room-layout .local-header > button { position: static; min-height: 44px; height: auto; }
.room-layout .local-header > .local-back { justify-self: start; min-width: 36px; }
.room-layout .local-header > strong { min-width: 0; text-align: center; overflow-wrap: anywhere; line-height: 1.25; }
.room-layout .local-header > .local-right { justify-self: end; white-space: nowrap; padding-inline: 6px; font-size: 14px; }
