/* ORAILIX Nexus — HUD and overlays. The world itself is drawn in WebGL
   (assets/js/nexus); this file only styles the DOM layer on top of it. */

:root {
  --navy: #050719;
  --ink: #0a0e26;
  --blue: #0066ff;
  --cyan: #41d3ff;
  --pink: #ff5fb6;
  --violet: #6a4bff;
  --amber: #ffb454;
  --mint: #41ffae;
  --danger: #ff3b6b;
  --text: #e8eeff;
  --dim: rgba(216, 227, 255, 0.62);
  --line: rgba(120, 160, 255, 0.2);
  --glass: rgba(8, 12, 36, 0.72);
  --font: "DM Sans", "Figtree", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--navy); color: var(--text); font-family: var(--font); overflow: hidden; overscroll-behavior: none; }
body { -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; color: inherit; }
kbd {
  display: inline-block; min-width: 22px; padding: 2px 6px; margin: 0 2px; text-align: center;
  font: 700 11px/1.4 var(--mono); color: var(--text);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-bottom-width: 2px; border-radius: 5px;
}

#nx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; outline: none; }
#nx-vignette {
  position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.35s ease;
  background: radial-gradient(ellipse at center, rgba(255, 40, 80, 0) 45%, rgba(255, 40, 80, 0.55) 100%);
}
#nx-vignette.hit { opacity: 1; transition: none; }
#nx-vignette.low { opacity: 0.45; }

/* ------------------------------- top bar ------------------------------- */
#nx-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  pointer-events: none;
}
#nx-top > * { pointer-events: auto; }
.nx-spacer { flex: 1; pointer-events: none !important; }
.nx-brand {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px);
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 13px; letter-spacing: 0.14em;
}
.nx-brand b { font-weight: 500; letter-spacing: 0.04em; color: var(--cyan); }
.nx-brand-dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--pink)); box-shadow: 0 0 12px var(--cyan); }
.nx-zone {
  font: 700 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan);
  padding: 9px 12px; border-left: 2px solid var(--cyan); background: linear-gradient(90deg, rgba(65, 211, 255, 0.14), transparent);
}
.nx-zone.danger { color: var(--danger); border-color: var(--danger); background: linear-gradient(90deg, rgba(255, 59, 107, 0.18), transparent); }
.nx-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; white-space: nowrap;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px);
  font-size: 12.5px; font-weight: 500; color: var(--dim);
}
.nx-pill b { color: var(--text); font-family: var(--mono); }
.nx-btn { cursor: pointer; color: var(--text); transition: border-color 0.15s, background 0.15s, color 0.15s; }
.nx-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.nx-btn.active { background: rgba(65, 211, 255, 0.16); border-color: rgba(65, 211, 255, 0.6); color: var(--cyan); }
.nx-btn.off { color: var(--dim); }
#nx-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
#nx-status-dot.live { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
#nx-status-dot.down { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* ------------------------------ wave banner ------------------------------ */
#nx-wave {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%) translateY(-10px); z-index: 15;
  min-width: 260px; padding: 9px 18px 10px; text-align: center; pointer-events: none;
  background: var(--glass); border: 1px solid rgba(255, 59, 107, 0.45); border-radius: 12px; backdrop-filter: blur(10px);
  font: 700 12.5px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: #ffd0dc;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
#nx-wave.show { opacity: 1; transform: translateX(-50%); }
#nx-boss { display: none; height: 7px; margin-top: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
#nx-wave.boss #nx-boss { display: block; }
#nx-wave.boss { min-width: min(520px, 80vw); }
#nx-boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--danger), var(--pink)); transition: width 0.15s linear; }

#nx-banner {
  position: fixed; left: 0; right: 0; top: 16%; z-index: 14; text-align: center; pointer-events: none;
  opacity: 0; transform: scale(0.94); transition: opacity 0.3s ease, transform 0.3s ease;
}
#nx-banner.show { opacity: 1; transform: none; }
#nx-banner-title { font-size: clamp(28px, 4.6vw, 60px); font-weight: 800; letter-spacing: 0.06em; line-height: 1; text-transform: uppercase; color: #fff; text-shadow: 0 0 34px rgba(255, 59, 107, 0.85), 0 2px 0 rgba(0, 0, 0, 0.4); }
#nx-banner.calm #nx-banner-title { text-shadow: 0 0 34px rgba(65, 211, 255, 0.85), 0 2px 0 rgba(0, 0, 0, 0.4); }
#nx-banner-sub { margin-top: 12px; font: 500 15px/1.3 var(--mono); letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }

