/* MockPet Phone + FaceTime shared layer — mobile-safe, non-blocking */
:root {
  --mpp-pink: #ff3fb4;
  --mpp-green: #39ff9e;
  --mpp-bg: rgba(8, 6, 16, 0.94);
  --mpp-safe-top: env(safe-area-inset-top, 0px);
  --mpp-safe-bot: env(safe-area-inset-bottom, 0px);
}

#mpp-root {
  position: fixed;
  inset: 0;
  z-index: 9200;
  pointer-events: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f6f2ff;
}

#mpp-root * { box-sizing: border-box; }

/* Floating phone affordance — sits above play, below critical modals; never covers hub-back (top-left) */
.mpp-fab {
  pointer-events: auto;
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(16px, var(--mpp-safe-bot)) + 56px);
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(255, 63, 180, 0.55);
  background: linear-gradient(145deg, rgba(255, 63, 180, 0.35), rgba(12, 8, 22, 0.92));
  color: #fff;
  box-shadow: 0 8px 28px rgba(255, 47, 180, 0.35), inset 0 0 0 1px rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9201;
  transition: transform 0.15s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mpp-fab:active { transform: scale(0.94); }
.mpp-fab.mpp-fab-collapsed {
  width: 40px;
  height: 40px;
  opacity: 0.72;
  border-radius: 12px;
}
.mpp-fab.mpp-fab-hidden { display: none !important; }
.mpp-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }

.mpp-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--mpp-green);
  color: #06140e;
  font: 800 9px/16px system-ui, sans-serif;
  text-align: center;
}

/* Incoming FaceTime card */
.mpp-incoming {
  pointer-events: auto;
  position: fixed;
  left: 50%;
  top: calc(12px + var(--mpp-safe-top));
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 20px));
  padding: 14px 14px 12px;
  border-radius: 22px;
  background: var(--mpp-bg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,63,180,0.18);
  display: none;
  gap: 12px;
  align-items: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: mpp-slide 0.35s ease;
}
.mpp-incoming.mpp-show { display: flex; flex-wrap: wrap; }

@keyframes mpp-slide {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.mpp-video-bubble {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #1a1228;
  box-shadow: 0 0 0 2px rgba(57, 255, 158, 0.45), 0 0 24px rgba(255, 63, 180, 0.35);
}
.mpp-video-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  animation: mpp-pulse-soft 2.4s ease-in-out infinite;
}
.mpp-video-bubble .mpp-live {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font: 800 8px/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  color: #06140e;
  background: var(--mpp-green);
  padding: 3px 5px;
  border-radius: 6px;
}
@keyframes mpp-pulse-soft {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.mpp-incoming-meta { flex: 1; min-width: 0; }
.mpp-kicker {
  font: 700 9px/1.2 system-ui, sans-serif;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
}
.mpp-caller {
  font: 650 16px/1.25 system-ui, sans-serif;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mpp-sub {
  font: 500 12px/1.3 system-ui, sans-serif;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}

.mpp-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: flex-end;
  margin-top: 2px;
}
.mpp-btn {
  pointer-events: auto;
  border: none;
  border-radius: 14px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  font: 700 13px/1 system-ui, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mpp-btn-decline {
  background: rgba(255, 80, 100, 0.18);
  color: #ffb4c0;
  border: 1px solid rgba(255, 100, 120, 0.35);
}
.mpp-btn-accept {
  
  background: linear-gradient(135deg, #2dff9a, #12c97a);
  color: #04140c;
  box-shadow: 0 0 18px rgba(57, 255, 158, 0.35);
}

/* Active FaceTime strip (compact, top) */
.mpp-livebar {
  pointer-events: auto;
  position: fixed;
  left: 50%;
  top: calc(8px + var(--mpp-safe-top));
  transform: translateX(-50%);
  width: min(340px, calc(100vw - 16px));
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 18px;
  background: rgba(6, 10, 18, 0.9);
  border: 1px solid rgba(57, 255, 158, 0.35);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}
.mpp-livebar.mpp-show { display: flex; }
.mpp-livebar .mpp-mini {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  background: #1a1228;
}
.mpp-livebar .mpp-timer {
  margin-left: auto;
  font: 700 12px/1 ui-monospace, monospace;
  color: var(--mpp-green);
}
.mpp-livebar .mpp-hang {
  border: none;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  background: rgba(255, 70, 90, 0.85);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.mpp-livebar.mpp-collapsed {
  width: auto;
  padding: 6px 10px;
}
.mpp-livebar.mpp-collapsed .mpp-caller-label,
.mpp-livebar.mpp-collapsed .mpp-timer { display: none; }

/* Top speech bubbles */
.mpp-bubbles {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: calc(78px + var(--mpp-safe-top));
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9202;
}
.mpp-bubble {
  align-self: flex-start;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px 16px 16px 6px;
  background: rgba(18, 12, 28, 0.92);
  border: 1px solid rgba(255, 63, 180, 0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  animation: mpp-bubble-in 0.25s ease;
}
.mpp-bubble strong {
  display: block;
  font: 800 10px/1 system-ui, sans-serif;
  letter-spacing: 0.12em;
  color: var(--mpp-pink);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.mpp-bubble span {
  font: 500 14px/1.35 system-ui, sans-serif;
  color: #f8f4ff;
}
@keyframes mpp-bubble-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mpp-toast {
  pointer-events: none;
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--mpp-safe-bot));
  transform: translateX(-50%);
  max-width: min(320px, 90vw);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(8, 6, 16, 0.92);
  border: 1px solid rgba(57, 255, 158, 0.4);
  color: #f4fff8;
  font: 700 12px/1.35 system-ui, sans-serif;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 9300;
}
.mpp-toast.mpp-show { opacity: 1; }

@media (max-width: 520px) {
  .mpp-fab { bottom: calc(max(12px, var(--mpp-safe-bot)) + 64px); }
  .mpp-video-bubble { width: 64px; height: 64px; }
  .mpp-bubbles { top: calc(96px + var(--mpp-safe-top)); }
}
