#arcade-social { color: #edf3ff; font: 14px "Segoe UI", system-ui, sans-serif; }
#arcade-social [hidden] { display: none !important; }
#arcade-social button, #arcade-social input { font: inherit; }
#arcade-social button { color: #edf3ff; background: #1d3150; border: 1px solid #526a8e; border-radius: 8px; padding: 9px 13px; cursor: pointer; min-height: 40px; }
#arcade-social button:hover { background: #304b73; }
#arcade-social button:focus-visible, #arcade-social input:focus-visible { outline: 3px solid #ffb865; outline-offset: 3px; }
#arcade-social button:disabled { opacity: .5; cursor: default; }
.social-toolbar { position: fixed; z-index: 22; top: 68px; right: 14px; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: calc(100vw - 28px); }
#social-status { padding: 7px 10px; border-radius: 8px; background: #0c172be8; font-size: 12px; }
#social-status[data-count]:not([data-count=""])::after { content: " · " attr(data-count); }
.social-panel { color: #edf3ff; background: #101c30; border: 1px solid #506382; border-radius: 16px; box-shadow: 0 20px 70px #0009; padding: 22px; }
.social-panel::backdrop { background: #020610c9; backdrop-filter: blur(5px); }
#character-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.social-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.social-heading h2 { margin: 0; font-size: 25px; }
.social-kicker { margin: 0 0 5px; font-size: 11px; font-weight: 800; letter-spacing: 2px; color: #ffb865; }
.social-hint { color: #afbdd2; font-size: 12px; line-height: 1.5; margin: 10px 0; }
.character-layout { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 24px; margin: 20px 0; }
#character-preview { width: 100%; height: auto; border-radius: 12px; border: 1px solid #30415e; }
.character-fields { display: grid; gap: 12px; min-width: 0; }
.character-fields label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; }
.character-fields label:first-child { display: grid; gap: 7px; }
#arcade-social input:not([type="color"]) { width: 100%; min-width: 0; color: #fff; background: #081324; border: 1px solid #526a8e; border-radius: 7px; padding: 10px; }
#arcade-social input[type="color"] { width: 62px; height: 36px; padding: 2px; border: 1px solid #526a8e; border-radius: 6px; background: #081324; cursor: pointer; }
.skin-presets { display: flex; flex-wrap: wrap; gap: 6px; }
#arcade-social .skin-presets button { background: var(--skin); border: 2px solid #a7b6cb; width: 26px; min-height: 26px; height: 26px; padding: 0; border-radius: 50%; }
#arcade-social .social-primary { width: 100%; background: #2169c5; border-color: #6faaff; font-weight: 700; }
#arcade-chat { position: fixed; z-index: 23; top: 118px; right: 14px; width: min(370px, calc(100vw - 28px)); max-height: calc(100dvh - 140px); padding: 16px; display: flex; flex-direction: column; transition: background-color 1s, border-color 1s, box-shadow 1s; }
#arcade-chat[data-idle="true"] { background: transparent; border-color: transparent; box-shadow: none; }
#arcade-chat[data-idle="true"] #chat-input, #arcade-chat[data-idle="true"] button { background: #0b172b33; border-color: #526a8e44; }
#arcade-chat[data-idle="true"] { text-shadow: 0 1px 4px #000, 0 1px 8px #000; }
#arcade-chat h2 { font-size: 19px; }
#chat-log { height: min(230px, 32dvh); min-height: 70px; overflow-y: auto; overflow-wrap: anywhere; padding: 0 4px; }
#chat-log:empty::before { content: "No messages yet. Say hello!"; color: #afbdd2; }
#chat-log p { margin: 0 0 10px; line-height: 1.5; }
#chat-log strong { color: #8fc3ff; }
#chat-form { display: flex; gap: 8px; margin-top: 10px; }
#chat-feedback { margin-bottom: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.playing #arcade-social { display: none; }
@media (max-width: 600px) {
  #social-status { font-size: 10px; padding: 7px; }
  #arcade-social .social-toolbar button { font-size: 12px; padding: 7px 10px; }
  .character-layout { grid-template-columns: 110px 1fr; gap: 14px; margin: 14px 0; }
  .social-panel { padding: 16px; }
  .social-heading h2 { font-size: 22px; }
}
/* The existing mobile header has three rows; keep our controls below it. */
@media (max-width: 760px), (pointer: coarse) {
  .social-toolbar { top: 184px; left: 14px; right: 14px; max-width: none; flex-wrap: nowrap; gap: 5px; }
  #social-status { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-content: center; }
  .arcade-birthday { top: 234px; }
  .classic-view { padding-top: 250px; }
  #arcade-chat { top: auto; bottom: 205px; max-height: min(260px, calc(100dvh - 280px)); width: min(320px, calc(100vw - 28px)); padding: 10px; }
  #chat-log { height: min(100px, 15dvh); min-height: 40px; }
  #arcade-chat > .social-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { #arcade-chat { transition: none; } }
@media (max-width: 360px) { .character-layout { grid-template-columns: 80px 1fr; gap: 10px; } }