/* ------------------------------ leaderboard ------------------------------ */
#nx-score {
  position: fixed; top: 62px; right: 14px; z-index: 15; width: 250px; padding: 12px 12px 10px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px);
  opacity: 0; transform: translateX(10px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
#nx-score.show { opacity: 1; transform: none; }
.nx-score-head { display: flex; justify-content: space-between; font: 700 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 9px; }
.nx-score-row { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 7px; font-size: 13px; }
.nx-score-row.me { background: rgba(65, 211, 255, 0.1); }
.nx-score-row .rank { font: 700 11px var(--mono); color: var(--dim); }
.nx-score-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-score-row .kills { font: 700 13px var(--mono); }
.nx-score-row .streak { font: 500 11px var(--mono); color: var(--amber); min-width: 26px; text-align: right; }

/* --------------------------------- chat --------------------------------- */
#nx-chat { position: fixed; left: 14px; bottom: 14px; z-index: 15; width: min(340px, 44vw); pointer-events: none; }
#nx-chat-log {
  max-height: 190px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; margin-bottom: 8px;
  mask-image: linear-gradient(to bottom, transparent, #000 34%); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 34%);
}
.nx-msg { font-size: 13px; line-height: 1.35; color: var(--text); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); word-break: break-word; user-select: text; -webkit-user-select: text; }
.nx-msg b { font-weight: 700; margin-right: 6px; }
.nx-msg.sys { color: var(--dim); font-size: 12px; }
#nx-chat-form { pointer-events: auto; }
#nx-chat-input {
  width: 100%; padding: 10px 14px; font: 500 13px var(--font); color: var(--text); outline: none;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(10px);
  user-select: text; -webkit-user-select: text;
}
#nx-chat-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(65, 211, 255, 0.15); }
#nx-chat-input::placeholder { color: var(--dim); }

