/* Server tab: the rally on the Challenges section only (js/challenges-live.js, with js/rally-room.js and css/rally-room.css).
   Rule of this file: outside Browse challenges and the Bitcoin Cash Challenge page nothing of the rally is shown.
   One exception since 2026-12-03: the "Mining right now" list lives at the top of the feed channel, not on Browse.
   The containers themselves are hidden (not their rows), with !important, so a later rule on a child cannot bring anything back. */

/* ---------- 1. off by default, everywhere ---------- */
html body .rr-bar,
html body .rr-act,
html body .rr-cs,
html body .rr-tabs,
html body .rr-pb,
html body .cl-now{display:none!important}

/* ---------- 2. on: Browse challenges only ----------
   A single challenge page has its own hero with one Join (js/challenges-fill.js), and css/challenges-fill.css hides
   the rally bar, strip and ticker there (.stage.chal-open.chal-page). So nothing here names a challenge page. */
/* These selectors need the active row to be a challenge row and .stage.chal-open, which is never true on a game view,
   so they do not test body.gf-game-on: the games add-on can leave that class set after a game (its box stays in the
   page under a challenge view), and the bar must still show on Browse then. */
html body.rr-on:has(#chalList button.on[data-key="x:browse"]) .stage.chal-open:not(.chal-page)>.rr-bar{display:block!important}
html body.rr-on:has(#chanList button.on[data-key="c:wins-feed"]) .stage:not(.chal-open)>.cl-now{display:block!important}
/* the "Show who is mining" switch controlled the list on Browse; the list moved, so the switch has nothing to do */
html body .rr-bar .rr-sw{display:none!important}
html body .rr-bar .rr-r .rr-fold{margin-left:auto} /* the switch used to push the collapse arrow to the right edge */
.cl-src{display:none}

/* order inside the stage (a column): header, Mining right now, messages */
.stage>.cl-now{order:2;flex:none}

/* the honesty line */
.cl-nog{margin:0;padding:0 16px 7px;font:500 12px/1.3 var(--font-body);color:var(--text-muted)}
.rr-bar.col .cl-nog{padding-top:0}

/* ---------- Happening now ---------- */
.cl-now{padding:6px 16px 6px;border-bottom:1px solid var(--line);background:var(--ground)}
.cl-nh{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;min-height:26px}
.cl-nt{display:inline-flex;align-items:center;gap:8px}
.cl-nt b{font:600 13px var(--font-display);letter-spacing:.1em;text-transform:uppercase;color:var(--text)}
.cl-ns{flex:1 1 240px;min-width:0;font-size:var(--fs-small);color:var(--text-muted);line-height:1.4}
.cl-more{min-height:32px;padding:0 6px;margin-left:auto;border:0;background:none;color:var(--accent-text);font:500 var(--fs-small) var(--font-body);white-space:nowrap}
.cl-more:hover{text-decoration:underline}
.cl-more[hidden]{display:none}
.cl-more:focus-visible{outline:2px solid var(--accent-text);outline-offset:2px}
.cl-evs{display:grid;gap:3px;margin-top:3px}
.cl-ev{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px 10px;min-height:36px;padding:3px 10px 3px 8px;border:1px solid var(--line-strong);border-left:3px solid var(--accent);border-radius:var(--r-sm);background:var(--surface-1)}
.cl-ev.rent{border-left-color:var(--gold)}
.cl-et{min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:0 12px;font-size:var(--fs-body);color:var(--text)}
.cl-l1 b{font:500 14px var(--font-mono);color:var(--text)}
.cl-l1{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.cl-l2{display:inline-flex;align-items:center;flex-wrap:wrap;gap:0 6px;font-size:var(--fs-small);color:var(--text-muted)}
.cl-plus{font:500 13px var(--font-mono);color:var(--text)}
.cl-sep{color:var(--text-faint)}
.cl-eff{font:500 12px var(--font-mono);color:var(--accent-text)}
.cl-first{font:600 10px var(--font-display);font-style:normal;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-text);border:1px solid var(--accent-line);border-radius:var(--r-round);padding:1px 6px}
.cl-er{display:flex;align-items:center;gap:8px;white-space:nowrap;font:500 12px var(--font-mono);color:var(--text-muted)}
.cl-none{margin:0;font-size:var(--fs-small);color:var(--text-muted)}
.cl-new{animation:cl-in .4s var(--motion-ease)}
@keyframes cl-in{from{opacity:0;transform:translateY(-8px);background:var(--accent-wash)}to{opacity:1;transform:none}}
.cl-now[data-n="1"] .cl-ev:nth-child(n+2){display:none}
.cl-now[data-n="2"] .cl-ev:nth-child(n+3){display:none}
.cl-now[data-n="3"] .cl-ev:nth-child(n+4){display:none}

/* ---------- who is hashing on a card ---------- */
.chal-card .chal-slot[data-chal-slot-at="card"]{order:-1;flex:1 1 0;min-width:0;justify-content:flex-start}
.chal-card .cc-foot{display:block}
.chal-card .cc-acts{margin-left:0;flex-wrap:nowrap;justify-content:space-between;align-items:center;gap:var(--sp-3)}
.cl-who{display:flex;align-items:center;gap:10px;min-height:36px;min-width:0;flex-wrap:wrap}
.cl-avs{display:inline-flex;align-items:center}
.cl-avs .rl-av{width:28px;height:28px;margin-left:-6px;border:2px solid var(--surface-1)}
.cl-avs .rl-av:first-child{margin-left:0}
.cl-rest{font:500 12px var(--font-mono);font-style:normal;color:var(--text-muted);margin-left:6px}
.cl-wc{font-size:var(--fs-small);color:var(--text-muted)}
.cl-wc b{font:500 14px var(--font-mono);color:var(--text)}
.cl-wc.none{color:var(--text-muted)}

/* ---------- narrow stage (a phone, or a phone on its side): .nw is set by the script from the stage's own width ---------- */
.cl-now.nw{padding:4px 12px 6px}
.cl-now.nw .cl-ns{display:none}
.cl-now.nw .cl-nh{min-height:28px;flex-wrap:nowrap}
.cl-now.nw .cl-first{display:none}
.cl-now.nw .cl-ev{grid-template-columns:auto minmax(0,1fr);min-height:40px;padding:2px 8px}
.cl-now.nw .cl-et{flex-direction:column;align-items:flex-start;gap:0}
.cl-now.nw .cl-l2{font-size:11.5px;gap:0 4px;flex-wrap:nowrap;white-space:nowrap}
.cl-now.nw .cl-l2 span:nth-of-type(2){overflow:hidden;text-overflow:ellipsis;min-width:0}
.cl-now.nw .cl-et{min-width:0;max-width:100%}
.cl-now.nw .cl-l2{max-width:100%;overflow:hidden}
.cl-now.nw .cl-eff,.cl-now.nw .cl-plus{font-size:11.5px}
.cl-now.nw .cl-er{display:none}
.cl-now.nw .cl-more{min-height:40px;margin-block:-6px}
/* one event: a single line */
.cl-now.nw[data-n="1"] .cl-ev{min-height:34px}
.cl-now.nw[data-n="1"] .cl-et{flex-direction:row;align-items:center;flex-wrap:nowrap;gap:0 8px;overflow:hidden}
.cl-now.nw[data-n="1"] .cl-l1{overflow:hidden;text-overflow:ellipsis;min-width:0;flex:0 1 auto}
.cl-now.nw[data-n="1"] .cl-tr,.cl-now.nw[data-n="1"] .cl-first,.cl-now.nw[data-n="1"] .cl-l2>:not(.cl-plus){display:none}
.cl-now.nw[data-n="1"] .cl-l2{flex:none}
@media (max-width:820px){
  .cl-nog{padding:0 12px 6px;font-size:11px}
}

/* ---------- the Bitcoin Cash page: the activity strip stays one short event ---------- */
.stage>.rr-act.dock{padding:4px 16px 6px}
.stage>.rr-act.dock .rr-wel{display:none}
.stage>.rr-act.dock .rr-ev{min-height:40px}

/* ---------- short screens (a phone on its side, a small laptop): the bar is the one-line strip, so the page's content keeps the room ---------- */
@media (max-width:820px){
  .stage>.rr-act.dock .rl-tag.first{display:none}
}
@media (max-height:600px){
  .stage>.rr-act.dock .rr-badge,.stage>.rr-act.dock .rl-tag.first,.stage>.rr-act.dock .rr-dot{display:none}
  .stage>.rr-act.dock .rr-el{flex-wrap:nowrap;overflow:hidden;gap:6px}
  .stage>.rr-act.dock .rr-plus,.stage>.rr-act.dock .rr-who1{white-space:nowrap;flex:none}
  .stage>.rr-act.dock .rr-how{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1 1 0}
  .stage>.rr-act.dock .rr-effi{display:none}
  .rr-bar:not(.col) .rr-row{display:none}
  .rr-bar:not(.col) .rr-thin{display:flex}
  .rr-bar:not(.col) .rr-thin .rr-fold{display:none}
  .rr-thin{flex-wrap:nowrap;min-height:40px}
  .rr-thin .rr-t{flex:none}
  .rr-thin .rr-jn{display:none}
  .cl-nog{padding-bottom:4px}
  .rr-join{max-height:calc(100vh - 110px)}
  .stage>.rr-act.dock .rr-ah{display:none}
  .stage>.rr-act.dock{padding-top:3px;padding-bottom:4px}
  .stage>.rr-act.dock .rr-ev{min-height:34px;padding-block:2px;grid-template-columns:auto minmax(0,1fr)}
  .stage>.rr-act.dock .rr-et{display:none}
}
@media (prefers-reduced-motion:reduce){.cl-new{animation:none}}

/* ---------- real numbers only: the bar's "miners online" chip stays away until the pool has answered ---------- */
.rr-bar.nojn .rr-jn{display:none}
