/* GameCMS-generated avatars, chat rows and event feed. No content/API changes. */
.cpa-site img.small_us_av {
  display:inline-block;width:32px;height:32px;min-width:32px;max-width:32px;
  max-height:32px;object-fit:cover;border-radius:7px;vertical-align:middle;flex-shrink:0;
}
.cpa-site .cpa-ranking .cpa-player-trigger {
  display:inline-flex;align-items:center;gap:10px;min-width:0;vertical-align:middle;
}
.cpa-site .cpa-ranking .cpa-player-trigger>a {
  display:inline-flex;align-items:center;gap:10px;min-width:0;max-width:100%;
  color:inherit;line-height:1.5;overflow-wrap:anywhere;
}
.cpa-site .cpa-ranking .cpa-player-trigger>a>i { min-width:0 }
.cpa-site .cpa-ranking .cpa-player-trigger img.small_us_av {
  width:36px;height:36px;min-width:36px;max-width:36px;max-height:36px;margin:0;
}

/* Keep the input visible while the message history scrolls. */
.cpa-site #chat { max-height:none;overflow:visible }
.cpa-site #chat_messages {
  max-height:320px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  scrollbar-width:thin;scrollbar-color:#536173 transparent;padding-right:6px;
}
.cpa-site #chat_messages .chat_message {
  display:flex;align-items:flex-start;gap:12px;min-width:0;margin:0 0 14px;
}
.cpa-site #chat_messages .chat_message:last-child { margin-bottom:0 }
.cpa-site #chat_messages .chat_message>a { display:block;flex:0 0 40px;line-height:0 }
.cpa-site #chat_messages .chat_message>a>img {
  display:block;width:40px;height:40px;min-width:40px;max-width:40px;max-height:40px;
  border-radius:8px;object-fit:cover;
}
.cpa-site #chat_messages .chat_message>.message {
  flex:1;min-width:0;margin:0;padding:12px 14px;
  background:var(--cpa-bg);border:1px solid var(--cpa-line);border-radius:8px;
}
.cpa-site #chat_messages .chat_message .info {
  display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;margin-bottom:6px;min-width:0;
}
.cpa-site #chat_messages .chat_message .author {
  min-width:0;max-width:100%;font-size:14px;font-weight:650;overflow-wrap:anywhere;cursor:pointer;
}
.cpa-site #chat_messages .chat_message .date {
  margin-left:auto;font-size:11px;line-height:1.5;color:var(--cpa-muted);white-space:nowrap;
}
.cpa-site #chat_messages .chat_message .info>.m-icon {
  display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:28px;
  color:var(--cpa-muted);font-size:13px;cursor:pointer;
}
.cpa-site #chat_messages .chat_message .info>.m-icon:hover { color:var(--cpa-accent) }
.cpa-site #chat_messages .chat_message .with_code { font-size:14px;line-height:1.6 }
.cpa-site #chat_messages .chat_message .message img:not(.g_smile) {
  width:auto;height:auto;min-width:0;max-width:min(100%,360px);max-height:none;
  object-fit:contain;vertical-align:middle;
}
.cpa-site #chat_messages .chat_message textarea { width:100%;max-width:100%;margin-top:8px }

/* These direct-child selectors affect author thumbnails, never event content images. */
.cpa-site #events .event {
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;
  position:relative;min-width:0;padding:16px 0;border-bottom:1px solid var(--cpa-line);
}
.cpa-site #events .event:first-child { padding-top:0 }
.cpa-site #events .event:last-child { padding-bottom:0;border-bottom:0 }
.cpa-site #events .event>div {
  grid-column:1/-1;min-width:0;padding-right:26px;font-size:13px;line-height:1.6;
  overflow-wrap:anywhere;
}
.cpa-site #events .event>a:not(.btn) {
  grid-column:1;grid-row:2;display:flex;align-items:center;gap:8px;min-width:0;
  max-width:100%;font-size:12px;line-height:1.4;
}
.cpa-site #events .event>a:not(.btn)>img {
  display:block;width:32px;height:32px;min-width:32px;max-width:32px;max-height:32px;
  object-fit:cover;border-radius:7px;flex-shrink:0;
}
.cpa-site #events .event>a:not(.btn)>span { min-width:0;overflow-wrap:anywhere }
.cpa-site #events .event>span {
  grid-column:1;grid-row:3;min-width:0;color:var(--cpa-muted);font-size:11px;line-height:1.5;
}
.cpa-site #events .event>a.btn {
  grid-column:2;grid-row:2/4;align-self:center;justify-self:end;
  min-height:36px;padding:7px 10px;font-size:11px;
}
.cpa-site #events .event>i.m-icon {
  position:absolute;right:0;top:14px;display:inline-flex;align-items:center;justify-content:center;
  width:24px;height:24px;color:var(--cpa-muted);font-size:12px;cursor:pointer;
}
.cpa-site #events .event:first-child>i.m-icon { top:-2px }
.cpa-site #events .event>i.m-icon:hover { color:var(--cpa-error) }
@media(max-width:767px) {
  .cpa-site #chat_messages { max-height:340px;padding-right:4px }
  .cpa-site #chat_messages .chat_message { gap:8px }
  .cpa-site #chat_messages .chat_message>a { flex-basis:32px }
  .cpa-site #chat_messages .chat_message>a>img {
    width:32px;height:32px;min-width:32px;max-width:32px;max-height:32px;border-radius:6px;
  }
  .cpa-site #chat_messages .chat_message>.message { padding:10px }
  .cpa-site #chat_messages .chat_message .info { gap:2px 7px }
  .cpa-site #chat_messages .chat_message .author { font-size:13px }
  .cpa-site #chat_messages .chat_message .with_code { font-size:13px }
}
