/* LUDO ROYALE — isolated from chat styles */
#ludoGameOverlay{--lg-ink:#26314b;--lg-purple:#73569c;--lg-red:#e65059;--lg-green:#20a678;--lg-yellow:#efb735;--lg-blue:#4389e5;position:fixed;inset:0;z-index:999995;display:none;overflow:auto;padding:15px 10px 30px;box-sizing:border-box;background:rgba(18,19,38,.78);backdrop-filter:blur(9px);direction:rtl;font-family:'El Messiri',Tahoma,Arial,sans-serif;color:var(--lg-ink)}
#ludoGameOverlay *{box-sizing:border-box}
#ludoGameOverlay .lg-shell{max-width:590px;margin:10px auto;background:linear-gradient(160deg,#fff,#f7f6fc);border:1px solid #ffffffd9;border-radius:25px;overflow:hidden;box-shadow:0 22px 75px #090b2070,0 2px 0 #ffffff80 inset}
#ludoGameOverlay .lg-head{background:linear-gradient(125deg,#3d335f,#765aa4 64%,#b094d1);color:#fff;padding:18px 20px 15px;display:flex;justify-content:space-between;align-items:center;gap:12px;position:relative;overflow:hidden}
#ludoGameOverlay .lg-head:after{content:'✦';position:absolute;left:25%;top:-30px;font-size:120px;color:#ffffff0b;pointer-events:none}
#ludoGameOverlay .lg-brand{font-weight:900;font-size:23px;letter-spacing:.2px;line-height:1.2}
#ludoGameOverlay .lg-sub{font-size:11px;color:#f4eafa;opacity:.86;margin-top:4px}
#ludoGameOverlay .lg-count{border:1px solid #ffffff65;background:#ffffff22;border-radius:50px;padding:8px 12px;font-size:12px;white-space:nowrap}
#ludoGameOverlay .lg-content{padding:15px}
#ludoGameOverlay .lg-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:14px}
#ludoGameOverlay .lg-player{display:flex;align-items:center;gap:9px;min-width:0;padding:9px 10px;background:#fff;border:1px solid #e8e5f0;border-radius:14px;box-shadow:0 3px 10px #2c27420a;position:relative}
#ludoGameOverlay .lg-player:before{content:'';position:absolute;right:0;top:11px;bottom:11px;width:4px;border-radius:4px;background:var(--pc)}
#ludoGameOverlay .lg-avatar{height:40px;width:40px;flex:none;object-fit:cover;border-radius:12px;border:2px solid var(--pc);background:#e9e5f1}
#ludoGameOverlay .lg-name{font-size:13px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#ludoGameOverlay .lg-role{font-size:10px;color:#7c7890;margin-top:3px}
#ludoGameOverlay .lg-board-frame{background:linear-gradient(135deg,#eee6d2,#b9a783 46%,#e9d9b9);padding:8px;border:2px solid #aa9675;border-radius:15px;box-shadow:0 7px 0 #96805e,0 13px 23px #51463140,inset 0 1px 0 #fff9}
#ludoGameOverlay .lg-board{width:100%;aspect-ratio:1;overflow:hidden;background:#fff;border:2px solid #534c51;border-radius:7px;box-shadow:inset 0 0 0 2px #fff}
#ludoGameOverlay .lg-board svg{display:block;width:100%;height:100%;touch-action:manipulation}
#ludoGameOverlay .lg-board .lg-square{stroke:#9b96a3;stroke-width:.8}
#ludoGameOverlay .lg-bottom{margin-top:18px;background:#fff;border:1px solid #e8e4f0;border-radius:16px;padding:13px;display:flex;align-items:center;gap:12px}
#ludoGameOverlay .lg-dice{height:66px;width:66px;flex:none;border-radius:15px;background:linear-gradient(145deg,#fff,#ebe7f3);border:1px solid #ddd6e8;box-shadow:0 5px 0 #d0c9db,0 9px 13px #251e3530;display:grid;place-items:center}
#ludoGameOverlay .lg-dice svg{width:50px;height:50px}
#ludoGameOverlay .lg-turnbox{flex:1;min-width:0}
#ludoGameOverlay .lg-turn{font-weight:900;font-size:15px;color:#57467a}
#ludoGameOverlay .lg-hint{font-size:11px;line-height:1.8;color:#77728a;margin-top:4px}
#ludoGameOverlay .lg-roll{font-family:inherit;background:linear-gradient(135deg,#7453a4,#9472be);color:#fff;border:0;border-radius:12px;padding:12px 17px;font-weight:900;white-space:nowrap;box-shadow:0 4px 0 #533b76}
#ludoGameOverlay .lg-roll:disabled{opacity:.45;cursor:not-allowed}
#ludoGameOverlay .lg-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:14px;color:#777287;font-size:11px;padding:16px 4px 2px}
#ludoGameOverlay .lg-legend b{color:#7965a2}
#ludoGameOverlay .lg-board-note{margin:10px 2px 0;text-align:center;color:#777287;font-size:11px;line-height:1.7}
@media(max-width:430px){#ludoGameOverlay{padding:6px 5px 20px}#ludoGameOverlay .lg-shell{border-radius:18px;margin:4px auto}#ludoGameOverlay .lg-head{padding:14px}#ludoGameOverlay .lg-brand{font-size:19px}#ludoGameOverlay .lg-content{padding:9px}#ludoGameOverlay .lg-players{gap:6px;margin-bottom:10px}#ludoGameOverlay .lg-player{padding:7px 8px;gap:6px}#ludoGameOverlay .lg-avatar{width:34px;height:34px;border-radius:9px}#ludoGameOverlay .lg-name{font-size:11px}#ludoGameOverlay .lg-board-frame{padding:5px;border-radius:11px}#ludoGameOverlay .lg-bottom{gap:9px;padding:10px}#ludoGameOverlay .lg-dice{width:53px;height:53px}#ludoGameOverlay .lg-dice svg{width:42px;height:42px}#ludoGameOverlay .lg-turn{font-size:13px}#ludoGameOverlay .lg-roll{padding:10px;font-size:11px}}
/* Clean game layout: seats match the four board corners */
#ludoGameOverlay .lg-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:'red green' 'blue yellow';direction:ltr;gap:9px;margin-bottom:12px}
#ludoGameOverlay .lg-player{direction:rtl;text-align:right;min-height:58px}
#ludoGameOverlay .lg-player[data-seat="0"]{grid-area:red}
#ludoGameOverlay .lg-player[data-seat="1"]{grid-area:green}
#ludoGameOverlay .lg-player[data-seat="2"]{grid-area:yellow}
#ludoGameOverlay .lg-player[data-seat="3"]{grid-area:blue}
#ludoGameOverlay .lg-player .lg-avatar{display:block;visibility:visible;opacity:1;object-fit:cover}
#ludoGameOverlay .lg-bottom{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px;margin-top:13px;padding:12px;background:transparent;border:0;box-shadow:none}
#ludoGameOverlay .lg-dice-button{width:80px;height:80px;display:grid;place-items:center;padding:0;background:linear-gradient(145deg,#fff,#e8e1f2);border:1px solid #c9bdd9;border-radius:20px;box-shadow:0 6px 0 #bdb0d0,0 12px 23px #3c2b5530;transition:transform .18s,box-shadow .18s;cursor:pointer}
#ludoGameOverlay .lg-dice-button:disabled{cursor:default;opacity:.7}
#ludoGameOverlay .lg-dice-button.lg-can-roll{opacity:1;box-shadow:0 6px 0 #ad96cd,0 12px 28px #73569c55}
#ludoGameOverlay .lg-dice-button.lg-can-roll:active{transform:translateY(5px);box-shadow:0 1px 0 #ad96cd,0 4px 12px #73569c44}
#ludoGameOverlay .lg-dice{height:65px;width:65px;border:0;box-shadow:none;background:transparent;border-radius:0;display:grid;place-items:center}
#ludoGameOverlay .lg-dice svg{height:65px;width:65px}
#ludoGameOverlay .lg-rolling .lg-dice{animation:lgDiceSpin .65s ease-in-out infinite}
@keyframes lgDiceSpin{0%{transform:rotate(0deg) scale(1)}45%{transform:rotate(200deg) scale(1.1)}100%{transform:rotate(360deg) scale(1)}}
#ludoGameOverlay .lg-turn{font-size:15px;font-weight:900;color:#584276;text-align:center}
#ludoGameOverlay .lg-active-player{border-color:var(--pc);box-shadow:0 0 0 2px var(--pc),0 5px 18px #3b2a4020}
#ludoGameOverlay .lg-legend,#ludoGameOverlay .lg-board-note,#ludoGameOverlay .lg-hint{display:none!important}
@media(max-width:430px){#ludoGameOverlay .lg-player{min-height:50px}#ludoGameOverlay .lg-dice-button{width:72px;height:72px}#ludoGameOverlay .lg-dice,#ludoGameOverlay .lg-dice svg{width:58px;height:58px}}
/* Interactive pawns and legal move highlighting */
#ludoGameOverlay .lg-piece{transition:filter .2s}
#ludoGameOverlay .lg-piece-legal{cursor:pointer;filter:drop-shadow(0 0 5px #fff) drop-shadow(0 0 6px #6c42bb)}
#ludoGameOverlay .lg-piece-legal .lg-piece-ring{animation:lgPawnPulse .8s infinite alternate;transform-box:fill-box;transform-origin:center}
@keyframes lgPawnPulse{to{transform:scale(1.13);opacity:.35}}

/* Ludo window controls and floating minimized tab */
#ludoGameOverlay .lg-actions{display:flex;align-items:center;gap:6px;position:relative;z-index:2}
#ludoGameOverlay .lg-head-btn{border:1px solid #ffffff75;background:#ffffff24;color:#fff;border-radius:10px;width:32px;height:32px;font-size:18px;font-family:inherit;cursor:pointer;display:grid;place-items:center;padding:0}
#ludoGameOverlay .lg-head-btn:active{transform:scale(.94)}
#ludoMiniTab{position:fixed;bottom:18px;left:16px;z-index:999995;border:1px solid #cbb8e4;background:linear-gradient(135deg,#73569c,#a180c6);color:white;padding:10px 16px;border-radius:16px;box-shadow:0 6px 24px #34244b55;font-family:'El Messiri',Tahoma,sans-serif;font-size:15px;font-weight:800;cursor:pointer;direction:rtl}
#ludoMiniTab span{font-size:10px;font-weight:400;display:block;opacity:.85}
#ludoGameOverlay.lg-fullscreen{padding:0;background:#f5f1fa;backdrop-filter:none}
#ludoGameOverlay.lg-fullscreen .lg-shell{max-width:min(100vw,850px);min-height:100dvh;border-radius:0;margin:0 auto}
#ludoGameOverlay.lg-fullscreen .lg-board-frame{max-width:730px;margin:0 auto}
#ludoGameOverlay .lg-moving-ghost{pointer-events:none;filter:drop-shadow(0 3px 3px #0005)}
@media(max-width:430px){#ludoGameOverlay .lg-head{gap:5px;padding:11px 9px}#ludoGameOverlay .lg-brand{font-size:16px}#ludoGameOverlay .lg-sub{font-size:9px}#ludoGameOverlay .lg-count{display:none}#ludoGameOverlay .lg-actions{gap:4px}#ludoGameOverlay .lg-head-btn{width:30px;height:30px}}

#ludoGameOverlay .lg-shell,#ludoGameOverlay.lg-fullscreen,#ludoBox{background:#111827!important;color:#e8eefc!important;border-color:#475569!important}#ludoGameOverlay .lg-head{background:#1e293b}#ludoGameOverlay .lg-player,#ludoGameOverlay .lg-bottom,#ludoBox .ludoUserItem,#ludoBox #ludoPlayers,#ludoBox #ludoUsers,#ludoBox #ludoTimerBox{background:#202c42!important;color:#edf2ff!important;border-color:#475569!important}#ludoGameOverlay .lg-avatar{border-radius:50%;width:48px;height:48px}#ludoGameOverlay .lg-turn,#ludoGameOverlay .lg-role,#ludoBox #ludoTimer{color:#cbd5e1!important}#ludoGameOverlay .lg-board-frame{background:#26334a;border-color:#64748b;box-shadow:0 5px 15px #0008}#ludoGameOverlay .lg-board{background:#202b40} .l48av{position:relative;flex:none}#l48Mic{position:absolute;bottom:-5px;right:-5px;border:1px solid #aab9d1;border-radius:50%;background:#26334a;color:white;width:25px;height:25px;padding:0}#l48Mic.on{background:#16a34a}#l48Watch{position:fixed;right:8px;top:40%;z-index:99990;border:1px solid #8296bb;border-radius:50%;background:#17243b;color:white;width:48px;height:48px;touch-action:none;font-size:23px}#l48List{position:fixed;inset:15% 5%;overflow:auto;z-index:999996;background:#141e30;color:white;border:1px solid #64748b;border-radius:20px;padding:16px;direction:rtl}#l48List button{background:#334766;color:white;border:1px solid #7185a4;border-radius:10px;padding:9px}.l48match{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px;border-bottom:1px solid #475569}.l48match img{width:32px;height:32px;border-radius:50%;object-fit:cover}#ludoBox #ludoMessage{color:#cbd5e1!important}#ludoGameOverlay .lg-players{grid-template-areas:'red green';margin:4px 0 8px;gap:8px}#ludoGameOverlay #ludoLowerPlayers{grid-template-areas:'blue yellow';margin:8px 0 0}#ludoGameOverlay .lg-player{background:transparent!important;border:1px solid transparent!important;min-height:48px;padding:4px 7px;gap:8px;box-shadow:none}#ludoGameOverlay .lg-active-player{border-color:var(--pc)!important;box-shadow:0 0 12px var(--pc)}#ludoGameOverlay .lg-avatar{width:42px;height:42px;border:2px solid var(--pc)}#ludoGameOverlay .lg-withdrawn{opacity:.45}#ludoGameOverlay .lg-bottom{margin-top:5px;padding:6px}#ludoGameOverlay .lg-dice-button{width:58px;height:58px}#ludoGameOverlay .lg-dice,#ludoGameOverlay .lg-dice svg{width:48px;height:48px}#ludoMiniTab{right:8px;left:auto;top:55%;bottom:auto;width:52px;height:52px;border-radius:50%;padding:0;font-size:0;touch-action:none;background:#17243b}#ludoMiniTab:before{content:'🎲';font-size:25px}#ludoMiniTab span{display:none}

/* V50: local player perspective */
#ludoGameOverlay .lg-player[data-visual-seat="0"]{grid-area:red}#ludoGameOverlay .lg-player[data-visual-seat="1"]{grid-area:green}#ludoGameOverlay .lg-player[data-visual-seat="2"]{grid-area:yellow}#ludoGameOverlay .lg-player[data-visual-seat="3"]{grid-area:blue}
#ludoGameOverlay.lg-duel .lg-players{display:flex;justify-content:center;flex-wrap:wrap}#ludoGameOverlay.lg-duel .lg-player{width:auto;min-width:110px;max-width:90%}#ludoGameOverlay.lg-duel .lg-withdrawn{min-width:0;opacity:.4}#ludoGameOverlay .lg-avatar{border-color:var(--pc)!important}#ludoGameOverlay .lg-active-player{border-color:var(--pc)!important}#ludoGameOverlay .lg-board svg{transform-origin:center}

/* V51 diagonal seats */
#ludoGameOverlay.lg-duel .lg-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}#ludoGameOverlay.lg-duel .lg-player{width:100%;min-width:0;max-width:100%}#ludoGameOverlay.lg-duel #ludoGamePlayers .lg-player{grid-area:red}#ludoGameOverlay.lg-duel #ludoLowerPlayers .lg-player{grid-area:yellow}
