/* Chat, party, player report and announcements, in the Owner's theme: cream slanted tag with a diamond, dark espresso
   sheets, no outlines. Text is 18 px or more at 100 %. Every class starts with so- */
.so{--so-fs:max(18px,calc(var(--u) * 18));color:var(--hd-cream,#f6e7c8);font-size:var(--so-fs);line-height:1.45}
.so [hidden]{display:none!important}
.so p,.so ul{margin:0;padding:0;list-style:none}
.so-tag{display:flex;align-items:center;gap:8px;align-self:flex-start;flex:none;max-width:100%;margin:0;padding:3px 22px 3px 12px;background:#f4ead8;color:#3a2a1e;font-family:Mitr,sans-serif;font-weight:500;font-size:calc(var(--so-fs) + 1px);clip-path:polygon(0 0,100% 0,calc(100% - 12px) 100%,0 100%)}
.so-tag i{flex:none;width:9px;height:9px;background:#b8793a;transform:rotate(45deg)}
.so-note{color:#d9cdd8}
.so-btn{min-height:44px;padding:0 16px;border:0;border-radius:999px;background:rgba(255,255,255,.12);color:inherit;font:inherit;font-family:Mitr,sans-serif;cursor:pointer}
.so-yes{background:#e8b04a;color:#2e1f12}
.so-btn:disabled{opacity:.5;cursor:default}
.so :is(button,input,textarea):focus-visible{outline:3px solid #ffd98a;outline-offset:2px}
.so-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end}
.so-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.so-open{position:fixed;z-index:29;left:calc(12px + env(safe-area-inset-left));bottom:calc(12px + env(safe-area-inset-bottom));pointer-events:auto;display:flex;align-items:center;gap:8px;min-height:48px;padding:0 20px;border:0;border-radius:999px;background:rgba(24,18,22,.84);color:inherit;font:inherit;font-family:Mitr,sans-serif;cursor:pointer}
.so-open b{min-width:1.5em;padding:0 6px;border-radius:99px;background:#e8614f;color:#fff;text-align:center}
.so-peek{position:fixed;z-index:28;left:calc(12px + env(safe-area-inset-left));bottom:calc(68px + env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:min(380px,60vw);pointer-events:none}
.so-peek .so-line{padding:2px 10px;border-radius:10px;background:rgba(24,18,22,.72);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.so-line{overflow-wrap:anywhere}
.so-label{color:#c9b8a0}
.so-whisper{color:#f2b8ee}
.so-party .so-line,.so-line.so-party{color:#a9e0ff}
.so-system{color:#ffd98a}
.so-gm{color:#f2c14e;font-weight:800}
.so-who{pointer-events:auto;min-height:44px;margin:-7px 0;padding:0 4px;border:0;background:none;color:#ffd98a;font:inherit;font-weight:600;cursor:pointer}
.so-chat{position:fixed;z-index:34;left:calc(12px + env(safe-area-inset-left));bottom:calc(12px + env(safe-area-inset-bottom));width:min(380px,94vw);height:min(360px,62vh);display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:16px;background:rgba(24,18,22,.9);pointer-events:auto}
.so-tabs{display:flex;flex-wrap:wrap;gap:6px}
.so-tab{min-height:44px;padding:0 14px;border:0;border-radius:999px;background:rgba(255,255,255,.1);color:inherit;font:inherit;font-family:Mitr,sans-serif;cursor:pointer}
.so-tab[aria-selected="true"]{background:#f4ead8;color:#3a2a1e}
.so-close{margin-left:auto}
.so-log,.so-people{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.so-people{display:flex;flex-direction:column;gap:8px}
.so-people li{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px}
.so-send{display:flex;gap:8px}
.so-send input{flex:1;min-width:0;min-height:44px;padding:0 14px;border:0;border-radius:999px;background:#f4ead8;color:#2e1f12;font:inherit}
.so-party[data-party]{position:fixed;z-index:20;left:calc(12px + env(safe-area-inset-left));top:44%;display:flex;flex-direction:column;gap:6px;width:200px;pointer-events:none}
.so-mate{padding:4px 12px 8px;border-radius:12px;background:rgba(24,18,22,.76)}
.so-mate-name{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.so-hp{display:block;height:8px;border-radius:99px;background:rgba(255,255,255,.16);overflow:hidden}
.so-hp i{display:block;height:100%;background:#6fc06a}
.so-off{opacity:.55}
.so-menu{position:fixed;z-index:36;width:min(320px,90vw);max-height:calc(100vh - 16px);overflow:auto;display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:16px;background:rgba(24,18,22,.95);pointer-events:auto}
.so-sheet{position:fixed;z-index:33;left:50%;top:calc(96px + env(safe-area-inset-top));transform:translateX(-50%);width:min(430px,92vw);max-height:calc(100vh - 120px);overflow:auto;display:flex;flex-direction:column;gap:8px;padding:14px 16px;border-radius:16px;background:rgba(24,18,22,.93);pointer-events:auto}
.so-report{z-index:37}
.so-report textarea{min-height:64px;padding:8px 12px;border:0;border-radius:12px;background:#f4ead8;color:#2e1f12;font:inherit;resize:none}
.so-reason[aria-checked="true"]{background:#f4ead8;color:#3a2a1e}
#hud:has(.du-sheet) .so-invite{visibility:hidden}      /* a duel question is answered first (it runs out sooner) */
.so-banner{position:fixed;z-index:38;left:50%;top:calc(8px + env(safe-area-inset-top));transform:translateX(-50%);width:max-content;max-width:min(640px,94vw);display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 18px;border-radius:16px;background:rgba(24,18,22,.94);text-align:center;pointer-events:auto}
.so-banner .so-tag{align-self:center}
body.windowed .so-open,body.windowed .so-peek,body.windowed .so-chat,body.windowed .so-party[data-party],body.windowed .so-menu{display:none}
/* a short screen (a phone on its side): the button stays clear of the thumbs, and the box sits at the top with the line
   being typed above the words, so the on-screen keyboard does not cover it */
@media (max-height:560px){
  body.touch .so-open{bottom:auto;top:calc(146px + env(safe-area-inset-top))}
  body.touch .so-peek{bottom:auto;top:calc(150px + env(safe-area-inset-top));left:calc(110px + env(safe-area-inset-left));max-width:min(340px,40vw)}
  body.touch .so-peek .so-line:not(:last-child){display:none}
  .so-chat{bottom:auto;top:calc(8px + env(safe-area-inset-top));height:calc(100vh - 16px)}
  .so-send{order:1}
  .so-log,.so-people{order:2}
  .so-sheet{top:calc(8px + env(safe-area-inset-top));max-height:calc(100vh - 16px);gap:6px;padding:10px 12px}
  .so-report{width:min(560px,94vw)}
  .so-report .so-grid{grid-template-columns:1fr 1fr 1fr}
  body.touch .so-party[data-party]{top:auto;bottom:auto;left:calc(120px + env(safe-area-inset-left));top:calc(200px + env(safe-area-inset-top));width:160px}
}

/* over the heads: chat bubbles, cream with a diamond pin, no outline */
.so-heads{position:fixed;inset:0;z-index:1;pointer-events:none;overflow:hidden}
.so .so-head{position:absolute;left:0;top:0;display:flex;justify-content:center;padding-bottom:4px;width:max-content;max-width:min(260px,70vw)}
.so .so-bubble{position:relative;padding:4px 14px;border-radius:12px;background:#f4ead8;color:#3a2a1e;font-size:max(18px,calc(var(--u) * 18));line-height:1.4;text-align:center;overflow-wrap:anywhere;box-shadow:0 3px 8px rgba(0,0,0,.28)}
.so .so-bubble::after{content:"";position:absolute;left:50%;bottom:-4px;width:9px;height:9px;margin-left:-4.5px;background:inherit;transform:rotate(45deg)}
