@import url("/dossier-items.css");
.world-social, .player-inspection {
  --social-ivory: #f6efd9;
  --social-muted: #d2d2c1;
  --social-gold: #ead19a;
  --social-rule: #c9b58960;
  --social-red: #f2b5a6;
  --social-face: Cormorant, Georgia, serif;
  --social-small: Manrope, 'Segoe UI', sans-serif;
  color: var(--social-ivory);
  font: 550 13px/1.45 var(--social-small);
}

.world-social [hidden] { display: none !important; }
.world-social {
  --panel-width: min(356px, calc(100vw - 32px));
  --chat-max-height: 65svh;
  position: fixed;
  z-index: 8;
  inset: auto auto var(--social-bottom, max(26px, env(safe-area-inset-bottom))) max(var(--hud-gutter, 16px), env(safe-area-inset-left));
  pointer-events: none;
}
.scene-location-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 9px;
}
[data-scene-population], [data-world-population] {
  color: #efe6d2;
  font: 600 12px/1.35 Manrope, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px #151c17;
}
[data-scene-population]::before {
  content: '·';
  margin-right: 8px;
  color: #d5bc8e;
}

.world-social button, .world-social input, .player-inspection button {
  color: inherit;
  font: inherit;
}
.world-social button, .player-inspection button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.world-social button:focus-visible, .world-social input:focus-visible, .player-inspection button:focus-visible {
  outline: 1px solid var(--social-gold);
  outline-offset: 2px;
}
.world-social button:disabled { cursor: default; }
.social-panel, .social-rail { pointer-events: auto; }

.social-rail {
  position: relative;
  display: flex;
  width: max-content;
  align-items: center;
  padding-inline: 7px;
  isolation: isolate;
}
.social-rail::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 3px 0;
  background: linear-gradient(100deg, transparent, #1d2824b8 13% 87%, transparent);
}
.social-rail button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .38em;
  min-height: 38px;
  padding: 0 10px;
  color: var(--social-ivory);
  font: 700 17px/1 var(--social-face);
  text-shadow: 0 1px 5px #080e0c;
}
.social-rail button + button::before {
  content: '';
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  border-left: 1px solid var(--social-rule);
}
.social-rail button:hover, .social-rail button[aria-expanded="true"] { color: var(--social-gold); }
.social-rail button[aria-expanded="true"]::after {
  content: '';
  position: absolute;
  inset: auto 11px 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--social-gold), transparent);
}
.social-rail button span {
  position: absolute;
  top: 1px;
  right: 1px;
  color: var(--social-gold);
  font: 750 10px/1 var(--social-small);
  font-variant-numeric: tabular-nums;
}

