/* ═══════════════════════════════════════════
   NEXUS — Login + command deck on the starship bridge
   ═══════════════════════════════════════════ */

.topbar .auth-chip {
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.btn--primary {
  color: #041018;
  background: linear-gradient(135deg, #7ef0ff 0%, #3de0ff 40%, #2b9bff 100%);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--ghost {
  color: var(--text);
  background: rgba(4, 14, 32, 0.45);
}

.btn--ghost:hover {
  border-color: var(--border-bright);
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.85rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  background: rgba(4, 14, 32, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-chip:hover,
.auth-chip:focus-visible {
  color: var(--cyan);
  border-color: var(--border-bright);
}

.auth-chip-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

body.is-auth .auth-chip-led {
  background: #3dff9a;
  box-shadow: 0 0 8px rgba(61, 255, 154, 0.7);
}

/* After enter: keep the live bridge, hide placeholder sections */
body.is-bridge {
  overflow: hidden;
  height: 100vh;
}

body.is-bridge .panel.section,
body.is-bridge .footer {
  display: none;
}

body.is-bridge .hero {
  min-height: auto;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

body.is-bridge .title {
  font-size: clamp(1.8rem, 5vw, 3.4rem);
}

body.is-bridge .cards {
  display: none;
}

/* Shared HUD chrome (mirrors the media player) */
.hud-panel {
  position: fixed;
  z-index: 55;
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  pointer-events: none;
}

.hud-panel.is-online {
  opacity: 1;
  transform: none;
  filter: none;
  pointer-events: auto;
  transition:
    opacity 0.8s var(--ease-soft),
    transform 0.8s var(--ease-soft),
    filter 0.8s var(--ease-soft);
}

.hud-panel[hidden] {
  display: none !important;
}

.hud-chrome {
  background: linear-gradient(
    165deg,
    rgba(6, 18, 40, 0.9) 0%,
    rgba(3, 10, 24, 0.95) 100%
  );
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(43, 155, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.hud-chrome::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--cyan) 70%, transparent);
  opacity: 0.5;
}

.hud-chrome {
  position: relative;
}

.hud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(61, 224, 255, 0.1);
}

.hud-id {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.hud-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}

.hud-led.is-live,
body.is-auth .hud-login .hud-led {
  background: #3dff9a;
  box-shadow: 0 0 10px rgba(61, 255, 154, 0.7);
}

.hud-sys {
  font-family: var(--font-display);
  font-size: 0.46rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.hud-mode {
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-top: 0.12rem;
}

.hud-hint {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.7rem;
}

.hud-field {
  display: grid;
  gap: 0.28rem;
  margin-bottom: 0.65rem;
  text-align: left;
}

.hud-field > span {
  font-family: var(--font-display);
  font-size: 0.46rem;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.hud-field input,
.hud-field textarea,
.hud-field select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: rgba(0, 8, 20, 0.55);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.5rem 0.6rem;
  outline: none;
}

.hud-field textarea {
  resize: vertical;
  min-height: 3.4rem;
}

.hud-field input:focus,
.hud-field textarea:focus,
.hud-field select:focus {
  border-color: var(--border-bright);
  box-shadow: 0 0 0 1px rgba(61, 224, 255, 0.2);
}

.hud-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Login — left of the city, opposite the media HUD */
.hud-login {
  top: clamp(4.25rem, 9vh, 5.25rem);
  left: clamp(0.75rem, 2vw, 1.5rem);
  width: min(360px, calc(100vw - 1.5rem));
}

.login-form {
  padding: 0.85rem 0.9rem 1rem;
}

.login-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.login-error {
  color: #ff8a9b;
  font-size: 0.78rem;
  margin: -0.2rem 0 0.6rem;
}

/* Public showcase strip */
.hud-showcase {
  left: 50%;
  transform: translate(-50%, 12px);
  bottom: 3.6rem;
  width: min(920px, calc(100vw - 1.5rem));
}

.hud-showcase.is-online {
  transform: translate(-50%, 0);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  padding: 0.75rem 0.85rem 0.9rem;
  max-height: 28vh;
  overflow: auto;
}

.showcase-card {
  display: grid;
  gap: 0.3rem;
  text-align: left;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: rgba(4, 14, 32, 0.45);
  min-height: 5.5rem;
}

.showcase-card h3 {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.showcase-card p {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.4;
}

.showcase-card .tag {
  font-family: var(--font-display);
  font-size: 0.42rem;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.showcase-empty {
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 0.5rem;
}

/* Command deck */
.hud-deck {
  left: 50%;
  bottom: 3.5rem;
  transform: translate(-50%, 14px);
  width: min(1120px, calc(100vw - 1.25rem));
  z-index: 58;
}

.hud-deck.is-online {
  transform: translate(-50%, 0);
}

body.is-auth .hud-showcase {
  display: none !important;
}

body.is-auth .hud-login {
  display: none !important;
}

.hud-head--deck {
  flex-wrap: wrap;
}

.deck-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.deck-tab {
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.4rem 0.55rem;
  border-bottom: 2px solid transparent;
}

.deck-tab.is-active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.deck-body {
  max-height: min(52vh, 460px);
  overflow: auto;
}

.deck-panel {
  padding: 0.75rem 0.85rem 0.95rem;
}

.deck-split {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.15fr);
  gap: 0.9rem;
}

.deck-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.deck-list {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  max-height: 42vh;
  overflow: auto;
}

.deck-item {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: rgba(4, 14, 32, 0.4);
}

.deck-item:hover,
.deck-item.is-active {
  border-color: rgba(61, 224, 255, 0.28);
  background: rgba(61, 224, 255, 0.08);
}

.deck-item-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
}

.deck-item-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
}

.badge {
  display: inline-block;
  margin-right: 0.3rem;
  font-family: var(--font-display);
  font-size: 0.4rem;
  letter-spacing: 0.1em;
  padding: 0.12rem 0.3rem;
  border: 1px solid rgba(61, 224, 255, 0.25);
  color: var(--cyan);
  border-radius: 2px;
}

.badge--public {
  color: #3dff9a;
  border-color: rgba(61, 255, 154, 0.35);
}

.badge--ai {
  color: #c9a6ff;
  border-color: rgba(201, 166, 255, 0.35);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.field-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.hud-field--rank {
  max-width: 6rem;
}

.form-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.form-msg {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: #3dff9a;
}

.form-msg.is-error {
  color: #ff8a9b;
}

.member-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.member-picks label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.45rem;
  border-radius: 2px;
}

.showcase-admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.deck-list--showcase {
  margin-top: 0.8rem;
}

@media (max-width: 900px) {
  .hud-login {
    top: auto;
    bottom: 12.5rem;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }

  .hud-showcase,
  .hud-deck {
    left: 0.6rem;
    right: 0.6rem;
    width: auto;
    transform: none;
  }

  .hud-showcase.is-online,
  .hud-deck.is-online {
    transform: none;
  }

  .deck-split,
  .field-row,
  .field-row.three {
    grid-template-columns: 1fr;
  }

  body.is-bridge .cta-row {
    display: none;
  }
}

@media (max-height: 740px) {
  body.is-bridge .subtitle,
  body.is-bridge .title-divider {
    display: none;
  }

  .deck-body {
    max-height: 46vh;
  }
}