/* ---------------------------------- hud ---------------------------------- */
#nx-hud {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 15; width: min(360px, 60vw);
  padding: 10px 14px 11px; pointer-events: none;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px);
}
.nx-hud-row { display: flex; align-items: center; gap: 10px; }
.nx-hud-sub { margin-top: 7px; }
.nx-hud-label { width: 36px; font: 700 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--dim); }
.nx-hp, .nx-dash { flex: 1; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.nx-dash { height: 4px; }
#nx-hp-fill { height: 100%; width: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--mint), var(--cyan)); transition: width 0.12s linear; }
#nx-hp-fill.warn { background: linear-gradient(90deg, var(--amber), #ffd98a); }
#nx-hp-fill.crit { background: linear-gradient(90deg, var(--danger), var(--pink)); }
#nx-dash-fill { height: 100%; width: 100%; background: var(--cyan); transform-origin: left; }
#nx-hp-num, #nx-kills { width: 36px; text-align: right; font: 700 14px/1 var(--mono); }
#nx-kills { font-size: 12px; color: var(--amber); }
#nx-kills::before { content: "✕ "; color: var(--dim); }
#nx-buffs { display: flex; gap: 6px; justify-content: center; position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); }
.nx-buff { padding: 5px 10px; border-radius: 999px; background: var(--glass); border: 1px solid; font: 700 11px/1 var(--mono); white-space: nowrap; }

/* ----------------------- first person / run HUD ----------------------- */
#nx-cross { position: fixed; left: 50%; top: 50%; width: 0; height: 0; z-index: 12; pointer-events: none; display: none; --gap: 6px; }
#nx-cross.show { display: block; }
#nx-cross i { position: absolute; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, 0.9); transition: transform 0.08s; }
#nx-cross i:nth-child(1) { width: 2px; height: 9px; left: -1px; top: calc(-9px - var(--gap)); }
#nx-cross i:nth-child(2) { width: 2px; height: 9px; left: -1px; top: var(--gap); }
#nx-cross i:nth-child(3) { height: 2px; width: 9px; top: -1px; left: calc(-9px - var(--gap)); }
#nx-cross i:nth-child(4) { height: 2px; width: 9px; top: -1px; left: var(--gap); }
#nx-cross b { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; opacity: 0; transform: rotate(45deg) scale(0.7);
  background: linear-gradient(#fff, #fff) center / 2px 100% no-repeat, linear-gradient(#fff, #fff) center / 100% 2px no-repeat; }
#nx-cross.hit b { opacity: 0.95; transform: rotate(45deg) scale(1); }
#nx-cross.kill b { opacity: 1; transform: rotate(45deg) scale(1.25); filter: drop-shadow(0 0 4px var(--danger)) brightness(1) sepia(1) saturate(20) hue-rotate(-40deg); }
#nx-lock {
  position: fixed; left: 50%; top: 58%; transform: translateX(-50%); z-index: 17; display: none; pointer-events: none;
  padding: 10px 16px; border-radius: 999px; background: rgba(8, 12, 36, 0.92); border: 1px solid rgba(65, 211, 255, 0.5); font-size: 13px; font-weight: 600;
}
#nx-lock.show { display: block; }
#nx-run { display: none; }
#nx-run.show { display: block; }
#nx-points {
  position: fixed; left: 14px; bottom: 262px; z-index: 15; display: flex; align-items: baseline; gap: 10px; padding: 8px 14px; pointer-events: none;
  background: var(--glass); border: 1px solid rgba(255, 210, 74, 0.45); border-radius: 12px; backdrop-filter: blur(10px);
}
#nx-points b { font: 700 24px/1 var(--mono); color: #ffd24a; }
.nx-pts-float { position: absolute; left: 100%; bottom: 8px; margin-left: 10px; font: 700 15px var(--mono); color: #ffd24a; white-space: nowrap; animation: nx-pts 0.9s ease-out forwards; }
.nx-pts-float.neg { color: var(--danger); }
@keyframes nx-pts { from { opacity: 1; transform: translate(0, 0); } to { opacity: 0; transform: translate(var(--dx, 10px), -34px); } }
#nx-gun {
  position: fixed; right: 198px; bottom: 14px; z-index: 15; min-width: 232px; padding: 8px 10px; pointer-events: none;
  display: grid; gap: 2px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px);
}
.nx-slot { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; padding: 4px 6px; border-radius: 9px; opacity: 0.5; }
.nx-slot.active { opacity: 1; background: rgba(255, 255, 255, 0.07); }
.nx-slot .nm { text-align: left; font-size: 14px; font-weight: 800; line-height: 1.1; }
.nx-slot .nm small { display: block; font: 500 9.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.nx-slot .am { font: 700 17px/1 var(--mono); }
.nx-slot .am i { font-style: normal; font-size: 11px; color: var(--dim); }
.nx-slot .am.low { color: var(--danger); }
.nx-slot:not(.active) .am { font-size: 12px; }
.nx-gun-tip { margin-top: 4px; font: 500 10.5px var(--mono); color: var(--dim); text-align: center; }
#nx-perks { display: flex; gap: 5px; justify-content: flex-end; position: absolute; right: 0; bottom: calc(100% + 8px); }
.nx-perk { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid; background: var(--glass); font-size: 15px; }
.nx-buff.team { background: rgba(40, 30, 0, 0.75); }
body.nx-meet-docked #nx-gun { right: 628px; }
body.nx-touch #nx-gun { right: 12px; bottom: 388px; min-width: 0; }
body.nx-touch #nx-points { left: 12px; bottom: 236px; }

/* -------------------------------- minimap -------------------------------- */
#nx-map-wrap { position: fixed; right: 14px; bottom: 14px; z-index: 15; width: 170px; height: 170px; border-radius: 50%; overflow: hidden;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); cursor: pointer; transition: width 0.25s, height 0.25s; }
#nx-map-wrap.big { width: min(440px, 80vw); height: min(440px, 80vw); }
#nx-map { width: 100%; height: 100%; display: block; }

/* ----------------------------- interact prompt ----------------------------- */
#nx-prompt {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%) translateY(12px); z-index: 16;
  display: flex; align-items: center; gap: 12px; max-width: min(560px, 92vw); padding: 10px 14px 10px 10px; text-align: left; cursor: pointer;
  background: rgba(8, 12, 36, 0.9); border: 1px solid rgba(65, 211, 255, 0.5); border-radius: 14px; backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px -10px rgba(65, 211, 255, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s;
}
#nx-prompt.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.nx-prompt-key { flex: none; width: 46px; height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--cyan); color: var(--navy); font: 800 19px/1 var(--mono); box-shadow: 0 3px 0 #1c8fb5; animation: nx-key 1.1s ease-in-out infinite; }
.nx-prompt-key small { font: 700 8px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 3px; opacity: 0.75; }
@keyframes nx-key { 0%, 100% { transform: translateY(0); box-shadow: 0 3px 0 #1c8fb5; } 50% { transform: translateY(2px); box-shadow: 0 1px 0 #1c8fb5; } }
/* in first person the prompt sits just under the crosshair, where you are looking */
body.nx-fp #nx-prompt { bottom: auto; top: 58%; }
body.nx-fp #nx-lock { top: 70%; }
.nx-prompt-body { display: flex; flex-direction: column; min-width: 0; }
.nx-prompt-body b { font-size: 14px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-prompt-body small { font: 500 10.5px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); margin-top: 3px; }
.nx-prompt-hint { flex: none; font: 700 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); padding-left: 6px; }

#nx-toast {
  position: fixed; left: 50%; top: 122px; transform: translateX(-50%) translateY(-8px); z-index: 17; pointer-events: none;
  padding: 9px 16px; border-radius: 999px; background: rgba(8, 12, 36, 0.92); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; opacity: 0; transition: opacity 0.2s, transform 0.2s;
}
#nx-toast.show { opacity: 1; transform: translateX(-50%); }
#nx-dead {
  position: fixed; inset: 0; z-index: 13; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(40, 0, 16, 0.25), rgba(20, 0, 10, 0.75));
}
#nx-dead.show { display: flex; }
#nx-dead b { font-size: clamp(30px, 5vw, 60px); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
#nx-dead span { font: 500 14px var(--mono); letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }

