/* Preserve the two independent transcripts, including the reserved three-row space while idle. */
html.mobile-hud.prism-phone #world-hud #mobile-chat[data-centered-chat]{
  --pr-chat-size:clamp(9px,1.47vw,18px);--pr-chat-line:clamp(10px,1.66vw,22px);
  --pr-chat-pad:clamp(2px,.28vw,4px);--pr-chat-h:calc(3 * var(--pr-chat-line) + 2 * var(--pr-chat-pad));
  --pr-chat-key:clamp(24px,3.8vw,43px);--pr-chat-gap:clamp(4px,.55vw,8px);
  --obs-chat-band:var(--pr-chat-h);--obs-chat-font:var(--pr-chat-size);--obs-chat-line:var(--pr-chat-line);
  --pr-chat-panel:linear-gradient(138deg,#334747fa,#1a2b2efb 40%,#101e22fb);
  --pr-chat-edge:#d2b98987;--mobile-chat-warm:#e1c99d;
  & .mobile-chat-preview{
    position:relative;isolation:isolate;grid-template-columns:minmax(0,1fr) var(--pr-chat-key);
    grid-template-rows:auto var(--pr-chat-h);gap:clamp(3px,.36vw,6px) var(--pr-chat-gap);align-items:center;
    font:500 var(--pr-chat-size)/var(--pr-chat-line) "Segoe UI",Arial,sans-serif;
  }
  & .mobile-chat-preview::before{content:none}
  & .mobile-chat-preview-events{
    grid-area:1/1/2/3;padding:var(--pr-chat-pad) 5px;row-gap:0;
    border:0;border-radius:2px;background:linear-gradient(90deg,#1a211fb0,#1e232078 77%,#20262046);
    color:#e2dbce;font:400 var(--pr-chat-size)/var(--pr-chat-line) "Segoe UI",Arial,sans-serif;
    text-shadow:0 1px 2px #151a1a;
  }
  & .mobile-chat-preview-events::before{content:none}
  & .mobile-chat-preview-open{
    display:grid;align-content:end;box-sizing:border-box;padding:var(--pr-chat-pad) 5px;height:var(--pr-chat-h);
    border:0;border-radius:2px;background:linear-gradient(90deg,#15262dbf,#18262b96 78%,#1d292769);
  }
  & .mobile-chat-preview-lines{row-gap:0;font:inherit}
  & .mobile-chat-preview-line{height:var(--pr-chat-line);min-height:0;font:inherit;text-shadow:0 1px 2px #151a1a}
  & .mobile-chat-preview-line[data-channel=party]{color:#b9e7a7}
  & .mobile-chat-preview-line[data-channel=clan]{color:#a9cdff}
  & .mobile-chat-preview-line[data-channel=whisper]{color:#efc2e9}
  & .obs-preview-symbol{display:none}
  & .obs-preview-type{display:inline}
  & .mobile-chat-preview-icon{
    align-items:end;justify-content:center;min-width:0;width:100%;min-height:0;height:var(--pr-chat-h);border:0;padding:0;
  }
  & .mobile-chat-preview-icon .obs-chat-key-face{
    display:grid;place-items:center;box-sizing:border-box;width:var(--pr-chat-key);height:var(--pr-chat-key);
    background:linear-gradient(135deg,#f4e0ab,#cea967);border:0;border-radius:0;color:#242a29;
    clip-path:polygon(19% 0,100% 0,100% 80%,81% 100%,0 100%,0 19%);
  }
  & .mobile-chat-preview-icon .obs-chat-key-face::before{content:none}
  & .mobile-chat-preview-icon .obs-chat-key-face svg{width:59%;height:59%;stroke-width:1.7}
  & .mobile-chat-preview:has(.mobile-chat-preview-lines:empty){
    grid-template-rows:auto;align-items:end;pointer-events:none;
    & .mobile-chat-preview-open{display:none}
    & .mobile-chat-preview-events{grid-area:1/1;align-self:center;pointer-events:auto}
    & .mobile-chat-preview-icon{grid-area:1/2;height:44px;pointer-events:auto}
  }
  & .mobile-chat-preview-icon[data-unread]::after{background:#c2609a}
  & .mobile-chat-launch .obs-chat-key-face{color:#192b31;background:linear-gradient(135deg,#f3e3bd,#c8ab75);border-color:#ceb788}
  & .mobile-chat-panel{border:1px solid var(--pr-chat-edge);border-radius:3px;background:var(--pr-chat-panel);color:#f6ede0}
  &:not([data-composing=true]) .mobile-chat-panel:not([data-picker-open]):has(> .obs-chat-tabs){
    width:min(416px,calc(var(--centered-chat-viewport-width,100vw) - 16px));height:min(234px,calc(var(--centered-chat-viewport-height,100dvh) - 12px));
    grid-template-rows:40px 38px minmax(0,1fr) auto;
  }
  &:not([data-composing=true]) .mobile-chat-header{
    min-height:0;height:100%;padding:0 7px 0 13px;border:0;border-bottom:1px solid #cbb58d3d;
    background:linear-gradient(100deg,#977c4b26,#3a4c4b19 51%,transparent);
  }
  & .obs-chat-title{font:400 19px/1.1 Georgia,serif;letter-spacing:-.25px;color:#fff4d9}
  & .obs-chat-title svg{color:#e4c999}
  & .obs-chat-tabs{
    align-items:stretch;align-content:stretch;box-sizing:border-box;padding:3px 6px;
    background:none;box-shadow:inset 0 -1px #cebe9d2e;
  }
  & .obs-chat-tabs button{height:auto;min-height:0;border:1px solid transparent;border-radius:3px;box-shadow:none;font-size:11px}
  & .obs-chat-tabs button[aria-pressed=true]{background:color-mix(in srgb,var(--mobile-message-color) 14%,transparent);border-color:color-mix(in srgb,var(--mobile-message-color) 35%,transparent);box-shadow:none}
  & .mobile-chat-log{background:none;scrollbar-color:#899a955c transparent}
  & .mobile-chat-log .mobile-chat-row{font:400 12px/1.3 "Segoe UI",Arial,sans-serif}
  & .mobile-chat-form{min-height:0;padding:7px 10px;border-top:1px solid #ccbb992e;background:none}
  & .obs-chat-capsule,& .obs-chat-capsule:focus-within{padding:0;gap:6px;min-height:36px;background:none;box-shadow:none}
  & .obs-chat-writing{align-self:stretch;box-sizing:border-box;padding:3px 11px;min-width:0;border-radius:20px;background:#0b181c94;box-shadow:inset 0 0 0 1px #b7b5a64a}
  & .obs-chat-writing:focus-within{background:#0d1e24c9;box-shadow:inset 0 0 0 1px #b4b9a9a6}
  & .mobile-chat-input::placeholder{font-size:12px}
  & .obs-chat-capsule .mobile-chat-send{height:36px;min-width:36px;flex-basis:36px;color:#252d2b}
  & .mobile-chat-send::before{inset:2px;background:linear-gradient(145deg,#ead3a3,#ba9764)}
  & .mobile-chat-send:disabled{color:#a9afa3}
  & .mobile-chat-send:disabled::before{background:#37464a}
  & .mobile-chat-picker{background:#16282e}
  & .mobile-chat-grid .mobile-chat-tile{background:#21343b;border-color:#9aa79440}
  & .mobile-chat-grid .mobile-chat-tile[aria-pressed=true]{background:color-mix(in srgb,var(--mobile-message-color) 15%,#1a2b32)}
  &[data-state=expanded][data-composing=true] .mobile-chat-panel{background:var(--pr-chat-panel);border-color:var(--pr-chat-edge)}
  &[data-state=expanded][data-composing=true] .mobile-chat-form{background:none}
  &[data-state=expanded][data-composing=true] .obs-chat-capsule{min-height:44px}
  &[data-composing=true] .obs-chat-capsule .mobile-chat-send{height:44px;min-width:44px;flex-basis:44px}
  & .obs-chat-quote{background:#23353bc4}
}
html.mobile-hud.prism-phone #world-hud{
  --pr-stick-base:clamp(64px,11.28vw,118.4px);
  --stick-size:var(--pr-stick-base);
  &[data-stick-size=compact]{--stick-size:calc(var(--pr-stick-base) * .87)}
  &[data-stick-size=large]{--stick-size:calc(var(--pr-stick-base) * 1.18)}
}
html.mobile-hud.prism-phone #world-hud.show-joystick #movement-stick{
  width:var(--stick-size);aspect-ratio:1;box-sizing:border-box;border-radius:50%;
  border:1px solid #d6cba38c;background:radial-gradient(circle at 50% 35%,#50625e25,#192a31a6);
  box-shadow:inset 0 0 0 3px #26373948,0 1px 2px #0e161851;
  &::before{
    content:"";position:absolute;inset:7%;width:auto;height:auto;border:0;border-radius:50%;box-shadow:none;
    background:radial-gradient(circle,#e3d5ae96 0 45%,transparent 57%) center top/6% 6% no-repeat,
      radial-gradient(circle,#e3d5ae96 0 45%,transparent 57%) right center/6% 6% no-repeat,
      radial-gradient(circle,#e3d5ae96 0 45%,transparent 57%) center bottom/6% 6% no-repeat,
      radial-gradient(circle,#e3d5ae96 0 45%,transparent 57%) left center/6% 6% no-repeat;
    opacity:1;transform:none;pointer-events:none;
  }
  & span{
    width:39%;aspect-ratio:1;border:1px solid #e4d8b2a6;border-radius:50%;
    background:radial-gradient(circle at 40% 28%,#b4b29775,#526763ad 72%);
    box-shadow:inset 0 0 0 2px #e4d8b220,0 1px 3px #111c2299;pointer-events:none;
  }
  &.is-held{border-color:#ead4a4c7}
  &.is-held span{width:35%;border-color:#ffe9b8}
}
html.mobile-hud.prism-phone #world-hud.show-joystick:not([data-centered-chat-layout]) #movement-stick{
  width:var(--stick-size)!important;height:var(--stick-size)!important;
}
html.mobile-hud.obsidian-phone.prism-phone #world-hud :is(#touch-pickup,#touch-pickup-receipt){
  position:absolute;inset:auto auto var(--pr-pickup-bottom,max(8px,env(safe-area-inset-bottom))) var(--pr-pickup-left,50%)!important;
  z-index:2;transform:translateX(-50%);width:var(--pr-pickup-width,clamp(96px,17.25vw,164px));height:44px;
  box-sizing:border-box;align-items:center;justify-content:center;gap:clamp(5px,.8vw,10px);
  padding:4px clamp(6px,.95vw,12px);overflow:hidden;isolation:isolate;text-align:left;
  border:1px solid #efd18c;border-radius:6px 3px 6px 3px;color:#fff2cf;
  background:linear-gradient(112deg,#ffc4662c,transparent 70%),linear-gradient(#565a46,#293e43 78%);
  box-shadow:inset 0 0 0 1px #f9d9994a,0 0 0 1px #242b28,0 1px 5px #e5b4594d;
  & :is(.action-art,[data-pickup-icon]){width:clamp(20px,3.8vw,28px);height:clamp(20px,3.8vw,28px);flex:none;object-fit:contain}
  & .prism-pickup-copy:not([hidden]){display:grid;min-width:0;gap:1px;font:500 clamp(10px,1.18vw,14px)/1.15 "Segoe UI",Arial,sans-serif}
  & .prism-pickup-item{display:flex;min-width:0;gap:3px}
  & [data-pickup-item]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  & [data-pickup-count]{flex:none;color:#f4d887}
}
html.mobile-hud.obsidian-phone.prism-phone #world-hud.has-nearby-loot #touch-pickup{
  display:flex;touch-action:manipulation;animation:prism-pickup-appear .3s cubic-bezier(.2,.7,.25,1) both;
  &::after{
    content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
    background:linear-gradient(110deg,transparent 38%,#ffe2a257 50%,transparent 62%) 100% 0/250% 100%;
    animation:prism-pickup-sheen .85s ease-out .09s both;
  }
  &:active{background:linear-gradient(#6e6645,#3f4b49);border-color:#ffe3a3}
  &:focus-visible{outline:2px solid #ffe6a3;outline-offset:2px}
}
html.mobile-hud.obsidian-phone.prism-phone #world-hud #touch-pickup-receipt:not([hidden]){
  display:flex;pointer-events:none;border-color:#9a9e74;background:linear-gradient(#40514a,#263b38);
  box-shadow:inset 0 0 0 1px #dcc28922;
  &[data-item-art] .action-art{display:none}
}
html.mobile-hud.obsidian-phone.prism-phone :is(main.ui-open #world-hud,#world-hud:has(#mobile-chat[data-state=expanded],#chat-content:not([hidden])))
  :is(#touch-pickup,#touch-pickup-receipt),
html.mobile-hud.obsidian-phone.prism-phone #world-hud:has(#touch-pickup-receipt:not([hidden])) #touch-pickup{display:none}
@keyframes prism-pickup-appear{
  from{opacity:0;transform:translate(-50%,5px)}
  to{opacity:1;transform:translate(-50%,0)}
}
@keyframes prism-pickup-sheen{from{background-position:100% 0}to{background-position:0 0}}
@media(prefers-reduced-motion:reduce){
  html.mobile-hud.obsidian-phone.prism-phone #world-hud.has-nearby-loot #touch-pickup,
  html.mobile-hud.obsidian-phone.prism-phone #world-hud.has-nearby-loot #touch-pickup::after{animation:none}
}
@media(max-width:539px){
  html.mobile-hud.prism-phone #world-hud{--pr-stick-base:clamp(44px,11.85vw,64px)}
}
@media(max-width:710px){
  html.mobile-hud.prism-phone #world-hud .mobile-chat-safe-area{left:max(5px,env(safe-area-inset-left))!important;bottom:max(5px,env(safe-area-inset-bottom))!important}
  html.mobile-hud.prism-phone #world-hud #mobile-chat[data-centered-chat]{
    &:not([data-composing=true]) .mobile-chat-panel:not([data-picker-open]):has(> .obs-chat-tabs){
      width:min(363px,calc(var(--centered-chat-viewport-width,100vw) - 12px));height:min(208px,calc(var(--centered-chat-viewport-height,100dvh) - 12px));
      grid-template-rows:36px 34px minmax(0,1fr) auto;
    }
  }
}
