/**
 * Companion Interior Polish — decorate mode, props, shop previews, typography.
 * Presentation only — no economy/save changes.
 */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

:root {
  --companion-font: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --companion-neon-pink: #ff69b4;
  --companion-neon-cyan: #38bdf8;
  --companion-gold: #fbbf24;
  --companion-glass: rgba(8, 10, 22, 0.88);
}

/* ===== Typography & header ===== */
.cat-room-full-header h2,
.cat-room-shop h3,
.cat-room-collection-header {
  font-family: var(--companion-font);
  letter-spacing: 0.03em;
}

.cat-room-full-tagline {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 180, 220, 0.75);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.cat-room-full-title {
  display: flex;
  flex-direction: column;
}

/* ===== Scene toolbar ===== */
.companion-scene-toolbar {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  right: 0.55rem;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
}

.companion-scene-toolbar > * {
  pointer-events: auto;
}

.companion-scene-room-badge {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-family: var(--companion-font);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: var(--companion-glass);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.companion-decorate-toggle {
  font-family: var(--companion-font);
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  min-height: 2rem !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 105, 180, 0.45) !important;
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.22), rgba(56, 189, 248, 0.18)) !important;
  box-shadow: 0 0 18px rgba(255, 105, 180, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.companion-decorate-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(255, 105, 180, 0.35);
}

.companion-decorate-toggle.is-active {
  border-color: rgba(74, 222, 128, 0.65) !important;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.28), rgba(56, 189, 248, 0.15)) !important;
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.25);
}

/* ===== Decorate mode slots ===== */
.companion-scene--decorate .cat-room-placed-item {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(0.15) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

.companion-interior-slots {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.companion-interior-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: rgba(8, 10, 24, 0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: companion-slot-pulse 2.4s ease-in-out infinite;
}

.companion-interior-slot:hover,
.companion-interior-slot:focus-visible {
  border-color: var(--companion-neon-cyan);
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
  outline: none;
}

.companion-interior-slot.is-occupied {
  border-style: solid;
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(8, 10, 24, 0.72);
}

.companion-interior-slot--pending-target {
  border-color: var(--companion-neon-pink);
  animation: companion-slot-pending 1s ease-in-out infinite;
}

.companion-interior-slot-plus {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
}

.companion-interior-slot-preview {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.companion-interior-slot-label {
  position: absolute;
  bottom: -1.15rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--companion-font);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

@keyframes companion-slot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(56, 189, 248, 0);
  }
  50% {
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.22);
  }
}

@keyframes companion-slot-pending {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(255, 105, 180, 0.3);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 105, 180, 0.55);
  }
}

/* ===== Slot picker popup ===== */
.companion-slot-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  max-width: 220px;
  padding: 0.45rem;
  border-radius: 12px;
  background: var(--companion-glass);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 20;
  pointer-events: auto;
}

.companion-slot-picker-header {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.companion-slot-picker-header strong {
  font-family: var(--companion-font);
  font-size: 0.78rem;
  color: #fff;
}

.companion-slot-picker-header span {
  font-size: 0.65rem;
  color: rgba(255, 220, 240, 0.65);
}

.companion-slot-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem;
}

.companion-slot-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  color: #fff;
  font-family: var(--companion-font);
  font-size: 0.62rem;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.companion-slot-picker-item:hover {
  border-color: var(--companion-neon-pink);
  background: rgba(255, 105, 180, 0.12);
}

