/* Soul Lord — floating chat (chat.js). Real CSS px: these elements live in <body>, outside the scaled #layer. */
#chfab{position:fixed;right:max(6px,env(safe-area-inset-right,0px));top:80%;transform:translateY(-50%);z-index:56;width:50px;height:50px;border-radius:50%;padding:0;cursor:pointer;
  background:radial-gradient(circle at 35% 30%,#7a3a26,#3a1a12 70%);border:2px solid #c8955a;box-shadow:0 3px 10px #000c;color:#ffe2b0;touch-action:none;
  display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;transition:opacity .2s}
#chfab[hidden],#chpanel[hidden],#chnote[hidden]{display:none}
#chfab svg{width:26px;height:26px;fill:currentColor;pointer-events:none}
#chfab small{position:absolute;top:-5px;left:-5px;min-width:20px;height:20px;border-radius:10px;background:#c0392b;color:#fff;font:700 12px/20px system-ui,sans-serif;padding:0 5px;text-align:center;pointer-events:none}
#chfab small.inv{background:#ffd36a;color:#2a1608}
#chfab:active{filter:brightness(1.25)}
#chfab:focus-visible,#chpanel button:focus-visible,#chnote button:focus-visible{outline:2px solid #ffd36a;outline-offset:2px}
/* during a match: smaller and translucent, it must not get in the way */
body.ch-game:not(.ch-col) #chfab{width:40px;height:40px;opacity:.6}
body.ch-game:not(.ch-col) #chfab svg{width:20px;height:20px}
body.ch-col #chfab{top:auto;bottom:18px;right:18px;transform:none;width:56px;height:56px}

