/* Companion Hub — large modal shell */
.companion-hub-modal.cat-room-modal--full {
  z-index: 12040;
}

.companion-hub-modal .cat-room-full,
.companion-hub-modal .companion-hub {
  width: min(96vw, 1280px);
  max-height: min(94vh, 920px);
  margin: 2vh auto;
  display: flex;
  flex-direction: column;
}

.companion-hub-body {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
}

.companion-hub-scene {
  min-height: 320px;
  border-radius: 16px;
}

.companion-hub-shop {
  min-height: 0;
}

.companion-hub-list,
.companion-hub-modal .cat-room-shop-list {
  max-height: min(52vh, 480px);
  flex: 1;
}

.companion-hub-tabs {
  gap: 0.25rem;
}

.companion-hub-tabs button {
  flex: 1 1 auto;
  min-width: 4.5rem;
  font-size: 0.62rem;
}

.showcase-companion-hub-btn {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.companion-hub-gacha-lead,
.companion-hub-gacha-balance {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.companion-hub-gacha-section-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.65rem 0 0.35rem;
  font-size: 0.78rem;
  color: #fbbf24;
}

.companion-hub-gacha-grid {
  display: grid;
  gap: 0.45rem;
}

.companion-hub-gacha-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(8, 12, 24, 0.85);
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
}

.companion-hub-gacha-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.companion-hub-gacha-cta {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fbbf24;
  text-transform: uppercase;
}

.companion-hub-chat-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.companion-hub-chat-header p {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

.companion-hub-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(251, 191, 36, 0.35);
}

.companion-hub-chat-avatar--lg {
  width: 48px;
  height: 48px;
}

.companion-hub-chat-log {
  flex: 1;
  min-height: 200px;
  max-height: min(40vh, 360px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.55);
  margin-bottom: 0.55rem;
}

.companion-hub-chat-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
}

.companion-hub-chat-row--user {
  justify-content: flex-end;
}

.companion-hub-chat-bubble {
  max-width: 85%;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.companion-hub-chat-bubble--user {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.35);
}

.companion-hub-chat-bubble p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.companion-hub-chat-name {
  display: block;
  font-size: 0.62rem;
  color: #fbbf24;
  margin-bottom: 0.15rem;
}

.companion-hub-chat-form {
  display: flex;
  gap: 0.45rem;
}

.companion-hub-chat-input {
  flex: 1;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(8, 12, 24, 0.9);
  color: #f8fafc;
  font-size: 0.82rem;
}

/* Shop / collection — single sprite frame from atlases */
.cat-catalog-preview-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.cat-catalog-preview-viewport--strip {
  justify-content: flex-start;
}

.cat-catalog-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.cat-catalog-preview-viewport--atlas .cat-catalog-preview-img--atlas {
  width: calc(100% * var(--cat-preview-tile-w, 1));
  height: calc(100% * var(--cat-preview-tile-h, 1));
  max-width: none;
  object-fit: none;
  object-position: 0 0;
}

.cat-room-shop-card-preview .cat-catalog-preview-viewport,
.cat-room-collection-card .cat-catalog-preview-viewport {
  width: 100%;
  height: 100%;
}

/* Asset gacha reveal (rooms / furniture) */
.asset-gacha-overlay {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: grid;
  place-items: center;
}

.asset-gacha-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 16, 0.82);
}

.asset-gacha-card {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  padding: 1.25rem 1.35rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(24, 16, 40, 0.98), rgba(12, 8, 24, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.35);
  text-align: center;
}

.asset-gacha-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #f472b6;
}

.asset-gacha-sub {
  margin: 0.25rem 0 0.75rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.asset-gacha-preview {
  margin: 0.75rem auto;
  width: min(280px, 80%);
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.asset-gacha-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-gacha-dup {
  color: #fbbf24;
  font-size: 0.75rem;
}

.asset-gacha-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.85rem;
}

@media (max-width: 900px) {
  .companion-hub-body {
    grid-template-columns: 1fr;
  }

  .companion-hub-scene {
    min-height: 220px;
  }

  .game-lobby-tab {
    min-width: 5.5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.72rem;
  }
}
