/* ═══════════════════════════════════════════════════════════════
   ZOTH 3D PETS SANCTUARY & CHAT CONSOLE — HIGH DENSITY UI SYSTEM
   ═══════════════════════════════════════════════════════════════ */

:root {
  --cyan: #00f0ff;
  --magenta: #d946ef;
  --gold: #fbbf24;
  --bg-deep: #030408;
  --bg-glass: rgba(10, 14, 26, 0.94);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-cyan: rgba(0, 240, 255, 0.35);
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

body.deck-page {
  background: var(--bg-deep);
  color: #f1f5f9;
  font-family: var(--font-body);
  margin: 0;
  overflow-x: hidden;
}

.pets-main-container {
  height: calc(100vh - 65px);
  padding: 12px 16px;
  box-sizing: border-box;
}

.sanctuary-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  height: 100%;
}

@media (max-width: 1024px) {
  .sanctuary-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* 3D WebGL Stage */
.sanctuary-stage {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #0d152c 0%, #030408 100%);
  border: 1px solid var(--border-cyan);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 240, 255, 0.08);
  min-height: 480px;
}

#three-stage {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-top-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-pill-row {
  display: flex;
  gap: 8px;
  pointer-events: auto;
  align-items: center;
}

.hud-pill {
  background: rgba(4, 6, 14, 0.88);
  border: 1px solid var(--border-cyan);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.hud-pill-btn {
  background: rgba(4, 6, 14, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.hud-pill-btn:hover, .hud-pill-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Sidebar Chat & Dispatch Console - Clean Left Alignment */
.sanctuary-sidebar {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  overflow-y: auto;
  text-align: left;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.chat-feed {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 14px;
  height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  text-align: left;
}

.chat-msg {
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.5;
  text-align: left;
}

.chat-msg.system {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  border-left: 3px solid var(--cyan);
}

.chat-msg.pet {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: #e2e8f0;
}

.chat-msg.user {
  background: rgba(217, 70, 239, 0.12);
  border: 1px solid rgba(217, 70, 239, 0.25);
  color: #fff;
  align-self: flex-end;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-box {
  flex: 1;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
  text-align: left;
}

.chat-input-box:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

/* Companion Roster Grid */
.roster-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}

.roster-card {
  background: rgba(18, 24, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.roster-card:hover, .roster-card.active {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.12);
  transform: translateY(-2px);
}

.roster-card strong {
  font-size: 0.82rem;
  color: #fff;
}

.roster-card small {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}
