/* Self-contained notification UI, never intercept walking/chat/settings input. */
#multiplayer-notifications{position:fixed;z-index:1200;max-height:calc(100vh - 100px);max-height:calc(100dvh - 100px);overflow:hidden;top:76px;top:max(76px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:min(320px,calc(100vw - 24px));display:grid;gap:8px;pointer-events:none;font:500 14px/1.4 system-ui,sans-serif;color:#183d2c}
#multiplayer-notifications .mp-notification{background:#fffbed;border:1px solid #b5cba7;border-left:4px solid #527a46;border-radius:12px;padding:10px 13px;box-shadow:0 4px 16px #142b2626;overflow-wrap:anywhere;white-space:pre-wrap;max-height:140px;overflow:hidden;animation:mp-notification-enter .18s ease-out;pointer-events:none}
#notification-sound-toggle{background:#fffbed;color:#183d2c;border:1px solid #b5cba7;border-radius:8px;padding:8px 10px;font:inherit;text-align:left;cursor:pointer}
#notification-sound-toggle:focus-visible{outline:3px solid #527a46;outline-offset:2px}
@keyframes mp-notification-enter{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
@media(max-width:480px){#multiplayer-notifications{top:max(68px,env(safe-area-inset-top));font-size:13px;width:min(280px,calc(100vw - 24px))}}
@media(prefers-reduced-motion:reduce){#multiplayer-notifications .mp-notification{animation:none}}
/* One latest full peer message: readable without moving the 3D camera. */
#multiplayer-chat-caption{display:flex;flex-direction:column;gap:5px;position:fixed;z-index:1190;right:max(12px,env(safe-area-inset-right));bottom:max(86px,calc(86px + env(safe-area-inset-bottom)));width:min(320px,calc(100vw - 24px));box-sizing:border-box;max-height:min(180px,calc(100vh - 110px));max-height:min(180px,calc(100dvh - 110px));overflow:hidden;pointer-events:none;background:#fffdf5f5;color:#183b2c;border:1px solid #b5cba7;border-left:4px solid #527a46;border-radius:12px;padding:10px;font:500 13px/18px system-ui,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 4px 16px #142b2626}
.mp-caption-text{display:block;min-height:0;overflow:hidden;white-space:pre-wrap}.mp-caption-read{align-self:flex-end;flex-shrink:0;pointer-events:auto;touch-action:manipulation;min-height:32px;padding:4px 7px;border:1px solid #b5cba7;border-radius:6px;background:#edf2e4;color:#183b2c;font:600 11px system-ui;cursor:pointer}.mp-caption-read:focus-visible{outline:3px solid #aa701e;outline-offset:2px}
.mp-sound-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;margin:10px 0;padding:10px;border:1px solid #b5cba7;border-radius:9px;min-width:0}.mp-sound-controls p{margin:0;font-size:12px}.mp-sound-controls :is(button,select,input){min-height:44px;max-width:100%;font-size:16px}.mp-sound-controls input[type=range]{width:100%;accent-color:#315a3b}.mp-sound-controls legend{font-weight:700}
/* Keep the caption visibly above the mobile joystick, not merely click-through. */
@media(pointer:coarse),(max-width:500px){#multiplayer-chat-caption{bottom:max(150px,calc(150px + env(safe-area-inset-bottom)));max-height:min(180px,calc(100vh - 210px));max-height:min(180px,calc(100dvh - 210px))}}
