/* Canonical parchment/portrait/chat surfaces are shared with the approved study. */
@import url('./social-surfaces.css');

#social-root { --paper-ink: #382714; --paper-soft: #735637; --paper-line: #997b4c; --friends-width: 340px;
  position: fixed; inset: auto 0 0; height: var(--social-strip-height, 52px); z-index: 100; overflow: visible;
  color: #eadfc6; background: linear-gradient(#242016, #17140f); border-top: 1px solid #79613c;
  font: 13px/1.5 'Menu interface', sans-serif; color-scheme: dark; pointer-events: none; }
/* Results own the screen. Keep the dock mounted, but invisible and unfocusable. */
body:has(#result:not([hidden])) #social-root { display: none; }
#social-root *, #social-root *::before, #social-root *::after { box-sizing: border-box; }
#social-root :is(h2, p) { margin: 0; }
#social-root button { min-height: 0; margin: 0; border-radius: 0; cursor: pointer; line-height: inherit; }
#social-root button:disabled { opacity: .55; cursor: default; }
#social-root input { min-height: 0; margin: 0; border-radius: 0; line-height: inherit; }
#social-root label { display: flex; flex-direction: row; color: inherit; }
#social-root small { color: inherit; }
#social-root button:focus-visible, #social-root input:focus-visible { outline: 2px solid #c58a38; outline-offset: 2px; }
#social-root .social-inner { position: absolute; bottom: 0; left: 0; width: calc(100% / var(--social-scale, 1)); height: var(--social-strip-height, 52px);
  transform: scale(var(--social-scale, 1)); transform-origin: bottom left; }
#social-root .social-workspace { position: absolute; inset: 0; }
#social-root .social-launcher { top: var(--social-tab-inset, 8px); left: 16px; width: var(--friends-width); height: var(--social-tab-height, 36px); box-shadow: none; border-color: #695231; background: #2d2518; }
#social-root .social-launcher > button { gap: 8px; padding: 0 10px; }
#social-root .launcher-symbol { display: none; }
#social-root .launcher-label { font-size: 15px; }
#social-root .launcher-label small { font-size: 9px; margin-left: 10px; color: #beaa82; }
#social-root .friends-panel { position: absolute; bottom: var(--social-panel-bottom, 60px); left: 16px; width: var(--friends-width); height: min(490px, calc(100dvh / var(--social-scale, 1) - 70px)); box-shadow: none; }
#social-root .chat-stack { position: absolute; bottom: var(--social-tab-inset, 8px); left: calc(16px + var(--friends-width) + 8px); display: flex; align-items: end; gap: 8px; }
#social-root .chat-window { flex: none; width: 300px; height: min(396px, calc(100dvh / var(--social-scale, 1) - 16px)); box-shadow: none; }
#social-root .chat-header { height: 36px; padding: 4px 6px 4px 9px; }
#social-root .chat-heading .social-avatar { width: 22px; height: 22px; }
#social-root .chat-heading strong { font: 12px 'Menu interface', sans-serif; }
#social-root .chat-heading small { display: none; }
#social-root .chat-heading > span:not(.social-avatar):not(.chat-unread-dot) { flex: 1; }
#social-root .chat-tab { height: calc(var(--social-tab-height, 36px) - 2px); padding-block: var(--social-tab-padding, 4px); }
#social-root .chat-window.minimized { height: var(--social-tab-height, 36px) !important; background: #241f16; border-color: #51432d; }
#social-root .chat-tab .chat-heading { color: #c6b38b; }
#social-root .minimized .icon-action { color: #978361 !important; }
#social-root .message-meta { color: #846b49; }
#social-root .message-form input { width: auto; }
#social-root .list-heading input { width: 11px; height: 11px; }
#social-root .social-error { position: absolute; left: 16px; bottom: 53px; max-width: 340px; padding: 8px 12px;
  border: 1px solid #984731; background: #f3deaf; color: #7c281d; pointer-events: auto; font-size: 11px; }
/* Follow the existing space below the hand, without adding layout or scroll overflow. */
body:has(#board[data-page='game']) #social-root { bottom: calc(-1 * var(--social-game-offset, 0px));
  --social-strip-height: 34px; --social-tab-height: 30px;
  --social-tab-padding: 3px; --social-tab-inset: 2px; --social-panel-bottom: 40px; background: none; border-top: 0; }
/* Command controls win when they need that same space. */
body:has(#board[data-page='game'] .actions .buttons > *) #social-root { z-index: 19; }