/* --------------------------------- cards --------------------------------- */
#nx-join, #nx-help, #nx-over, #nx-fallback {
  position: fixed; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 5, 20, 0.6); backdrop-filter: blur(7px);
}
#nx-join { display: flex; backdrop-filter: blur(2px); background: radial-gradient(ellipse at 50% 40%, rgba(3, 5, 20, 0.25), rgba(3, 5, 20, 0.82)); }
/* before joining, only the world and the join card are visible */
body.nx-pre #nx-top > :not(.nx-brand), body.nx-pre #nx-chat, body.nx-pre #nx-hud, body.nx-pre #nx-map-wrap { display: none; }
#nx-join.hide { display: none; }
#nx-help.show, #nx-over.show, #nx-fallback.show { display: flex; }
.nx-card {
  width: min(500px, 100%); padding: 30px 30px 26px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(14, 20, 54, 0.96), rgba(7, 10, 30, 0.96)); border: 1px solid var(--line);
  box-shadow: 0 30px 90px -20px rgba(0, 102, 255, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.nx-eyebrow { font: 700 10.5px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan); margin-bottom: 14px; }
.nx-card h1, .nx-card h2 { margin: 0 0 12px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.nx-card h1 { font-size: 40px; background: linear-gradient(100deg, #fff 30%, var(--cyan) 70%, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-card h2 { font-size: 28px; }
.nx-card p { margin: 0 0 18px; font-size: 14.5px; line-height: 1.55; color: var(--dim); }
.nx-label { display: block; margin: 14px 0 7px; font: 700 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
#nx-name {
  width: 100%; padding: 13px 15px; font: 500 15px var(--font); color: var(--text); outline: none;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; user-select: text; -webkit-user-select: text;
}
#nx-name:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(65, 211, 255, 0.15); }
.nx-swatches { display: flex; gap: 10px; }
.nx-swatch { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.12s; }
.nx-swatch:hover { transform: scale(1.08); }
.nx-swatch.sel { border-color: #fff; box-shadow: 0 0 18px currentColor; }
.nx-primary {
  display: inline-block; padding: 13px 22px; border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
  font: 700 15px var(--font); color: #fff; background: linear-gradient(100deg, var(--blue), #3a7bff 55%, var(--violet));
  box-shadow: 0 10px 30px -8px rgba(0, 102, 255, 0.8); transition: transform 0.12s, filter 0.12s;
}
.nx-primary:hover { transform: translateY(-1px); filter: brightness(1.12); }
.nx-primary:disabled { filter: grayscale(0.6) brightness(0.7); cursor: progress; transform: none; }
#nx-enter { width: 100%; margin-top: 22px; }
.nx-ghost { padding: 13px 18px; border-radius: 12px; cursor: pointer; background: transparent; border: 1px solid var(--line); font: 600 14px var(--font); color: var(--text); }
.nx-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.nx-row { display: flex; gap: 10px; flex-wrap: wrap; }
.nx-load { margin-top: 12px; text-align: center; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); min-height: 14px; }
.nx-keys { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 9px; font-size: 13.5px; color: var(--dim); }
.nx-keys li { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: baseline; line-height: 1.5; }
.nx-keys li span { color: var(--text); white-space: nowrap; }
.nx-note { font-size: 13px !important; padding: 10px 12px; border-radius: 10px; background: rgba(65, 211, 255, 0.07); border: 1px solid rgba(65, 211, 255, 0.18); }
#nx-over h2 { font-size: 54px; background: linear-gradient(100deg, #fff, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#nx-over .nx-eyebrow { color: var(--danger); }

/* --------------------------- reader + meeting --------------------------- */
#nx-reader { position: fixed; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center; padding: 3vh 3vw; background: rgba(3, 5, 20, 0.7); backdrop-filter: blur(8px); }
#nx-reader.show { display: flex; }
.nx-reader-card, .nx-meet-card {
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  background: #0a0c1a; border: 1px solid rgba(65, 211, 255, 0.3); box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.8);
}
.nx-reader-card { width: min(1180px, 100%); height: 100%; border-radius: 16px; }
.nx-reader-head, .nx-meet-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--text);
  background: rgba(65, 211, 255, 0.07); border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.nx-reader-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); flex: none; }
