/* Hidayat360 mascot: roaming lantern-bot (adapted from the gobotAi mascot, recoloured to the Hidayat360 theme). */
.roam-bot {
  --roam-w: 96px;
  --roam-h: 106px;
  position: fixed;
  left: 0;
  top: 0;
  width: var(--roam-w);
  height: var(--roam-h);
  z-index: 40;               /* below the sticky header (50) and language menu (60) */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
  contain: layout style;
}
.roam-bot.is-visible { opacity: 1; }
.roam-bot__tilt { position: absolute; inset: 0; transform-origin: 50% 80%; will-change: transform; }
.roam-bot__float { position: absolute; inset: 0; animation: roam-bot-float 3.2s ease-in-out infinite; }
@keyframes roam-bot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.roam-bot svg { width: 100%; height: 100%; overflow: visible; display: block; filter: drop-shadow(0 0 5px rgba(255, 217, 138, 0.45)); }

.roam-bot__shadow {
  position: absolute; left: 50%; bottom: -14px; width: 60px; height: 8px; margin-left: -30px;
  border-radius: 50%; background: rgba(11, 21, 51, 0.28); filter: blur(4px);
  animation: roam-bot-shadow 3.2s ease-in-out infinite;
}
@keyframes roam-bot-shadow { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(0.72); opacity: 0.5; } }

.roam-bot__eyes { transition: transform 0.18s ease-out; }
.roam-bot__eye { transform-box: fill-box; transform-origin: center; animation: roam-bot-blink 5s infinite; }
@keyframes roam-bot-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }

.roam-bot__antenna-tip { animation: roam-bot-pulse 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes roam-bot-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.45); opacity: 0.6; } }

.roam-bot__bubble {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translate(-50%, 6px) scale(0.92);
  padding: 7px 13px; border-radius: 999px;
  background: #0b1533; color: #ffd98a;
  font-family: var(--font, sans-serif); font-weight: 700; font-size: 13px; line-height: 1.4;
  white-space: nowrap; opacity: 0;
  box-shadow: 0 8px 22px rgba(11, 21, 51, 0.3);
  border: 1px solid rgba(244, 185, 66, 0.45);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.roam-bot__bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; width: 9px; height: 9px; margin-left: -4.5px;
  background: inherit; border-right: inherit; border-bottom: inherit; transform: rotate(45deg);
}
.roam-bot__bubble.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.roam-bot.is-left  .roam-bot__bubble { left: 0; transform: translate(0, 6px) scale(0.92); }
.roam-bot.is-left  .roam-bot__bubble.is-on { transform: translate(0, 0) scale(1); }
.roam-bot.is-right .roam-bot__bubble { left: auto; right: 0; transform: translate(0, 6px) scale(0.92); }
.roam-bot.is-right .roam-bot__bubble.is-on { transform: translate(0, 0) scale(1); }
.roam-bot.is-left  .roam-bot__bubble::after { left: 28px; }
.roam-bot.is-right .roam-bot__bubble::after { left: auto; right: 24px; margin-left: 0; }

.roam-trail-dot {
  position: fixed; left: 0; top: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #f4b942; box-shadow: 0 0 8px rgba(244, 185, 66, 0.8);
  z-index: 39; pointer-events: none; opacity: 0; will-change: transform, opacity;
}
.roam-ring-flash {
  position: fixed; left: 0; top: 0; width: 86px; height: 86px; margin: -43px 0 0 -43px; border-radius: 50%;
  border: 2px solid rgba(244, 185, 66, 0.85); z-index: 39; pointer-events: none; opacity: 0;
}
.roam-ring-flash.is-on { animation: roam-ring 0.9s ease-out; }
@keyframes roam-ring { 0% { opacity: 0.9; transform: var(--ring-pos) scale(0.4); } 100% { opacity: 0; transform: var(--ring-pos) scale(2.1); } }

@media (max-width: 1000px) {
  .roam-bot { --roam-w: 76px; --roam-h: 84px; }
  .roam-bot__shadow { width: 48px; margin-left: -24px; bottom: -11px; }
  .roam-bot__bubble { font-size: 12px; padding: 6px 11px; }
  .roam-ring-flash { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
}
@media (max-width: 600px) {
  .roam-bot { --roam-w: 56px; --roam-h: 62px; }
  .roam-bot__shadow { width: 36px; height: 6px; margin-left: -18px; bottom: -8px; }
  .roam-bot__bubble { font-size: 11.5px; padding: 6px 10px; bottom: calc(100% + 9px); }
  .roam-bot.is-left  .roam-bot__bubble::after { left: 20px; }
  .roam-bot.is-right .roam-bot__bubble::after { right: 18px; }
  .roam-trail-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
  .roam-ring-flash { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
}
@media (prefers-reduced-motion: reduce) {
  .roam-bot__float, .roam-bot__shadow, .roam-bot__eye, .roam-bot__antenna-tip { animation: none !important; }
  .roam-bot__eyes, .roam-bot__bubble { transition: none !important; }
  .roam-trail-dot, .roam-ring-flash { display: none !important; }
}
@media print { .roam-bot, .roam-trail-dot, .roam-ring-flash { display: none !important; } }
