/* the global chat: a column to the left of the page */
:root { --chat-w: 300px; }
.body { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; align-items: start; }
body.chat-open .body { grid-template-columns: var(--chat-w) minmax(0, 1fr); }

.chat { display: none; position: sticky; top: var(--top); height: calc(100vh - var(--top)); flex-direction: column; min-width: 0; background: var(--surface); border-right: 1px solid var(--border-soft); }
body.chat-open .chat { display: flex; }

.chat__head { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border-soft); flex: none; }
.chat__head b { font: 650 14px/1 var(--sans); letter-spacing: 0; }
.chat__online { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1 var(--sans); color: var(--faint); }
.chat__online::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--faint); }
.chat__online.is-on { color: var(--dim); }
.chat__online.is-on::before { background: var(--green); }
.chat__spacer { flex: 1; }
.chat__close svg { transform: rotate(180deg); }

.chat__feed { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat__list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 8px 0; }
.chat__empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--faint); font-size: 13px; pointer-events: none; }
.chat__empty[hidden] { display: none; }
.chat__jump { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px; background: var(--brand); color: var(--accent-ink); font: 700 12px/1 var(--sans); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.chat__jump[hidden] { display: none; }

.cm { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 7px 14px; }
.cm:hover { background: var(--surface-2); }
.cm__head { display: block; width: 30px !important; height: 30px !important; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
.cm__top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cm__top b { font: 700 13px/1.2 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm time, .cw time { margin-left: auto; font: 500 11px/1 var(--sans); color: var(--faint); }
.cm__text { margin-top: 3px; font-size: 13.5px; line-height: 1.4; color: #dde4f2; overflow-wrap: anywhere; }
.cm.is-mention { background: rgba(77, 139, 247, 0.1); box-shadow: inset 2px 0 0 var(--brand); }

/* a big win, posted by the site */
.cw { margin: 6px 12px; padding: 10px 12px 12px; display: grid; gap: 6px; border-radius: 8px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.cw__top { display: flex; align-items: center; gap: 7px; }
.cw__top b { font: 600 12px/1 var(--sans); color: var(--dim); }
.cw__who { display: flex; align-items: center; gap: 8px; font: 700 13px/1 var(--sans); }
.cw__who .skin { width: 22px !important; height: 22px !important; border-radius: 3px; }
.cw__game { font-size: 12px; color: var(--dim); }
.cw__amt { display: flex; align-items: center; gap: 8px; }
.cw__amt b { font: 700 18px/1 var(--sans); color: var(--green); font-variant-numeric: tabular-nums; }
.cw__amt i { padding: 3px 6px; border-radius: 4px; background: var(--surface-3); color: var(--dim); font: 600 11.5px/1 var(--sans); font-style: normal; }

.chat__notice { flex: none; padding: 8px 14px; font-size: 12.5px; line-height: 1.4; color: var(--red); border-top: 1px solid var(--border-soft); }
.chat__notice[hidden] { display: none; }
.chat__composer { flex: none; display: flex; gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--border-soft); }
.chat__input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: var(--r-sm); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); border: 0; outline: 0; font: 500 13.5px/1 var(--sans); color: var(--text); }
.chat__input:focus { box-shadow: inset 0 0 0 1.5px var(--brand); }
.chat__input::placeholder { color: var(--faint); }
.chat__send { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-sm); background: var(--brand); color: var(--accent-ink);  transition: background 0.15s, transform 0.08s; }
.chat__send:hover:not(:disabled) { background: var(--accent-hi); }
.chat__send:active:not(:disabled) { transform: translateY(2px); }
.chat__send:disabled { opacity: 0.5; cursor: not-allowed; }
.chat__rules { flex: none; padding: 0 14px 12px; font-size: 11px; line-height: 1.4; color: var(--faint); }

.chat-toggle { position: relative; }
.chat-toggle .dot { position: absolute; right: 6px; top: 6px; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 0 2px var(--bg); }
.chat-toggle .dot[hidden] { display: none; }
body.chat-open .chat-toggle { color: var(--text); background: var(--surface-2); }

@media (max-width: 1100px) {
  body.chat-open .body { grid-template-columns: minmax(0, 1fr); }
  .chat { position: fixed; left: 0; right: 0; top: var(--top); bottom: 60px; height: auto; z-index: 45; border-right: 0; }
  .chat__close svg { transform: rotate(90deg); }
}

.chat__gate { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border-soft); color: var(--dim); font-size: 13px; line-height: 1.35; }