#nx-reader-title, #nx-meet-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-reader-head a, .nx-reader-head button, .nx-meet-head a, .nx-meet-head button {
  flex: none; padding: 5px 11px; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.15); font: 500 12px var(--font); color: var(--text);
}
.nx-reader-head a:hover, .nx-reader-head button:hover, .nx-meet-head a:hover, .nx-meet-head button:hover { border-color: var(--cyan); color: var(--cyan); }
.nx-meet-head button.active { background: rgba(65, 211, 255, 0.15); color: var(--cyan); border-color: rgba(65, 211, 255, 0.5); }
#nx-reader-frame, #nx-meet iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
#nx-meet iframe, #nx-meet-slot { background: #000; }

#nx-meet { position: fixed; z-index: 28; display: none; pointer-events: none; }
#nx-meet.open { display: block; }
#nx-meet.dock { top: 0; right: 0; bottom: 0; }
#nx-meet.dock .nx-meet-card { pointer-events: auto; width: min(430px, 96vw); height: 100vh; height: 100dvh; border-radius: 16px 0 0 16px; border-right: 0; }
#nx-meet.center { inset: 0; display: none; align-items: center; justify-content: center; background: rgba(3, 5, 20, 0.8); backdrop-filter: blur(6px); pointer-events: auto; }
#nx-meet.center.open { display: flex; }
#nx-meet.center .nx-meet-card { width: min(1100px, 96vw); height: min(720px, 92vh); border-radius: 16px; }
body.nx-meet-docked #nx-score { right: 444px; }
body.nx-meet-docked #nx-map-wrap { right: 444px; }