.companion-slot-picker-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.companion-slot-picker-action {
  width: 100%;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font-family: var(--companion-font);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.companion-slot-picker-empty {
  margin: 0;
  font-size: 0.68rem;
  color: rgba(255, 220, 240, 0.7);
  text-align: center;
  line-height: 1.35;
}

/* ===== Decorate tab ===== */
.companion-decorate-hint,
.companion-decorate-empty {
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-family: var(--companion-font);
  font-size: 0.74rem;
  line-height: 1.4;
  color: rgba(255, 230, 245, 0.82);
  background: rgba(255, 105, 180, 0.08);
  border: 1px solid rgba(255, 105, 180, 0.18);
}

.companion-decorate-mode-row {
  margin-bottom: 0.75rem;
}

.companion-decorate-slot {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: rgba(125, 211, 252, 0.85);
  font-weight: 700;
}

.cat-room-decorate-card.is-pending {
  border-color: rgba(255, 105, 180, 0.55) !important;
  box-shadow: 0 0 20px rgba(255, 105, 180, 0.2);
}

.cat-room-decorate-card.is-placed {
  border-color: rgba(74, 222, 128, 0.35);
}

/* ===== Shop furniture previews ===== */
.cat-room-shop-card-preview--furniture {
  min-height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(255, 105, 180, 0.08), rgba(8, 6, 18, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-room-shop-card-preview--furniture img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.cat-room-shop-card--premium:not(.cat-room-shop-card--room-rescue) {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(18, 14, 32, 0.95), rgba(8, 6, 18, 0.98));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.cat-room-shop-card--premium:not(.cat-room-shop-card--room-rescue):hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
}

.cat-room-shop-preview-tier {
  position: relative;
  overflow: hidden;
}

.cat-room-shop-preview-tier img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.cat-room-shop-preview-tier span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

/* ===== Room props (from RC8 art pass, inlined for runtime) ===== */
.companion-room-props {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.companion-prop {
  position: absolute;
  pointer-events: none;
}

.companion-prop--floor-rug {
  bottom: 6%;
  left: 50%;
  width: 48%;
  height: 14%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 105, 180, 0.14), rgba(56, 189, 248, 0.08) 55%, transparent 75%);
  animation: companion-rug-shimmer 8s ease-in-out infinite;
}

.companion-prop--neon-strip {
  top: 5%;
  left: 28%;
  width: 44%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--companion-neon-pink), var(--companion-neon-cyan), transparent);
  box-shadow: 0 0 14px rgba(255, 105, 180, 0.35), 0 0 22px rgba(56, 189, 248, 0.28);
  animation: companion-neon-pulse 4s ease-in-out infinite;
}

.companion-room-props--minimal .companion-prop--neon-strip {
  opacity: 0.35;
}

@keyframes companion-rug-shimmer {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@keyframes companion-neon-pulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* ===== Placed furniture polish ===== */
.companion-room-scene--premium .cat-room-placed-item {
  animation: companion-furn-settle 0.45s ease backwards;
}

@keyframes companion-furn-settle {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
  }
}

.companion-room-scene--premium .cat-room-placed-item:hover {
  filter: drop-shadow(0 4px 14px rgba(255, 105, 180, 0.35));
}

.companion-room-scene--premium .cat-room-scene-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 1;
}

/* ===== Scene depth ===== */
.cat-room-scene {
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 8px 32px rgba(255, 105, 180, 0.08);
}

.companion-scene--decorate::after {
  content: 'Pick a slot';
  position: absolute;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-family: var(--companion-font);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 105, 180, 0.25);
  border: 1px solid rgba(255, 105, 180, 0.45);
  z-index: 15;
  pointer-events: none;
  animation: companion-slot-pending 1.2s ease-in-out infinite;
}

.companion-purchase-notice {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-family: var(--companion-font, 'Nunito', sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  color: #fecaca;
  background: rgba(40, 10, 18, 0.94);
  border: 1px solid rgba(248, 113, 113, 0.55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: companion-notice-in 0.28s ease;
}

@keyframes companion-notice-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 720px) {
  .companion-interior-slot {
    width: 44px;
    height: 44px;
  }

  .companion-interior-slot-label {
    display: none;
  }

  .cat-room-shop-card--premium:not(.cat-room-shop-card--room-rescue) {
    grid-template-columns: 1fr;
  }
}
