/* Giga Blow multiplayer UI (src/net-ui.js, src/net-avatars.js): lobby, start countdown, in-game room HUD + chat, name tags.
   Uses the tokens from styles.css (:root) — dark-ink panels, Lilita One numbers/titles, Barlow Semi Condensed text. */

/* ---------------------------------------------------------------- lobby */
.nl { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, rgba(12, 24, 28, .7) 0%, rgba(5, 9, 11, .9) 70%, rgba(3, 5, 6, .96) 100%); }
.nl[hidden], .nl [hidden] { display: none !important; }
.nl-panel { position: relative; width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 22px 22px; border-radius: 14px;
  background: var(--panel-bg); border: 2px solid var(--line); box-shadow: var(--panel-shadow), 0 20px 60px rgba(0, 0, 0, .6);
  user-select: text; animation: nlIn .22s var(--pop) backwards; }
@keyframes nlIn { from { transform: scale(.94); opacity: 0; } }
.nl-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.nl-title { font: 400 clamp(30px, 3.4vw, 42px)/1 var(--f-num); color: #fff; letter-spacing: 1px; -webkit-text-stroke: .08em #000; paint-order: stroke fill;
  text-shadow: 0 .07em 0 #000, 0 0 .5em rgba(63, 224, 200, .4); }
.nl-conn { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: rgba(7, 11, 13, .7); border: 1px solid var(--line);
  font: 700 14px/1 var(--f-ui); color: var(--text-dim); letter-spacing: .5px; }
.nl-conn i { width: 9px; height: 9px; border-radius: 50%; background: #5d6f73; }
.nl-conn[data-s="open"] i { background: var(--gain); box-shadow: 0 0 8px var(--gain); }
.nl-conn[data-s="connecting"] i, .nl-conn[data-s="reconnecting"] i { background: var(--gold); animation: nlBlink .8s ease-in-out infinite; }
.nl-conn[data-s="closed"] i { background: var(--blood); }
@keyframes nlBlink { 50% { opacity: .3; } }
.nl-x { margin-left: auto; width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); background: var(--ink-2); color: var(--text);
  font: 400 26px/1 var(--f-num); cursor: pointer; transition: border-color .12s, transform .12s var(--pop); }
.nl-x:hover { border-color: var(--ember); transform: translateY(-2px); }
.nl h3 { margin: 0 0 4px; font: 400 24px/1.1 var(--f-num); color: #fff; letter-spacing: .5px; text-shadow: 0 2px 0 #000; }
.nl h4 { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 8px; font: 800 14px/1 var(--f-ui); letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-dim); }
.nl h4:first-child { margin-top: 0; }
.nl h4 small, .nl h4 span { font: 700 13px/1 var(--f-ui); letter-spacing: .5px; text-transform: none; color: var(--teal); }
.nl p { margin: 0 0 12px; font: 600 15px/1.35 var(--f-ui); color: var(--text-dim); }
.nl input { font: 700 17px/1 var(--f-ui); color: var(--text); background: var(--ink-0); border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none;
  transition: border-color .12s, box-shadow .12s; min-width: 0; }
.nl input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(63, 224, 200, .18); }
.nl input::placeholder { color: #5d7376; }
.nl code { font: 600 13px/1 ui-monospace, Menlo, monospace; color: var(--text); background: var(--ink-0); padding: 2px 5px; border-radius: 5px; }

.nl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; cursor: pointer;
  font: 800 16px/1 var(--f-ui); letter-spacing: 1.2px; text-transform: uppercase; color: var(--text);
  background: linear-gradient(180deg, #24353c, var(--ink-1)); border: 2px solid var(--line);
  box-shadow: 0 0 0 2px #000, inset 0 1px 0 rgba(255, 255, 255, .1), 0 5px 12px rgba(0, 0, 0, .45); transition: transform .12s var(--pop), border-color .12s, box-shadow .12s, opacity .12s; }
.nl-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--ember); box-shadow: 0 0 0 2px #000, 0 0 16px rgba(255, 154, 58, .4), inset 0 1px 0 rgba(255, 255, 255, .12), 0 7px 14px rgba(0, 0, 0, .5); }
.nl-btn:disabled { opacity: .45; cursor: default; }
.nl-btn.nl-primary { color: #2a1204; background: linear-gradient(180deg, #ffd27a 0%, #ff9a3a 50%, #e5641c 100%); border-color: #ffe2a8; text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  box-shadow: 0 0 0 2px #000, 0 4px 0 #7a2e08, 0 0 22px rgba(255, 154, 58, .35), inset 0 2px 0 rgba(255, 255, 255, .55); }
.nl-btn.nl-primary:hover:not(:disabled) { border-color: #fff3d8; box-shadow: 0 0 0 2px #000, 0 6px 0 #7a2e08, 0 0 30px rgba(255, 170, 70, .7), inset 0 2px 0 rgba(255, 255, 255, .6); }
.nl-btn.nl-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--text-dim); font-size: 14px; padding: 8px 10px; }
.nl-btn.nl-ghost:hover { color: var(--blood); border-color: transparent; box-shadow: none; }
.nl-btn.done { border-color: var(--gain); color: var(--gain); }
.nl-ico { width: 1.1em; height: 1.1em; flex: 0 0 auto; display: inline-block; vertical-align: -.15em; }

/* entry */
.nl-name { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.nl-name span { font: 800 14px/1 var(--f-ui); letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-dim); }
.nl-name input { width: min(320px, 100%); font-size: 20px; }
.nl-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nl-card { padding: 16px 18px 18px; border-radius: 12px; background: rgba(7, 11, 13, .55); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.nl-card .nl-btn { width: 100%; padding: 14px; font-size: 18px; }
.nl-joinRow { display: flex; gap: 10px; }
.nl-codeIn { flex: 1; width: 0; text-align: center; font: 400 30px/1 var(--f-num) !important; letter-spacing: 8px; text-transform: uppercase; padding: 7px 10px !important; }
.nl-joinRow .nl-btn { width: auto; padding: 0 22px; }
.nl-err { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 59, 78, .12); border: 1px solid rgba(255, 59, 78, .5); color: #ffb3bb; font: 700 15px/1.3 var(--f-ui); }
.nl-err:empty { display: none; }
.nl-adv { margin-top: 14px; color: var(--text-dim); font: 600 14px/1.4 var(--f-ui); }
.nl-adv summary { cursor: pointer; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 12px; width: max-content; }
.nl-advRow { display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; flex-wrap: wrap; }
.nl-advRow input { width: min(360px, 100%); font: 600 14px/1 ui-monospace, Menlo, monospace; }
.nl-srv { font: 600 13px/1.2 ui-monospace, Menlo, monospace; color: var(--teal); word-break: break-all; }

/* room */
.nl-codeBox { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 18px; border-radius: 12px; margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(255, 210, 63, .1), rgba(7, 11, 13, .5) 60%); border: 1px solid rgba(255, 210, 63, .35); }
.nl-codeCol small { display: block; font: 800 12px/1 var(--f-ui); letter-spacing: 3px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 4px; }
.nl-code { display: block; font: 400 clamp(46px, 6vw, 68px)/1 var(--f-num); letter-spacing: .16em; color: var(--gold); -webkit-text-stroke: .06em #000; paint-order: stroke fill;
  text-shadow: 0 .06em 0 #000, 0 0 .45em rgba(255, 210, 63, .45); user-select: all; }
.nl-codeBtns { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.nl-codeBtns .nl-btn { font-size: 14px; padding: 9px 14px; }
.nl-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.nl-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.nl-members li { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; border-radius: 10px; background: rgba(26, 38, 44, .7); border: 1px solid var(--line); }
.nl-members li.me { border-color: rgba(63, 224, 200, .55); }
.nl-members li.away { opacity: .5; }
.nl-av { flex: 0 0 38px; height: 38px; padding: 6px; border-radius: 50%; color: #fff8ec; background: radial-gradient(circle at 50% 35%, hsl(var(--h) 45% 42%), hsl(var(--h) 50% 16%)); box-shadow: 0 0 0 2px #000, inset 0 1px 0 rgba(255, 255, 255, .2); }
.nl-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nl-who b { font: 800 17px/1.1 var(--f-ui); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-who b small { font: 800 11px/1 var(--f-ui); letter-spacing: 1.5px; text-transform: uppercase; color: var(--teal); margin-left: 4px; }
.nl-who > small { font: 600 13px/1 var(--f-ui); color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl-crown { color: var(--gold); font-size: 20px; filter: drop-shadow(0 0 6px rgba(255, 210, 63, .6)) drop-shadow(0 1px 0 #000); }
.nl-ping { min-width: 64px; text-align: right; font: 400 15px/1 var(--f-num); color: var(--text-dim); }
.nl-ping.good { color: var(--gain); } .nl-ping.ok { color: var(--gold); } .nl-ping.bad { color: var(--blood); }
.nl-rdy { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-0); }
li.ready .nl-rdy { background: var(--teal); box-shadow: 0 0 10px rgba(63, 224, 200, .6); }
.nl-mini { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--ink-1); color: var(--text-dim);
  font: 400 18px/1 var(--f-num); cursor: pointer; opacity: 0; transition: opacity .12s, color .12s, border-color .12s; }
.nl-members li:hover .nl-mini { opacity: 1; }
.nl-mini:hover { color: var(--gold); border-color: var(--gold); }
.nl-kick:hover { color: var(--blood); border-color: var(--blood); }
.nl-chat { display: flex; flex-direction: column; gap: 8px; }
.nl-log { height: 170px; overflow-y: auto; padding: 8px 10px; border-radius: 10px; background: rgba(7, 11, 13, .6); border: 1px solid var(--line); }
.nl-log p, .nc-log p { margin: 0 0 4px; font: 600 15px/1.3 var(--f-ui); color: var(--text); word-wrap: break-word; }
.nl-log p b, .nc-log p b { color: hsl(var(--h) 85% 70%); font-weight: 800; }
.nl-log p.sys, .nc-log p.sys { color: var(--text-dim); font-style: italic; font-size: 14px; }
.nl-say { display: flex; gap: 8px; }
.nl-say input { flex: 1; font-size: 15px; padding: 9px 11px; }
.nl-say .nl-btn { padding: 0 14px; font-size: 13px; }
.nl-sets { display: flex; flex-direction: column; gap: 10px; }
.nl-set { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 6px 10px; }
.nl-set > span { font: 800 13px/1.1 var(--f-ui); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.nl-set > small { grid-column: 2; font: 600 13px/1.2 var(--f-ui); color: var(--text-dim); opacity: .8; }
.nl-set.dim .nl-seg { opacity: .65; }
.nl-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.nl-seg button { position: relative; padding: 9px 12px; border-radius: 9px; border: 2px solid var(--line); background: var(--ink-0); color: var(--text-dim); cursor: pointer;
  font: 800 14px/1 var(--f-ui); letter-spacing: .6px; transition: border-color .12s, color .12s, background .12s; }
.nl-seg button:hover:not(:disabled) { color: var(--text); border-color: #4a656d; }
.nl-seg button.on { color: #fff; border-color: var(--teal); background: linear-gradient(180deg, rgba(63, 224, 200, .25), rgba(63, 224, 200, .08)); box-shadow: 0 0 12px rgba(63, 224, 200, .25); }
.nl-seg button:disabled { cursor: default; }
.nl-seg button:disabled:not(.on) { opacity: .5; }
.nl-seg em { margin-left: 6px; padding: 2px 5px; border-radius: 5px; background: var(--ink-2); font: 800 10px/1 var(--f-ui); letter-spacing: 1px; text-transform: uppercase; font-style: normal; color: var(--ember); }
.nl-runInfo { margin: 16px 0 10px; font: 600 15px/1.35 var(--f-ui); color: var(--text-dim); min-height: 1.35em; }
.nl-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.nl-acts .nl-btn { flex: 1; min-height: 52px; font-size: 18px; }
.nl-start { flex: 2 !important; font: 400 26px/1 var(--f-num) !important; letter-spacing: 1px !important; text-transform: none !important; }
.nl-start small { font: 800 13px/1 var(--f-ui); letter-spacing: .5px; opacity: .8; margin-left: 4px; }
.nl-ready.on { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 0 2px #000, 0 0 16px rgba(63, 224, 200, .35); }
.nl-leave { margin-top: 14px; }

@media (max-width: 760px) {
  .nl-choices, .nl-cols { grid-template-columns: 1fr; }
  .nl-panel { padding: 14px 14px 18px; }
  .nl-codeBtns { margin-left: 0; }
  .nl-set { grid-template-columns: 1fr; }
  .nl-set > small { grid-column: 1; }
}

/* ---------------------------------------------------------------- start countdown */
#netGo { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; cursor: pointer; background: rgba(3, 5, 6, .55); }
#netGo[hidden] { display: none; }
.ng-box { text-align: center; padding: 26px 46px 24px; border-radius: 16px; background: var(--panel-bg); border: 2px solid var(--line); box-shadow: var(--panel-shadow), 0 20px 60px rgba(0, 0, 0, .6); }
.ng-room { display: block; font: 800 14px/1 var(--f-ui); letter-spacing: 3px; text-transform: uppercase; color: var(--text-dim); }
.ng-n { display: block; margin: 10px 0 6px; font: 400 120px/1 var(--f-num); color: #fff; -webkit-text-stroke: .06em #000; paint-order: stroke fill;
  text-shadow: 0 .06em 0 #000, 0 0 .4em rgba(63, 224, 200, .5); }
#netGo.go .ng-n { color: var(--gold); text-shadow: 0 .06em 0 #000, 0 0 .5em rgba(255, 210, 63, .7); animation: popIn .3s var(--pop); }
.ng-msg { margin: 0; font: 800 18px/1 var(--f-ui); letter-spacing: 2px; text-transform: uppercase; color: var(--teal); }

/* ---------------------------------------------------------------- in-game room HUD + chat */
#netHud { position: fixed; left: 16px; top: 116px; z-index: 4; width: 230px; pointer-events: none; }
#netHud[hidden], #netChat[hidden] { display: none; }
.nh-room { display: inline-flex; align-items: center; gap: 8px; padding: 4px 9px; border-radius: 8px; background: rgba(7, 11, 13, .72); border: 1px solid var(--line); }
.nh-code { font: 400 17px/1 var(--f-num); letter-spacing: 2px; color: var(--gold); text-shadow: 0 1px 0 #000; }
.nh-conn { font: 700 12px/1 var(--f-ui); color: var(--text-dim); }
.nh-conn[data-s="reconnecting"], .nh-conn[data-s="closed"] { color: var(--blood); }
.nh-players { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.nh-players li { display: flex; align-items: center; gap: 6px; font: 700 14px/1.15 var(--f-ui); color: var(--text); text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.nh-players li > i, .nh-players li > svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--gold); }
.nh-players li > i { border-radius: 50%; background: hsl(var(--h) 70% 55%); transform: scale(.6); box-shadow: 0 0 0 2px #000; }
.nh-players li b { font-weight: 800; color: hsl(var(--h) 85% 72%); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-players li.me b { color: var(--text); }
.nh-players li.away { opacity: .5; }
.nh-players li em { margin-left: auto; font: 400 12px/1 var(--f-num); font-style: normal; color: var(--text-dim); }
.nh-toasts { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; align-items: flex-start; }
.nh-toast { padding: 5px 10px; border-radius: 8px; background: rgba(7, 11, 13, .85); border: 1px solid var(--line); font: 700 14px/1.2 var(--f-ui); color: var(--text);
  animation: popIn .25s var(--pop) backwards; transition: opacity .4s, transform .4s; }
.nh-toast.out { opacity: 0; transform: translateX(-10px); }
#netChat { position: fixed; left: 16px; bottom: 168px; z-index: 4; width: min(400px, 42vw); pointer-events: none; }
.nc-log p { margin: 0 0 3px; padding: 3px 8px; border-radius: 6px; width: max-content; max-width: 100%; background: rgba(7, 11, 13, .62); text-shadow: 0 1px 2px #000;
  transition: opacity 1.2s; }
.nc-log p.old { opacity: 0; }
#netChat.typing .nc-log p.old { opacity: .85; }
.nc-say { margin-top: 4px; pointer-events: auto; }
.nc-say input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 2px solid var(--teal); background: rgba(7, 11, 13, .9); color: var(--text); font: 700 15px/1 var(--f-ui); outline: none; }
.nc-hint { margin-top: 3px; font: 700 12px/1 var(--f-ui); color: var(--text-dim); opacity: .55; text-shadow: 0 1px 2px #000; }
.nc-hint kbd { font-size: 11px; }
#netChat.typing .nc-hint { display: none; }

/* ---------------------------------------------------------------- name tags over remote players */
#netTags { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.ntag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 4px; padding: 3px 9px 4px; border-radius: 8px; white-space: nowrap; will-change: transform;
  background: rgba(7, 11, 13, .62); border: 1px solid rgba(110, 180, 255, .45); font: 400 16px/1 var(--f-num); color: #dcecff; letter-spacing: .5px; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.ntag .ncrown { width: 15px; height: 15px; color: var(--gold); filter: drop-shadow(0 0 4px rgba(255, 210, 63, .7)); }
.ntag.away { opacity: .45 !important; }
body:not(.playing) #netTags { display: none; }

/* ---------------------------------------------------------------- co-op (src/coop-ui.js): team list, level bank, bubble, downed, spectate */
body.coop .nh-players { display: none; }
#coopTeam { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; width: 230px; pointer-events: none; }
#coopTeam[hidden] { display: none; }
#coopTeam li { position: relative; display: grid; grid-template-columns: 10px 1fr auto; grid-template-rows: auto 7px; column-gap: 6px; row-gap: 3px; align-items: center;
  padding: 5px 8px 6px; border-radius: 9px; background: rgba(7, 11, 13, .72); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
#coopTeam li > i { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h) 80% 60%); box-shadow: 0 0 0 2px #000; }
#coopTeam .ct-who { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#coopTeam .ct-who b { font: 800 14px/1.1 var(--f-ui); color: hsl(var(--h) 85% 74%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
#coopTeam li.me .ct-who b { color: var(--text); }
#coopTeam .ct-who b small { font: 700 11px/1 var(--f-ui); color: var(--text-dim); letter-spacing: .5px; }
#coopTeam .ct-who > small { font: 700 11px/1 var(--f-ui); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#coopTeam li > em { font: 400 12px/1 var(--f-num); font-style: normal; letter-spacing: .5px; padding: 3px 6px 2px; border-radius: 6px; }
#coopTeam em.down { color: #fff; background: var(--blood); animation: coopBlink .7s ease-in-out infinite; }
#coopTeam em.dead { color: var(--text-dim); background: var(--ink-2); }
#coopTeam em.pick { color: #062026; background: #7fe8ff; }
#coopTeam .ct-hp { grid-column: 1 / -1; position: relative; height: 7px; border-radius: 4px; background: #2a0d12; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); }
#coopTeam .ct-hp u { position: absolute; inset: 0; transform-origin: 0 50%; background: linear-gradient(180deg, #ff7a86, #e0283c); transition: transform .15s; }
#coopTeam .ct-hp span { display: none; }
#coopTeam li.s1 { border-color: var(--blood); }
#coopTeam li.s2 { opacity: .55; }
@keyframes coopBlink { 50% { opacity: .45; } }

#coopLevel { position: fixed; top: 18px; left: 50%; z-index: 6; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 16px;
  border-radius: 999px; pointer-events: none; background: linear-gradient(180deg, rgba(60, 44, 6, .92), rgba(26, 18, 3, .92)); border: 2px solid var(--gold);
  box-shadow: 0 0 0 2px #000, 0 0 22px rgba(255, 210, 63, .55); animation: coopPulse 1.1s ease-in-out infinite; }
#coopLevel[hidden] { display: none; }
#coopLevel b { font: 400 24px/1 var(--f-num); color: var(--gold); letter-spacing: 1px; text-shadow: var(--outline); }
#coopLevel span { font: 700 14px/1 var(--f-ui); color: var(--text); text-shadow: 0 1px 2px #000; }
@keyframes coopPulse { 50% { transform: translateX(-50%) scale(1.06); box-shadow: 0 0 0 2px #000, 0 0 34px rgba(255, 210, 63, .85); } }

#coopPick { position: fixed; top: 14px; left: 50%; z-index: 11; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); padding: 8px 14px 10px; border-radius: 12px;
  pointer-events: none; text-align: center; background: rgba(6, 26, 32, .9); border: 2px solid #7fe8ff; box-shadow: 0 0 0 2px #000, 0 0 24px rgba(127, 232, 255, .4); }
#coopPick[hidden] { display: none; }
#coopPick span { display: block; font: 700 15px/1.2 var(--f-ui); color: var(--text); }
#coopPick span b { font: 400 17px/1 var(--f-num); color: #7fe8ff; }
#coopPick s { display: block; position: relative; height: 6px; margin-top: 7px; border-radius: 3px; background: rgba(0, 0, 0, .5); overflow: hidden; }
#coopPick s u { position: absolute; inset: 0; transform-origin: 0 50%; background: #7fe8ff; }

#coopDown { position: fixed; left: 50%; top: 56%; z-index: 6; transform: translate(-50%, -50%); width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#coopDown[hidden] { display: none; }
#coopDown svg { width: 120px; height: 120px; transform: rotate(-90deg); filter: drop-shadow(0 0 10px rgba(255, 59, 78, .6)); }
#coopDown circle { fill: none; stroke-linecap: round; }
#coopDown .bg { stroke: rgba(0, 0, 0, .55); stroke-width: 9; }
#coopDown .fg { stroke: var(--blood); stroke-width: 9; transition: stroke-dashoffset .1s linear; }
#coopDown .rv { stroke: var(--gain); stroke-width: 6; }
#coopDown b { position: absolute; top: 60px; transform: translateY(-50%); font: 400 40px/1 var(--f-num); color: #fff; text-shadow: var(--outline); }
#coopDown span { font: 700 16px/1.25 var(--f-ui); color: var(--text); text-align: center; text-shadow: 0 1px 2px #000, 0 0 6px #000; }

#coopSpect, #coopRevive { position: fixed; left: 50%; bottom: 150px; z-index: 6; transform: translateX(-50%); padding: 8px 16px; border-radius: 10px; pointer-events: none;
  background: rgba(7, 11, 13, .82); border: 1px solid var(--line); font: 700 17px/1.2 var(--f-ui); color: var(--text); white-space: nowrap; text-shadow: 0 1px 2px #000; }
#coopSpect[hidden], #coopRevive[hidden] { display: none; }
#coopSpect b { color: var(--teal); }
#coopRevive { bottom: 190px; border-color: var(--gain); }
#coopRevive b { color: var(--gain); }

.ntag { flex-wrap: wrap; justify-content: center; }
.ntag .nco { flex-basis: 100%; display: block; position: relative; height: 5px; margin-top: 3px; border-radius: 3px; background: #2a0d12; overflow: hidden; }
.ntag .nco u { position: absolute; inset: 0; transform-origin: 0 50%; background: #ff5a6a; }
.ntag .nco.s1, .ntag .nco.s2 { height: auto; background: none; overflow: visible; font: 400 13px/1 var(--f-num); text-align: center; }
.ntag .nco.s1 { color: #ff6a7a; animation: coopBlink .7s ease-in-out infinite; }
.ntag .nco.s2 { color: var(--text-dim); }

/* ---------------------------------------------------------------- Rivals: lobby preview (src/net-ui.js) */
.nl-seg[data-k="mode"] button[data-v="rivals"].on { border-color: var(--blood); background: linear-gradient(180deg, rgba(255, 59, 78, .3), rgba(255, 59, 78, .08)); box-shadow: 0 0 12px rgba(255, 59, 78, .3); }
.nl-set.rvset .nl-seg button.on { border-color: var(--blood); background: linear-gradient(180deg, rgba(255, 59, 78, .3), rgba(255, 59, 78, .08)); box-shadow: 0 0 12px rgba(255, 59, 78, .3); }
.nl-cardsHow { grid-column: 2; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(60, 8, 16, .4); border: 1px solid rgba(255, 59, 78, .45); }
.nl-cardsHow .mini { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.nl-cardsHow .row { display: flex; gap: 3px; }
.nl-cardsHow .row b { width: 15px; height: 21px; border-radius: 3px; border: 1.5px solid #000; box-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.nl-cardsHow .row.small b { width: 11px; height: 14px; }
.nl-cardsHow b.u { background: linear-gradient(180deg, #7ff0dc, #128a78); }
.nl-cardsHow b.c { background: linear-gradient(180deg, #ff8a96, #9a0f22); box-shadow: 0 0 6px rgba(255, 59, 78, .7); }
.nl-cardsHow .sep { font: 800 9px/1 var(--f-ui); font-style: normal; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.nl-cardsHow p { margin: 0; font: 600 14px/1.3 var(--f-ui); color: #ffd6da; }
@media (max-width: 760px) { .nl-cardsHow { grid-column: 1; } }

/* ---------------------------------------------------------------- Rivals in game (src/rivals-ui.js) */
body.rivals #coopTeam { display: none; }
#rvList { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; width: 244px; pointer-events: none; }
#rvList[hidden] { display: none; }
#rvList .rv-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 2px 0; }
#rvList .rv-head b { font: 400 18px/1 var(--f-num); letter-spacing: 1px; color: #ff6a78; text-shadow: var(--outline); }
#rvList .rv-head span { font: 700 12px/1 var(--f-ui); color: var(--text-dim); text-shadow: 0 1px 2px #000; }
#rvList li:not(.rv-head) { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; grid-template-rows: auto 7px; column-gap: 6px; row-gap: 3px; align-items: center;
  padding: 5px 8px 6px; border-radius: 9px; background: rgba(7, 11, 13, .76); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
#rvList li > i { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--h) 80% 60%); box-shadow: 0 0 0 2px #000; }
#rvList .rv-who { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#rvList .rv-who b { font: 800 14px/1.1 var(--f-ui); color: hsl(var(--h) 85% 74%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
#rvList li.me .rv-who b { color: var(--text); }
#rvList .rv-who b small { font: 700 11px/1 var(--f-ui); color: var(--text-dim); letter-spacing: .5px; }
#rvList .rv-who > small { font: 700 11px/1 var(--f-ui); color: var(--text-dim); white-space: nowrap; }
#rvList .rv-tags { display: flex; align-items: center; gap: 3px; }
#rvList .rv-tags svg { width: 15px; height: 15px; display: block; }
#rvList .rv-crown { color: var(--gold); filter: drop-shadow(0 0 4px rgba(255, 210, 63, .7)) drop-shadow(0 1px 0 #000); }
#rvList .rv-tgt { color: var(--blood); filter: drop-shadow(0 0 4px rgba(255, 59, 78, .8)); }
#rvList .rv-ch { display: inline-flex; align-items: center; font: 400 11px/1 var(--f-num); }
#rvList .rv-ch.w { color: #7fe8ff; } #rvList .rv-ch.r { color: #c9a2ff; }
#rvList .rv-lv { font: 400 21px/1 var(--f-num); font-style: normal; color: #fff; text-shadow: var(--outline); }
#rvList .rv-lv small { font-size: 10px; margin-right: 2px; color: var(--text-dim); }
#rvList li.lead .rv-lv { color: var(--gold); }
#rvList .rv-hp { grid-column: 1 / -1; position: relative; height: 7px; border-radius: 4px; background: #2a0d12; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); }
#rvList .rv-hp u { position: absolute; inset: 0; transform-origin: 0 50%; background: linear-gradient(180deg, #ff7a86, #e0283c); transition: transform .15s; }
#rvList .rv-gh { grid-column: 1 / -1; font: 800 11px/7px var(--f-ui); letter-spacing: 2px; text-transform: uppercase; color: #a8ccff; }
#rvList li.ghost { opacity: .62; }
#rvList li.me { border-color: rgba(63, 224, 200, .55); }
#rvList li.tgt { border-color: rgba(255, 59, 78, .75); box-shadow: 0 0 12px rgba(255, 59, 78, .3), 0 2px 8px rgba(0, 0, 0, .35); }

#rvFeed { position: fixed; right: 16px; top: 430px; z-index: 4; width: min(340px, 40vw); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
.rvf { max-width: 100%; padding: 5px 10px; border-radius: 8px; background: rgba(7, 11, 13, .84); border: 1px solid var(--line); font: 700 14px/1.3 var(--f-ui); color: var(--text);
  text-shadow: 0 1px 2px #000; animation: popIn .25s var(--pop) backwards; transition: opacity 1.4s, transform 1.4s; }
.rvf b { font-weight: 800; color: hsl(var(--h, 350) 85% 72%); }
.rvf small { color: var(--text-dim); font-size: 12px; }
.rvi { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; color: #ff6a78; }
.rvi svg { width: 100%; height: 100%; display: block; }
.rvf.in { border-color: var(--blood); background: linear-gradient(90deg, rgba(100, 10, 24, .92), rgba(30, 6, 10, .9)); }
.rvf.out { border-color: rgba(255, 59, 78, .45); }
.rvf.good { border-color: var(--teal); } .rvf.good .rvi { color: var(--teal); }
.rvf.death .rvi { color: var(--text-dim); }
.rvf.sys { border-color: var(--blood); color: #ffd0d4; }
.rvf.dim { opacity: .78; font-size: 13px; }
.rvf.old { opacity: 0; transform: translateX(12px); }

#rvActive { position: fixed; left: 50%; bottom: 112px; z-index: 5; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
#rvActive[hidden] { display: none; }
.rva { position: relative; display: flex; align-items: center; gap: 6px; padding: 5px 10px 9px 6px; border-radius: 10px; animation: popIn .25s var(--pop) backwards;
  background: linear-gradient(180deg, rgba(96, 10, 22, .94), rgba(30, 6, 10, .94)); border: 2px solid var(--blood); box-shadow: 0 0 0 2px #000, 0 0 14px rgba(255, 59, 78, .45); }
.rva > svg { width: 26px; height: 26px; color: #ffe6e8; filter: drop-shadow(0 1px 1px #000); }
.rva b { font: 400 20px/1 var(--f-num); color: #fff; text-shadow: var(--outline); }
.rva span { font: 800 12px/1 var(--f-ui); letter-spacing: 1px; text-transform: uppercase; color: #ffc2c8; }
.rva s { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, .6); overflow: hidden; text-decoration: none; }
.rva s u { position: absolute; inset: 0; transform-origin: 0 50%; background: #ff6a78; text-decoration: none; }
.rva.q { border-style: dashed; padding-bottom: 5px; }
.rva.ch { padding-bottom: 5px; }
.rva.ch.w { border-color: #7fe8ff; background: linear-gradient(180deg, rgba(10, 50, 60, .94), rgba(5, 20, 26, .94)); box-shadow: 0 0 0 2px #000, 0 0 14px rgba(127, 232, 255, .4); }
.rva.ch.w span { color: #bff4ff; }
.rva.ch.r { border-color: #c9a2ff; background: linear-gradient(180deg, rgba(48, 20, 72, .94), rgba(20, 8, 30, .94)); box-shadow: 0 0 0 2px #000, 0 0 14px rgba(201, 162, 255, .4); }
.rva.ch.r span { color: #e2d0ff; }

#rvWarn { position: fixed; top: 25%; left: 50%; z-index: 12; transform: translateX(-50%); width: min(540px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(116, 8, 24, .96), rgba(40, 4, 10, .96)); border: 2px solid #ff3b4e; box-shadow: 0 0 0 2px #000, 0 0 44px rgba(255, 40, 60, .7); }
#rvWarn[hidden], #rvArrow[hidden], #rvGhost[hidden] { display: none; }
.rw-box { display: flex; align-items: center; gap: 14px; }
.rw-ico { flex: 0 0 64px; height: 64px; padding: 13px; border-radius: 50%; color: #fff0f0; background: radial-gradient(circle at 50% 30%, #ff9aa4 0%, #e0283c 34%, #5a0814 76%, #120205 100%);
  box-shadow: 0 0 0 3px #000, 0 0 0 5px #ff3b4e, 0 0 26px rgba(255, 59, 78, .85); animation: rvJitter .09s steps(2) infinite; }
.rw-ico svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 1px #000); }
@keyframes rvJitter { to { transform: translate(1px, -1px) rotate(2deg); } }
.rw-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rw-txt small { font: 800 13px/1 var(--f-ui); letter-spacing: 3px; text-transform: uppercase; color: #ff9aa4; }
.rw-txt b { font: 400 clamp(30px, 3.2vw, 42px)/1 var(--f-num); color: #fff; letter-spacing: .5px; text-shadow: var(--outline), 0 0 18px rgba(255, 60, 80, .85); }
.rw-txt span { font: 700 16px/1.2 var(--f-ui); color: #ffd6da; }
.rw-txt span em { font-style: normal; font-weight: 800; color: hsl(var(--h) 85% 74%); }
.rw-txt span small { color: #ff9aa4; font-size: 12px; }
#rvWarn s { display: block; position: relative; height: 6px; margin-top: 10px; border-radius: 3px; background: rgba(0, 0, 0, .55); overflow: hidden; text-decoration: none; }
#rvWarn s u { position: absolute; inset: 0; transform-origin: 0 50%; background: linear-gradient(90deg, #ff3b4e, #ffb0b8); text-decoration: none; }
#rvArrow { position: fixed; left: 50%; top: 50%; z-index: 6; width: 46px; height: 46px; pointer-events: none; }
#rvArrow svg { width: 100%; height: 100%; display: block; fill: #ff3b4e; stroke: #000; stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(255, 59, 78, .95)); animation: rvBeat .28s ease-in-out infinite alternate; }
@keyframes rvBeat { to { transform: scale(1.18); } }

#rvEdge { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; }
body.rv-marked #rvEdge { opacity: 1; box-shadow: inset 0 0 0 4px rgba(255, 59, 78, .55), inset 0 0 70px rgba(255, 30, 50, .3); animation: rvMark 1.2s ease-in-out infinite; }
body.rv-warned #rvEdge { opacity: 1; box-shadow: inset 0 0 140px rgba(255, 30, 50, .6); animation: rvBeat2 .25s ease-in-out infinite alternate; }
@keyframes rvMark { 50% { opacity: .45; } }
@keyframes rvBeat2 { to { opacity: .55; } }
#rvNight { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 56%, transparent 0, transparent 8%, rgba(2, 3, 8, .84) 19%, rgba(0, 0, 0, .975) 34%); }

#rvGhost { position: fixed; left: 50%; bottom: 150px; z-index: 6; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 18px 10px; border-radius: 12px;
  pointer-events: none; white-space: nowrap; background: rgba(10, 16, 30, .86); border: 2px solid #9fc8ff; box-shadow: 0 0 0 2px #000, 0 0 24px rgba(159, 200, 255, .35); }
#rvGhost > b { font: 400 22px/1 var(--f-num); letter-spacing: 4px; color: #e2eeff; text-shadow: var(--outline), 0 0 14px rgba(160, 200, 255, .75); }
#rvGhost span { font: 700 15px/1.2 var(--f-ui); color: var(--text); text-shadow: 0 1px 2px #000; }
#rvGhost span kbd { font-size: 12px; }
#rvGhost span em { font-style: normal; font-weight: 800; color: hsl(var(--h) 85% 74%); }
#rvGhost span b { font: 400 17px/1 var(--f-num); color: #ff8a94; }
#rvGhost s { display: block; position: relative; width: 100%; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .55); overflow: hidden; text-decoration: none; }
#rvGhost s u { position: absolute; inset: 0; transform-origin: 0 50%; background: linear-gradient(90deg, #9fc8ff, #ff6a78); text-decoration: none; }

.ntag b[data-lv]:not([data-lv=""])::after { content: attr(data-lv); margin-left: 6px; font-size: 13px; color: var(--gold); }

/* results */
.rvres { width: min(660px, 92vw); border-collapse: separate; border-spacing: 0 4px; margin: 2px auto 0; }
.rvres th { padding: 0 10px 2px; font: 800 12px/1.1 var(--f-ui); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); text-align: center; }
.rvres td { padding: 8px 10px; background: rgba(26, 38, 44, .78); text-align: center; font: 400 21px/1 var(--f-num); color: #fff; text-shadow: 0 2px 0 #000; }
.rvres td:first-child { border-radius: 9px 0 0 9px; } .rvres td:last-child { border-radius: 0 9px 9px 0; }
.rvres td.pl { width: 46px; font-size: 26px; color: var(--text-dim); }
.rvres td.nm { text-align: left; font: 800 17px/1.1 var(--f-ui); color: hsl(var(--h) 85% 74%); white-space: nowrap; }
.rvres td.nm i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: hsl(var(--h) 80% 60%); box-shadow: 0 0 0 2px #000; }
.rvres td.nm small { font: 700 11px var(--f-ui); color: var(--text-dim); letter-spacing: .5px; }
.rvres td.nm em { margin-left: 6px; font: 800 10px var(--f-ui); font-style: normal; letter-spacing: 1.5px; text-transform: uppercase; color: #a8ccff; }
.rvres tr.gold td { background: rgba(66, 54, 20, .88); }
.rvres tr.gold td.pl { background: linear-gradient(90deg, rgba(255, 210, 63, .5), rgba(66, 54, 20, .88)); }
.rvres tr.gold td.pl { color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 210, 63, .7); }
.rvres tr.silver td.pl { color: #e0e8f0; } .rvres tr.bronze td.pl { color: #e0a070; }
.rvres tr.me td { box-shadow: inset 0 1px 0 rgba(63, 224, 200, .6), inset 0 -1px 0 rgba(63, 224, 200, .6); }
