/* Anoxiacord shared styles. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0b0d10;
  color: #e6e8eb;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

#viewer,
#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#viewer {
  /* The spectator mirror surface. The host agent's replayed DOM lands here. */
  overflow: auto;
}

#stage {
  background: #000;
}

.hidden {
  display: none !important;
}

/* ---- Pre-handshake splash ---- */

#status {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #0b0d10;
  z-index: 50;
}

#status.hidden {
  display: none;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #5865f2;
  border-radius: 50%;
  animation: anoxiacord-spin 0.8s linear infinite;
}

@keyframes anoxiacord-spin {
  to {
    transform: rotate(360deg);
  }
}

#status-text {
  margin: 0;
  font-size: 0.9rem;
  color: #9aa0a6;
}

/* ---- Quick ball (host control surface) ---- */
/* Deliberately faint and tucked into the bottom-right corner so it stays out
   of the host's way. Becomes more visible on hover/active. */

#anoxiacord-quickball-root {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 9999;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

#anoxiacord-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 23, 28, 0.42);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease,
    opacity 160ms ease;
  opacity: 0.38;
}

#anoxiacord-fab:hover,
#anoxiacord-fab.active {
  opacity: 1;
  background: rgba(88, 101, 242, 0.85);
  color: #fff;
  transform: scale(1.04);
}

#anoxiacord-panel {
  position: absolute;
  bottom: 48px;
  right: 0;
  width: 248px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
  border-radius: 12px;
  background: rgba(20, 23, 28, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  color: #e6e8eb;
  font-size: 13px;
}

#anoxiacord-panel.hidden {
  display: none;
}

.ac-header {
  padding: 4px 8px 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b9098;
}

#anoxiacord-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#anoxiacord-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}

#anoxiacord-list li:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ac-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.ac-avatar-none {
  background: #3a3f46;
}

.ac-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-toggle {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #c7ccd1;
  font-size: 12px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.ac-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ac-toggle.on {
  background: rgba(88, 101, 242, 0.9);
  border-color: transparent;
  color: #fff;
}

.ac-empty {
  color: #7a7f87;
  font-style: italic;
  padding: 8px;
  text-align: center;
}
