/* /portalis/bystander — Portalis Bystander, the company's live streams, in
   Portalis OS (os.css): channels in the task pane, the player and what's
   on it, the chat beside. the player is the game's own picture, so it keeps
   its palette; only the badges over it are the company's */

.by {
  width: min(1240px, calc(100% - 32px));
  margin: 3.4em auto 2.5em;
}
.by__body { display: grid; grid-template-columns: 196px minmax(0, 1fr); }
.by__work { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; padding: 12px; }
/* the game beside the streamer, or under them when the pane's too narrow for both */
.by__tasks a:has(small) { flex-wrap: wrap; row-gap: 0; }
.by__tasks a small { margin-left: auto; color: var(--os-dk); font-size: 10px; font-weight: normal; white-space: nowrap; }
.by__tasks a[aria-disabled] { color: var(--os-sh); cursor: not-allowed; }
.by__det p { margin: 0 0 5px; }
.by__det span { font-family: vtFont, "Courier New", monospace; font-size: 14px; }

/* the player: sunk into the window, 16:9 */
.by__player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #04141b;
  box-shadow: inset 1px 1px 0 var(--os-dk), inset -1px -1px 0 #fff;
  padding: 2px;
}
/* watch-only: the streamer has the camera */
.by__cv { display: block; width: 100%; height: 100%; }
.by__live,
.by__eyes,
.by__pass {
  position: absolute;
  top: 10px;
  padding: 2px 7px;
  font: bold 11px/1.3 var(--os-ui);
  pointer-events: none;
}
.by__live { left: 10px; background: linear-gradient(#ffe08a, #f2b648 50%, #c9781a); color: var(--os-ink); text-transform: uppercase; letter-spacing: .06em; border: 1px solid #fff4cc; }
.by__eyes { left: 58px; background: rgba(4, 20, 26, .72); color: #fff; }
/* the render's own readout, as the renderer had it: the pass it's on */
.by__pass { right: 10px; top: auto; bottom: 10px; background: rgba(4, 20, 26, .72); color: #b9fbff; font: 14px/1.2 vtFont, "Courier New", monospace; letter-spacing: .04em; }
/* the stream's sound (bystander-chat.js): muted, a pill in the corner saying so;
   on, only the speaker, faint till the pointer's over the picture. while muted it
   stirs when someone's talking that you're not hearing */
.by__snd {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 7px;
  border: 1px solid #fff4cc;
  background: linear-gradient(#ffe08a, #f2b648 50%, #c9781a);
  color: var(--os-ink);
  font: bold 12px/1.2 var(--os-ui);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
.by__snd:hover { background: linear-gradient(#fff0b8, #ffcf6a 50%, #dc8c22); }
.by__snd:focus-visible { outline: 1px dotted #fff; outline-offset: 2px; }
.by__snd svg { flex: none; }
.by__snd .by__snd-w { display: none; }
.by__snd.is-talk { animation: by-snd 1.1s ease-in-out infinite; }
@keyframes by-snd { 50% { box-shadow: 0 0 0 3px rgba(242, 182, 72, .45), 0 1px 0 rgba(0, 0, 0, .5); } }
.by__snd.is-on { padding: 4px; border-color: transparent; background: rgba(4, 20, 26, .72); color: #fff; box-shadow: none; opacity: .45; transition: opacity .2s; }
.by__player:hover .by__snd.is-on, .by__snd.is-on:focus-visible { opacity: 1; }
.by__snd.is-on span, .by__snd.is-on .by__snd-x { display: none; }
.by__snd.is-on .by__snd-w { display: inline; }
/* muted, the picture is the button too */
.by__player:has(.by__snd:not(.is-on)) { cursor: pointer; }
/* the captions (bystander-chat.js): the streamer on mic and the rent being
   read, a row at a time over the picture, above the pass readout; the words
   take their room from the start and light as they're said */
.by__cc {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 40px);
  margin: 0;
  padding: 3px 10px 4px;
  background: rgba(4, 20, 26, .8);
  border-left: 3px solid var(--os-t3);
  color: #fff;
  font: bold 14px/1.35 var(--os-ui);
  text-align: center;
  text-shadow: 0 1px 0 #000;
  pointer-events: none;
}
.by__cc[hidden] { display: none; }
.by__cc span { visibility: hidden; }
.by__cc span.is-on { visibility: visible; }
.by__cc img { width: 20px; height: 20px; margin: -4px 0 -5px; vertical-align: middle; image-rendering: pixelated; }
.by__cc--don { border-left-color: var(--os-gold); }
.by__cc-n { color: var(--os-gold); }
/* the company itself, reading a notice */
.by__cc--co { border-left-color: #b9fbff; }
.by__cc--co .by__cc-n { color: #b9fbff; }
/* the notice of regrowth (bystander.js): a company window over the picture
   while a lease is run out, in the corner so the plot stays in view, its
   bar counting down in teal, then the regrowth itself in gold */
.by__rg { position: absolute; top: 36px; left: 10px; z-index: 2; width: min(290px, calc(100% - 20px)); pointer-events: none; }
.by__rg[hidden] { display: none; }
.by__rg .os-title { height: 24px; font-size: 12px; }
.by__rg-b { padding: 7px 10px 9px; font-size: 12px; line-height: 1.4; }
.by__rg-b p { margin: 0 0 7px; }
.by__rg-bar { height: 12px; padding: 2px; background: #fff; box-shadow: inset 1px 1px 0 var(--os-dk), inset -1px -1px 0 #fff; }
.by__rg-bar i { display: block; width: 0; height: 100%; background: repeating-linear-gradient(90deg, var(--os-t2) 0 7px, transparent 7px 9px); }
.by__rg-bar i.is-go { background: repeating-linear-gradient(90deg, var(--os-gold2) 0 7px, transparent 7px 9px); }
.by__rg.is-done .by__rg-bar { display: none; }
.by__rg.is-done .by__rg-b p { margin: 0; }
/* the workshop (bystander.js): LEASEHOLD's own window, not the company's: the
   renderer's pewter, rounded and embossed, its presets as balls in wells, the
   one in hand ringed in amber, a pointer making the pick. top right, clear of
   the badges, the captions and the pass readout; smaller as the player is */
.by__player { container-type: inline-size; }
.by__ws {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 258px;
  color: #e9e2cf; font: 11px/1.25 Verdana, Tahoma, sans-serif;
  background: linear-gradient(#6c6860, #4d4a44 55%, #3c3a35);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 0, 0, .45), 0 0 0 1px #201e1b, 0 6px 16px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(-6px); transform-origin: top right;
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.by__ws[hidden] { display: none; }
.by__ws.is-on { opacity: 1; transform: none; }
@container (max-width: 640px) { .by__ws { scale: .76; } }
@container (max-width: 470px) { .by__ws { scale: .5; top: 6px; right: 6px; } }
.ws__t { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 5px; border-bottom: 1px solid #262420; box-shadow: 0 1px 0 rgba(255, 255, 255, .1); text-shadow: 0 1px 0 #000; }
.ws__t span { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #b3aa95; }
.ws__t b { overflow: hidden; color: #f6e9c4; font-size: 12px; letter-spacing: .03em; white-space: nowrap; text-overflow: ellipsis; }
.ws__tools { display: flex; gap: 5px; padding: 7px 10px 0; }
.ws__tl { flex: 1; padding: 2px 0; border-radius: 9px; background: linear-gradient(#5a564f, #393731); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 0 0 1px #201e1b; color: #a59d89; font-size: 9px; letter-spacing: .12em; text-align: center; text-transform: uppercase; text-shadow: 0 1px 0 #000; transition: transform .1s; }
.ws__tl.is-on { background: linear-gradient(#ffe9a8, #f2c14e 55%, #b47e18); color: #2a1d05; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.ws__b { display: flex; gap: 9px; padding: 8px 10px; }
.ws__g { display: grid; grid-template-columns: repeat(3, 40px); gap: 5px; align-content: start; }
.ws__s { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 5px; background: #24221f; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .75), 0 1px 0 rgba(255, 255, 255, .13); transition: transform .1s, box-shadow .15s; }
.ws__s canvas { width: 36px; height: 36px; border-radius: 3px; }
.ws__s.is-none canvas { opacity: .5; filter: grayscale(.5); }
.ws__s b { position: absolute; right: 2px; bottom: 0; color: #fff; font-size: 9px; text-shadow: 0 0 2px #000, 0 1px 0 #000; }
.ws__s svg { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.ws__s.is-sel { box-shadow: inset 0 2px 3px rgba(0, 0, 0, .75), 0 0 0 2px #f2c14e, 0 0 9px rgba(242, 193, 78, .75); }
.ws__s.is-dn,
.ws__tl.is-dn { transform: scale(.9); }
.ws__lab { flex: 1; min-width: 0; }
.ws__pv { display: block; width: 84px; height: 84px; margin: 0 auto 5px; border-radius: 50%; background: #24221f; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .13), 0 0 0 3px #3a3833; overflow: hidden; }
.ws__pv canvas { display: block; width: 84px; height: 84px; }
.ws__n { min-height: 2.5em; margin: 0 0 3px; color: #f6e9c4; font-size: 10px; font-weight: bold; text-align: center; text-shadow: 0 1px 0 #000; }
.ws__c { margin: 0 0 2px; color: #b3aa95; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.ws__c i { display: block; height: 4px; margin-top: 1px; border-radius: 2px; background: #1f1d1a; box-shadow: inset 0 1px 1px #000, 0 1px 0 rgba(255, 255, 255, .1); }
.ws__c u { display: block; width: 0; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #b47e18, #ffe08a); transition: width .3s; }
.ws__f { display: flex; justify-content: space-between; padding: 5px 10px 7px; border-top: 1px solid #262420; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); color: #b3aa95; font-size: 9px; letter-spacing: .06em; text-shadow: 0 1px 0 #000; }
.ws__cur { position: absolute; left: 0; top: 0; z-index: 1; line-height: 0; transition: transform .45s cubic-bezier(.4, .1, .2, 1); }
.ws__cur svg { transition: transform .1s; transform-origin: 0 0; }
.ws__cur.is-dn svg { transform: scale(.85); }
@media (prefers-reduced-motion: reduce) {
  .by__ws, .ws__s, .ws__tl, .ws__c u { transition: none; }
  .by__ws { transform: none; }
  .by__snd.is-talk { animation: none; }
}
.by__err { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #fff; font-size: 13px; }
.by__err[hidden] { display: none; }

.by__about {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 12px;
  background: linear-gradient(#fff, #f1f3ee);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 var(--os-sh), 0 0 0 1px var(--os-line);
}
/* the streamer's tile: their plot drawn small, ringed in gold while they're live */
.by__av { flex: none; display: grid; place-items: center; width: 52px; height: 52px; background: linear-gradient(135deg, var(--os-t2), var(--os-t1)); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--os-gold); }
.by__meta { flex: 1; min-width: 0; }
.by__h {
  margin: 0; padding: 0; background: none; border: 0;
  font: 20px/1.05 vtFont, "Courier New", monospace; color: var(--os-t1); text-align: left;
  /* two lines at most: the title is the joke, so it wraps before it's cut */
  white-space: normal; overflow: hidden; height: auto;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.by__h::before,
.by__h::after { content: none; }
.by__by { margin: 3px 0 0; font-size: 12px; color: var(--os-dk); }
.by__by b { color: var(--os-t1); }
.by__sep { margin: 0 6px; color: var(--os-sh); }
.by__game { color: var(--os-t2); font-weight: bold; }
.by__tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.by__tags li { padding: 0 6px; background: var(--os-pane1); border: 1px solid var(--os-pane2); color: var(--os-t1); font-size: 10px; line-height: 16px; }
.by__tags li::before { content: none; }
.by__side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.by__stats { display: flex; gap: 12px; margin: 0; font-size: 12px; color: var(--os-dk); }
.by__stats span { display: flex; align-items: center; gap: 4px; }
.by__stats b { color: var(--os-t1); font-variant-numeric: tabular-nums; }
.by__stats span:first-child { color: #b3401f; }
.by__acts { display: flex; gap: 6px; }

/* the channel's panels, three across */
.by__panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 0; }
.by__pn { background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px var(--os-line); font-size: 12px; line-height: 1.45; }
.by__pn h2 { margin: 0; padding: 5px 9px; background: linear-gradient(90deg, #fff 30%, #c9e6eb); border: 0; color: var(--os-t1); font: bold 12px var(--os-ui); text-align: left; }
.by__pn h2::before,
.by__pn h2::after { content: none; }
.by__pn p { margin: 7px 9px; }
.by__pn-f { color: var(--os-dk); font-size: 11px; }
/* what the kid is building, kept up to date by bystander.js details() */
.by__wip { padding-left: 7px; border-left: 3px solid var(--os-gold); color: var(--os-t1); }
.by__wip:empty { display: none; }
.by__dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 7px 9px; }
.by__dl dt { color: var(--os-dk); }
.by__dl dd { margin: 0; color: var(--os-t1); font-family: vtFont, "Courier New", monospace; font-size: 14px; line-height: 1.05; }
.by__rules { margin: 7px 9px 8px; padding-left: 18px; }
.by__rules li { padding: 1px 0; }
.by__rules li::before { content: none; }

.by__chat {
  /* sized by the row the player makes, never by how much has been said */
  contain: size;
  min-height: 0;
  background: #fff;
  box-shadow: inset 1px 1px 0 var(--os-dk), inset -1px -1px 0 #fff;
}
.by__ch { margin: 0; padding: 6px 10px; background: linear-gradient(90deg, #fff 30%, #c9e6eb); color: var(--os-t1); font: bold 12px var(--os-ui); text-align: left; border: 0; }
.by__ch::before,
.by__ch::after { content: none; }

/* the chat (bystander-chat.js): the log, white, under the company's header;
   nicks in their colours, emotes and badges drawn in pixels and kept that way */
.bc { display: flex; flex-direction: column; height: 100%; }
.bc__top { display: flex; align-items: center; background: linear-gradient(90deg, #fff 30%, #c9e6eb); }
.bc__top .by__ch { flex: 1; background: none; }
.bc__tts { display: grid; place-items: center; width: 24px; height: 22px; margin-right: 4px; padding: 0; border: 0; background: none; color: var(--os-t1); cursor: pointer; }
.bc__tts:hover { color: var(--os-t2); }
.bc__tts:focus-visible { outline: 1px dotted var(--os-ink); }
.bc__tts[aria-pressed="false"] { color: var(--os-sh); }
.bc__tts[aria-pressed="false"] .bc__wave { display: none; }
.bc__log {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 4px 8px 6px;
  list-style: none;
  font: 12px/1.5 var(--os-ui);
  color: #1a2a30;
  overflow-wrap: anywhere;
}
.bc__m { padding: 2px 0; }
.bc__log > li::before { content: none; }
.bc__n { font-weight: bold; }
.bc__bd { width: 14px; height: 14px; margin-right: 3px; vertical-align: -2px; image-rendering: pixelated; }
.bc__e { width: 24px; height: 24px; margin: -6px 1px -5px; vertical-align: middle; image-rendering: pixelated; }
.bc__at { color: var(--os-t1); }
.bc__ref { color: var(--os-t2); }
.bc__sys { color: var(--os-dk); font-style: italic; }
.bc__sys--t { margin: 3px -4px; padding: 3px 6px; font-style: normal; color: var(--os-t1); background: var(--os-pane1); border-left: 3px solid var(--os-t2); }
/* the company in the chat: a regrowth's notice and its compensation */
.bc__sys--p { margin: 4px -4px; padding: 4px 7px; font-style: normal; color: var(--os-ink); background: linear-gradient(90deg, #dff1f4, #fff); border-left: 3px solid var(--os-gold); }
/* a mod's pinned message, over the log */
.bc__pin { margin: 0; padding: 5px 8px; background: #fffaea; border-bottom: 1px solid var(--os-gold2); font: 11px/1.4 var(--os-ui); color: #1a2a30; }
.bc__pin[hidden] { display: none; }
.bc__pin small { display: block; color: var(--os-dk); font-size: 10px; }
.bc__del .bc__t { color: var(--os-sh); font-style: italic; }
/* ground rent paid in: the company's gold */
.bc__don { margin: 5px -4px; padding: 5px 7px 6px; background: linear-gradient(#fffaea, #ffeab0); border: 1px solid var(--os-gold2); box-shadow: inset 0 1px 0 #fff; }
.bc__don--big { background: linear-gradient(#ffe48f, #f2b648); }
.bc__dh { font-size: 11px; font-weight: bold; }
.bc__coin { width: 18px; height: 18px; margin-right: 4px; vertical-align: -5px; image-rendering: pixelated; }
.bc__dt { margin-top: 2px; }
.bc__more { position: relative; z-index: 1; align-self: center; margin: -30px 0 8px; padding: 3px 10px; border: 0; background: var(--os-t1); color: #fff; font: 11px var(--os-ui); cursor: pointer; }
.bc__more[hidden] { display: none; }
.bc__say { display: flex; gap: 6px; padding: 6px; background: var(--os-face); border-top: 1px solid var(--os-sh); }
.bc__in { flex: 1; min-width: 0; font-size: 11px; cursor: pointer; }
.bc__dlg { display: flex; gap: 12px; align-items: flex-start; }
.bc__dlg img { flex: none; margin-top: 10px; }

@media (max-width: 960px) {
  .by__body { grid-template-columns: 1fr; }
  .by__tasks { display: none; }
  .by__work { grid-template-columns: 1fr; }
  .by__chat { height: 380px; }
  /* stacked, the chat comes before the panels: it's what's live */
  .by__main { display: contents; }
  .by__work { row-gap: 0; }
  .by__chat { order: 1; margin-top: 10px; }
  .by__panels { order: 2; grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .by__cc { bottom: 36px; font-size: 12px; }
  .by__rg { top: 34px; }
  .by__rg-b { padding: 5px 8px 7px; font-size: 11px; }
  .by__about { flex-wrap: wrap; }
  .by__side { width: 100%; align-items: stretch; }
  .by__stats { justify-content: flex-start; }
  .by__acts .os-btn { flex: 1; }
}

/* ACCEPT ALL (bystander-accept.js): the captions go up top, out of the arrows' way */
.by__player--accept .by__cc { bottom: auto; top: 10px; max-width: 56%; }
/* the sound clear of the face cam, bottom left */
.by__player--accept .by__snd { left: auto; right: 10px; }

/* ARBITRATION (bystander-arena.js): the 240 lines kept square on the way up, the
   captions over the middle of the HUD, clear of the standing and the ammo */
.by__player--arena .by__cv { image-rendering: pixelated; }
.by__player--arena .by__cc { bottom: 64px; max-width: 54%; }
/* the HUD has both bottom corners: the sound goes up top, the clock in the middle */
.by__player--arena .by__snd { left: auto; right: 10px; bottom: auto; top: 10px; }
