/* ========== GLOBAL ========== */

.bs-body {
  margin: 0;
  min-height: 100vh;
  width: 100vw;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  background: radial-gradient(circle at top, #0b1220 0%, #020617 55%, #000 100%);
  color: #e2f3ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== SMALL TERMINAL SHELL (HOME + ENTRY) ========== */

.bs-shell {
  width: min(520px, 100% - 2rem);
  padding: 1.5rem 1.75rem;
  background: rgba(5, 10, 20, 0.94);
  border-radius: 0.75rem;
  border: 1px solid #1e293b;
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.15);
}

.bs-header {
  display: flex;
  gap: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
}

.bs-tag {
  color: #67e8f9;
}

.bs-node {
  color: #fb7185;
  text-shadow: 0 0 4px rgba(248, 113, 113, 0.7);
}

.bs-content p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

.bs-trace-group {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bs-trace-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.bs-link {
  text-decoration: none;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #22c55e;
  color: #bbf7d0;
  background: rgba(21, 128, 61, 0.16);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-size: 0.78rem;
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.bs-link:hover {
  background: rgba(22, 163, 74, 0.32);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.55);
  transform: translateY(-1px);
}

.bs-hint {
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: #64748b;
}

/* "submit" rows on puzzle page */
.bs-submit-row {
  margin: 0.8rem 0;
  display: inline-flex;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.8);
  font-size: 0.8rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.8);
}

/* ========== FULLSCREEN LIVE HUB ========== */

.bs-portal {
  position: relative;
  box-sizing: border-box;
  height: 100vh;
  width: 100vw;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
  overflow: hidden;
}

/* override centering for this page */
.bs-portal .bs-header-hub {
  margin-bottom: 0.4rem;
}

/* glitch overlays */
.bs-portal::before,
.bs-portal::after {
  content: "";
  position: absolute;
  inset: -10%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.07;
  background-image: repeating-linear-gradient(
      180deg,
      #22c55e 0,
      #22c55e 1px,
      transparent 1px,
      transparent 3px
    );
  animation: bs-glitch-scan 6s infinite linear;
}

.bs-portal::after {
  opacity: 0.05;
  background-image: repeating-linear-gradient(
      90deg,
      #38bdf8 0,
      #38bdf8 1px,
      transparent 1px,
      transparent 4px
    );
  animation: bs-glitch-flicker 4s infinite alternate ease-in-out;
}

/* scanline sweep */
@keyframes bs-glitch-scan {
  0% {
    transform: translateY(-15%);
  }
  100% {
    transform: translateY(15%);
  }
}

/* subtle flicker / jitter */
@keyframes bs-glitch-flicker {
  0% {
    transform: translateX(0);
    opacity: 0.03;
  }
  20% {
    transform: translateX(-2px);
    opacity: 0.08;
  }
  40% {
    transform: translateX(1px);
    opacity: 0.05;
  }
  60% {
    transform: translateX(-1px);
    opacity: 0.09;
  }
  80% {
    transform: translateX(0px);
    opacity: 0.04;
  }
  100% {
    transform: translateX(2px);
    opacity: 0.07;
  }
}

/* ensure inner content sits above glitches */
.bs-portal > * {
  position: relative;
  z-index: 1;
}

/* live hub header additions */
.bs-title {
  display: flex;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
}

.bs-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #a5b4fc;
}

.bs-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
  animation: bs-status-pulse 1.4s infinite ease-in-out;
}

@keyframes bs-status-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.4;
  }
}

.bs-status-text {
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

/* live hub layout */
.bs-layout {
  margin-top: 0.75rem;
  display: flex;
  gap: 1rem;
  height: calc(100% - 2.25rem);
}

@media (max-width: 768px) {
  .bs-layout {
    flex-direction: column;
  }
}

.bs-panel-title {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  text-transform: lowercase;
  letter-spacing: 0.12em;
  color: #a5b4fc;
}

/* left: live feed */
.bs-feed {
  flex: 0.9;
  min-width: 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(30, 64, 175, 0.7);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.9));
  padding: 0.75rem 0.9rem;
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.25);
  display: flex;
  flex-direction: column;
}

.bs-feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  font-size: 0.8rem;
}

.bs-feed-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed rgba(51, 65, 85, 0.7);
}

.bs-feed-item:last-child {
  border-bottom: none;
}

.bs-feed-time {
  flex-shrink: 0;
  width: 3.1rem;
  color: #38bdf8;
  opacity: 0.9;
}

.bs-feed-text {
  color: #e5e7eb;
}

.bs-feed-hint {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: #64748b;
}

/* right: chat panel */
.bs-chat {
  flex: 2;
  min-width: 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(22, 163, 74, 0.7);
  background: radial-gradient(circle at top, rgba(6, 95, 70, 0.26), rgba(15, 23, 42, 0.96));
  padding: 0.75rem 0.9rem;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
  display: flex;
  flex-direction: column;
}

.bs-chat-frame {
  flex: 1;
  margin-top: 0.25rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.9);
}

/* iframe fill */
.bs-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #020617;
}
