/* HEXBAZAAR · House of SYN — dens shell law (v=dens3)
 * Night-market OS tokens. Every dens page inherits these.
 */
:root {
  --hx-shell-h: 48px;
  --hx-strip-h: 28px;
  /* palette */
  --hx-void: #05040a;
  --hx-bg: #05040a;
  --hx-bg2: #0b0910;
  --hx-panel: #100c18;
  --hx-panel2: #16101f;
  --hx-line: #3a2a55;
  --hx-line2: #5c4080;
  --hx-text: #f4ecff;
  --hx-muted: #9a88b8;
  --hx-faint: #6a5a82;
  --hx-gold: #ffd56a;
  --hx-cyan: #5ce1ff;
  --hx-pink: #ff6bcb;
  --hx-lime: #7dffb3;
  --hx-pri: #9966ff;
  --hx-red: #c8102e;
  --hx-font-px: 'Press Start 2P', monospace;
  --hx-font-ui: 'IBM Plex Sans', system-ui, sans-serif;
  /* dens plate helpers */
  --hx-plate-shadow: 4px 4px 0 #05040a;
  --hx-bubble-z: 99980;
}

/* Optional page surfaces that opt into tokens */
body.hex-has-shell {
  --bg: var(--hx-bg2);
  --panel: var(--hx-panel);
  --line: var(--hx-line);
  --line2: var(--hx-line2);
  --text: var(--hx-text);
  --muted: var(--hx-muted);
  --gold: var(--hx-gold);
  --cyan: var(--hx-cyan);
  --pink: var(--hx-pink);
  --lime: var(--hx-lime);
}

#hexShell {
  position: sticky;
  top: 0;
  z-index: 9000;
  height: var(--hx-shell-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  background: rgba(8, 6, 14, 0.94);
  border-bottom: 1px solid var(--hx-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--hx-font-ui);
  color: var(--hx-text);
  box-sizing: border-box;
}
#hexShell *, #hexShell *::before, #hexShell *::after { box-sizing: border-box; }

#hexShell .hx-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--hx-gold);
  font-family: var(--hx-font-px);
  font-size: 8px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  padding: 6px 4px;
  text-shadow: 0 0 12px rgba(255, 213, 106, 0.25);
}
#hexShell .hx-brand:hover { color: #ffe9a8; }
#hexShell .hx-brand .hx-mark {
  width: 10px; height: 10px;
  background: linear-gradient(135deg, var(--hx-pri), var(--hx-cyan));
  clip-path: polygon(50% 0%, 100% 38%, 80% 100%, 20% 100%, 0% 38%);
  flex-shrink: 0;
}
#hexShell .hx-brand .hx-home-hint {
  font-family: var(--hx-font-ui);
  font-size: 10px;
  color: var(--hx-muted);
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 2px;
}

#hexShell .hx-primary {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#hexShell .hx-primary::-webkit-scrollbar { display: none; }

#hexShell a.hx-link {
  flex-shrink: 0;
  text-decoration: none;
  color: var(--hx-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color .12s, background .12s, border-color .12s;
}
#hexShell a.hx-link:hover {
  color: var(--hx-cyan);
  background: rgba(92, 225, 255, 0.06);
}
#hexShell a.hx-link.on {
  color: var(--hx-gold);
  border-color: rgba(255, 213, 106, 0.35);
  background: rgba(255, 213, 106, 0.08);
}
#hexShell a.hx-link.hot { color: var(--hx-pri); }
#hexShell a.hx-link.hot.on {
  color: #e0d0ff;
  border-color: rgba(153, 102, 255, 0.45);
  background: rgba(153, 102, 255, 0.12);
}

/* Who — shell chip */
#hexShell .hx-who-wrap {
  flex-shrink: 0;
  margin-left: 4px;
}
#hexShell .hx-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--hx-cyan);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px 4px 4px;
  border: 1px solid rgba(92, 225, 255, 0.28);
  border-radius: 999px;
  background: rgba(92, 225, 255, 0.07);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hexShell .hx-who img.hx-who-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 1px solid rgba(92, 225, 255, 0.35);
  background: #0a0810;
  flex-shrink: 0;
}
#hexShell .hx-who:hover {
  border-color: rgba(92, 225, 255, 0.55);
  background: rgba(92, 225, 255, 0.12);
  color: #b8f4ff;
}
#hexShell .hx-who .hx-who-at {
  overflow: hidden;
  text-overflow: ellipsis;
}
#hexShell .hx-who .hex-badge {
  font-size: 10px;
  color: var(--hx-gold);
  text-shadow: 0 0 8px rgba(255, 213, 106, 0.45);
}
#hexShell .hx-who .hex-badge.admin { color: var(--hx-gold); }
#hexShell .hx-who .hex-badge.verified { color: var(--hx-cyan); }
#hexShell .hx-who.hx-who-in {
  color: var(--hx-muted);
  border-color: var(--hx-line);
  background: transparent;
  font-weight: 600;
  padding: 5px 9px;
}
#hexShell .hx-who.hx-who-in:hover {
  color: var(--hx-gold);
  border-color: rgba(255, 213, 106, 0.4);
}

