:root {
  --bg-deep: #060913;
  --glass-bg: rgba(15, 23, 42, 0.68);
  --glass-border: rgba(255, 255, 255, 0.12);
  --jarvis-color: #00e5ff;
  --jarvis-glow: rgba(0, 229, 255, 0.35);
  --emma-color: #b388ff;
  --emma-glow: rgba(179, 136, 255, 0.35);
  --active-accent: var(--jarvis-color);
  --active-glow: var(--jarvis-glow);
}

body.persona-emma {
  --active-accent: var(--emma-color);
  --active-glow: var(--emma-glow);
}

* {
  box-sizing: border-box;
  user-select: none;
}

body {
  background-color: var(--bg-deep);
  color: #f8fafc;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0;
}

/* خلفية الصور العائلية المتغيرة أو خلفيات الطقس والأذان */
#ambient-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  background-image: radial-gradient(circle at 20% 20%, #0f172a 0%, #060913 75%);
  transition: background-image 1.2s ease-in-out, filter 0.6s ease;
}

#ambient-backdrop::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 19, 0.55) 0%, rgba(6, 9, 19, 0.85) 100%);
  z-index: -1;
}

/* بطاقات الزجاج الداكن */
.hud-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.hud-accent-border {
  border-color: var(--active-accent) !important;
  box-shadow: 0 0 24px var(--active-glow);
}

/* الكرة التفاعلية الحية لجارفس وإيما (Companion Orb) */
.companion-orb-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.companion-orb {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, var(--active-accent) 45%, #090d16 95%);
  box-shadow: 0 0 35px var(--active-glow), inset 0 0 20px rgba(255, 255, 255, 0.6);
  transition: transform 0.25s ease, box-shadow 0.35s ease, background 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #060913;
}

.companion-orb-ring {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px dashed var(--active-accent);
  opacity: 0.55;
  animation: spinSlow 18s linear infinite;
}

.orb-listening .companion-orb {
  transform: scale(1.12);
  animation: pulseWave 1.4s ease-in-out infinite;
}

.orb-speaking .companion-orb {
  transform: scale(1.18);
  box-shadow: 0 0 60px var(--active-accent), 0 0 90px var(--active-glow);
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseWave {
  0%, 100% { transform: scale(1.06); }
  50% { transform: scale(1.18); }
}

/* الساعة الرقمية للشاشة الجدارية */
.kiosk-clock {
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* شريط درع الخصوصية الأحمر */
.privacy-shield-banner {
  background: linear-gradient(90deg, #991b1b, #dc2626);
  color: #fff;
  border-radius: 0.9rem;
  padding: 0.65rem 1rem;
  font-weight: 700;
  animation: pulseOpacity 2s infinite;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

/* وضع القيادة على الهاتف (Hands-Free Drive Mode) */
body.drive-mode .hud-glass {
  border-width: 2px;
}

body.drive-mode .drive-btn {
  padding: 1.35rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 1.2rem;
}

/* معاينة كاميرا وتين أو الماسح الضوئي */
.live-camera-box {
  width: 100%;
  max-width: 320px;
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid var(--active-accent);
  background: #000;
}

.live-camera-box video {
  width: 100%;
  height: auto;
  display: block;
}

/* تنسيق الجداول داخل البطاقات البصرية */
.visual-card-body table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.visual-card-body th,
.visual-card-body td {
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.6rem 0.8rem;
  text-align: right;
}

.visual-card-body th {
  background: rgba(255, 255, 255, 0.08);
  color: var(--active-accent);
}