/* ---------------------------------- touch ---------------------------------- */
#nx-joy, #nx-fire, #nx-dash, #nx-melee { display: none; }
body.nx-touch #nx-joy {
  display: block; position: fixed; left: 22px; bottom: 96px; z-index: 18; width: 124px; height: 124px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); touch-action: none;
}
.nx-joy-thumb { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(65, 211, 255, 0.5); border: 1px solid var(--cyan); }
body.nx-touch #nx-fire, body.nx-touch #nx-dash {
  display: block; position: fixed; right: 22px; z-index: 18; border-radius: 50%; touch-action: none;
  font: 800 12px var(--mono); letter-spacing: 0.1em; color: #fff;
}
body.nx-touch #nx-fire { bottom: 200px; width: 92px; height: 92px; background: rgba(255, 59, 107, 0.35); border: 1px solid var(--danger); }
body.nx-touch #nx-dash { bottom: 304px; right: 34px; width: 64px; height: 64px; background: rgba(65, 211, 255, 0.25); border: 1px solid var(--cyan); }
/* on phones the chat and the map move to the top, clear of the thumbs */
body.nx-touch #nx-chat { top: 58px; bottom: auto; left: 12px; width: min(280px, 58vw); display: flex; flex-direction: column-reverse; }
body.nx-touch #nx-chat-log { max-height: 96px; margin: 8px 0 0; justify-content: flex-start; mask-image: none; -webkit-mask-image: none; }
body.nx-touch #nx-chat-input { padding: 8px 12px; font-size: 12px; }
body.nx-touch #nx-map-wrap { top: 58px; bottom: auto; right: 12px; width: 104px; height: 104px; }
body.nx-touch #nx-map-wrap.big { width: min(360px, 90vw); height: min(360px, 90vw); }
body.nx-touch #nx-score { top: 172px; right: 12px; width: 200px; }
body.nx-touch #nx-hud { width: min(300px, 52vw); }
body.nx-touch #nx-wave { top: 172px; }
body.nx-touch #nx-prompt { bottom: 96px; }
body.nx-touch .nx-prompt-key { font-size: 0; }
body.nx-touch .nx-prompt-key small { font-size: 0; margin: 0; }
body.nx-touch .nx-prompt-key::after { content: "TAP"; font-size: 12px; }

@media (max-width: 900px) {
  #nx-btn-pvp, #nx-btn-sound, .nx-status span { display: none; }
  .nx-brand b, .nx-zone { display: none; }
  #nx-map-wrap { width: 118px; height: 118px; }
  #nx-score { width: 210px; }
  #nx-hud { bottom: 12px; }
}
@media (max-width: 1100px) {
  #nx-gun { right: 14px; bottom: 196px; }
  #nx-points { bottom: 230px; }
}
@media (max-width: 560px) {
  #nx-top { gap: 6px; padding: 10px; }
  .nx-pill, .nx-brand { padding: 7px 10px; font-size: 12px; }
  #nx-btn-help, .nx-status { display: none; }
}
@media (max-width: 640px) {
  #nx-meet.dock { top: auto; left: 0; right: 0; bottom: 0; }
  #nx-meet.dock .nx-meet-card { width: 100%; height: 55vh; border-radius: 16px 16px 0 0; border-right: 1px solid rgba(65, 211, 255, 0.3); }
  body.nx-meet-docked #nx-score, body.nx-meet-docked #nx-map-wrap { right: 14px; }
  .nx-card { padding: 24px 20px 20px; }
  .nx-card h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}

/* gadgets (duck / deadline extension / sentry) under the weapon slots */
#nx-items { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.nx-item { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--c); background: var(--glass); font-size: 14px; color: var(--c); }
.nx-item b { font: 700 12px var(--mono); }
.nx-item kbd { font-size: 10px; }
.nx-item.none { opacity: 0.4; border-color: rgba(255,255,255,0.2); }

/* a RUN-0 log, read on a terminal */
#nx-log { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; background: rgba(3,5,18,0.72); backdrop-filter: blur(6px); }
#nx-log.show { display: flex; }
.nx-logcard { max-width: 640px; width: calc(100% - 32px); border-color: rgba(143,180,255,0.35); }
#nx-log-body { margin: 14px 0 18px; padding: 16px 18px; background: #04071c; border: 1px solid rgba(143,180,255,0.18); border-radius: 10px; color: #b9c8ff; font: 500 13px/1.6 var(--mono); white-space: pre-wrap; max-height: 52vh; overflow: auto; }
#nx-log .nx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#nx-log-foot { font: 500 11px var(--mono); color: var(--dim); }

/* touch: melee button, and the gadget chips become buttons */
body.nx-touch #nx-melee { display: block; position: fixed; z-index: 18; border-radius: 50%; touch-action: none; font: 800 12px var(--mono); letter-spacing: 0.1em; color: #fff;
  bottom: 228px; right: 128px; width: 64px; height: 64px; background: rgba(255, 180, 84, 0.25); border: 1px solid #ffb454; }
#nx-items { pointer-events: auto; }
.nx-item { cursor: pointer; }
body.nx-touch .nx-item { padding: 8px 12px; font-size: 17px; }
