/* A shared conversation surface for the waiting room and every live table. */
#app .room-immersive .side-panel{
  --surface:#fffdf7;--surface-2:#f4f1e7;--text:#292d3e;--text-2:#77786f;--text-3:#959387;--border:#e8e4d6;--brand:#6062c9;--brand-soft:#eeedf9;--bubble:#f2efe7;--bubble-self:#e9e5fb;--on-brand:#fff;
  box-sizing:border-box;background:var(--surface);color:var(--text);padding:22px 20px 16px;font-family:CinemaInterface,'Microsoft YaHei',sans-serif;
}
html[data-theme=dark] #app .room-immersive .side-panel{--surface:#242b3b;--surface-2:#303747;--text:#efeee4;--text-2:#bdc0bd;--text-3:#a6aaa8;--border:#424956;--brand:#b8b4ff;--brand-soft:#353b53;--bubble:#30394a;--bubble-self:#454667;--on-brand:#202738}
#app .room-immersive .side-panel .waiting-chat-title{display:block;flex:none;margin:0 0 18px;font-size:19px;line-height:1.4;font-weight:600;color:var(--text)}
#app .room-immersive .side-panel>.drawer-heading{padding:0 0 10px;border:0;background:none;color:var(--text)}
#app .room-immersive .side-panel:has(>.drawer-heading:not([hidden]))>.room-sidebar-title{display:none}
#app .room-immersive .room-info-tabs{gap:24px;min-height:40px;padding:0;border:0;border-bottom:1px solid var(--border)}
#app .room-immersive .room-info-tabs>button{position:relative;flex:none;min-height:40px;padding:0 2px;border:0;border-radius:0;box-shadow:none;background:none;color:var(--text-2);font-size:12px;font-weight:500}
#app .room-immersive .room-info-tabs>button[aria-selected=true]{color:var(--brand);background:none;box-shadow:inset 0 -2px var(--brand)}
#app .room-immersive .side-panel[data-tab=players]>.panel-section.room-members{display:flex;flex-direction:column;flex:1;min-height:0;margin:0;padding:0;border:0;overflow:hidden}
#app .room-immersive .side-panel[data-tab=players] .room-members-summary{flex:none;cursor:default}
#app .room-immersive .side-panel[data-tab=players] .room-members-summary::after{content:none}
#app .room-immersive .side-panel[data-tab=players] .players-list{flex:1;min-height:0;max-height:none;overflow:auto}
#app .room-immersive .side-panel[data-tab=round]>.room-members,#app .room-immersive .side-panel[data-tab=round]>.chat-area{display:none}
.room-members-summary{display:flex;align-items:center;gap:8px;min-height:42px;list-style:none;font-size:11px;color:var(--text-2);cursor:pointer}
.room-members-summary::-webkit-details-marker{display:none}.room-members-summary::after{content:'⌄';margin-left:auto}.room-members[open]>.room-members-summary::after{content:'⌃'}
#app .room-immersive .side-panel .players-list{max-height:180px;overflow:auto;padding:0 0 8px;overscroll-behavior:contain}
#app .room-immersive .side-panel .player-item{gap:10px;min-height:44px;padding:7px 0;margin:0;background:none;border:0;border-radius:0;cursor:default}
#app .room-immersive .side-panel .player-item.is-turn{background:var(--brand-soft);border-radius:6px;padding-left:5px;padding-right:5px}
#app .room-immersive .side-panel .player-avatar{width:30px;height:30px;border:0;box-shadow:none;flex:none}
.side-panel .player-avatar>span:first-child,.side-panel .player-avatar>span:first-child>*{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover}
#app .room-immersive .side-panel .player-name{font-size:11px;font-weight:500;line-height:1.5;color:var(--text);white-space:normal;overflow-wrap:anywhere}
#app .room-immersive .side-panel .player-status{font-size:9px;color:var(--text-2);line-height:1.6}
#app .room-immersive .side-panel .player-details{min-width:0;flex:1}
#app .room-immersive .side-panel .player-actions select{min-height:30px;max-width:62px;padding:3px;font-size:10px;background:var(--surface);color:var(--text)}
#app .room-immersive .side-panel .player-transfer-host{width:auto;min-height:36px;padding:0 7px;border-radius:999px;white-space:nowrap}
#app .room-immersive .side-panel .player-avatar .crown{top:-5px;left:0;transform:none;width:12px;height:12px}
#app .room-immersive .side-panel .player-avatar .ready-check{width:12px;height:12px}
#app .room-immersive .side-panel .chat-area{padding:0;border:0;min-height:0;overflow:visible;flex:1}
#app .room-immersive .side-panel .chat-area>.panel-header{display:none}
#app .room-immersive .side-panel .chat-messages{padding:14px 0;max-height:none;min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#app .room-immersive .side-panel .chat-message{display:flex;gap:9px;margin:0;padding:10px 0;background:none;border:0;border-radius:0;font-size:12px;line-height:1.75;color:var(--text);overflow-wrap:anywhere}
.chat-avatar{display:block;width:28px;height:28px;flex:none;background:var(--surface-2);border-radius:50%;overflow:hidden}.chat-avatar>*{display:block;width:100%;height:100%;object-fit:cover}
.chat-message-copy{flex:0 1 auto;min-width:0;max-width:calc(100% - 37px)}.chat-message-copy>header{display:flex;gap:5px;align-items:center;margin-bottom:5px;min-height:16px}
#app .room-immersive .side-panel .chat-message .sender{color:var(--text-2);font-size:10px;font-weight:500;margin:0;flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#app .room-immersive .side-panel .chat-message .chat-time{color:var(--text-3);font-size:9px;white-space:nowrap;margin:0 0 0 auto}
#app .room-immersive .side-panel .chat-message.is-self .sender{color:var(--brand)}
#app .room-immersive .side-panel .chat-message.is-system{padding:7px 0;color:var(--text-3);font-size:10px;text-align:center}
.chat-message.is-system .chat-message-copy>header{justify-content:center;margin:0}.chat-avatar[hidden]{display:none}
#app .room-immersive .side-panel .chat-input-area{position:relative;flex:none;padding:12px 0 0;border:0;border-top:1px solid var(--border);gap:6px;background:none;align-items:center}
#app .room-immersive .side-panel .chat-input{min-width:0;min-height:42px;padding:9px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);box-shadow:none;font-size:12px}
#app .room-immersive .side-panel .chat-send-btn{min-height:42px;padding:8px 10px;border:0;border-radius:8px;background:var(--brand);color:var(--on-brand);font-size:11px;box-shadow:none}
#app .room-immersive .side-panel .emoji-toggle{min-width:28px;min-height:38px;padding:5px;background:none;border:0;color:var(--text-2);box-shadow:none}
#app .room-immersive .side-panel .room-round-info{padding:18px 0;overflow:auto;min-height:0;overscroll-behavior:contain;scrollbar-width:thin}
#app .room-immersive .side-panel .match-history h3{font-size:12px;color:var(--text-2);font-weight:500;margin:0 0 10px}
#app .room-immersive .side-panel .match-history-round{padding:12px 0 16px}
.match-player-filter{display:flex;gap:5px;overflow:auto;margin:13px 0 7px;padding:2px 1px 5px;scrollbar-width:thin}
#app .match-player-filter button{flex:none;min-height:30px;padding:4px 10px;border:1px solid var(--border);border-radius:18px;background:none;color:var(--text-2);font-size:10px;box-shadow:none;white-space:nowrap}
#app .match-player-filter button[aria-pressed=true]{color:var(--brand);border-color:var(--brand);background:var(--brand-soft)}
.match-filter-count,.match-filter-empty{font-size:10px;color:var(--text-3)}
#app .match-steps{gap:0;margin:12px 0}.match-steps>li{position:relative;padding:0 0 14px 12px;border-left:1px solid var(--border)}
.match-steps>li::before{content:'';position:absolute;left:-3px;top:7px;width:5px;height:5px;border-radius:50%;background:var(--brand)}
.match-step-copy{width:100%;min-width:0}.match-step-copy>header{display:flex;gap:8px;justify-content:space-between;align-items:baseline;margin-bottom:4px}.match-step-copy b{font-size:11px;font-weight:500;color:var(--text)}
#app .match-step-copy time{font-size:9px;padding:0;white-space:nowrap}.match-step-copy>span{display:block;font-size:12px;line-height:1.75;color:var(--text-2)}
.match-step-effect{display:block;margin-top:4px;font-size:10px;line-height:1.7;color:var(--text-3)}
#app .match-steps button{display:block;width:100%;padding:0;text-align:left;min-height:0}.match-steps button:hover .match-step-copy>span{color:var(--brand)}
:is(.room-interrupt-dialog,.room-transfer-dialog){box-sizing:border-box;width:min(420px,calc(100vw - 32px));padding:26px;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text)}
:is(.room-interrupt-dialog,.room-transfer-dialog)::backdrop{background:#111c2b88;backdrop-filter:blur(3px)}
:is(.room-interrupt-dialog,.room-transfer-dialog) h2{font-size:20px;margin:0 0 12px}
:is(.room-interrupt-dialog,.room-transfer-dialog) p{font-size:13px;line-height:1.8;color:var(--text-2);margin:0 0 22px}
:is(.room-interrupt-dialog,.room-transfer-dialog) footer{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
:is(.room-interrupt-dialog,.room-transfer-dialog) button{font-size:12px;min-height:40px}
@media(max-width:700px){#app .room-immersive .side-panel{padding:14px 17px 12px}#app .room-immersive .side-panel .waiting-chat-title{font-size:17px;margin-bottom:9px}#app .room-immersive .room-info-tabs{min-height:35px}#app .room-immersive .room-info-tabs>button{min-height:35px;font-size:11px}.room-members-summary{min-height:36px;font-size:10px}#app .room-immersive .side-panel .players-list{max-height:118px}#app .room-immersive .side-panel .chat-messages{padding:7px 0}#app .room-immersive .side-panel .chat-message{padding:7px 0}}
@media(max-height:500px){#app .room-immersive .side-panel .waiting-chat-title{margin-bottom:6px;font-size:15px}#app .room-immersive .side-panel{padding-top:10px}.room-members-summary{min-height:32px}}

/* Bubbles share the scene's hue, while the reading surface stays quiet. */
#app .room-immersive .side-panel .chat-bubble{padding:9px 11px;border-radius:3px 13px 13px 13px;background:var(--bubble);color:var(--text);text-align:left}
.chat-message-text{white-space:pre-wrap;overflow-wrap:anywhere}
#app .room-immersive .side-panel .chat-message.is-self{flex-direction:row-reverse}
#app .room-immersive .side-panel .is-self .chat-bubble{background:var(--bubble-self);border-radius:13px 3px 13px 13px}
#app .room-immersive .side-panel .is-self .chat-message-copy>header{justify-content:flex-end}
#app .room-immersive .side-panel .chat-host-label{flex:none;padding:0 4px;border-radius:4px;background:var(--brand-soft);color:var(--brand);font-size:9px;line-height:17px;white-space:nowrap}
.chat-host-label[hidden]{display:none!important}
#app .room-immersive .side-panel .is-system{justify-content:center}
#app .room-immersive .side-panel .is-system .chat-message-copy{max-width:100%;flex:1}
#app .room-immersive .side-panel .is-system .chat-message-copy>header{display:none}
#app .room-immersive .side-panel .is-system .chat-bubble{padding:0;background:none;color:var(--text-3);text-align:center;font-size:10px}
#app .room-immersive .side-panel .is-sticker .chat-bubble{padding:0;background:none}
#app .room-immersive .side-panel .sticker-img{max-width:100%;object-fit:contain}
#app .room-immersive[data-chat-palette=warm] .side-panel{--surface:#fff8f0;--surface-2:#f5e8d9;--text:#453328;--text-2:#7e6856;--text-3:#8f7967;--border:#eadbcb;--brand:#99502e;--brand-soft:#f4e1d1;--bubble:#f2e8dc;--bubble-self:#f4d6b9;--on-brand:#fff}
#app .room-immersive[data-chat-palette=blue] .side-panel{--surface:#edf4f7;--surface-2:#e0ebf0;--text:#233d4c;--text-2:#546f7d;--text-3:#6a808b;--border:#cfdee6;--brand:#28617a;--brand-soft:#dae9ef;--bubble:#fff;--bubble-self:#cbdfe9;--on-brand:#fff}
#app .room-immersive[data-chat-palette=wood] .side-panel{--surface:#fbf4e9;--surface-2:#f1e4d1;--text:#47372b;--text-2:#7d6852;--text-3:#8b7966;--border:#e5d6bf;--brand:#80562f;--brand-soft:#efe1cb;--bubble:#f0e6d7;--bubble-self:#e8d4b7;--on-brand:#fff}
#app .room-immersive[data-chat-palette=felt] .side-panel{--surface:#edf2e9;--surface-2:#dce5d6;--text:#2a4435;--text-2:#5b7160;--text-3:#72836e;--border:#d4dfce;--brand:#3e674d;--brand-soft:#dce8d5;--bubble:#fffdf5;--bubble-self:#d4e4c9;--on-brand:#fff}
#app .room-immersive[data-chat-palette=night] .side-panel{--surface:#192d43;--surface-2:#243d54;--text:#ecf1f4;--text-2:#bacbd5;--text-3:#98afbf;--border:#365066;--brand:#9ac7da;--brand-soft:#2a465f;--bubble:#243d54;--bubble-self:#355a73;--on-brand:#172e40}
html[data-theme=dark] #app .room-immersive[data-chat-palette=warm] .side-panel,html[data-theme=dark] #app .room-immersive[data-chat-palette=wood] .side-panel{--surface:#322722;--surface-2:#44342b;--text:#f6eadd;--text-2:#d4c1ae;--text-3:#b7a18e;--border:#5b4639;--brand:#ecc198;--brand-soft:#574133;--bubble:#44342b;--bubble-self:#654833;--on-brand:#322722}
html[data-theme=dark] #app .room-immersive[data-chat-palette=blue] .side-panel{--surface:#192e40;--surface-2:#263e51;--text:#eaf1f5;--text-2:#b7cbd6;--text-3:#96afbd;--border:#3c5668;--brand:#99c9df;--brand-soft:#2b485d;--bubble:#263e51;--bubble-self:#315c76;--on-brand:#192e40}
.player-timeouts{font-size:11px;line-height:1.6;color:var(--text-2);font-variant-numeric:tabular-nums}

/* A room keeps its conversation geometry while the table changes state. */
#app .room-container.room-immersive .side-panel{
  padding:18px 20px 16px;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
  font-size:14px;
}
#app .room-container.room-immersive .side-panel .room-info-tabs{gap:24px;min-height:42px;padding:0;border-bottom:1px solid var(--border)}
#app .room-container.room-immersive .side-panel .room-info-tabs>button{min-height:42px;padding:0 2px;font-size:14px;line-height:1.5}
#app .room-container.room-immersive .side-panel .chat-area{display:flex;flex-direction:column;flex:1;min-height:0;padding:0;border:0}
#app .room-container.room-immersive .side-panel .chat-messages{flex:1;min-height:0;max-height:none;padding:14px 0;line-height:1.65;font-size:14px;overflow:auto}
#app .room-container.room-immersive .side-panel .chat-message{padding:10px 0;font-size:14px;line-height:1.65}
#app .room-container.room-immersive .side-panel .chat-message .sender{font-size:12px}
#app .room-container.room-immersive .side-panel .chat-message .chat-time{font-size:10px}
#app .room-container.room-immersive .side-panel .chat-input-area{display:flex;flex:none;align-items:center;min-height:55px;box-sizing:border-box;padding:12px 0 0;gap:6px;border-top:1px solid var(--border)}
#app .room-container.room-immersive .side-panel .chat-input{box-sizing:border-box;min-width:0;min-height:42px;padding:9px 10px;font-size:14px;line-height:22px}
#app .room-container.room-immersive .side-panel .chat-send-btn{box-sizing:border-box;min-height:42px;padding:8px 10px;font-size:13px;line-height:24px}
#app .room-container.room-immersive .side-panel .emoji-toggle{min-width:28px;min-height:38px;padding:5px}
@media(max-width:700px){
  #app .room-container.room-immersive .side-panel{padding:10px 14px 12px}
  #app .room-container.room-immersive .side-panel .room-info-tabs{gap:22px;min-height:36px}
  #app .room-container.room-immersive .side-panel .room-info-tabs>button{min-height:36px;font-size:13px}
  #app .room-container.room-immersive .side-panel .chat-messages{padding:8px 0}
  #app .room-container.room-immersive .side-panel .chat-message{padding:8px 0}
}

/* Keep conversation text consistent across rooms and games. */
#app .room-container.room-immersive .side-panel .chat-message,
#app .room-container.room-immersive .side-panel .chat-messages,
#app .room-container.room-immersive .side-panel .chat-input{font-size:14px}
#app .room-container.room-immersive .side-panel .chat-message{padding:10px 0;line-height:1.65}
#app .room-container.room-immersive .side-panel .chat-input{line-height:22px;max-height:42px}
#app .room-container.room-immersive[data-chat-compact='true'] .side-panel .chat-input-area{flex-wrap:wrap}
#app .room-container.room-immersive[data-chat-compact='true'] .side-panel .chat-input{flex:1 0 100%;width:100%}
#app .room-container.room-immersive[data-chat-compact='true'] .side-panel .chat-jump-latest{bottom:114px}
#app .room-container.room-immersive .side-panel .chat-area{position:relative}
#app .room-container.room-immersive .side-panel .chat-jump-latest{position:absolute;z-index:4;left:50%;bottom:66px;transform:translateX(-50%);max-width:calc(100% - 12px);min-height:34px;padding:6px 14px;border:1px solid var(--border);border-radius:20px;background:var(--surface);box-shadow:0 3px 12px #0002;color:var(--brand);font-size:12px;line-height:20px;white-space:nowrap;cursor:pointer}
#app .room-container.room-immersive .side-panel .chat-jump-latest[hidden],.chat-unread-count[hidden]{display:none!important}
#app .room-container.room-immersive .side-panel .chat-messages{overflow-anchor:none;scroll-padding-bottom:50px}
.chat-unread-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;box-sizing:border-box;padding:0 5px;margin-left:5px;border-radius:12px;background:#db3445;color:#fff;font-size:10px;line-height:18px;font-variant-numeric:tabular-nums}
.chat-reading-announcement{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
#app .room-container .room-chat-button[data-unread]:not([data-unread=''])::after{content:attr(data-unread);position:absolute;top:-5px;right:-6px;min-width:18px;height:18px;box-sizing:border-box;padding:0 4px;border-radius:12px;background:#db3445;color:#fff;font:10px/18px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;text-align:center}
#app .room-container .room-chat-button{position:relative}

.room-interrupt-dialog footer{justify-content:space-between}