.social-panel {
  position: absolute;
  inset: auto auto calc(100% + 3px) 0;
  display: flex;
  flex-direction: column;
  width: var(--panel-width);
  max-height: min(48svh, 320px);
  padding: 5px 12px 6px;
  isolation: isolate;
  text-shadow: 0 1px 3px #101715bf;
}
.social-panel::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -3px -6px -4px;
  background: linear-gradient(105deg, #25302bd1 3%, #23302ac7 68%, #2530289c);
  backdrop-filter: blur(5px);
  mask-image: linear-gradient(90deg, transparent, #000 12px calc(100% - 12px), transparent),
    linear-gradient(180deg, transparent, #000 7px calc(100% - 8px), transparent);
  mask-composite: intersect;
}
#world-chat {
  width: var(--chat-width, 356px);
  height: var(--chat-height, 174px);
  max-width: calc(100vw - clamp(32px, 8vw, 132px));
  max-height: var(--chat-max-height);
}
#world-chat[data-resizing] { user-select: none; }
.world-social .social-resize {
  position: absolute;
  inset: 0 0 auto auto;
  width: 28px;
  height: 30px;
  color: var(--social-muted);
  cursor: nesw-resize;
  touch-action: none;
}
.social-resize::before, .social-resize::after {
  content: '';
  position: absolute;
  inset: 7px 8px auto auto;
  width: 10px;
  height: 10px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}
.social-resize::after { inset: 10px 11px auto auto; width: 6px; height: 6px; }
.social-resize:is(:hover, :focus-visible), [data-resizing] .social-resize { color: var(--social-gold); }
#world-nearby { width: min(252px, var(--panel-width)); }
.social-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.social-heading h2 {
  margin: 4px 0 5px;
  color: var(--social-gold);
  font: 650 20px/1.05 var(--social-face);
}

.social-tabs {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 5px;
  padding-inline-end: 21px;
  border-bottom: 1px solid var(--social-rule);
}
.social-tabs button {
  position: relative;
  min-height: 31px;
  color: var(--social-muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.social-tabs button:hover, .social-tabs button[aria-selected="true"] { color: var(--social-gold); }
.social-tabs button[aria-selected="true"]::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: var(--social-gold);
}
.social-tabs [data-channel="party"]:not([aria-selected="true"], :hover) { color: #c5c8b6; }
#social-channel { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.social-meta { margin: 0; padding: 7px 0 4px; color: var(--social-muted); }
.social-history {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 8px 0 5px;
}
.social-history p { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 3px; line-height: 19px; overflow-wrap: anywhere; }
.social-history p:last-child { margin-bottom: 0; }
.social-history time { flex: none; color: var(--social-muted); font-size: 10px; line-height: inherit; font-variant-numeric: tabular-nums; }
.social-history button { margin-inline-end: .4em; font-weight: 730; text-align: start; }
.social-history button:not(:disabled):hover { text-decoration: underline; text-underline-offset: 2px; }
.social-history .social-empty { color: var(--social-muted); }
.social-history [data-channel="location"] { color: #fff; }
.social-history [data-channel="region"] { color: #ffbf80; }
.social-history [data-channel="trade"] { color: #ffc1de; }
.social-history [data-channel="private"] { color: #d8c9ff; }

.social-compose {
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 10px;
  align-items: center;
  padding-bottom: 1px;
  border-top: 1px solid var(--social-rule);
}
.social-compose input {
  width: 100%;
  min-width: 0;
  min-height: 33px;
  padding: 5px 1px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-shadow: inherit;
}
.social-compose input::placeholder { color: var(--social-muted); }
.social-compose button {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 33px;
  color: var(--social-gold);
  font: 400 21px/1 'Segoe UI Symbol', sans-serif;
}
.social-compose button:enabled:hover { background: #e9cc9218; }
.social-compose button:disabled { color: var(--social-muted); }
.social-error { margin: 2px 0 4px; color: var(--social-red); }

.social-nearby-list { min-height: 0; max-height: min(37svh, 240px); overflow: auto; scrollbar-width: thin; }
.social-nearby-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  border-top: 1px solid var(--social-rule);
}
.social-nearby-list span { overflow-wrap: anywhere; }
.social-nearby-list small { color: var(--social-gold); padding: 7px 3px; }
.social-nearby-list button { min-height: 34px; padding-inline: 3px; color: var(--social-gold); font: 650 16px/1 var(--social-face); }
.social-nearby-list button:hover { text-decoration: underline; text-underline-offset: 3px; }
.social-nearby-list p { margin: 0 0 4px; color: var(--social-muted); }

.player-inspection {
  box-sizing: border-box;
  width: min(505px, calc(100vw - 24px));
  --dossier-serif: var(--social-face);
  --body: var(--social-small);
  --hairline: #e1cb9a48;
  --slot-tint: rgb(20 28 26 / 28%);
  max-height: 90dvh;
  padding: 4px clamp(12px, 2.8vw, 32px) 12px;
  margin: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: auto;
  overscroll-behavior: contain;
}
.player-inspection::backdrop {
  background: radial-gradient(ellipse max(390px, 33vw) max(300px, 36vh) at center, #141e1aeb 15%, #19221db8 70%, transparent 135%), #11181366;
  backdrop-filter: blur(3px);
}
.player-inspection [hidden] { display: none; }
.inspection-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px;
  background: linear-gradient(90deg, #ddc9a272, #ddc9a224 72%, transparent) left bottom / 100% 1px no-repeat;
}
.inspection-heading h2 { margin: 0; font: 500 clamp(34px, 4vw, 50px)/1.06 var(--social-face); letter-spacing: -.025em; overflow-wrap: anywhere; }
.inspection-heading form { margin: 0; }
.inspection-heading button { min-width: 44px; min-height: 44px; color: var(--social-gold); font: 400 25px/1 Georgia, serif; }
.inspection-figure { position: relative; }
.inspection-figure .dossier-empty-slot { pointer-events: none; }
.player-inspection .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.inspection-stage {
  position: relative; height: clamp(310px,53dvh,508px);
  background: radial-gradient(ellipse 42% 50% at 50% 53%, #cdb48025, transparent);
}
.inspection-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.inspection-stage canvas:active { cursor: grabbing; }
.inspection-stage canvas:focus-visible { outline: 1px solid var(--social-rule); outline-offset: -2px; }
.inspection-stage:not([data-status="ready"]) canvas { visibility: hidden; }
.inspection-stage [role=status] { position: absolute; inset: 0; display: grid; place-content: center; color: var(--social-muted); pointer-events: none; }
.inspection-stage[data-status="loading"] [role=status] { font-size: 0; }
.inspection-stage[data-status="loading"] [role=status]::before {
  content: ''; width: 21px; height: 21px; border: 1px solid var(--social-rule); border-top-color: var(--social-gold); border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .inspection-stage[data-status="loading"] [role=status]::before { animation: inspection-load .9s linear infinite; }
}
@keyframes inspection-load { to { transform: rotate(1turn); } }
.player-inspection [data-whisper] { min-height: 42px; color: var(--social-gold); font: 600 17px/1.15 var(--social-face); }
.player-inspection [data-whisper]::after { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 2px 2px 9px; background: currentColor; transform: rotate(45deg); }
.player-inspection button:hover { color: #fff1cc; }

@media (max-width: 540px) {
  .player-inspection { max-height: 94dvh; }
  .inspection-stage { height: clamp(300px,48dvh,425px); }
}

@media (max-width: 620px) {
  .social-rail button { min-height: 44px; }
  .social-tabs button { min-height: 38px; }
  .social-compose input { font-size: 16px; }
  .social-compose button { min-width: 44px; }
  .social-compose :is(input, button), .social-nearby-list button { min-height: 44px; }
}