#chpanel{position:fixed;z-index:57;display:flex;flex-direction:column;background:#140d0aF5;border:2px solid #6b5137;color:#efe6d6;font:15px/1.35 var(--serif,Georgia,serif);box-shadow:0 0 24px #000d;box-sizing:border-box}
body.ch-sheet #chpanel{left:0;right:0;bottom:0;height:min(64vh,560px);border-radius:16px 16px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom,0px);animation:chup .22s ease-out}
body.ch-float #chpanel{right:12px;bottom:12px;width:360px;height:min(72vh,600px);border-radius:14px;animation:chup .2s ease-out}
body.ch-col #chpanel{right:0;top:0;bottom:0;border-width:0 0 0 2px;animation:chin .2s ease-out}
@keyframes chup{from{transform:translateY(30px);opacity:0}to{transform:none;opacity:1}}
@keyframes chin{from{transform:translateX(30px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){#chpanel{animation:none!important}}
.chhead{display:flex;gap:8px;align-items:center;padding:8px 8px 6px;flex:none}
.chtabs{display:flex;gap:6px;flex:1;min-width:0}
.chtabs button{flex:1;position:relative;min-height:44px;border-radius:10px;border:2px solid #6b5137;background:#1a120f;color:#e8dcc4;font:600 15px var(--serif,Georgia,serif);cursor:pointer}
.chtabs button.on{background:#5a2a1e;border-color:#ffd36a;color:#ffd9a0}
.chtabs small,.chfr em{min-width:20px;height:20px;border-radius:10px;background:#c0392b;color:#fff;font:700 12px/20px system-ui,sans-serif;padding:0 5px;text-align:center;font-style:normal}
.chtabs small{position:absolute;top:-6px;right:-4px}
.chx{flex:none;width:44px;height:44px;border-radius:10px;border:2px solid #6b5137;background:#1a120f;color:#e8dcc4;font-size:18px;cursor:pointer}
.chsub{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;padding:2px 10px 6px;font-size:13px;color:#b9a88f;flex:none}
.chsub small{font-size:11px;opacity:.8}.chsub b{color:#ffd9a0}
.chwho{display:flex;gap:6px;align-items:center;flex:1;min-width:0;font-size:15px}.chwho b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chlog{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;display:flex;flex-direction:column;gap:6px;padding:8px 10px;margin:0 8px;border-radius:10px;background:#0c0806;border:1px solid #3a2c22;scrollbar-width:thin;scrollbar-color:#6b5137 transparent}
.chm{display:flex;flex-wrap:wrap;gap:0 8px;align-items:baseline}
.chm b{color:#ffd9a0;cursor:pointer;font-size:14px}.chm.mine b{color:#9fd3ff}
.chm i{font-size:11px;color:#8d7d68;font-style:normal}
.chm span{flex-basis:100%;word-break:break-word;color:#efe6d6}
.chm.leg{display:block;font-size:13px;color:#b9a88f}.chm.leg em{color:#ffd36a;font-style:normal}
.chnone{margin:auto;text-align:center;color:#8d7d68;font-size:14px;padding:12px}
.chform{display:flex;gap:6px;padding:8px;flex:none}
.chform[hidden]{display:none}
.chform input{flex:1;min-width:0;height:44px;border-radius:10px;border:2px solid #6b5137;background:#0c0806;color:#efe6d6;font:16px var(--serif,Georgia,serif);padding:0 12px}
.chform button{flex:none;width:52px;height:44px;border-radius:10px;border:2px solid #ffd36a;background:#8a2f1e;color:#ffe9c2;font-size:18px;cursor:pointer}
.chbtn{min-height:44px;padding:4px 12px;border-radius:10px;border:2px solid #6b5137;background:#1a120f;color:#e8dcc4;font:600 14px var(--serif,Georgia,serif);cursor:pointer;flex:none}
.chbtn.gold,.btn.gold[data-inv]{border-color:#ffd36a;background:#6a3a14;color:#ffe9c2}
.chbtn.sent,.btn.sent[data-inv]{opacity:.6;cursor:default}
.chbtn.wide{align-self:stretch;margin-top:auto}
.chfr{display:flex;gap:8px;align-items:center;padding:6px 8px;border-radius:10px;background:#1a120f;border:1px solid #3a2c22;cursor:pointer;min-height:48px}
.chfn{flex:1;min-width:0;display:flex;flex-direction:column}.chfn b{color:#ffd9a0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chfn small{font-size:12px;color:#8d7d68;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chdot{width:10px;height:10px;border-radius:50%;background:#5a4a3c;flex:none}.chdot.on{background:#5fd35f;box-shadow:0 0 6px #5fd35f}
.chinvs:empty{display:none}
.chinvs{display:flex;flex-direction:column;gap:6px;padding:0 8px 6px;flex:none}
.chinv{display:flex;gap:6px;align-items:center;padding:6px 8px;border-radius:10px;background:#3a2a10;border:2px solid #ffd36a}
.chinv span{flex:1;min-width:0;font-size:14px}.chinv b{color:#ffd9a0}.chinv small{display:block;font-size:11px;color:#b9a88f}

/* the invitation notice: a card at the top; during a match only a discreet pill */
#chnote{position:fixed;z-index:58;top:calc(10px + env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);width:min(380px,calc(100vw - 20px));box-sizing:border-box;
  display:flex;flex-direction:column;gap:8px;padding:10px 12px;border-radius:14px;background:#2a1a0cF7;border:2px solid #ffd36a;color:#efe6d6;font:15px/1.3 var(--serif,Georgia,serif);box-shadow:0 6px 20px #000d;animation:chdown .25s ease-out}
#chnote b{color:#ffd9a0}
#chnote div{display:flex;gap:8px}#chnote div .chbtn{flex:1}#chnote div .chbtn.x{flex:none;width:44px;padding:0}
#chnote.mini{width:auto;max-width:calc(100vw - 20px);padding:0;border-radius:22px;opacity:.94}
#chnote.mini button{background:none;border:0;color:inherit;font:14px var(--serif,Georgia,serif);padding:10px 16px;min-height:44px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
@keyframes chdown{from{transform:translate(-50%,-20px);opacity:0}to{transform:translateX(-50%);opacity:1}}
@media (prefers-reduced-motion:reduce){#chnote{animation:none}}
/* waiting-room screen (inside the scaled layer) */
#olfriends{width:100%;max-width:760px;display:flex;flex-direction:column;gap:8px}
#olfriends .frow .btn{flex:none}

/* shared decks in the chat (José, 30 nov) */
.chform .chdkb{width:44px;border-color:#6b5137;background:#2a1d14;font-size:20px}
.chdk{display:flex!important;align-items:center;gap:8px;flex-wrap:wrap;margin-top:4px;padding:6px 8px;border:1px solid #6b5137;border-radius:10px;background:#1f150f}
.chdk img{width:34px;height:48px;object-fit:cover;border-radius:4px;flex:none}
.chdkt{display:flex;flex-direction:column;flex:1;min-width:120px}.chdkt b{color:#ffe9c2!important;cursor:default!important}.chdkt small{color:#b9a88f;font-size:12px}
.chdk .chbtn{min-height:36px}
.chpick{flex:none;max-height:45%;overflow-y:auto;border-top:1px solid #6b5137;padding:6px 8px;display:flex;flex-direction:column;gap:6px;background:#0f0a07}
.chpkh{display:flex;justify-content:space-between;align-items:center;gap:8px}
.chpki{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:44px;padding:4px 10px;border-radius:8px;border:1px solid #6b5137;background:#21170f;color:#efe6d6;font:15px var(--serif,Georgia,serif);cursor:pointer;text-align:left}
.chpki small{color:#b9a88f}
