/* AnomicFlip — live chat sidebar */
:root { --chat-w: 380px; --bar-h: 91px; }
.chat, .chat * , .chat-toggle { box-sizing: border-box; }

.chat {
  position: fixed; z-index: 50; left: 0; top: var(--bar-h); bottom: 0; width: var(--chat-w);
  display: flex; flex-direction: column;
  background: #1a1d20; border-right: 1px solid #23272c;
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif; color: #fff;
  transition: transform .22s ease;
}
body.chat-closed .chat { transform: translateX(-100%); }
.page { transition: padding-left .22s ease; }
@media (min-width: 901px) { body:not(.chat-closed) .page { padding-left: var(--chat-w); } }

.chat-top {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 20px; border-bottom: 1px solid #23272c;
  font-size: 15px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase;
}
.chat-title {
  display: block; width: 125px; height: 24px;
  background: url('/livechat.png') left center / contain no-repeat; image-rendering: pixelated;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
.chat-top .t { display: flex; align-items: center; gap: 10px; color: #9a9ea6; }
.chat-online { display: flex; align-items: center; gap: 8px; color: #9a9ea6; font-variant-numeric: tabular-nums; }
.chat-online::before, .chat-toggle .dot { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3fd68f; box-shadow: 0 0 8px rgba(63,214,143,.7); }

.chat-list { flex: 1; min-height: 0; overflow: hidden; /* no scrolling: always shows the latest messages */ padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: #33373e transparent; }
/* never squash a message (tip cards used to collapse into a thin green line when chat was full) */
.chat-list > * { flex-shrink: 0; }
.chat-empty { margin: auto; color: #6b7078; font-size: 15px; text-align: center; }

.msg { background: #24272c; border-radius: 8px; padding: 12px 14px; }
.msg-reply {
  display: flex; gap: 6px; align-items: baseline; overflow: hidden; white-space: nowrap;
  margin: -2px 0 10px; padding: 6px 10px; border-left: 3px solid #3fd68f; background: #1e2125; border-radius: 4px;
  font-size: 14px; color: #8b8f97;
}
.msg-reply b { color: #3fd68f; font-weight: 700; flex: none; }
.msg-reply span { overflow: hidden; text-overflow: ellipsis; }
.msg-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.msg-av {
  flex: none; width: 30px; height: 30px; border-radius: 4px; background: #3a3f46 center / cover no-repeat;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #3fd68f; user-select: none;
}
.msg-name { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg-rank { flex: none; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 5px 8px; border-radius: 5px; }
.msg-time { flex: none; margin-left: auto; font-size: 13px; color: #8b8f97; font-variant-numeric: tabular-nums; }
.msg-act { flex: none; width: 26px; height: 26px; border: 0; border-radius: 5px; background: none; color: #8b8f97; cursor: pointer; display: grid; place-items: center; }
.msg-act:hover { color: #fff; background: #30343b; }
.msg-act.done { color: #ff5c6c; cursor: default; }
.msg-text { margin-top: 8px; font-size: 17px; line-height: 1.4; color: #e9ebee; overflow-wrap: anywhere; }
.msg.mine { background: #262a2f; box-shadow: inset 0 0 0 1px rgba(63,214,143,.15); }

/* TIP cards */
.msg.tip { padding: 0; overflow: hidden; background: #17221d; border: 1px solid #3fd68f; }
.tip-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #3fd68f; color: #0d1f16; }
.tip-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.tip-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tip-body { display: grid; gap: 10px; padding: 12px 14px 14px; }
.tip-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tip-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.tip-word { color: #8b8f97; font-size: 16px; }
.tip-amt {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 6px;
  background: #101513; border: 1px solid #2a3a32; color: #3fd68f; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.tip-coin { display: block; width: 13px; height: 17px; background: url('/coin.png') center / contain no-repeat; }

/* rank colors */
.r-bronze   { --rc: #d9883f; } .r-silver { --rc: #c9ccd1; } .r-gold { --rc: #f5c84a; }
.r-platinum { --rc: #6fd3e0; } .r-diamond { --rc: #5b8cff; } .r-default { --rc: #a7abb2; }
.msg-name { color: var(--rc); }
.msg-rank { color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, transparent); }

.chat-new {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
  border: 0; border-radius: 99px; padding: 8px 16px; background: #3fd68f; color: #0d1f16;
  font: 700 14px 'Archivo', system-ui, sans-serif; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

.chat-foot { flex: none; padding: 12px; border-top: 1px solid #23272c; background: #1a1d20; }
.chat-replying {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 10px;
  background: #24272c; border-radius: 6px; font-size: 14px; color: #8b8f97;
}
.chat-replying b { color: #3fd68f; }
.chat-replying span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-replying button { border: 0; background: none; color: #8b8f97; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.chat-form { display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 8px 0 18px; background: #2a2d33; border-radius: 8px; border: 1px solid transparent; }
.chat-form:focus-within { border-color: rgba(63,214,143,.6); }
.chat-input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font: 500 16px 'Archivo', system-ui, sans-serif; }
.chat-input::placeholder { color: #7d8189; }
.chat-input:disabled { cursor: not-allowed; }
.chat-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 6px; background: #33373e; color: #c9ccd1; cursor: pointer; display: grid; place-items: center; }
.chat-send:hover:not(:disabled) { background: #3fd68f; color: #0d1f16; }
.chat-send:disabled { opacity: .45; cursor: not-allowed; }
.chat-err { min-height: 0; color: #ff8b97; font-size: 13px; margin-top: 6px; }
.chat-err:empty { display: none; }

/* open / close tab */
.chat-toggle {
  position: fixed; z-index: 51; bottom: 24px; left: var(--chat-w);
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px; border: 1px solid #2e3238; border-left: 0; border-radius: 0 8px 8px 0;
  background: #1a1d20; color: #c9ccd1; cursor: pointer;
  font: 700 14px 'Archivo', system-ui, sans-serif; font-variant-numeric: tabular-nums;
  transition: left .22s ease, background .15s;
}
.chat-toggle:hover { background: #24272c; color: #fff; }
.chat-toggle .lbl { display: none; align-items: center; gap: 8px; }
.chat-toggle svg { transition: transform .22s; }
body.chat-closed .chat-toggle { left: 0; }
body.chat-closed .chat-toggle .lbl { display: flex; }
body.chat-closed .chat-toggle .arrow { transform: rotate(180deg); }
.chat-toggle:focus-visible, .chat-send:focus-visible, .msg-act:focus-visible { outline: 2px solid #3fd68f; outline-offset: 2px; }

@media (max-width: 900px) {
  :root { --chat-w: min(380px, 88vw); --bar-h: 71px; }
  .chat { box-shadow: 20px 0 50px rgba(0,0,0,.5); }
}
@media (prefers-reduced-motion: reduce) { .chat, .chat-toggle, .page, .chat-toggle svg { transition: none; } }

/* ---------- emotes, GIFs & VIP locks ---------- */
.chat-foot { position: relative; }
.chat-form { padding-left: 16px; gap: 6px; }
.chat-tool { flex: none; height: 36px; min-width: 36px; padding: 0 7px; border: 0; border-radius: 6px; background: #33373e; color: #c9ccd1; cursor: pointer; display: grid; place-items: center; font: 900 13px 'Archivo', system-ui, sans-serif; letter-spacing: .3px; }
.chat-tool:hover { background: #3c4148; color: #fff; }
.chat-tool:focus-visible { outline: 2px solid #3fd68f; outline-offset: 2px; }
.msg-emote { width: 24px; height: 24px; object-fit: contain; vertical-align: -6px; margin: 0 1px; }
.msg-text.big .msg-emote { width: 40px; height: 40px; vertical-align: middle; }
.msg-gif { display: block; margin-top: 8px; width: 240px; max-width: 100%; height: auto; max-height: 260px; object-fit: cover; border-radius: 6px; background: #1e2125; }

/* "GIFs locked · Unlock at Silver" */
.chat-lock { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; padding: 14px; border-radius: 10px; background: #24272c; border: 1px solid #30343b; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: chat-pop .16s ease-out; }
.chat-lock[hidden] { display: none; }
.chat-lock-ic { flex: none; width: 48px; height: 48px; border-radius: 12px; background: #1a1d20; border: 1px solid #2e3238; display: grid; place-items: center; color: #c9ccd1; }
.chat-lock > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.chat-lock > div > b { font-size: 17px; font-weight: 800; }
.chat-lock > div > span { font-size: 15px; color: #8b8f97; }
.chat-lock > div > span b { color: #fff; font-weight: 700; }
.chat-lock button { flex: none; border: 0; background: none; color: #8b8f97; cursor: pointer; padding: 4px; display: grid; place-items: center; }
.chat-lock button:hover { color: #fff; }

/* popups sit above the message box */
.chat-pop { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); z-index: 5; background: #1d2024; border: 1px solid #2e3238; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.55); overflow: hidden; display: flex; flex-direction: column; height: min(440px, calc(100vh - 260px)); animation: chat-pop .16s ease-out; }
.chat-pop[hidden] { display: none; }
@keyframes chat-pop { from { opacity: 0; transform: translateY(6px); } }
.ep-x { flex: none; border: 0; background: none; color: #8b8f97; cursor: pointer; padding: 4px; display: grid; place-items: center; margin-left: auto; }
.ep-x:hover { color: #fff; }

/* emote picker */
.ep-top { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; border-bottom: 1px solid #2a2d33; }
.ep-s { flex: 1; display: flex; align-items: center; gap: 10px; color: #8b8f97; }
.ep-s input, .gp-s input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font: 500 16px 'Archivo', system-ui, sans-serif; }
.ep-s input::placeholder, .gp-s input::placeholder { color: #7d8189; }
.ep-body { flex: 1; min-height: 0; display: flex; }
.ep-rail { flex: none; width: 58px; padding: 10px 8px; display: grid; align-content: start; gap: 8px; border-right: 1px solid #2a2d33; }
.ep-rail button { width: 42px; height: 42px; border: 0; border-radius: 10px; background: none; color: #8b8f97; cursor: pointer; display: grid; place-items: center; }
.ep-rail button:hover { color: #fff; }
.ep-rail button.on { background: #2a2d33; color: #3fd68f; }
.ep-main { flex: 1; min-width: 0; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; scrollbar-color: #33373e transparent; position: relative; }
.ep-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px 8px; }
.ep-h b { font-size: 16px; font-weight: 800; }
.ep-h span { color: #8b8f97; font-weight: 800; font-size: 15px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.ep-e { aspect-ratio: 1; border: 0; border-radius: 8px; background: none; cursor: pointer; display: grid; place-items: center; padding: 4px; }
.ep-e:hover { background: #2a2d33; }
.ep-e img { width: 100%; height: 100%; object-fit: contain; }
.ep-none { grid-column: 1 / -1; color: #7d8189; font-size: 14px; padding: 8px 0; }

/* GIF picker (Discord-style) */
.gp-tabs { flex: none; display: flex; align-items: center; gap: 6px; padding: 12px 12px 0; }
.gp-tabs button:not(.ep-x) { border: 0; border-radius: 8px; padding: 8px 14px; background: none; color: #c9ccd1; cursor: pointer; font: 700 15px 'Archivo', system-ui, sans-serif; }
.gp-tabs button.on { background: #2e3238; color: #fff; }
.gp-tabs button:not(.on):not(.ep-x):hover { color: #fff; }
.gp-s { flex: none; display: flex; align-items: center; gap: 10px; margin: 12px; padding: 0 14px; height: 46px; border-radius: 10px; background: #15171a; border: 2px solid #2e3238; color: #8b8f97; cursor: text; }
.gp-s:focus-within { border-color: #3fd68f; }
.gp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px; border-top: 1px solid #2a2d33; padding-top: 12px; scrollbar-width: thin; scrollbar-color: #33373e transparent; }
.gp-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gp-cat { position: relative; height: 84px; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: #2a2d33 center / cover no-repeat; color: #fff; font: 800 15px 'Archivo', system-ui, sans-serif; display: flex; align-items: center; justify-content: center; gap: 6px; text-transform: capitalize; isolation: isolate; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.gp-cat::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: -1; transition: background .15s; }
.gp-cat:hover::before { background: rgba(0,0,0,.3); }
.gp-cat.fav { background: #3fd68f; color: #0d1f16; text-shadow: none; }
.gp-cat.fav::before { display: none; }
.gp-cat.fav:hover { background: #57e1a0; }
.gp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.gp-head b { font-size: 16px; text-transform: capitalize; }
.gp-back { border: 0; border-radius: 6px; background: #2a2d33; color: #c9ccd1; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; }
.gp-back:hover { color: #fff; }
.gp-grid { columns: 2; column-gap: 8px; }
.gp-g { position: relative; display: block; width: 100%; margin: 0 0 8px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: #2a2d33; break-inside: avoid; }
.gp-g img { display: block; width: 100%; height: auto; }
.gp-g:hover { outline: 2px solid #3fd68f; outline-offset: -2px; }
.gp-star { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 6px; background: rgba(0,0,0,.6); color: #c9ccd1; display: none; place-items: center; }
.gp-g:hover .gp-star, .gp-star.on { display: grid; }
.gp-star.on { color: #f5c84a; }
.gp-star:hover { color: #f5c84a; }
.gp-msg { column-span: all; color: #8b8f97; text-align: center; padding: 30px 10px; font-size: 15px; }

/* staff ranks (shown instead of the VIP rank) */
.r-owner { --rc: #ff5c6c; } .r-support { --rc: #a78bfa; } .r-withdrawer { --rc: #38bdf8; } .r-depositor { --rc: #3fd68f; }
.msg-act.del:hover { color: #ff5c6c; }

/* warn / mute / ban notices */
.msg.mod { padding: 0; overflow: hidden; background: #241a1c; border: 1px solid #ff5c6c; }
.msg.mod.warn { background: #262116; border-color: #f5c84a; }
.mod-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #ff5c6c; color: #2a0d11; }
.msg.mod.warn .mod-head { background: #f5c84a; color: #2a210a; }
.mod-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.mod-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.mod-dur { flex: none; padding: 4px 9px; border-radius: 6px; background: #101213; color: #ff8b97; font-size: 14px; font-weight: 800; }
.mod-why { font-size: 15px; color: #e9ebee; overflow-wrap: anywhere; }
.mod-why b { color: #9a9ea6; font-weight: 700; }
.mod-by { font-size: 13px; color: #8b8f97; }

/* message actions: inline on touch screens, a small floating bar on hover with a mouse */
.msg { position: relative; }
.msg-acts { flex: none; display: flex; gap: 2px; }
@media (hover: hover) {
  .msg-acts { position: absolute; top: 8px; right: 8px; display: none; padding: 3px; border-radius: 8px; background: #2e3238; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
  .msg:hover .msg-acts, .msg-acts:focus-within { display: flex; }
}
