:root{color-scheme:dark;--dark:#18120e;--panel:#261b14;--panel2:#3e2c1b;--gold:#dfb877;--pale:#fff0cf;--text:#eadfcf;--muted:#b9a38b;--line:#80613f;--green:#879d76}*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:radial-gradient(ellipse at 50% -20%,#624022,#20150e 65%,#140f0c);color:var(--text);font-family:system-ui,-apple-system,'Segoe UI',sans-serif}body{overflow-x:hidden}button,select{font:inherit}button{border:1px solid #745836;color:#ffecd0;background:linear-gradient(#453020,#2a1c15);border-radius:9px;cursor:pointer;transition:background .15s,border-color .15s;min-height:39px}button:hover{border-color:#e3b677;background:#513821}button:focus-visible,select:focus-visible{outline:2px solid #e8c887;outline-offset:2px}button:disabled{opacity:.45;cursor:not-allowed}#app{min-height:100svh;display:flex;flex-direction:column}.topbar{height:75px;padding:10px clamp(12px,3vw,42px);display:flex;align-items:center;justify-content:space-between;gap:14px;border-bottom:1px solid #89603545;background:#170f0bbb}.brand{display:flex;align-items:center;gap:13px;min-width:0}.brand-icon{font-size:39px;color:#d7a763;text-shadow:0 1px 10px #dcb15a55}.brand h1{font:500 clamp(19px,2.2vw,29px) Georgia,serif;white-space:nowrap;margin:0;color:#ffe5ad}.brand h1 span{color:#efddbb}.brand p{font-size:11px;letter-spacing:1.5px;text-transform:uppercase;color:#caa977;margin:4px 0 0}.top-actions{display:flex;align-items:center;gap:15px}.top-state{font-size:12px;color:#c8ab83}.soft{padding:10px 13px;border-color:#786043;background:#281d16;font-size:12px}main{flex:1;width:100%}.stage{position:relative;overflow:hidden;height:clamp(400px,calc(100svh - 195px),815px);background:#37251a;isolation:isolate;user-select:none}.stage:before{content:"";position:absolute;inset:-50px;z-index:-1;background:linear-gradient(90deg,#311b11ad,#311b1111,#311b11ad),url('assets/KINGS_HALL_CONTINUOUS_27_TABLES_V160.jpg') center/cover;filter:blur(22px) brightness(.55)}.room-viewport{position:absolute;inset:0;overflow:hidden;touch-action:none;cursor:grab}.room-viewport.panning{cursor:grabbing}.room-scene{position:absolute;left:0;top:0;width:1983px;height:793px;transform-origin:0 0;will-change:transform}.background-image{width:100%;height:100%;position:absolute;inset:0;object-fit:fill;pointer-events:none;-webkit-user-drag:none}.scene-object{position:absolute;transform:translate(-50%,-50%);border:0;min-height:0;padding:0;background:none;box-shadow:none;border-radius:0;touch-action:none;-webkit-user-drag:none;cursor:pointer;outline:0}.scene-object:hover,.scene-object:focus-visible{background:none;border:0}.scene-object img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none;filter:drop-shadow(0px 4px 3px #2e150a44);-webkit-user-drag:none}.scene-object:hover img,.scene-object:focus-visible img{filter:drop-shadow(0 0 6px #fff0b477) drop-shadow(0 7px 3px #220a0b55)}.scene-object.table::after{content:"";position:absolute;left:17%;right:17%;bottom:3%;height:10%;border-radius:50%;background:#2b160e66;filter:blur(5px);z-index:-1}.scene-object.chair::after{content:"";position:absolute;left:18%;right:18%;bottom:6%;height:8%;border-radius:50%;background:#29140955;filter:blur(4px);z-index:-1}.scene-object .spot-number{position:absolute;left:50%;top:-19px;transform:translateX(-50%);display:none;font-size:17px;line-height:22px;padding:0 7px;background:#28170fe0;border:1px solid #dfae6f;color:#ffe9bc;border-radius:7px;pointer-events:none;font-weight:800;white-space:nowrap}.show-spots .spot-number{display:block}.scene-object.table .spot-number{border-color:#b5a866}.scene-object.chair .spot-number{background:#311c13}.scene-object.selected img{filter:drop-shadow(0 0 9px #e5ffaba0)}#player{position:absolute;left:991px;top:710px;width:80px;height:104px;transform:translate(-50%,-100%);pointer-events:none;object-fit:fill;transition:opacity .16s;filter:drop-shadow(0 5px 2px #34190877);z-index:9500;will-change:left,top,width,height;user-select:none}#footmark{position:absolute;width:36px;height:11px;left:991px;top:706px;border-radius:50%;background:#2b130c5c;filter:blur(5px);transform:translate(-50%,-50%);pointer-events:none;z-index:100}#walkMarker{position:absolute;width:30px;height:10px;border-radius:50%;border:2px solid #ffe0a4;transform:translate(-50%,-50%);box-shadow:0 0 14px #ffdb775e;pointer-events:none;z-index:13000}.stage-top-left{position:absolute;z-index:20005;top:14px;left:14px;color:#ffedd2;font-size:12px;line-height:1.5;padding:9px 13px;background:#251b13d8;border:1px solid #866448a6;border-radius:8px;pointer-events:none;max-width:calc(100% - 190px);box-shadow:0 3px 10px #0004}.room-controls-button{z-index:20010;position:absolute;right:14px;top:13px;padding:10px 15px;background:#29180fe5;border-color:#b18b53;font-size:12px;font-weight:700;box-shadow:0 5px 22px #0008}.stage-bottom{z-index:20000;position:absolute;bottom:13px;left:14px;right:14px;display:flex;align-items:center;justify-content:space-between;gap:10px;pointer-events:none;text-shadow:0 1px 2px #000}.stage-bottom span{font-size:12px;color:#fce8c8}.stage-bottom .soft-badge{background:#23170fcc;border:1px solid #a37f50a8;padding:7px 12px;border-radius:20px}.hint-mobile{display:none}.pan-hints{position:absolute;z-index:20000;left:15px;right:15px;top:50%;transform:translateY(-50%);display:flex;justify-content:space-between;pointer-events:none}.pan-hints button{pointer-events:auto;width:42px;height:58px;background:#21160b88;border:1px solid #ab804276;border-radius:14px;font-family:Georgia;font-size:32px;color:#f4dcad;opacity:.84}.pan-hints button:hover{opacity:1}.control-panel{z-index:20100;position:absolute;top:62px;right:14px;width:min(350px,calc(100vw - 28px));max-height:calc(100% - 78px);overflow:auto;background:#221910f8;border:1px solid #aa8653;border-radius:13px;box-shadow:0 20px 45px #000c;padding:16px;color:#ecddc5}.control-panel[hidden],.overlay[hidden],[hidden]{display:none!important}.control-heading{display:flex;align-items:center;justify-content:space-between;font:600 19px Georgia;color:#ffe6b6}.control-heading button{min-height:29px;width:32px}.control-panel p{font-size:12px;color:#d5bea0;line-height:1.6}.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:14px 0}.control-grid button{font-size:12px;min-height:41px}.setting{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:#e1cda9;margin:12px 0}.setting select{padding:7px 8px;background:#372719;border:1px solid #866139;border-radius:6px;color:#ffecd4}.wide-soft{display:block;width:100%;padding:8px 10px;font-size:12px}.game-state{margin:14px 0;padding:12px;border:1px solid #7a5f414f;background:#47321c61;border-radius:8px;display:grid;gap:7px}.game-state strong{font:600 15px Georgia;color:#ffdda3}.game-state span{font-size:12px;line-height:1.45;color:#d5c7b7}.quickbar{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:11px 24px;background:linear-gradient(90deg,#2d2117,#1c1610);border-top:1px solid #d19e5c66;border-bottom:1px solid #7e603c46;min-height:63px}.quick-summary{display:flex;align-items:center;gap:10px;color:#e9d3b3;font-size:13px}.activity-dot{background:#9eb47d;width:8px;height:8px;border-radius:50%;box-shadow:0 0 13px #9eb47d}.quick-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.quick-actions button{min-height:37px;padding:8px 13px;font-size:12px}.quick-actions button:first-child{background:#825729;border-color:#e0b474}.quick-actions button:last-child{background:#312318}footer{padding:9px 24px 14px;color:#967e66;font-size:11px;text-align:center}.overlay{position:fixed;z-index:45000;inset:0;padding:15px;display:flex;align-items:center;justify-content:center;background:#120c09e6;backdrop-filter:blur(9px)}.chess-modal,.reference-modal,.help-modal{max-height:95svh;overflow:auto;background:linear-gradient(140deg,#fff4dc,#e7cba1 83%,#e0ba79);border:2px solid #e4bf7f;box-shadow:0 0 0 5px #4b2b1a,0 15px 80px #000c;border-radius:15px;padding:clamp(12px,2vw,23px);color:#452d19;width:min(970px,100%)}.modal-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #9e7547aa;padding-bottom:12px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:2px;color:#946432;margin:0 0 5px}.modal-heading h2{font:normal clamp(20px,2.8vw,29px) Georgia;margin:0}.chess-modal button,.reference-modal button,.help-modal button{color:#51351c;background:#fff5de;border-color:#b9955d}.chess-modal button:hover,.reference-modal button:hover,.help-modal button:hover{background:#fffbee}.modal-heading button{font-size:19px;padding:3px 11px;min-height:34px}.players{display:grid;grid-template-columns:1fr auto 1fr;gap:15px;align-items:center;margin:13px 0}.player-card{padding:8px;display:flex;gap:9px;align-items:center;border:1px solid #ab8c60;background:#f2e1c0;border-radius:8px}.player-card.active{box-shadow:0 0 0 2px #7fa35e55;border-color:#81985c}.player-card strong{display:block;font-size:13px}.player-card small{display:block;color:#7f5b3a;font-size:10px;margin-top:3px}.piece-badge{font-size:32px}.players #turn{font:600 14px Georgia;text-align:center;min-width:125px}.chess-layout{display:grid;grid-template-columns:minmax(0,1fr) 215px;gap:20px}.board-area{min-width:0;display:flex;flex-direction:column}.board-frame{width:min(100%,min(56vh,600px));max-width:100%;align-self:center;padding:12px;border:3px ridge #a4773e;background:linear-gradient(130deg,#572a13,#b1884e,#58301b);border-radius:9px;box-shadow:0 9px 19px #6b3b2155}.board{width:100%;aspect-ratio:1;display:grid;grid-template-columns:repeat(8,1fr);border:2px solid #5d331b}.board .square{min-width:0;min-height:0;position:relative;display:block;border-radius:0;border:0;padding:1px;background:#f1d5a0;aspect-ratio:1}.board .square.dark{background:#97623a}.board .square:hover{background:#d4a970}.square svg{position:absolute;inset:4%;width:92%;height:92%;filter:drop-shadow(1px 2px 1px #0005);pointer-events:none}.square.selected{box-shadow:inset 0 0 0 3px #f8ea6e}.square.last{background:#c7a451}.square.legal:after{content:'';position:absolute;left:42%;top:42%;width:16%;height:16%;border-radius:50%;background:#55703f91}.square.legal.has-piece:after{left:4%;top:4%;width:92%;height:92%;background:transparent;border:3px solid #a1cf83}.coord{position:absolute;top:1px;left:2px;font-weight:700;font-size:8px;color:#573716}.dark .coord{color:#ffeccc}.chess-sidebar{display:flex;flex-direction:column;gap:8px}.chess-sidebar h3{font:normal 21px Georgia;margin:0 0 4px}.chess-sidebar button{min-height:38px}.chess-sidebar button.primary,.help-modal button.primary{color:#f9e7c5;background:#65401c}.chess-sidebar button.primary:hover,.help-modal button.primary:hover{background:#765122}#moves{height:150px;overflow:auto;white-space:pre-wrap;font-size:13px;line-height:1.65;padding:10px;background:#fff8e7b7;border:1px solid #b08b5d;border-radius:6px}.local-note,#gameHelp{font-size:12px;line-height:1.4;color:#7a5a3b}#gameHelp{margin:10px 0 0}#promotion{padding:10px;border:1px solid #ac8152}#promotion p{margin:0 0 8px}#promotion button{margin:3px}.reference-modal{width:min(1100px,100%)}.reference-modal img{display:block;max-width:100%;width:100%;height:auto;border:1px solid #9c6731;margin-top:14px}.reference-modal p{font-size:12px;line-height:1.6;color:#694a2b}.help-modal{width:min(550px,100%)}.help-modal p{line-height:1.7;font-size:14px}.help-modal button.primary{margin-top:8px;padding:9px 20px}@media(max-width:800px){.topbar{height:64px;padding:8px 13px}.brand h1{font-size:21px}.brand p{font-size:9px}.top-state{display:none}.stage{height:clamp(390px,calc(100svh - 195px),730px)}.stage-bottom .hint-desktop{display:none}.stage-bottom .hint-mobile{display:inline}.stage-top-left{font-size:10px;top:10px;left:8px;max-width:calc(100% - 168px);padding:6px 8px}.room-controls-button{top:9px;right:8px;padding:8px 9px;font-size:11px}.quickbar{padding:9px 11px;flex-direction:column;align-items:stretch}.quick-summary{font-size:11px}.quick-actions{justify-content:space-between}.quick-actions button{font-size:11px;flex:1;padding:8px 6px}.pan-hints{left:7px;right:7px}.pan-hints button{width:33px;height:45px;font-size:26px}.stage-bottom{left:8px;right:8px;bottom:7px}.stage-bottom span{font-size:10px}.stage-bottom .soft-badge{padding:6px 8px}.chess-layout{grid-template-columns:1fr;gap:12px}.chess-sidebar{display:grid;grid-template-columns:repeat(2,1fr);align-items:center}.chess-sidebar h3,.chess-sidebar #moves,.chess-sidebar .local-note{grid-column:span 2}.chess-sidebar #moves{height:75px}.board-frame{width:min(100%,min(56svh,440px));padding:7px}.players{gap:5px;margin:9px 0}.players #turn{min-width:74px;font-size:11px}.player-card{padding:5px;gap:4px}.piece-badge{font-size:22px}.player-card strong{font-size:10px}.player-card small{font-size:9px}.chess-modal{max-height:97svh;padding:11px}.modal-heading{padding-bottom:9px}.chess-sidebar h3{font-size:16px}.chess-sidebar button{min-height:31px;font-size:12px}footer{font-size:10px;padding:8px}}@media(max-width:380px){.top-actions .soft{font-size:10px;padding:7px}.brand h1{font-size:18px}.brand-icon{font-size:30px}.brand p{font-size:8px}}

.setting input{width:156px;background:#372719;border:1px solid #866139;color:#fff0d4;padding:8px 10px;border-radius:7px;font:13px system-ui}.setting input:focus-visible{outline:2px solid #e8c887}

@media(max-width:500px){.brand h1{white-space:normal;font-size:17px;line-height:1.08}.brand h1 span{display:block;font-size:15px}.brand p{font-size:8px;letter-spacing:.8px}.topbar{height:77px}.brand{gap:7px}.top-actions{flex-shrink:0}.top-actions .soft{width:90px;line-height:1.2}.brand-icon{font-size:27px}.stage{height:clamp(370px,calc(100svh - 215px),725px)}}

/* V98 Royal Vintage Edition: true edge-to-edge scene on every viewport. */
html,body{width:100%;height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
#app{position:relative;display:block;width:100%;height:100%;height:100dvh;min-height:0;overflow:hidden}
main{position:absolute;inset:0;display:block;width:100%;height:100%}
.stage{position:absolute;inset:0;width:100%;height:100%;height:100dvh;max-height:none;min-height:0;background:#3b291e;isolation:isolate}
.stage:before{background:linear-gradient(90deg,#3b221379,#3b221300,#3b221379),url('assets/KINGS_HALL_CONTINUOUS_27_TABLES_V160.jpg') center center / cover no-repeat;filter:blur(18px) brightness(.8)}
.room-scene{transform-origin:0 0}
.topbar{position:absolute;top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));z-index:20120;height:auto;min-height:53px;width:max-content;max-width:calc(100vw - 175px);padding:7px 14px;border:1px solid #bd9052a3;border-radius:12px;background:linear-gradient(120deg,#180e0be9,#352211df);box-shadow:0 7px 24px #150b09a0;backdrop-filter:blur(8px)}
.brand{gap:8px}.brand-icon{font-size:32px}.brand h1{font-size:clamp(16px,1.55vw,23px);white-space:normal;line-height:1.06}.brand p{font-size:clamp(8px,.75vw,10px);letter-spacing:.7px;margin-top:4px}.top-actions{display:none}
.room-controls-button{position:absolute;top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));min-height:42px;min-width:128px;border-radius:9px;padding:8px 12px;box-shadow:0 6px 20px #150b0a99}
.control-panel{top:calc(59px + env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));max-height:calc(100% - 80px - env(safe-area-inset-bottom));overscroll-behavior:contain;backdrop-filter:blur(12px)}
.stage-top-left{top:calc(80px + env(safe-area-inset-top));left:12px;max-width:min(360px,calc(100vw - 32px));padding:6px 10px;font-size:11px;background:#281b13b8;opacity:.96}
.stage-bottom{bottom:calc(76px + env(safe-area-inset-bottom));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));pointer-events:none}
.stage-bottom .soft-badge{background:#26170bd1}
.pan-hints{left:max(5px,env(safe-area-inset-left));right:max(5px,env(safe-area-inset-right));top:52%}
.pan-hints button{background:#251609a3;color:#fff0c9}
.quickbar{position:absolute;left:50%;bottom:calc(10px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:20090;width:min(900px,calc(100vw - 28px));min-height:54px;padding:8px 12px;border:1px solid #c39857a1;border-radius:14px;background:linear-gradient(100deg,#1e130deb,#312015ed);backdrop-filter:blur(12px);box-shadow:0 8px 24px #09050595}
.quickbar .quick-summary{min-width:0;flex:1;white-space:nowrap;overflow:hidden}.quickbar .quick-summary #quickStatus{overflow:hidden;text-overflow:ellipsis}
.quick-actions{flex-shrink:0;gap:5px}.quick-actions button{min-height:36px;white-space:nowrap}
footer{display:none}
.overlay{padding:clamp(5px,1.5vw,16px);align-items:center;justify-content:center}
.chess-modal{max-height:calc(100dvh - 20px)}
.board-frame{width:min(100%, min(64dvh,630px))}
@media(max-width:800px){
 .stage{height:100%;height:100dvh;min-height:0;max-height:none}
 .topbar{height:auto;max-width:calc(100vw - 148px);min-height:44px;padding:6px 9px}
 .brand{gap:5px}.brand-icon{font-size:25px}
 .brand h1{font-size:clamp(13px,3.3vw,18px);line-height:1.04}.brand h1 span{display:inline;font-size:inherit}
 .brand p{font-size:8px;letter-spacing:0;line-height:1.13}
 .room-controls-button{right:max(7px,env(safe-area-inset-right));top:max(9px,env(safe-area-inset-top));min-width:126px;min-height:38px;font-size:11px;padding:6px 8px}
 .stage-top-left{top:calc(64px + env(safe-area-inset-top));max-width:calc(100vw - 25px);font-size:10px;padding:4px 8px}
 .quickbar{left:50%;bottom:calc(5px + env(safe-area-inset-bottom));transform:translateX(-50%);width:calc(100vw - 12px);min-height:42px;padding:5px 7px;display:flex;gap:6px;flex-direction:row;align-items:center;border-radius:11px}
 .quick-summary{display:none}.quick-actions{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 .quick-actions button{font-size:clamp(10px,2.7vw,12px);min-width:0;min-height:34px;padding:6px 3px}
 .stage-bottom{bottom:calc(56px + env(safe-area-inset-bottom))}.stage-bottom .soft-badge{font-size:10px;padding:4px 7px}
 .stage-bottom .hint-mobile{display:inline}.stage-bottom .hint-desktop{display:none}
 .pan-hints{left:1px;right:1px}.pan-hints button{width:29px;height:47px;font-size:24px}
 .control-panel{width:min(350px,calc(100vw - 16px));right:8px;top:calc(54px + env(safe-area-inset-top));max-height:calc(100dvh - 67px - env(safe-area-inset-bottom))}
 .chess-modal{padding:8px;max-height:calc(100dvh - 10px)}
 .board-frame{width:min(100%,min(53dvh,420px))}
}
@media(max-width:530px){.topbar{max-width:calc(100vw - 142px)}.brand p{display:none}.brand h1{font-size:clamp(13px,3.7vw,16px)}.brand-icon{font-size:23px}.stage-bottom .hint-mobile{display:none}.stage-top-left{font-size:9px;top:calc(55px + env(safe-area-inset-top));max-width:min(280px,calc(100vw - 15px))}}
@media(max-height:500px) and (orientation:landscape){
 .topbar{min-height:37px;padding:4px 10px}.brand h1{font-size:15px}.brand p{display:none}
 .stage-top-left{display:none}.quickbar{width:min(635px,calc(100vw - 14px));min-height:35px;padding:3px 5px}
 .quick-actions button{min-height:29px;padding:3px 6px}.stage-bottom{bottom:calc(43px + env(safe-area-inset-bottom))}
 .control-panel{top:48px;max-height:calc(100% - 53px)}.board-frame{width:min(100%,min(47dvh,430px));padding:4px}
 .chess-sidebar{gap:4px}.players{margin:3px 0}.chess-layout{gap:7px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important}}

/* V99 — exact user-supplied picture, with image-aligned transparent hit areas. */
.stage:before{display:none!important}
.room-scene{width:5884px!important;height:728px!important}
.background-image{width:5884px;height:728px;object-fit:fill;image-rendering:auto}
.scene-object{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:22%;z-index:auto}
.scene-object img{display:none!important}
.scene-object.table::after,.scene-object.chair::after{display:none!important}
.scene-object:hover,.scene-object:focus-visible,.scene-object.selected{background:#ffecaa19!important;box-shadow:inset 0 0 0 3px #f5d36eaa!important}
.scene-object:active{background:#f5d36e28!important}
.scene-object .spot-number{pointer-events:none}
.artwork-control{position:absolute;z-index:16000;background:transparent!important;border:0!important;padding:0!important;min-height:0!important;border-radius:7px;color:transparent;opacity:1;box-shadow:none;touch-action:manipulation}
.artwork-control:hover,.artwork-control:focus-visible{background:#e7bb6030!important;outline:2px solid #ffdf91;outline-offset:-2px}
/* The exact input PNG contains its own crest and top toolbar; never duplicate them on desktop. */
.topbar,.stage-top-left,.stage-bottom,.pan-hints,.quickbar{display:none!important}
.room-controls-button{display:none!important}
.room-controls-button.needs-fallback{display:block!important;top:calc(12px + env(safe-area-inset-top));right:calc(9px + env(safe-area-inset-right));background:#20150be9;border:1px solid #d09b49;min-width:118px;min-height:38px;box-shadow:0 4px 15px #1a0b0899}
body.needs-brand .topbar{display:flex!important;position:absolute;top:calc(10px + env(safe-area-inset-top));left:calc(9px + env(safe-area-inset-left));background:#23160fe4;min-height:40px;max-width:calc(100vw - 145px);padding:7px 10px;box-shadow:0 4px 15px #1a0b0899}
body.needs-brand .topbar .brand-icon{font-size:22px}
body.needs-brand .topbar .brand h1{font-size:clamp(14px,2vw,17px)}
body.needs-brand .topbar .brand p{display:none}
.control-panel{z-index:25000;position:absolute;right:max(8px,env(safe-area-inset-right));top:calc(60px + env(safe-area-inset-top));max-height:calc(100dvh - 75px - env(safe-area-inset-bottom))}
@media(max-width:700px){
 .quickbar{display:flex!important;position:absolute;left:50%;bottom:calc(6px + env(safe-area-inset-bottom));transform:translateX(-50%);width:min(500px,calc(100vw - 14px));z-index:22500;min-height:44px;padding:5px;border-radius:10px;background:#211307e8;backdrop-filter:blur(8px)}
 .quickbar .quick-summary{display:none}
 .quick-actions{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
 .quick-actions button{font-size:clamp(10px,2.6vw,12px);min-height:34px;padding:5px 2px}
 .control-panel{width:min(350px,calc(100vw - 14px))}
}
@media(max-height:460px){.control-panel{top:44px;max-height:calc(100dvh - 48px)}}

/* Do not draw rectangles over the user's supplied chair artwork after selection. */
.scene-object:hover,.scene-object.selected{background:transparent!important;box-shadow:none!important}
.scene-object:focus-visible,.show-spots .scene-object{box-shadow:inset 0 0 0 2px #fff0a2a8!important}

/* V101: the white/gray pixels BETWEEN walking legs were removed from source PNGs. */
#player{background:transparent!important;background-color:transparent!important}


/* V104: cushion-pinned seat and floor contact shadows. No paintings altered. */
#seatContact,#shoeContact{position:absolute;display:none;transform:translate(-50%,-50%);pointer-events:none;border-radius:50%;background:radial-gradient(ellipse at 50% 50%,rgba(35,10,10,.45) 0%,rgba(42,12,10,.16) 42%,transparent 76%);filter:blur(2px);mix-blend-mode:multiply}
#shoeContact{background:radial-gradient(ellipse at 50% 50%,rgba(32,13,8,.40) 0%,rgba(32,13,8,.15) 48%,transparent 80%);filter:blur(2px)}
#player.seat-settle{animation:cqNaturalSit .30s cubic-bezier(.21,.77,.33,1) both}
@keyframes cqNaturalSit{0%{translate:var(--sit-entry-x,0px) -4px;opacity:.96}65%{translate:0px 1px;opacity:1}100%{translate:0 0;opacity:1}}
@media(prefers-reduced-motion:reduce){#player.seat-settle{animation:none}}


/* V105: soften the WALK -> SIT and SIT -> STAND visual change.
   The seated and standing sprites share the exact same shoe contact coordinates.
   These are PNG overlays only: no chair, table, rug, or background repainting. */
.pose-ghost{position:absolute;pointer-events:none;user-select:none;object-fit:fill;background:transparent;image-rendering:auto;will-change:opacity,translate,scale;}
.pose-ghost-sit{animation:cqSideStandFadeV105 420ms cubic-bezier(.25,.65,.40,1) both;}
.pose-ghost-stand{animation:cqChairFadeV105 360ms ease-out both;}
#player.seat-enter{animation:cqSeatEnterV105 420ms cubic-bezier(.21,.76,.32,1) both;}
#player.stand-enter{animation:cqStandEnterV105 360ms ease-out both;}
@keyframes cqSideStandFadeV105{0%{opacity:1;translate:0 0;scale:1}48%{opacity:.83;translate:0 1px;scale:1 .95}100%{opacity:0;translate:0 7px;scale:1 .88}}
@keyframes cqSeatEnterV105{0%{opacity:.08;translate:var(--sit-entry-x,0px) -11px;scale:1.025 1.075}45%{opacity:.8;translate:1px -4px;scale:1.012 1.025}75%{opacity:1;translate:0 1px;scale:1 .99}100%{opacity:1;translate:0 0;scale:1}}
@keyframes cqChairFadeV105{0%{opacity:1;translate:0 0;scale:1}55%{opacity:.78;translate:0 -5px;scale:1 1.03}100%{opacity:0;translate:0 -8px;scale:1 1.06}}
@keyframes cqStandEnterV105{0%{opacity:.08;translate:0 7px;scale:1 .90}48%{opacity:.72;translate:0 -2px;scale:1 1.03}100%{opacity:1;translate:0 0;scale:1}}
.seat-adjust-details{margin:10px 0;padding:8px 10px;border:1px solid #98754389;border-radius:9px;background:#2a1a10b8;}
.seat-adjust-details summary{cursor:pointer;color:#ffdea4;font-size:12px;font-weight:600;}
.seat-adjust-details p{margin:9px 0;font-size:11px;}
.seat-adjust-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
.seat-adjust-grid button{min-height:36px;font-size:11px;padding:6px 3px;}
@media(prefers-reduced-motion:reduce){#player.seat-enter,#player.stand-enter,.pose-ghost{animation:none!important;}}

/* V106: 2.5D chair depth; original gold armrests mask the avatar's knees naturally.
   No duplicate furniture and no chair/table edits in the master picture. */
#seatForeground{position:absolute;inset:0;width:5884px;height:728px;object-fit:fill;pointer-events:none;user-select:none;image-rendering:auto;z-index:15900;max-width:none!important;max-height:none!important;}
#player.seat-enter{animation:cqV106Sit 320ms cubic-bezier(.18,.78,.32,1) both!important;}
#player.stand-enter{animation:cqV106Stand 290ms cubic-bezier(.22,.63,.3,1) both!important;}
@keyframes cqV106Sit{0%{opacity:.96;translate:var(--sit-entry-x,0px) -7px;scale:1.01 1.08}58%{opacity:1;translate:0 1px;scale:1 .985}100%{opacity:1;translate:0 0;scale:1}}
@keyframes cqV106Stand{0%{opacity:1;translate:0 7px;scale:1 .90}56%{opacity:1;translate:0 -2px;scale:1 1.02}100%{opacity:1;translate:0 0;scale:1}}
@media(prefers-reduced-motion:reduce){#player.seat-enter,#player.stand-enter{animation:none!important;}}

/* V107: no whole-body squash/stretch; distinct transparent sitting frames keep shoes fixed. */
#player.seat-enter,#player.stand-enter{animation:none!important;translate:none!important;scale:none!important}
#player{image-rendering:auto;backface-visibility:hidden}

/* V112: atlas canvas exactly overlays the previous #player image. */
#avatarCanvas{position:absolute;left:991px;top:710px;width:80px;height:104px;transform:translate(-50%,-100%);pointer-events:none;filter:drop-shadow(0 5px 2px #34190877);z-index:9500;will-change:transform,left,top,width,height;user-select:none;image-rendering:auto;background:transparent!important;}
#avatarCanvas[hidden],#player[hidden]{display:none!important;}

/* V130: the 3D character and its original illustrated face share the same joint-anchored canvas placement. */
#avatar3d,#avatarOriginalFace{position:absolute;pointer-events:none!important;user-select:none;max-width:none!important;max-height:none!important;image-rendering:auto;will-change:left,top,transform;}
#avatar3d[hidden],#avatarOriginalFace[hidden]{display:none!important;}
#avatar3d{filter:drop-shadow(0 2px 2px rgba(30,14,0,.16));}

/* V132: Compact, touch-first outfit wardrobe inside Room Controls. */
.wardrobe{margin:14px 0;padding:12px 10px;background:#3b2a1bb8;border:1px solid #b98a55;border-radius:13px;box-shadow:inset 0 1px 0 #ffe2ab16;}
.wardrobe-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.wardrobe-heading h2{font:600 17px Georgia,serif;color:#ffe6b9;margin:0;line-height:1.2;}
.wardrobe-count{flex-shrink:0;font-size:10px;color:#f6d89b;padding:4px 7px;border:1px solid #986d41;border-radius:14px;}
.wardrobe .wardrobe-intro,.wardrobe .outfit-footnote{font-size:11px;line-height:1.45;margin:8px 0;color:#d9c4a7;}
.outfit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}
.outfit-choice{display:flex;flex-direction:column;align-items:stretch;min-width:0;padding:5px;background:#241810;border:2px solid #745439;border-radius:9px;overflow:hidden;transition:border-color .12s,background .12s,transform .12s;}
.outfit-choice img{display:block;width:100%;height:128px;object-fit:contain;background:#fffcf6;border-radius:5px;}
.outfit-choice .outfit-name{font-size:11px;font-weight:700;color:#ffebcc;text-align:center;line-height:1.3;padding:7px 2px 3px;}
.outfit-choice:hover{border-color:#d5a65a;transform:translateY(-1px);}
.outfit-choice[aria-pressed="true"]{border-color:#ffcc72;background:#584021;box-shadow:0 0 0 1px #ffdf96b6,0 0 12px #e2a74f45;}
.outfit-choice[aria-pressed="true"] .outfit-name::after{content:'  ✓';color:#f6d27e;}
.wardrobe .outfit-footnote{font-style:italic;}
.wardrobe .outfit-current{font-size:12px;color:#ffe0a0;font-weight:650;margin:7px 0 1px;}
@media(max-width:380px){.outfit-choice img{height:109px}.outfit-choice .outfit-name{font-size:10px}.wardrobe{padding:9px 7px}.outfit-grid{gap:7px}}
@media(prefers-reduced-motion:reduce){.outfit-choice{transition:none!important}}

/* V137: approved casual-clothes 3D-illustration avatar sprite overlays. */
#realisticBoyStanding,#realisticBoySeated{position:absolute;pointer-events:none!important;image-rendering:auto;backface-visibility:hidden;user-select:none;will-change:transform,opacity,left,top;}
#realisticBoyStanding[hidden],#realisticBoySeated[hidden]{display:none!important}


/* V145: small-screen usability and clear keyboard focus without touching the original hall art. */
#greenSpriteWalking[hidden],#greenSpriteSeated[hidden],#realisticBoyWalking[hidden],#realisticBoySitTransition[hidden]{display:none!important}
#greenSpriteWalking,#greenSpriteSeated{max-width:none;max-height:none;backface-visibility:hidden}
#promotion button:focus-visible,.chess-modal button:focus-visible,.control-panel button:focus-visible{outline:3px solid #b97b26;outline-offset:2px}
#helpOverlay .help-modal{max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
@media(max-height:500px) and (orientation:landscape){
 .chess-modal{max-height:calc(100dvh - 8px);padding:7px 11px;scrollbar-width:thin}
 .chess-modal .modal-heading{padding-bottom:5px}
 .chess-modal .modal-heading h2{font-size:clamp(16px,2.5vw,21px)}
 .chess-modal .players{margin:4px 0 6px}
 .chess-modal .player-card{min-height:34px;padding:4px 8px}
 .chess-modal .chess-layout{gap:10px}
 .chess-modal .board-frame{width:min(100%,58dvh);padding:4px}
 .chess-modal #gameHelp{margin:5px 0}
 .chess-modal #moves{height:75px}
}

/* Keep wardrobe, speed, display and seat-tuning controls accessible even when
   the art's five printed toolbar buttons are visible at the far right. */
.room-controls-button.scene-toolbar-visible{display:block!important;top:calc(67px + env(safe-area-inset-top));right:calc(10px + env(safe-area-inset-right));min-height:38px;padding:6px 10px;background:#20150be9;border:1px solid #d09b49;box-shadow:0 4px 15px #1a0b0899}


/* V146: native emoji avatars: no fetched image, no dependence on emoji PNGs. */
.emoji-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:10px 0 8px}
.emoji-choice{min-width:0;min-height:72px;padding:6px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:#281b12;border:2px solid #755539;border-radius:11px;color:#ffead0;cursor:pointer;transition:background .16s,border-color .16s,transform .16s}
.emoji-choice-icon{font:normal 32px/1.15 "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;display:block;white-space:nowrap;filter:drop-shadow(0 2px 1px #0004)}
.emoji-choice-name{font-size:10px;line-height:1.2;font-weight:650}
.emoji-choice:hover{border-color:#efbd74;background:#44301f;transform:translateY(-1px)}
.emoji-choice[aria-pressed="true"]{border-color:#ffcc72;background:#594021;box-shadow:0 0 0 1px #ffda8d,0 0 12px #daae6360}
.emoji-choice:focus-visible{outline:3px solid #ffce8d;outline-offset:2px}
.legacy-outfits{margin-top:12px;padding:9px 8px;border:1px solid #856343;border-radius:9px;background:#271c14}
.legacy-outfits summary{cursor:pointer;color:#f4d0a5;font-size:12px;font-weight:650;line-height:1.55}
.legacy-outfits[open] summary{margin-bottom:10px}
.legacy-outfits .outfit-grid{margin:8px 0}
.emoji-character{position:absolute;pointer-events:none;user-select:none;-webkit-user-select:none;max-width:none;max-height:none;transform-origin:center;will-change:transform,left,top,opacity;contain:layout style;isolation:isolate;filter:drop-shadow(0 2px 2px #2c190d7a)}
.emoji-character[hidden]{display:none!important}
.emoji-figure{position:relative;width:100%;height:100%;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;transform-origin:50% 68%;line-height:1}
.emoji-part{position:absolute;display:flex;align-items:center;justify-content:center;white-space:nowrap;text-align:center;line-height:1;transform-origin:50% 60%;font-weight:400}
.emoji-head{left:0;top:0;width:100%;height:39%;font-size:calc(var(--emoji-h) * .38);z-index:4;filter:drop-shadow(0 1px 1px #34160f55)}
.emoji-shirt{left:8%;top:31%;width:84%;height:37%;font-size:calc(var(--emoji-h) * .36);z-index:3}
.emoji-pants{left:19%;top:58%;width:62%;height:30%;font-size:calc(var(--emoji-h) * .31);z-index:2}
.emoji-shoes{left:16%;top:83%;width:68%;height:16%;display:flex;justify-content:space-around;align-items:center;gap:0;z-index:1}
.emoji-shoe{display:inline-block;font-size:calc(var(--emoji-h) * .16);line-height:1;transform-origin:45% 25%}
.emoji-face-left .emoji-figure{transform:scaleX(-1)}
/* Going away from the camera reduces face emphasis rather than showing a fake back image. */
.emoji-face-back .emoji-head{transform:scale(.91)}
.emoji-sitting .emoji-head{top:0;left:-1%;width:93%}
.emoji-sitting .emoji-shirt{top:29%;left:5%;transform:rotate(-9deg)}
.emoji-sitting .emoji-pants{left:48%;top:55%;width:55%;transform:rotate(-64deg)}
.emoji-sitting .emoji-shoes{left:54%;top:79%;width:43%;justify-content:space-evenly;transform:rotate(-13deg)}
.emoji-moving .emoji-figure{animation:emojiWeightShift .48s ease-in-out infinite alternate}
.emoji-moving .emoji-head{animation:emojiHeadBob .48s ease-in-out infinite alternate}
.emoji-moving .emoji-shirt{animation:emojiBodySway .48s ease-in-out infinite alternate}
.emoji-moving .emoji-pants{animation:emojiLegSway .48s ease-in-out infinite alternate}
.emoji-moving .emoji-shoe-left{animation:emojiFootLeft .48s ease-in-out infinite alternate}
.emoji-moving .emoji-shoe-right{animation:emojiFootRight .48s ease-in-out infinite alternate}
@keyframes emojiWeightShift{from{transform:translateY(1.2%)}to{transform:translateY(-1.1%)}}
@keyframes emojiHeadBob{from{transform:rotate(-3deg) translateY(2%)}to{transform:rotate(3deg) translateY(-1%)}}
@keyframes emojiBodySway{from{transform:rotate(-4deg)}to{transform:rotate(4deg)}}
@keyframes emojiLegSway{from{transform:rotate(8deg)}to{transform:rotate(-8deg)}}
@keyframes emojiFootLeft{from{transform:translateY(-22%) rotate(-11deg)}to{transform:translateY(10%) rotate(8deg)}}
@keyframes emojiFootRight{from{transform:translateY(10%) rotate(8deg)}to{transform:translateY(-22%) rotate(-11deg)}}
@media(prefers-reduced-motion:reduce){.emoji-moving .emoji-figure,.emoji-moving .emoji-part,.emoji-moving .emoji-shoe,.emoji-choice{animation:none!important;transition:none!important}}


/* V147 blue-face simplification */
#player{object-fit:contain;filter:drop-shadow(0 6px 8px rgba(0,0,0,.28));border-radius:0;}
#wardrobe,#seatAdjustDetails,#avatarAppearanceSetting{display:none !important;}

/* V149: single user-supplied blue head, no body or sprite layers. */
#player{position:absolute!important;object-fit:contain!important;pointer-events:none!important;user-select:none!important;-webkit-user-drag:none!important;max-width:none!important;max-height:none!important;filter:drop-shadow(0 4px 4px rgba(11,21,32,.42));image-rendering:auto!important;animation:none!important;transition:none!important;}
#player[hidden]{display:none!important}
#footmark{position:absolute!important;pointer-events:none!important;opacity:.45!important;filter:blur(2px)!important}
.ready-message{position:absolute;top:calc(62px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:26000;pointer-events:none;max-width:calc(100% - 32px);padding:10px 19px;text-align:center;white-space:nowrap;border-radius:24px;color:#fff6d4;background:#231508f2;border:1px solid #f5c371;box-shadow:0 8px 25px #170c07a8;font-weight:800;font-size:clamp(14px,2.6vw,20px);letter-spacing:.02em;}
.ready-message[hidden]{display:none!important}
@media(max-width:700px){.ready-message{top:calc(61px + env(safe-area-inset-top));padding:9px 14px}}
@media(max-height:500px){.ready-message{top:48px;padding:6px 12px;font-size:14px}}

/* V150 precise red-cushion hotspots (JS supplies 58% of old width, 33% of height).
   Only the cushion target is clickable; no invisible full-chair button remains. */
.scene-object.chair{border-radius:46%!important;}
.scene-object.chair:hover,.scene-object.chair:focus-visible{
 box-shadow:inset 0 0 0 2px #ffe59cc4!important;background:#ffed9d1a!important;
}
/* The seat does not keep a large glowing outline after the head has sat. */
.scene-object.chair.selected:not(:hover):not(:focus-visible){
 box-shadow:none!important;background:transparent!important;
}
/* Keep the static blue head unchanged, including while it rises to the seat. */
#player{animation:none!important;transition:none!important;}


/* V152 — responsive scene with a single title baked into the image. */
html,body{width:100%;height:100%;overflow:hidden!important;overscroll-behavior:none}
#app,main{width:100%;height:100dvh;min-height:0!important;margin:0;padding:0}
.stage{height:100dvh!important;min-height:0!important;max-height:none!important;width:100%!important}
.topbar,.stage-top-left,.stage-bottom,.pan-hints,.quickbar{display:none!important}
.room-controls-button,.room-controls-button.needs-fallback,.room-controls-button.scene-toolbar-visible{
 display:block!important;position:absolute!important;
 top:calc(12px + env(safe-area-inset-top))!important;
 right:calc(12px + env(safe-area-inset-right))!important;
 left:auto!important;min-width:125px;min-height:42px;
 background:#20150bf2!important;color:#fff0d7!important;
 border:1px solid #d3aa6e!important;box-shadow:0 4px 15px #13090994!important;
 font-size:12px!important;border-radius:10px;padding:9px 12px!important;
}
.room-controls-button.below-toolbar{top:calc(72px + env(safe-area-inset-top))!important}
.control-panel{top:calc(62px + env(safe-area-inset-top))!important;right:calc(10px + env(safe-area-inset-right))!important;
 max-height:calc(100dvh - 72px - env(safe-area-inset-bottom))!important;
 width:min(340px,calc(100vw - 20px))!important;overscroll-behavior:contain}
.control-panel.below-toolbar{top:calc(121px + env(safe-area-inset-top))!important;
 max-height:calc(100dvh - 131px - env(safe-area-inset-bottom))!important}
.control-panel .control-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:14px 0}
.control-panel .control-grid button{min-width:0;min-height:43px;font-size:12px;padding:7px 5px}
.control-panel .setting{border-top:1px solid #ffffff26;padding-top:12px}
.control-panel #playerName{min-width:0;width:175px;max-width:65%;padding:8px;
 background:#fdf0d6;border:1px solid #bf9e6f;border-radius:6px;color:#342319;font-size:13px}
.visually-hidden{position:absolute!important;left:-10000px!important;top:auto!important;width:1px!important;height:1px!important;
 overflow:hidden!important;clip-path:inset(100%)!important;white-space:nowrap!important}
@media(max-width:700px){
 .room-controls-button,.room-controls-button.needs-fallback{top:calc(10px + env(safe-area-inset-top))!important;
  right:calc(10px + env(safe-area-inset-right))!important;min-height:44px}
 .room-controls-button.below-toolbar{top:calc(70px + env(safe-area-inset-top))!important}
 .control-panel{top:calc(61px + env(safe-area-inset-top))!important;max-height:calc(100dvh - 70px - env(safe-area-inset-bottom))!important}
 .control-panel.below-toolbar{top:calc(120px + env(safe-area-inset-top))!important;max-height:calc(100dvh - 129px - env(safe-area-inset-bottom))!important}
}

/* Preserve the hall backdrop for screen-cover resizing and device rotation. */
.stage:before{z-index:0!important;pointer-events:none!important;opacity:.85}
.room-viewport{z-index:1}


/* V153: two top-right artwork buttons removed; only Room Controls remains. */
.room-controls-button,.room-controls-button.needs-fallback,.room-controls-button.scene-toolbar-visible,
.room-controls-button.below-toolbar{top:calc(12px + env(safe-area-inset-top))!important;}
.control-panel,.control-panel.below-toolbar{top:calc(62px + env(safe-area-inset-top))!important;
 max-height:calc(100dvh - 72px - env(safe-area-inset-bottom))!important;}
.control-panel .control-grid #helpButton{grid-column:1/-1;}
@media(max-width:700px){
 .room-controls-button,.room-controls-button.below-toolbar{top:calc(10px + env(safe-area-inset-top))!important;}
 .control-panel,.control-panel.below-toolbar{top:calc(61px + env(safe-area-inset-top))!important;
 max-height:calc(100dvh - 70px - env(safe-area-inset-bottom))!important;}
}

/* V158: native-resolution circular panorama, single head sprite, no UI clutter. */
.room-scene{width:5884px!important;height:728px!important;overflow:visible!important;}
.cyclic-backdrop{position:absolute;top:0;pointer-events:none;user-select:none;z-index:0;background-repeat:repeat-x;background-position:0 0;}
.room-scene .background-image[hidden]{display:none!important;}
#pieces{position:absolute;inset:0;pointer-events:none;}
#pieces .scene-object{pointer-events:auto;}


/* V162 avatar picker */
#player{object-fit:contain !important;}
.avatar-section{margin-top:14px;padding-top:12px;border-top:1px solid #ffffff26;}
.avatar-section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:9px;}
.avatar-section-head strong{font-size:13px;color:#ffe7b6;}
.avatar-choice-status{font-size:11px;line-height:1.35;color:#cfba9d;text-align:right;max-width:52%;}
.avatar-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.avatar-option{min-height:0;aspect-ratio:1;padding:4px;border-radius:10px;background:linear-gradient(#342317,#22150f);border:1px solid #7d603f;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.avatar-option:hover{border-color:#e3b677;background:linear-gradient(#412b1d,#261811);}
.avatar-option.active{border-color:#f0c676;box-shadow:0 0 0 2px #f0c67655 inset, 0 0 14px #f0c67633;}
.avatar-option img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;}
@media(max-width:420px){.avatar-grid{grid-template-columns:repeat(3,minmax(0,1fr));}.avatar-choice-status{max-width:58%;}}


/* V163: actual online two-player chess, chat and watcher sidebar. */
.chess-modal{width:min(1090px,100%)}
.chess-layout{grid-template-columns:minmax(0,1fr) minmax(272px,320px);gap:16px}
.match-sidebar{display:flex;flex-direction:column;gap:9px;min-width:0}
.match-sidebar h3{font:600 18px Georgia,serif;margin:3px 0;color:#58351c}
.match-connection{display:flex;justify-content:space-between;align-items:center;gap:8px}
#connectionStatus{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:#7a5540}
#connectionStatus::before{content:'';height:8px;width:8px;border-radius:50%;background:#b89a66;display:inline-block}
#connectionStatus.connected::before{background:#408e51}
.match-connection button{font-size:11px;min-height:32px;padding:4px 10px}
.match-name-label{font-size:11px;color:#795432;display:grid;gap:5px}
#matchName{font:13px system-ui;padding:7px 9px;color:#3e2a1b;background:#fff9eb;border:1px solid #bb9867;border-radius:7px;width:100%}
.match-role{font:600 12px system-ui;color:#745130;margin:0!important}
.match-chat{display:grid;gap:7px;border:1px solid #c4a270;padding:10px;border-radius:10px;background:#fff4dc99}
.match-chat h3,.match-spectators h3{font-size:16px;margin:0}
.chat-messages{height:clamp(135px,24vh,212px);overflow-y:auto;overscroll-behavior:contain;padding:7px 8px;display:flex;flex-direction:column;gap:8px;background:#fffdf4;border-radius:7px;border:1px solid #d4b891}
.chat-message{display:grid;gap:3px;align-self:stretch;max-width:100%;font-size:12px;overflow-wrap:anywhere}
.chat-message strong{color:#603d1e;font-size:11px}
.chat-message span{background:#f2e2c6;padding:6px 9px;border-radius:8px;white-space:pre-wrap;color:#433121}
.chat-empty{font:12px system-ui;color:#967b5f;margin:5px 0}
.chat-form{display:flex;gap:5px;min-width:0}
#chatInput{flex:1;min-width:0;border:1px solid #baa078;border-radius:7px;background:#fffdf8;color:#3f2817;font:13px system-ui;padding:8px}
#chatSend{min-width:55px;padding:4px 9px;font-size:12px}
.chat-explain{font:11px/1.45 system-ui;color:#825c34;margin:0!important}
.match-spectators{padding:9px 10px;border:1px solid #c4a270;border-radius:10px;background:#fff7e8aa;display:grid;gap:8px}
.match-spectators h3{display:flex;align-items:center;gap:7px}
#spectatorCount{font:700 11px system-ui;background:#a57839;color:white;border-radius:10px;padding:2px 6px}
.spectator-names{font-size:12px;color:#755a42;display:flex;flex-wrap:wrap;gap:5px;max-height:90px;overflow:auto}
.spectator-chip{border-radius:13px;border:1px solid #bfaa81;background:white;padding:3px 7px;color:#503820;overflow-wrap:anywhere}
.match-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.match-actions button{font-size:11px;padding:7px 5px;min-width:0}
.match-actions #returnHall{grid-column:1/-1}
.live-notice{font:11px/1.45 system-ui;color:#66482e;min-height:20px;margin:0!important}
.live-notice.error{color:#a02e19;font-weight:700}
@media(max-width:800px){
 .chess-layout{display:grid;grid-template-columns:1fr;gap:12px}
 .chess-sidebar.match-sidebar{display:flex;grid-template-columns:unset;gap:9px}
 .chess-sidebar.match-sidebar>*{grid-column:auto}
 .chess-modal{max-height:98dvh}
 .chat-messages{height:160px}
 .board-frame{max-width:430px}
}
@media(max-width:430px){.match-connection button{font-size:10px}.chat-messages{height:140px}}

/* V163 mobile sidebar: prevent older chess-sidebar grid rules from splitting the chat. */
.match-sidebar .match-chat,.match-sidebar .match-spectators{display:flex;flex-direction:column;gap:7px}
.match-sidebar .match-chat h3,.match-sidebar .match-spectators h3{grid-column:auto}
.match-sidebar .chat-form{display:flex;flex-wrap:nowrap;align-items:stretch}
.match-sidebar .chat-messages{width:100%;flex:none}

.spectator-chip{display:inline-flex;align-items:center;gap:5px;max-width:100%;}
.spectator-chip img{width:24px;height:24px;object-fit:contain;flex:none;border-radius:50%;}
.spectator-chip span{overflow-wrap:anywhere;}


/* V164: Enchanted Kingdom chess interactions inside the original King's Hall popup. */
.board-play-status{display:grid;gap:3px;background:#f8ebcc;border:1px solid #cba86d;border-radius:9px;padding:9px 12px;margin:0 0 10px;color:#624225;min-height:65px}
.board-play-status strong{font:600 clamp(14px,1.45vw,18px) Georgia,serif;color:#422715}
.board-play-status>span:last-child{font:11px/1.45 system-ui;color:#6f5036}
.board-live-badge{font:700 10px system-ui;color:#7c5a3d;letter-spacing:.07em;text-transform:uppercase}
.board-live-badge.connected{color:#2d7746}
.board-live-badge.local{color:#a14a23}
.board-play-status.your-turn{border-color:#729251;box-shadow:inset 0 0 0 1px #97b481;background:#f2f2d9}
.board-play-status.game-over{border-color:#bc925b;background:#f4e3c6}
.board .square.can-select{cursor:pointer}
.board .square:focus-visible{outline:3px solid #193f6c;outline-offset:-3px;z-index:2}
.board .square.check-king{background:#d56c5a!important;box-shadow:inset 0 0 0 4px #aa2222}
.board .square.last{box-shadow:inset 0 0 0 2px #e5ad44}
.board .square.drag-source{opacity:.6}
.board .square.drop-target{box-shadow:inset 0 0 0 4px #467d4c;background:#cbdd9a!important}
.board .square.legal{cursor:pointer}
.board .square .coord{pointer-events:none}
.retry-connection{width:100%;min-height:34px;background:#f4e6cd!important;border-color:#bd995d!important;color:#75431f!important;font-size:12px!important}
.match-fairplay{border-top:1px solid #c6a874;padding-top:9px;display:flex;flex-wrap:wrap;gap:6px}
.match-fairplay>button{flex:1;min-width:90px;min-height:33px;font-size:11px;padding:5px}
.match-fairplay>button:disabled{opacity:.5}
#drawOfferNotice{width:100%;font-size:11px;line-height:1.4;color:#664124;padding:7px 9px;background:#fff7e7;border:1px solid #b9a075;border-radius:6px}
#drawOfferText{margin:0 0 5px!important}
.draw-responses{display:flex;gap:6px}
.draw-responses button{flex:1;padding:5px;font-size:11px}
@media(max-width:800px){.board-play-status{margin:0 0 7px;padding:8px 10px}.board-play-status strong{font-size:15px}}

.live-check-link{font-size:11px;color:#805128;text-decoration:underline;text-underline-offset:3px}.live-check-link:hover{color:#543112}
.board .square .coord.file{position:absolute;bottom:2px;right:2px;top:auto;left:auto;font-size:8px}


/* V165 - King's Hall guest entrance and live guest lobby. */
.guest-gate{position:fixed;inset:0;z-index:90000;display:flex;justify-content:center;align-items:center;padding:16px;background:linear-gradient(120deg,#120c09ef,#1b110cf5),url('assets/KINGS_HALL_CONTINUOUS_27_TABLES_V160.jpg') center/cover;overflow:auto;overscroll-behavior:contain;}
.guest-gate[hidden]{display:none!important;}
.guest-gate-card{width:min(520px,100%);max-height:calc(100dvh - 28px);overflow-y:auto;color:#f2dfb8;border:2px ridge #b78b50;border-radius:17px;box-shadow:0 0 0 4px #2c1b11,0 25px 70px #000c;background:linear-gradient(150deg,#342418,#1f140e 78%);padding:clamp(16px,3vw,28px);text-align:center;}
.guest-gate-kicker{font-size:11px;letter-spacing:.19em;font-weight:800;color:#e0bf85;}
.guest-gate-crest{font-size:35px;line-height:1.2;color:#d9a65d;margin:8px 0 3px;}
.guest-gate-card h1{font:500 clamp(27px,5vw,37px) Georgia,serif;color:#ffe8b8;margin:0 0 10px;}
.guest-gate-card p{font-size:13px;line-height:1.55;color:#d5bf9d;margin:0 0 14px;}
.guest-gate-card form{text-align:left;}
.guest-gate-card label,.guest-avatar-heading{display:block;font-weight:700;font-size:13px;color:#f2dbaf;margin:0 0 8px;}
.guest-gate-card input{width:100%;height:46px;border:1px solid #b48c57;border-radius:9px;padding:10px 14px;color:#fff3d9;background:#24170f;font:16px system-ui;}
.guest-gate-card input:focus-visible{outline:3px solid #dfb877;outline-offset:2px;}
.guest-avatar-heading{margin:16px 0 9px;}
.guest-avatar-heading span{font-weight:400;color:#bd9f79;font-size:11px;}
.guest-entry-avatars{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;max-height:146px;overflow-y:auto;padding:3px 2px 6px;}
.guest-entry-avatar{padding:3px;aspect-ratio:1;min-height:0;border:1px solid #735234;border-radius:9px;background:#1c130e;display:flex;align-items:center;justify-content:center;}
.guest-entry-avatar img{width:100%;height:100%;object-fit:contain;pointer-events:none;}
.guest-entry-avatar.selected{border-color:#f5d08d;box-shadow:0 0 0 2px #e0b67388 inset;}
.guest-enter-button{width:100%;margin-top:14px;min-height:50px;font-weight:750;background:linear-gradient(#9f7136,#735020)!important;border-color:#e9b65e!important;color:#fff6da!important;font-size:15px;}
.guest-enter-button:hover{background:linear-gradient(#b18448,#825922)!important;}
.guest-entry-error{font-size:13px!important;color:#ffb9a4!important;margin:10px 0!important;}
.guest-preview-button{display:block;width:100%;margin:9px 0 0;min-height:41px;font-size:12px;}
.guest-privacy-note{margin:13px 0 0!important;font-size:11px!important;color:#ab967c!important;}
.guest-lobby-panel{border-top:1px solid #9a714773;margin-top:14px;padding-top:13px;}
.guest-lobby-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;color:#f2dda8;font-size:13px;}
.guest-count{font-size:11px;color:#d9bd86;white-space:nowrap;}
.guest-server-status{margin:6px 0!important;color:#d0b895;}
.guest-online-list{max-height:160px;overflow-y:auto;display:grid;gap:6px;margin:9px 0 10px;}
.guest-online-member{display:flex;align-items:center;gap:8px;min-width:0;padding:5px 7px;border-radius:8px;background:#46321e88;border:1px solid #8b663b55;color:#f3e2c4;font-size:12px;}
.guest-online-member img{width:30px;height:30px;object-fit:contain;flex-shrink:0;}
.guest-online-member span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;}
.guest-online-member small{font-size:10px;color:#bfa37d;}
.guest-find-game{width:100%;min-height:43px;font-weight:700;background:#795528;border-color:#d6a45a;margin-top:5px;}
.guest-edit-name{width:100%;min-height:32px;margin-top:7px;font-size:11px;border-color:#68523b;background:#211810;}
@media(max-width:420px){.guest-gate{padding:9px;align-items:center}.guest-gate-card{padding:15px;max-height:calc(100dvh - 16px)}.guest-entry-avatars{grid-template-columns:repeat(6,minmax(0,1fr));max-height:132px}.guest-gate-crest{margin:1px}.guest-gate-card h1{font-size:27px}.guest-gate-card p{font-size:12px}}
@media(max-height:540px){.guest-gate{align-items:flex-start}.guest-gate-card{max-height:unset;min-height:calc(100dvh - 20px)}.guest-entry-avatars{max-height:85px}}

.guest-health-link{display:inline-block;color:#e2c58d;font-size:11px;margin:9px 0 0;text-decoration:underline;}
/* V168 — supervised guest entrance, chat and administrator controls */
.guest-admin-options{display:flex;gap:8px;justify-content:center;margin:12px 0 4px}
.guest-admin-options button{padding:9px 12px;font-size:12px}
.admin-login-form{display:flex;flex-direction:column;gap:8px;margin-top:14px;border-top:1px solid #aa865360;padding-top:14px}
.admin-login-form label{font-size:13px;color:#f5e4c2}
.admin-login-form input,.admin-manager input{width:100%;box-sizing:border-box;min-height:40px;border-radius:8px;border:1px solid #927247;background:#251812;color:#f7e4cb;padding:9px}
.admin-login-form .guest-enter-button{width:100%}.admin-login-hint{font-size:11px!important;color:#c8b596!important}
.guest-wait{margin:16px 0;padding:15px;border:1px solid #cba867;background:#312111;border-radius:12px;text-align:center}
.guest-wait strong{display:block;color:#ffe6a8;font:600 18px Georgia}
.guest-wait p{font-size:13px;line-height:1.55}
.guest-wait button{padding:8px 15px}
.hall-admin-status{color:#ffdf99!important;font-weight:700}
.hall-chat-toggle{position:absolute;right:14px;top:62px;z-index:20009;min-width:128px;padding:9px 13px;background:#271a12ec;border:1px solid #d1aa68;font-weight:650;font-size:12px}
.hall-public-chat{position:absolute;z-index:25001;right:14px;top:105px;width:min(350px,calc(100vw - 28px));max-height:calc(100% - 117px);overflow:auto;background:#23180ff9;border:1px solid #cda56c;border-radius:12px;padding:12px;box-shadow:0 16px 38px #000b}
.hall-chat-header{display:flex;justify-content:space-between;align-items:center;color:#ffe1a5;font:600 15px Georgia;gap:8px}
.hall-chat-header button{min-height:30px;width:34px}
.hall-public-chat>p{font-size:11px;line-height:1.45;color:#ccb89a;margin:9px 0}
.hall-chat-messages{height:190px;overflow:auto;border-radius:7px;background:#150e0bcc;border:1px solid #866548;padding:8px;display:flex;flex-direction:column;gap:7px}
.hall-chat-line{padding:5px 7px;background:#3a291b;border-radius:7px;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.hall-chat-line strong{display:block;color:#f2d39f;margin-bottom:2px;font-size:11px}
.hall-public-chat .chat-form{margin-top:9px;display:flex;gap:6px}.hall-public-chat .chat-form input{width:100%;min-width:0;flex:1;padding:8px;background:#fff8e5;color:#392816;border-radius:7px;border:1px solid #aa8b66}.hall-public-chat .chat-form button{padding:7px 9px}
#hallChatStatus{color:#ffd895;font-size:11px;min-height:14px}
.chat-channel-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:7px 0}
.chat-channel-tabs button{padding:7px 3px;min-height:32px;font-size:10px;white-space:normal;line-height:1.25}
.chat-channel-tabs button.active{border:2px solid #d2ac67;background:#755029;color:#fff0d0}
.chat-channel-tabs [data-channel="private"][hidden]{display:none!important}
.chair-hint{font-size:12px!important;border:1px solid #b6955d;border-radius:8px;background:#f1e1c0;padding:8px;line-height:1.45;color:#6c4524!important}
.admin-manager{border-top:1px solid #bc9656;margin-top:17px;padding-top:10px;display:flex;flex-direction:column;gap:8px}
.admin-manager h3{font:600 17px Georgia;color:#ffdfa1;margin:0}.admin-manager p{margin:2px 0;font-size:12px}
.admin-account-list{display:grid;gap:4px;font-size:11px;color:#e7d0aa;max-height:160px;overflow:auto}
.admin-account-row{display:flex;justify-content:space-between;gap:6px;align-items:center;padding:5px 7px;border:1px solid #725639;border-radius:5px}
.admin-account-row button{min-height:26px;padding:3px 6px;font-size:11px}
.admin-manager form{display:grid;gap:9px}.admin-manager form label{font-size:11px;display:grid;gap:4px}
.admin-manager form button{padding:8px}
@media(max-width:650px){.hall-chat-toggle{right:8px;top:54px;font-size:11px;padding:7px 10px;min-width:115px}.hall-public-chat{right:8px;top:94px;width:min(350px,calc(100vw - 16px));max-height:calc(100% - 100px)}.chat-channel-tabs button{font-size:10px}}
.other-guest-avatar{position:absolute;display:block;object-fit:contain;transform:translate(-50%,-100%);pointer-events:none;filter:drop-shadow(0 5px 3px #200f0c77);user-select:none}


/* V170: smooth remote avatars, also visible while guests are walking. */
#remoteAvatars{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;overflow:visible;}
.remote-guest{position:absolute;left:0;top:0;transform:translate(-50%,-100%);display:flex;flex-direction:column-reverse;align-items:center;justify-content:flex-start;pointer-events:none;will-change:left,top;overflow:visible;}
.remote-guest .other-guest-avatar{position:relative;left:auto;top:auto;transform:none;display:block;flex-shrink:0;object-fit:contain;max-width:none;pointer-events:none;}
.remote-guest-name{position:absolute;bottom:calc(100% + 5px);left:50%;transform:translateX(-50%);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;min-width:50px;text-align:center;padding:3px 6px;border:1px solid #e7c68e;background:#24170fe5;color:#fff1d4;border-radius:6px;font:700 11px/1.2 system-ui,sans-serif;box-shadow:0 2px 9px #0009;}
.live-avatar-status{font-size:11px!important;line-height:1.35!important;margin:8px 0!important;color:#b7dcab!important;}

/* V178 — matching the bright white/green admin entrance in the supplied example. */
.guest-gate{
 background:linear-gradient(120deg,rgba(9,41,23,.77),rgba(3,30,16,.8)),url('assets/KINGS_HALL_CONTINUOUS_27_TABLES_V160.jpg') center center/cover no-repeat;
 padding:18px;align-items:center;
}
.guest-gate-card{
 width:min(630px,100%);max-height:calc(100dvh - 36px);padding:clamp(20px,3.5vw,48px);
 border:0;border-radius:24px;background:#fff;color:#234333;box-shadow:0 20px 90px rgba(0,0,0,.4);
 text-align:center;outline:1px solid rgba(255,255,255,.6);
}
.guest-gate-kicker{font-size:11px;font-weight:800;color:#24613d;letter-spacing:.13em;}
.guest-gate-crest{display:none;}
.guest-gate-card h1{font:800 clamp(28px,4vw,47px)/1.13 system-ui,-apple-system,'Segoe UI',sans-serif;color:#0f5837;margin:4px 0 12px;letter-spacing:-.025em;}
.guest-gate-card p{color:#5a7168;font-size:clamp(13px,1.6vw,19px);line-height:1.4;}
.gate-hall-status{padding:14px 17px;border-radius:11px;margin:23px 0 20px;background:#592c23;color:#fff3e6;font-weight:700;font-size:clamp(13px,1.55vw,19px);line-height:1.4;}
.gate-hall-status.open{background:#145f43;color:#fff;}
.gate-or-divider{display:flex;align-items:center;gap:16px;margin:12px 0 10px;color:#7b8e81;font-size:12px;}
.gate-or-divider:before,.gate-or-divider:after{content:"";flex:1;height:1px;background:#ccd8cd;}
.guest-gate-card h2{color:#0f5837;font:700 clamp(21px,2.5vw,28px)/1.15 system-ui,sans-serif;margin:14px 0 19px;}
.guest-gate-card label,.guest-avatar-heading,.admin-login-form label{color:#1e4a35;font-size:13px;font-weight:750;}
.guest-gate-card input,.admin-login-form input{
 width:100%;height:57px;padding:10px 17px;background:#e7effe;color:#182a37;
 font:17px system-ui,sans-serif;border:2px solid #d2dcd3;border-radius:13px;margin:0 0 10px;
}
.guest-gate-card input:focus-visible{outline:3px solid #a8cdbc;outline-offset:0;}
.guest-gate-card .guest-enter-button{
 background:linear-gradient(180deg,#9b5e24,#7a4017)!important;border:3px double #dbac70!important;
 min-height:61px;color:#fff5df!important;font-size:19px;margin:12px 0 0;
}
.guest-gate-card .guest-enter-button:hover{background:linear-gradient(#b67434,#84491e)!important;}
.admin-login-form{border:0;padding-top:0;margin-top:0;display:flex;flex-direction:column;gap:3px;}
.guest-gate-card .admin-login-hint{font-size:11px!important;color:#758578!important;margin:9px 0!important;}
.guest-admin-options{margin:15px 0 8px;}
.guest-admin-options button,.guest-wait button{
 background:#f1f7f3;color:#125a3c;border:1px solid #a3bcae;padding:9px 17px;font-weight:700;
}
.guest-admin-options button:hover,.guest-wait button:hover{background:#e4f0e9;color:#084029;}
.guest-gate-card .guest-avatar-heading span{color:#5f8170;}
.guest-entry-avatars{max-height:128px;grid-template-columns:repeat(8,minmax(0,1fr));}
.guest-entry-avatar{background:#eef4f1;border-color:#a8c7b2;}
.guest-entry-avatar.selected{border-color:#146144;box-shadow:0 0 0 2px #6ca689 inset;}
.guest-gate-card .guest-privacy-note{color:#748477!important;font-size:11px!important;}
.guest-health-link{color:#1d6847;}
.guest-wait{background:#f3f6f2;border:1px solid #a5bcb0;}
.guest-wait strong{color:#14543c;}
.guest-entry-error{color:#9e2f1b!important;}
@media(max-width:500px){
 .guest-gate{padding:10px;}
 .guest-gate-card{max-height:calc(100dvh - 18px);border-radius:18px;padding:17px 16px;}
 .guest-gate-card h1{font-size:30px;}
 .guest-gate-card h2{font-size:22px;margin:9px 0 12px;}
 .guest-gate-card input{height:49px;font-size:16px;}
 .guest-gate-card .guest-enter-button{min-height:51px;font-size:16px;}
 .guest-entry-avatars{grid-template-columns:repeat(6,minmax(0,1fr));max-height:120px;}
 .gate-hall-status{margin:13px 0;padding:11px;}
}
@media(max-height:580px){.guest-gate{align-items:flex-start}.guest-gate-card{max-height:calc(100dvh - 20px);min-height:0;}}

/* V178 — separate administrator panel beside the preserved Room Controls. */
.hall-actions{position:absolute;z-index:20010;right:14px;top:13px;display:flex;align-items:center;gap:7px;max-width:calc(100% - 28px);}
.hall-actions .room-controls-button{position:relative;right:auto;top:auto;z-index:1;white-space:nowrap;}
.admin-controls-button{position:relative;z-index:1;min-height:39px;padding:10px 15px;border:1px solid #dab477;background:#563d19ee;color:#ffe8ab;font-size:12px;font-weight:800;box-shadow:0 5px 22px #0008;white-space:nowrap;}
.admin-controls-button:hover{background:#765124;}
.admin-control-panel{width:min(390px,calc(100vw - 28px));top:62px;max-height:calc(100% - 76px);z-index:26000;}
.admin-tools{border-top:1px solid #9f7b4b8a;margin-top:14px;padding-top:14px;}
.admin-tools h3{font:700 15px system-ui,sans-serif;color:#ffdda0;margin:0 0 6px;}
.admin-tools p{font-size:12px;line-height:1.5;margin:7px 0 10px;}
.admin-tools button{width:100%;min-height:38px;padding:7px 10px;margin:4px 0;font-size:12px;font-weight:700;}
.admin-tools textarea{width:100%;min-width:0;resize:vertical;border:1px solid #b68a4e;background:#fff8e7;color:#301f12;border-radius:8px;padding:10px;font:13px system-ui;}
.admin-tools textarea:focus-visible{outline:2px solid #dbab60;}
.admin-kick-list{display:flex;flex-direction:column;max-height:250px;overflow-y:auto;gap:7px;font-size:12px;}
.admin-kick-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 9px;border-radius:8px;background:#3d2e1d;border:1px solid #816542;}
.admin-kick-row span{flex:1;overflow-wrap:anywhere;}
.admin-kick-row button{width:auto;min-width:74px;margin:0;background:#763f2d;border:1px solid #cc8758;}
.moderation-status{font-weight:650!important;color:#f8d7a0!important;}
.exit-hall-button{border-color:#b77650;background:#613a28;}
.local-player-name{position:absolute;z-index:15000;transform:translate(-50%,-100%);border:1px solid #e9c687;background:#23170fec;color:#fff7e3;box-shadow:0 2px 9px #000a;border-radius:7px;padding:3px 6px;white-space:nowrap;max-width:190px;overflow:hidden;text-overflow:ellipsis;font:700 12px/1.3 system-ui,sans-serif;pointer-events:none;}
.remote-guest-name{max-width:190px;}
.announcement-banner{position:fixed;z-index:70000;top:clamp(10px,3vh,35px);left:50%;transform:translateX(-50%);display:flex;gap:16px;align-items:flex-start;width:min(620px,calc(100vw - 22px));padding:18px 20px;border:2px solid #ffdc91;border-radius:16px;background:#194c37;color:#fff9e8;box-shadow:0 12px 40px #0009;}
.announcement-banner strong{display:block;color:#ffe19c;margin-bottom:5px;font-size:15px;}
.announcement-banner p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.5;}
.announcement-banner button{flex-shrink:0;margin-left:auto;min-height:29px;padding:3px 10px;}
.private-message-toast{position:fixed;z-index:70001;bottom:19px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 20px);background:#fff1cb;color:#3d2a18;border:2px solid #bb7a31;padding:13px 20px;border-radius:12px;box-shadow:0 8px 26px #0007;font-size:13px;font-weight:750;}
.live-voice-banner{position:fixed;z-index:70000;top:90px;left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;max-width:calc(100vw - 22px);padding:9px 12px;background:#123e33;color:#fff4e4;border:1px solid #80c09a;border-radius:10px;box-shadow:0 8px 24px #0008;font-size:13px;font-weight:650;}
.live-voice-banner button{padding:6px 11px;min-height:33px;background:#8a581f;border-color:#d1a85a;}
#adminVoiceAudio{display:none;}
@media(max-width:650px){
 .hall-actions{top:7px;right:7px;gap:5px;}
 .hall-actions .room-controls-button,.admin-controls-button{font-size:11px;padding:8px;min-height:34px;}
 .admin-control-panel{right:7px;top:48px;width:min(380px,calc(100vw - 14px));max-height:calc(100% - 56px);}
 .announcement-banner{top:8px;padding:12px 13px;}
 .announcement-banner p{font-size:13px;}
 .live-voice-banner{top:69px;}
}
/* The legacy V152 room button uses !important absolute positioning.
   Override it within the two-button toolbar so neither button overlaps. */
.hall-actions #panelToggle,
.hall-actions #adminPanelToggle{
 position:static!important;top:auto!important;right:auto!important;left:auto!important;
 transform:none!important;margin:0!important;flex:0 0 auto;align-self:center;
}
.hall-actions #panelToggle{min-height:40px;}
@media(max-width:650px){.hall-actions #panelToggle{min-height:36px;}}

/* King's Hall V180: simplified logout, direct messages, real chess invitations. */
.control-panel .control-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
.control-panel .control-grid #guestSignOut{font-size:12px;}
.hall-public-chat #adminLogout.admin-signout-button{display:inline-flex;align-items:center;justify-content:center;width:auto;max-width:100%;min-height:33px;padding:6px 12px;font-size:12px;line-height:1.3;margin:8px 0 2px;background:#51321f;border:1px solid #b28a53;}
.guest-online-member .roster-private-button{flex-shrink:0;width:auto;min-height:28px;padding:4px 7px;border-radius:6px;font-size:10px;}
.hall-chat-line strong .public-sender-button{background:transparent;border:0;color:#f2d39f;min-height:24px;padding:0;font-size:11px;text-decoration:underline;text-decoration-style:dotted;text-underline-offset:2px;}
.hall-chat-line strong .public-sender-button:hover{color:#fff2d8;}
.hall-public-chat .direct-toggle{width:100%;text-align:center;margin:8px 0 3px;padding:8px 10px;min-height:36px;font-size:12px;border:1px solid #cfac6e;background:#4d3420;color:#fff0d7;}
.direct-chat-panel{border:1px solid #967750;background:#231c16;border-radius:9px;padding:10px;margin-top:6px;display:grid;gap:7px;}
.direct-chat-panel label{font-size:11px;color:#edd7b4;}
.direct-chat-panel select{width:100%;min-width:0;min-height:36px;padding:7px 8px;color:#2c1d11;background:#fff4db;border:1px solid #ab885a;border-radius:7px;}
.direct-chat-messages{height:140px;overflow:auto;background:#150f0c;border:1px solid #665139;border-radius:7px;padding:7px;display:flex;flex-direction:column;gap:6px;color:#e8d8be;font-size:12px;overflow-wrap:anywhere;}
.direct-chat-line{padding:5px 8px;border-radius:7px;display:flex;flex-direction:column;gap:2px;background:#3a2a1b;}
.direct-chat-line.outgoing{background:#26402f;}
.direct-chat-line strong{font-size:10px;color:#ecd29f;}
#directChatStatus{font-size:11px;line-height:1.35;color:#f2cf99;margin:1px 0;}
.remote-avatar-message{display:flex;align-items:center;justify-content:center;position:relative;flex-shrink:0;pointer-events:auto;touch-action:manipulation;overflow:visible;background:transparent;border:0;box-shadow:none;padding:0;margin:0;min-height:0;min-width:0;border-radius:50%;cursor:pointer;}
.remote-avatar-message:hover,.remote-avatar-message:focus-visible{background:transparent;border:0;outline:3px solid #f6d08a;outline-offset:2px;}
.remote-avatar-message .other-guest-avatar{pointer-events:none;}
.invite-panel{border:1px solid #ba9456;border-radius:9px;background:#f6e3bf;padding:9px;display:flex;flex-direction:column;gap:7px;font-size:12px;}
.invite-panel strong{font:700 14px Georgia;color:#4d311c;}
.invite-panel label{font-size:11px;color:#7a4d2a;}
.invite-panel select{min-width:0;width:100%;min-height:34px;background:#fff9e9;color:#492a17;border:1px solid #b68b57;padding:6px;border-radius:6px;}
.chess-sidebar .invite-panel button{min-height:32px;padding:5px;font-size:12px;}
.invite-panel p{font-size:11px;line-height:1.35;color:#694524;margin:0;overflow-wrap:anywhere;}
.chess-invite-toast{position:fixed;z-index:70020;bottom:86px;left:50%;transform:translateX(-50%);width:min(390px,calc(100vw - 20px));border-radius:12px;padding:12px 15px;background:#fff0c9;color:#382514;border:2px solid #ab782f;box-shadow:0 10px 30px #0009;display:flex;flex-direction:column;gap:7px;font-size:13px;}
.chess-invite-toast strong{color:#5b3715;font:700 16px Georgia;}
.chess-invite-toast>div{display:flex;gap:7px;flex-wrap:wrap;}
.chess-invite-toast button{flex:1;background:#533416;color:#fff2d3;border-color:#a47937;padding:7px 10px;min-height:35px;}
.game-event-toast{position:fixed;z-index:70015;bottom:20px;left:50%;transform:translateX(-50%);width:min(560px,calc(100vw - 20px));display:flex;align-items:center;gap:12px;justify-content:space-between;background:#fff0ce;color:#3b2b1c;border:1px solid #c49b5a;padding:10px 13px;border-radius:9px;box-shadow:0 5px 17px #0008;font-size:12px;line-height:1.4;font-weight:650;}
.game-event-toast button{flex-shrink:0;width:30px;min-height:30px;padding:2px;color:#4e371b;background:#ffe2a7;border-color:#ba945a;}
@media(max-width:650px){.guest-online-member{flex-wrap:wrap;}.guest-online-member span{min-width:100px;}.guest-online-member small{flex:1 0 100%;padding-left:37px;}.guest-online-member .roster-private-button{margin-left:auto}.hall-public-chat{max-height:calc(100svh - 135px)}.chess-invite-toast{bottom:90px;padding:10px}.game-event-toast{bottom:12px}}

/* Compact admin sign-out is intentionally inside Public Chat only. */
.hall-public-chat #adminLogout.admin-signout-button{margin-top:7px;font-size:11px;min-height:30px;padding:5px 10px;}
#adminLogout[hidden]{display:none!important;}

/* All new notices and expandable panels must obey their hidden attribute.
   Author display:grid/flex rules otherwise override the browser's default. */
[hidden]{display:none!important;}

/* Keep the tiny Admin Sign Out visible in the Public Chat header. */
.hall-chat-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-shrink:0;}
.hall-chat-header .hall-chat-head-actions #adminLogout.admin-signout-button{width:auto;min-width:0;max-width:none;min-height:29px;margin:0;padding:4px 7px;font:700 10px/1.2 system-ui;white-space:nowrap;}
.hall-chat-header>strong{min-width:0;font-size:clamp(11px,1.2vw,15px);}
.hall-chat-head-actions #closePublicChat{width:30px;min-width:30px;}

/* V183: in-game new-game request, private to the two players. */
.rematch-notice{display:grid;gap:7px;padding:10px 12px;border:1px solid #cf9f55;background:#fff2d4;color:#543817;border-radius:9px;font-size:12px;line-height:1.45;}
.rematch-notice strong{font-family:Georgia,serif;font-size:15px;color:#613e19;}
.rematch-notice p{margin:0;color:#563c25;}
.rematch-responses{display:flex;flex-wrap:wrap;gap:7px;}
.rematch-responses button{flex:1 1 130px;padding:7px 8px;min-height:38px;font-size:12px;}
#acceptRematch{background:#246040;color:#fff9e6;border-color:#75a57f;}
#declineRematch{background:#593c29;color:#fff0db;}
@media(max-width:600px){.rematch-notice{padding:9px;font-size:11px;}.rematch-responses button{font-size:11px;}}

/* V185: scoreboard in two tidy rows above each avatar; long names truncate. */
.local-player-name,.remote-guest-name{display:flex;flex-direction:column;align-items:center;gap:1px;overflow:visible;max-width:225px;width:max-content;white-space:normal;line-height:1.2;}
.avatar-score-value{display:block;font:800 12px/1.2 system-ui,sans-serif;color:#ffdc79;white-space:nowrap;}
.avatar-name-caption{display:block;max-width:min(210px,36vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 11px/1.3 system-ui,sans-serif;}
.match-actions{display:flex;gap:5px}.match-actions #flip{width:100%;grid-column:auto;}
@media(max-width:650px){.avatar-score-value{font-size:11px}.avatar-name-caption{max-width:140px;font-size:10px}}

/* V189: visible and accessible global private inbox within the chessboard. */
.board-direct-inbox{display:flex;flex-direction:column;gap:7px;padding:10px;border:1px solid #a57b3e;border-radius:11px;background:linear-gradient(155deg,#fff4d8,#f1dfb7);min-width:0}
.board-direct-inbox h3{display:flex;gap:8px;align-items:center;margin:0;font:700 16px Georgia,serif;color:#513318}
.board-direct-inbox label{font:600 11px system-ui,sans-serif;color:#684722}
.board-direct-inbox select,.board-direct-inbox input{width:100%;min-width:0;background:#fffdf7;color:#412b19;border:1px solid #a9834e;border-radius:7px;padding:8px;font:13px system-ui,sans-serif}
.board-direct-inbox p{font:11px/1.4 system-ui,sans-serif;color:#6b4725;margin:0}
.board-direct-messages{max-height:150px;min-height:48px;overflow:auto;overscroll-behavior:contain;padding:7px;border:1px solid #c9a875;border-radius:7px;background:#fffcf4;display:flex;flex-direction:column;gap:5px}
.board-direct-message{display:flex;flex-direction:column;align-items:flex-start;gap:3px;background:#f0e2c9;color:#422f1c;padding:6px 8px;border-radius:8px;font:12px/1.35 system-ui,sans-serif;overflow-wrap:anywhere}
.board-direct-message strong{font-size:10px;color:#694621}
.board-direct-message.from-me{background:#d8ecda;align-self:flex-end;max-width:96%}
.board-direct-unread{font:700 11px system-ui,sans-serif;padding:3px 7px;color:#fff;background:#a02926;border-radius:30px}
.board-direct-inbox .chat-form{display:flex;gap:6px}
.board-direct-inbox .chat-form input{flex:1}
.board-direct-inbox .chat-form button{min-width:54px;padding:6px 9px;font-size:12px}
.board-direct-inbox:focus-within{border-color:#704518}
@media(max-width:650px){.board-direct-inbox{padding:8px}.board-direct-messages{max-height:120px;min-height:44px}.board-direct-inbox h3{font-size:15px}}

/* V189 game sound unlock for browsers with autoplay restrictions. */
.board-audio-button{align-self:flex-start;min-height:32px;padding:6px 10px;border:1px solid #8d714b;border-radius:8px;font:600 11px system-ui,sans-serif;background:#f4dfb8;color:#54371e}
.board-audio-button[aria-pressed=true]{background:#dfead8;border-color:#758c63;color:#2d4927}

/* King's Hall V190 — Option B: separate Help toolbar button and responsive guide. */
.hall-actions #helpToggle{position:static!important;top:auto!important;right:auto!important;left:auto!important;flex:0 0 auto;white-space:nowrap;min-width:68px;min-height:40px;padding:8px 12px;border:1px solid #d2ac6b;border-radius:10px;background:#2c1c10f5;color:#ffe9bc;font:800 12px system-ui,sans-serif;box-shadow:0 4px 15px #13090994;cursor:pointer;}
.hall-actions #helpToggle:hover,.hall-actions #helpToggle[aria-expanded="true"]{background:#775021;color:#fff8e1;border-color:#eac383;}
.hall-actions #helpToggle:focus-visible,.hall-help-panel button:focus-visible{outline:3px solid #f7d798;outline-offset:2px;}
.hall-help-panel{position:absolute;left:calc(12px + env(safe-area-inset-left));top:calc(68px + env(safe-area-inset-top));bottom:calc(12px + env(safe-area-inset-bottom));width:min(465px,calc(100vw - 24px));z-index:26030;border:1px solid #d7a05a;border-radius:15px;background:#241509fa;color:#f8e7c6;box-shadow:0 22px 65px #000c;padding:clamp(15px,2.8vw,25px);overflow-y:auto;overscroll-behavior:contain;}
.hall-help-panel[hidden]{display:none!important;}
.hall-help-head{display:flex;justify-content:space-between;align-items:center;gap:10px;}
.hall-help-kicker{display:inline-flex;align-items:center;border:1px solid #bd8d4b;border-radius:24px;background:#6a4922;padding:5px 12px;letter-spacing:.09em;font:800 10px system-ui,sans-serif;color:#ffe5b5;}
#helpClose{flex-shrink:0;width:36px;height:36px;padding:4px;border:1px solid #c29356;border-radius:7px;background:#3b2515;color:#ffe9c0;font-size:18px;}
.hall-help-panel h2{margin:12px 0 9px;font:700 clamp(27px,3.1vw,35px)/1.12 Georgia,serif;color:#ffedc9;}
.hall-help-intro{margin:0 0 14px;line-height:1.55;font-size:13px;color:#e3c498;}
.hall-help-steps{list-style:none;margin:0;padding:0;display:grid;gap:0;}
.hall-help-steps li{display:flex;align-items:flex-start;gap:12px;border-top:1px solid #79512b;padding:13px 0;}
.hall-help-step-number{display:flex;align-items:center;justify-content:center;flex:0 0 33px;width:33px;height:33px;border-radius:50%;background:#614123;color:#ffe3aa;border:1px solid #d3a569;font-weight:800;font-size:14px;}
.hall-help-steps strong{display:block;color:#ffe4b8;font-size:15px;margin-bottom:5px;}
.hall-help-steps p{font-size:12px;line-height:1.48;margin:0;color:#dfc19c;}
#helpGotIt{display:block;width:100%;margin-top:14px;min-height:42px;padding:10px;border:1px solid #e9c38a;border-radius:8px;background:linear-gradient(#e2b96f,#ab7634);color:#261608;font-weight:800;font-size:13px;}
#helpGotIt:hover{filter:brightness(1.08);}
@media(max-width:650px){
 .hall-actions #helpToggle{padding:7px 9px;min-width:56px;min-height:36px;font-size:11px;}
 .hall-actions #panelToggle{min-width:0!important;min-height:36px!important;padding:7px 8px!important;font-size:10.5px!important;}
 .hall-actions #adminPanelToggle{min-width:0;padding:7px 7px;font-size:10.5px;min-height:36px;}
 .hall-help-panel{left:8px;right:8px;top:calc(53px + env(safe-area-inset-top));bottom:calc(8px + env(safe-area-inset-bottom));width:auto;padding:16px;border-radius:12px;}
 .hall-help-panel h2{font-size:28px;}
}
@media(max-width:360px){
 .hall-actions{gap:3px!important;right:5px!important;}
 .hall-actions #helpToggle{font-size:10px;padding:6px 7px;min-width:51px;}
 .hall-actions #panelToggle,.hall-actions #adminPanelToggle{font-size:10px!important;padding:6px!important;}
}
/* Awaiting an opponent's acceptance is visible and never a finished result. */
#drawOfferNotice.draw-offer-notice{display:grid;gap:7px;width:100%;padding:10px;background:#fff7e7;border:1px solid #be9857;border-radius:8px;color:#5e4225;font-size:12px;line-height:1.45;}
#drawOfferNotice[hidden],#drawResponses[hidden]{display:none!important;}
#drawOfferText{margin:0!important;}
#drawResponses.draw-responses{display:flex;gap:8px;}
#drawResponses button{flex:1;min-height:34px;padding:7px 9px;font-size:12px;}
#acceptDraw{background:#557f51;color:white;border-color:#41653f;}
#declineDraw{background:#74472d;color:white;border-color:#5d351c;}
