/* BoxScored – Live Game Chat (preview). Applies only on #/game/<id>/chat (body.chat-mode / .chat-screen).
   Spec type scale (smaller than the first mockup): message 13.5px/1.35, username 13px bold, chips 11px,
   BoxScored Live text 13px, crowd 12px, composer 14px, period/clock 13.5px bold, score numbers large. */
body.chat-mode { overflow: hidden; }
body.chat-mode .footer { display: none; }
body.chat-mode .main { padding: 0; }
.chat-screen { position: fixed; left: 0; right: 0; top: 0; margin: 0 auto; width: 100%; max-width: 520px; display: flex; flex-direction: column; background: var(--bg); z-index: 5; overflow: hidden; }
@media (min-width: 540px) { .chat-screen { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* 1. game switcher */
.cs-switch { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 8px 2px; min-width: 0; }
.cs-back, .cs-more-btn { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; font-size: 15px; line-height: 1; }
.cs-back:hover, .cs-more-btn:hover { background: var(--panel2); }
.cs-pills { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cs-pills::-webkit-scrollbar { display: none; }
.cs-pill { flex: none; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-size: 11.5px; line-height: 16px; padding: 4px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.cs-pill b { color: var(--white); font-weight: 700; }
.cs-pill .num { font-size: 11px; }
.cs-pill.is-live .num { color: var(--green); }
.cs-pill:hover { border-color: var(--line2); }
.cs-none { font-size: 11.5px; padding: 4px 2px; white-space: nowrap; }
.cs-more { position: relative; flex: none; }
.cs-more-menu { position: absolute; right: 0; top: 32px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); padding: 4px; z-index: 20; min-width: 140px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.cs-more-menu[hidden] { display: none; }
.cs-more-menu a { display: block; padding: 8px 10px; font-size: 13px; border-radius: 4px; white-space: nowrap; color: var(--white); }
.cs-more-menu a:hover { background: var(--panel); color: var(--white); }

/* 2. score header (score numbers keep the large size; the header is the exception to the reduction) */
.cs-head { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 14px 2px; }
.ch-side { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-side.home { flex-direction: row-reverse; }
.ch-team { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; color: var(--white); }
.ch-team:hover { color: var(--white); }
.ch-abbr { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--text); white-space: nowrap; }
.ch-score { font-size: 30px; font-weight: 800; color: var(--white); line-height: 1; }
.ch-score.lose { color: var(--muted); }
.ch-mid { text-align: center; min-width: 0; }
.ch-per { font-size: 13.5px; font-weight: 700; color: var(--white); white-space: nowrap; }
.ch-per.ch-time { font-size: 13px; }
.ch-st { margin-top: 3px; font-size: 11px; white-space: nowrap; }
.ch-st .live-tag { font-size: 11px; }

/* 3. crowd pill */
.cs-crowd-row { flex: none; display: flex; justify-content: center; padding: 3px 12px 6px; border-bottom: 1px solid var(--line); min-width: 0; }
.cs-crowd { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; padding: 3px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--text); max-width: 100%; white-space: nowrap; overflow: hidden; }
.cs-crowd b { color: var(--white); font-weight: 800; font-size: 12px; }
.cc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(0,224,84,.5); animation: ccpulse 1.8s ease-out infinite; flex: none; }
.cc-split { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; min-width: 0; }
.cc-ab { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.cs-crowd .pick-split-bar.cc-bar { flex: none; width: 72px; min-width: 0; max-width: none; height: 6px; }
.cs-crowd .cc-bar i { transition: width .6s ease; }
@keyframes ccpulse { 0% { box-shadow: 0 0 0 0 rgba(0,224,84,.55); } 70% { box-shadow: 0 0 0 6px rgba(0,224,84,0); } 100% { box-shadow: 0 0 0 0 rgba(0,224,84,0); } }

/* 4. feed – the only scrolling area */
.cs-feed-wrap { flex: 1 1 auto; min-height: 0; position: relative; }
.cs-feed { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 0 6px; }
.cs-older { text-align: center; font-size: 11px; color: var(--muted); min-height: 4px; padding: 3px 0; }
.cs-empty { display: flex; align-items: center; justify-content: center; min-height: 100%; color: var(--muted); font-size: 13px; text-align: center; padding: 0 16px; }
.cs-empty p { margin: 0; }
.cm { display: flex; gap: 9px; padding: 6px 12px; align-items: flex-start; min-width: 0; }
.cm .av-link { flex: none; display: inline-flex; }
.cm .av.sm, .cm-av { width: 28px; height: 28px; flex: none; }
.cm-main { min-width: 0; flex: 1 1 auto; }
.cm-head { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; line-height: 18px; }
.cm-head .who { min-width: 0; overflow: hidden; display: inline-flex; align-items: center; gap: 3px; flex: 0 1 auto; }
.cm-name { font-size: 13px; font-weight: 700; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cm-head .media-badge { flex: none; }
.cm-head .founder-chip, .cm-pick, .cm-rec { flex: none; }
.cm-head .founder-chip { font-size: 11px; }
.cm-pick { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--green); border: 1px solid rgba(0,224,84,.45); border-radius: 99px; padding: 0 6px 0 2px; line-height: 16px; }
.cm-pick .tlogo.xs, .cm-pick .tlogo-wrap { width: 14px; height: 14px; }
.cm-rec { font-size: 11px; color: var(--muted); }
.cm-time { font-size: 11px; color: var(--muted); margin-left: auto; padding-left: 4px; display: none; flex: none; }
.cm-fan.is-open .cm-time { display: inline; }
@media (hover: hover) { .cm-fan:hover .cm-time { display: inline; } .cm-fan:hover { background: rgba(255,255,255,.02); cursor: pointer; } }
.cm-text { font-size: 13.5px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; word-break: break-word; }
.cm-text.emoji { font-size: 20px; line-height: 1.25; }
.cm-text a { color: var(--blue); }
.cm-fan.is-open { background: rgba(255,255,255,.035); }
.cm.is-pending { opacity: .6; }
.cm.is-failed .cm-text { opacity: .7; }
.cm.is-hidden .cm-text { opacity: .6; }
.cm-note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cm-note.err { color: var(--red); }
.cm-note .linkbtn { font-size: 11px; color: var(--white); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
/* BoxScored Live rows: distinct system background, left accent and system avatar, same row scale */
.cm-sys { background: rgba(255,128,0,.06); box-shadow: inset 2px 0 0 var(--orange); }
.cm-sys-av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #0f1215; border: 1px solid rgba(255,128,0,.55); overflow: hidden; }
.cm-sys-av svg { width: 22px; height: auto; }
.cm-verified { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); color: #14181c; font-size: 11px; font-weight: 900; line-height: 1; flex: none; }
.cm-sys .cm-text { font-size: 13px; }
.cm-clock { color: var(--white); font-weight: 700; }
.cm-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cm-rp { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; line-height: 18px; }
.cm-rp .num { font-size: 11px; }
.cm-rp.on { border-color: var(--green); background: rgba(0,224,84,.12); color: var(--white); }
.cm-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; align-items: center; }
.cm-ra { font-size: 15px; width: 30px; height: 28px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; padding: 0; line-height: 1; }
.cm-ra:hover { border-color: var(--line2); }
.cm-act { font-size: 12px; padding: 4px 9px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.cm-act.danger { color: var(--red); }
.cs-jump { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: var(--green); color: #0b0f12; font-weight: 700; font-size: 12px; border: 0; border-radius: 99px; padding: 6px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.45); cursor: pointer; white-space: nowrap; z-index: 3; }
.cs-jump[hidden] { display: none; }
.cs-notice { flex: none; text-align: center; font-size: 12px; color: var(--white); background: var(--panel2); padding: 4px 8px; }
.cs-notice[hidden] { display: none; }

/* 5. composer – fixed at the bottom of the screen, above the safe area */
.cs-composer { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg2); }
.cs-input-wrap { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-end; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 0 3px 0 12px; position: relative; }
.cs-input-wrap:focus-within { border-color: var(--line2); box-shadow: 0 0 0 1px rgba(0,224,84,.35); }
.cs-input-wrap textarea { flex: 1 1 auto; min-width: 0; width: auto; background: transparent; border: 0; border-radius: 0; box-shadow: none; resize: none; padding: 8px 0; font-size: 14px; line-height: 1.35; height: 35px; max-height: 96px; color: var(--white); overflow-y: auto; }
.cs-input-wrap textarea:focus { box-shadow: none; border: 0; }
.cs-input-wrap textarea::placeholder { color: var(--muted); }
@supports (-webkit-touch-callout: none) { .cs-input-wrap textarea { font-size: 16px; } } /* iOS zooms the page on focus below 16px */
.cs-quick { display: flex; flex: none; align-items: center; padding-bottom: 3px; }
.cs-quick button { width: 29px; height: 29px; font-size: 16px; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; line-height: 1; }
.cs-quick button:hover, .cs-quick button:active { background: var(--panel2); }
.cs-send { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #0b0f12; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cs-count { position: absolute; right: 10px; top: -17px; font-size: 11px; color: var(--muted); }
.cs-count[hidden] { display: none; }
.cs-count.over { color: var(--red); }
.cs-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line2); border-top-color: var(--green); border-radius: 50%; animation: csspin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes csspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cc-dot { animation: none; } .cs-crowd .cc-bar i { transition: none; } .cs-spin { animation: none; } }
@media (max-width: 360px) { .cs-quick button { width: 26px; } .cs-head { padding: 4px 10px 2px; } .ch-score { font-size: 28px; } }
.chat-auth-box .form-actions { flex-wrap: wrap; }
/* --- Nov 27 additions: team logos in the switcher + crowd split, rooting prompt, rooting logo by names --- */
.cs-pill { padding: 3px 10px 3px 6px; }
.cs-pl { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.cs-pl i { font-style: normal; font-size: 10px; color: var(--muted); }
.cs-pl .tlogo.xs, .cs-pl .tlogo-wrap { width: 18px; height: 18px; }
.cc-ab { display: inline-flex; align-items: center; }
.cc-ab .tlogo.xs, .cc-ab .tlogo-wrap { width: 16px; height: 16px; }
.cs-crowd { cursor: default; }
.cm-root { flex: none; display: inline-flex; align-items: center; }
.cm-root .tlogo.xs, .cm-root .tlogo-wrap { width: 16px; height: 16px; }
.cs-more-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; font-size: 13px; border-radius: 4px; white-space: nowrap; color: var(--white); background: none; border: 0; cursor: pointer; font-family: inherit; }
.cs-more-menu button:hover { background: var(--panel); }
.cs-root { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--bg2); min-width: 0; }
.cs-root[hidden] { display: none; }
.cr-q { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 700; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px 0 4px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line2); color: var(--white); font: 700 12px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.cr-btn .tlogo.sm, .cr-btn .tlogo-wrap { width: 24px; height: 24px; }
.cr-btn.on { border-color: var(--green); color: var(--green); }
.cr-btn:hover { background: var(--panel2); }
.cr-x { flex: none; width: 28px; height: 28px; border-radius: 50%; background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.cr-x:hover { color: var(--white); background: var(--panel); }
@media (max-width: 360px) { .cr-btn { padding: 0 8px 0 3px; gap: 4px; } .cs-root { gap: 5px; padding: 6px 8px; } }
/* --- Nov 27 pt107u: no switcher; back + ⋯ live in the crowd row; team-colour crowd bar; gradient score header --- */
.cs-crowd-row { justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; }
.cs-crowd-row .cs-back, .cs-more-slot { flex: none; width: 28px; }
.cs-more-slot { display: flex; justify-content: flex-end; }
.cs-crowd { cursor: pointer; flex: 0 1 auto; }
.cs-crowd .cc-bar.cc-team { width: 84px; background: rgba(255,255,255,.08); }
.cs-crowd .cc-bar.cc-team.empty i { opacity: .35; }
.cs-head { position: relative; padding: 10px 14px 8px; color: #fff;
  background: linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.18)), linear-gradient(100deg, var(--ca, #2a3038) 0%, var(--ca, #2a3038) 22%, var(--ch, #2a3038) 78%, var(--ch, #2a3038) 100%); }
.cs-head::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 34% 90% at 50% 50%, rgba(0,0,0,.28), transparent 75%); }
.cs-head > * { position: relative; z-index: 1; }
.cs-head .ch-abbr, .cs-head .ch-per, .cs-head .ch-st, .cs-head .ch-score { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.65); }
.cs-head .ch-score.lose { color: rgba(255,255,255,.62); }
.cs-head .ch-st.muted { color: rgba(255,255,255,.8); }
.cs-head .ch-team .tlogo-wrap, .cs-head .ch-team > .tlogo { background: rgba(0,0,0,.28); border-radius: 50%; padding: 3px; box-sizing: content-box; }
.cs-head .ch-team .tlogo-wrap.tlogo-on-gold { background: #FFCD00; }
.cs-head .live-tag { text-shadow: none; }
@media (max-width: 360px) { .cs-head { padding: 8px 10px 6px; } }
/* --- rooting panel per Anthony's sketch (pt107u follow-up) --- */
.cs-root { display: block; padding: 6px 10px 4px; border-top: 0; background: transparent; }
.cr-panel { border: 1px solid var(--line2); border-radius: 12px; background: var(--panel); padding: 4px 4px 4px 12px; }
.cr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cr-panel .cr-q { flex: 1 1 auto; font-size: 12px; font-weight: 700; color: var(--white); text-align: left; }
.cr-panel .cr-x { width: 24px; height: 24px; font-size: 16px; }
.cr-teams { display: flex; align-items: center; padding: 0 8px 2px 0; }
.cr-panel .cr-btn { flex: 1 1 0; min-width: 0; height: 46px; justify-content: center; padding: 0; gap: 0; border: 0; border-radius: 8px; background: none; }
.cr-panel .cr-btn:hover { background: var(--panel2); }
.cr-panel .cr-btn .tlogo.md, .cr-panel .cr-btn .tlogo-wrap { width: 38px; height: 38px; }
.cr-panel .cr-btn.on { background: rgba(0,224,84,.1); box-shadow: inset 0 0 0 1.5px var(--green); }
.cr-div { flex: none; width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line2); }
@media (max-width: 360px) { .cs-root { padding: 6px 8px 4px; } .cr-panel .cr-btn { height: 44px; } }
/* --- Nov 27 pt109u: floating crowd pill over the feed, no back/⋯, plain header logos, button-like rooting panel --- */
.cs-crowd-row.cs-float { position: absolute; top: 6px; left: 0; right: 0; z-index: 5; display: flex; justify-content: center; padding: 0 10px; border: 0; pointer-events: none; }
.cs-float .cs-crowd { pointer-events: auto; background: rgba(20,24,28,.66); border-color: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .cs-float .cs-crowd { background: rgba(20,24,28,.92); } }
.cs-feed { padding-top: 40px; }
.cs-head { border-bottom: 1px solid rgba(0,0,0,.35); }
/* same size filled or empty (the old "empty" class collided with a global .empty style) */
.cs-crowd .cc-bar.cc-team { height: 6px; padding: 0; margin: 0; }
.cs-crowd .cc-bar.cc-none i { opacity: .35; }
/* header logos: no circle, subtle shadow keeps them legible on any gradient */
.cs-head .ch-team .tlogo-wrap, .cs-head .ch-team > .tlogo { background: none; padding: 0; border-radius: 0; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.55)) drop-shadow(0 0 1px rgba(0,0,0,.35)); }
/* rooting panel: tighter, centred label, logos as real buttons */
.cs-root { padding: 4px 10px 4px; }
.cr-panel { position: relative; padding: 4px 8px 6px; border-radius: 12px; }
.cr-top { justify-content: center; min-height: 20px; }
.cr-panel .cr-q { flex: none; text-align: center; font-size: 12px; line-height: 16px; }
.cr-panel .cr-x { position: absolute; top: 2px; right: 4px; width: 24px; height: 24px; }
.cr-teams { padding: 2px 0 0; gap: 0; }
.cr-panel .cr-btn { height: 50px; border-radius: 10px; background: linear-gradient(180deg, #2a3138, #1d2329); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 2px 0 rgba(0,0,0,.55), 0 3px 8px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08); transition: transform .08s ease, box-shadow .08s ease, background .12s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cr-panel .cr-btn:hover { background: linear-gradient(180deg, #313942, #222930); }
.cr-panel .cr-btn:active { transform: translateY(1px) scale(.97); box-shadow: 0 0 0 rgba(0,0,0,.55), inset 0 2px 6px rgba(0,0,0,.5); background: linear-gradient(180deg, #1b2026, #232a31); }
.cr-panel .cr-btn .tlogo.md, .cr-panel .cr-btn .tlogo-wrap { width: 42px; height: 42px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.cr-panel .cr-btn.on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), 0 2px 0 rgba(0,0,0,.55), inset 0 0 12px rgba(0,224,84,.14); }
.cr-div { margin: 8px 8px; background: rgba(255,255,255,.12); }
@media (prefers-reduced-motion: reduce) { .cr-panel .cr-btn { transition: none; } .cr-panel .cr-btn:active { transform: none; } }
@media (max-width: 360px) { .cs-root { padding: 4px 8px; } .cr-panel .cr-btn { height: 48px; } }
.cs-head .ch-team .tlogo-wrap.tlogo-on-gold { background: none; border-radius: 0; }
/* tighter rooting panel */
.cs-root { padding: 3px 10px; }
.cr-panel { padding: 2px 6px 5px; }
.cr-top { min-height: 18px; }
.cr-panel .cr-x { top: 0; width: 22px; height: 22px; }
.cr-panel .cr-btn { height: 46px; }
@media (max-width: 360px) { .cs-root { padding: 3px 8px; } .cr-panel .cr-btn { height: 46px; } }
/* --- Nov 27 pt111u: pregame lock --- */
.chat-screen.is-locked .cs-composer, .chat-screen.is-locked .cs-notice { display: none; }
.chat-screen.is-locked .cs-root { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.cs-lock { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 100%; padding: 0 20px; text-align: center; color: var(--muted); }
.cs-lock-ic { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line2); color: var(--white); margin-bottom: 4px; }
.cs-lock-t { margin: 0; font-size: 14px; font-weight: 700; color: var(--white); }
.cs-lock-c { margin: 0; font-size: 13px; color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