#hexShell .hx-more-wrap {
  position: relative;
  flex-shrink: 0;
  margin-left: 2px;
}
#hexShell .hx-more-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--hx-muted);
  background: transparent;
  border: 1px solid var(--hx-line);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
#hexShell .hx-more-btn:hover,
#hexShell .hx-more-wrap.open .hx-more-btn {
  color: var(--hx-text);
  border-color: var(--hx-line2);
}
#hexShell .hx-more-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 176px;
  background: #120c1c;
  border: 1px solid var(--hx-line2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  padding: 6px;
  z-index: 9100;
}
#hexShell .hx-more-wrap.open .hx-more-menu { display: block; }
#hexShell .hx-more-menu a {
  display: block;
  text-decoration: none;
  color: var(--hx-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 4px;
}
#hexShell .hx-more-menu a:hover { color: var(--hx-cyan); background: rgba(92, 225, 255, 0.06); }
#hexShell .hx-more-menu a.on { color: var(--hx-gold); }
#hexShell .hx-more-menu .hx-sep {
  height: 1px;
  background: var(--hx-line);
  margin: 4px 6px;
}
#hexShell .hx-more-menu .hx-own {
  padding: 8px 10px 4px;
  font-size: 10px;
  letter-spacing: 0.4px;
  color: var(--hx-muted);
  font-family: var(--hx-font-ui);
}

/* ── LIVE DENS STRIP (under shell) ── */
#hexDensStrip {
  position: sticky;
  top: var(--hx-shell-h);
  z-index: 8990;
  height: var(--hx-strip-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: rgba(6, 4, 12, 0.92);
  border-bottom: 1px solid rgba(58, 42, 85, 0.65);
  font-family: var(--hx-font-ui);
  font-size: 11px;
  color: var(--hx-muted);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
#hexDensStrip::-webkit-scrollbar { display: none; }
#hexDensStrip .hx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hx-lime);
  box-shadow: 0 0 8px rgba(125, 255, 179, 0.55);
  display: inline-block;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}
#hexDensStrip b {
  color: var(--hx-faint);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 4px;
}
#hexDensStrip .hx-strip-den {
  color: var(--hx-gold);
  font-weight: 700;
}
#hexDensStrip .hx-strip-who { color: var(--hx-cyan); font-weight: 600; }
#hexDensStrip .hx-strip-speech {
  color: var(--hx-pink);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hexDensStrip .hx-strip-end {
  margin-left: auto;
  font-family: var(--hx-font-px);
  font-size: 7px;
  color: var(--hx-faint);
  letter-spacing: 0.04em;
}

body.hex-has-shell.hex-has-strip {
  /* strip is sticky in flow after shell */
}

/* Lounge: shell stays fixed so chat uses remaining height */
body.hex-page-lounge #hexShell {
  position: fixed;
  left: 0; right: 0; top: 0;
}
body.hex-page-lounge #hexDensStrip {
  position: fixed;
  left: 0; right: 0;
  top: var(--hx-shell-h);
}
body.hex-page-lounge .shell {
  padding-top: calc(var(--hx-shell-h) + var(--hx-strip-h));
  height: 100%;
  height: 100dvh;
  box-sizing: border-box;
}

/* Dens plate chrome helpers (opt-in classes) */
.hx-plate {
  border: 2px solid var(--hx-line2);
  background: var(--hx-panel);
  box-shadow: var(--hx-plate-shadow);
}
.hx-label-px {
  font-family: var(--hx-font-px);
  font-size: 8px;
  color: var(--hx-gold);
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  #hexShell .hx-brand .hx-home-hint { display: none; }
  #hexShell a.hx-link { padding: 7px 8px; font-size: 11px; }
  #hexShell .hx-brand { font-size: 7px; }
  #hexShell .hx-who { max-width: 110px; font-size: 10px; }
  #hexDensStrip .hx-strip-speech { max-width: 100px; }
  #hexDensStrip .hx-strip-end { display: none; }
}
