/**
 * ============================================================================
 * Project Noyan - Popy Companion Engine & HUD Styling (v2.0.0)
 * ============================================================================
 * Organization: Vida Pendar Pars
 * Integration: Noyan Pixar Design System & Ergonomic Touch Architecture
 * Target Devices: Student Tablets (10-inch), Mobile Phones & Interactive Boards
 * ============================================================================
 */

/* ----------------------------------------------------------------------------
 * 1. COMPANION HUD CONTAINER & FLOATING POSITIONING
 * ------------------------------------------------------------------------- */
.popy-hud-container {
  position: fixed;
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* موقعیت پیش‌فرض گوشه پایین چپ برای محیط‌های فارسی (RTL) */
.popy-hud-bottom-left {
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: calc(20px + env(safe-area-inset-left, 0px));
}

/* موقعیت گوشه پایین راست اختیاری */
.popy-hud-bottom-right {
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
}

/* استقرار درون‌صفحه‌ای (Inline Stage) برای اتاق پوپی یا سربرگ بازی‌ها */
.popy-inline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 234, 223, 0.4) 0%, transparent 70%);
  border-radius: var(--radius-card, 32px);
  position: relative;
}

/* ----------------------------------------------------------------------------
 * 2. COMPANION CONTROLLER & ACTION HUD
 * ------------------------------------------------------------------------- */
.popy-companion-hud {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--noyan-peach-light, #FFEADF);
  box-shadow: 0 16px 32px -8px rgba(74, 52, 36, 0.12), 0 4px 12px rgba(74, 52, 36, 0.04);
  border-radius: 999px;
  padding: 8px 16px;
  margin-top: 10px;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--noyan-bg-base, #FAF7F0);
  color: var(--noyan-text-body, #4A3B32);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #D8D0C5;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hud-btn:hover {
  transform: translateY(-2px);
  background: #FFF;
  color: var(--noyan-peach-main, #FF8A50);
}

.hud-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #D8D0C5;
}

/* دکمه درخواست کمک (Protégé Teach Button) */
.hud-btn-help {
  background: linear-gradient(180deg, #FFC85C 0%, #FFB830 100%);
  color: #573A00;
  box-shadow: 0 4px 0 #C68612;
}

/* ----------------------------------------------------------------------------
 * 3. RESPONSIVE MEDIA QUERIES FOR TABLETS & PHONES
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .popy-hud-bottom-left {
    bottom: 12px;
    left: 12px;
  }
  .popy-hud-bottom-right {
    bottom: 12px;
    right: 12px;
  }
  .popy-hud-container popy-companion {
    --stage-scale: 0.85;
  }
}

@media (max-width: 480px) {
  .popy-hud-bottom-left,
  .popy-hud-bottom-right {
    bottom: 8px;
  }
}
