/* دکمه بازنشانی مدل در AR */
.ar-reset-btn {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 9999;
  min-width: 148px; /* کمی کوچک‌تر تا در کنار هم بهتر جا شوند */
  max-width: 80vw;
  padding: 13px 22px 14px; /* پدینگ کمتر */
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(135deg,#233871 0%,#2d4588 55%,#1a2b56 100%);
  color: #fff;
  font-size: 13.5px; /* اندکی کوچکتر */
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .4px;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Vazirmatn",sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 48px -16px rgba(0,0,0,.85),0 8px 26px -10px rgba(0,0,0,.65),0 0 0 1px rgba(255,255,255,.18),inset 0 1px 0 rgba(255,255,255,.12);
  transition: box-shadow .35s ease, transform .25s ease, background .6s ease;
  -webkit-tap-highlight-color: transparent;
}

.ar-reset-btn:active { transform: translateX(-50%) scale(.94); }

@media (hover:hover) and (pointer:fine){
  .ar-reset-btn:hover { background:linear-gradient(135deg,#2a4380 0%,#355290 55%,#1f3464 100%); box-shadow:0 26px 60px -18px rgba(0,0,0,.9),0 10px 34px -10px rgba(0,0,0,.7),0 0 0 1px rgba(255,255,255,.25),inset 0 1px 0 rgba(255,255,255,.18); }
}

/* افکت ضربان بعد از کلیک */
.ar-reset-btn.pulse { animation: arPulse .4s ease; }
@keyframes arPulse {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(.88); }
  100% { transform: translateX(-50%) scale(1); }
}

/* حالت روشن (اگر در آینده تم روشن خواستی) */
:root.light .ar-reset-btn { background:linear-gradient(145deg,#fafafa,#e7e7e7); color:#ff8c1f; box-shadow:0 6px 18px -6px rgba(0,0,0,.28),0 0 0 1px #d0d0d5; }

/* (حذف شد: متن راهنما) */

/* دکمه راهنما بالا */
.ar-help-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  min-width: 132px;
  padding: 16px 26px 17px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .45px;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Vazirmatn",sans-serif;
  background: linear-gradient(135deg,#233871 0%,#2d4588 55%,#1a2b56 100%);
  color: #fff;
  box-shadow: 0 18px 48px -16px rgba(0,0,0,.85),0 8px 26px -10px rgba(0,0,0,.65),0 0 0 1px rgba(255,255,255,.18),inset 0 1px 0 rgba(255,255,255,.12);
  cursor: pointer;
  transition: box-shadow .35s ease, transform .25s ease, background .6s ease;
  -webkit-tap-highlight-color: transparent;
}
.ar-help-btn:active { transform: scale(.94); }
@media (hover:hover) and (pointer:fine){ .ar-help-btn:hover { background:linear-gradient(135deg,#2a4380 0%,#355290 55%,#1f3464 100%); box-shadow:0 26px 60px -18px rgba(0,0,0,.9),0 10px 34px -10px rgba(0,0,0,.7),0 0 0 1px rgba(255,255,255,.25),inset 0 1px 0 rgba(255,255,255,.18); } }

/* پنل شیشه ای راهنما */
.ar-help-panel {
  position: fixed;
  inset: 0;
  background: rgba(15,20,40,.55);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(18px,4vw,40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  z-index: 12000;
}
.ar-help-panel.open { opacity:1; pointer-events:auto; }
.ar-help-panel__inner {
  width: min(480px,90vw);
  background: linear-gradient(155deg,rgba(35,56,113,.88),rgba(15,23,69,.88));
  border-radius: 30px;
  padding: 24px 26px 30px;
  color: #f3f6fc;
  box-shadow: 0 26px 60px -18px rgba(0,0,0,.8),0 10px 34px -10px rgba(0,0,0,.65),0 0 0 1px rgba(255,255,255,.18),inset 0 0 0 1px rgba(255,255,255,.08);
  position: relative;
  animation: panelPop .55s cubic-bezier(.4,.78,.25,1);
  direction: rtl;
  text-align: right;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@keyframes panelPop { from { opacity:0; transform:translateY(22px) scale(.94);} to { opacity:1; transform:translateY(0) scale(1);} }
.ar-help-panel__inner h2 { margin:0 0 16px; font-size:clamp(17px,2.6vw,20px); letter-spacing:.5px; text-align:right; }
.ar-help-panel__inner ul { margin:0; padding:0 1em 0 0; font-size:clamp(13px,2.1vw,14.5px); line-height:1.6; list-style:none; }
.ar-help-panel__inner li { margin:0 0 8px; position:relative; padding-right:16px; }
.ar-help-panel__inner li:last-child { margin-bottom:0; }
.ar-help-panel__inner li:before {
  content:"";
  position:absolute;
  top:.55em;
  right:0;
  width:8px; height:8px;
  border-radius:50%;
  background:linear-gradient(135deg,#ff9620,#ff7a10);
  box-shadow:0 0 0 3px rgba(255,140,20,.25);
}
.ar-help-list strong { color:#ffb347; font-weight:700; text-shadow:0 2px 6px rgba(0,0,0,.35); }
.ar-help-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border:0;
  border-radius:16px;
  cursor:pointer;
  background: linear-gradient(135deg,#233871,#1a2b56);
  color:#fff;
  font-size:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 26px -10px rgba(0,0,0,.7),0 4px 14px -6px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.15),inset 0 1px 0 rgba(255,255,255,.08);
  transition:box-shadow .28s ease, transform .28s ease, background .55s;
}
/* Responsive tightening for small screens */
@media (max-width: 540px){
  .ar-help-panel { padding:20px; }
  .ar-help-panel__inner { padding:20px 20px 24px; border-radius:24px; max-height: calc(100dvh - 36px); }
  .ar-help-panel__inner h2 { font-size:clamp(16px,4.2vw,18px); margin-bottom:14px; }
  .ar-help-panel__inner ul { font-size:clamp(12.5px,3.6vw,13.5px); line-height:1.55; }
  .ar-help-panel__inner li { margin-bottom:6px; }
  .ar-help-close { top:8px; left:8px; width:38px; height:38px; }
}
@media (max-height: 640px){
  .ar-help-panel__inner { padding:18px 18px 22px; }
  .ar-help-panel__inner h2 { margin-bottom:12px; }
}

/* نسبت خیلی بلند: کمی کاهش عرض برای حس تعادل */
@media (min-aspect-ratio: 9/18){
  .ar-help-panel__inner { width: min(440px,88vw); }
}

/* safe-area در دستگاه‌های notch */
.ar-help-panel__inner { padding-top: calc(env(safe-area-inset-top,0) + 20px); padding-bottom: calc(env(safe-area-inset-bottom,0) + 26px); }

/* قفل اسکرول پس‌زمینه وقتی پنل باز است (با افزودن کلاس به body در اسکریپت در صورت نیاز) */
body.help-open { overflow:hidden; touch-action:none; }
.ar-help-close:active { transform:scale(.9); }
@media (hover:hover) and (pointer:fine){ .ar-help-close:hover { background:linear-gradient(135deg,#2a4380,#233871); box-shadow:0 16px 34px -14px rgba(0,0,0,.75),0 6px 18px -8px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.2); } }

/* دکمه اجرای انیمیشن کنار دکمه ریست در AR مبتنی بر تصویر */
.ar-play-btn {
  position: fixed;
  bottom: 22px;
  left: calc(50% + 205px); /* فاصله متعادل از دکمه ریست */
  transform: translateX(-50%);
  z-index: 9999;
  min-width: 128px; /* کمی کوچک‌تر */
  max-width: 70vw;
  padding: 11px 16px 12px; /* پدینگ کمتر */
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(135deg,#233871 0%,#2d4588 55%,#1a2b56 100%);
  color: #fff;
  font-size: 12.5px; /* فونت کوچکتر */
  font-weight: 700;
  letter-spacing: .3px;
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Vazirmatn",sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 42px -16px rgba(0,0,0,.8),0 8px 22px -10px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.16),inset 0 1px 0 rgba(255,255,255,.1);
  transition: box-shadow .35s ease, transform .25s ease, background .6s ease;
}
.ar-play-btn:active { transform: translateX(-50%) scale(.94); }
@media (hover:hover) and (pointer:fine){ .ar-play-btn:hover { background:linear-gradient(135deg,#2a4380 0%,#355290 55%,#1f3464 100%); box-shadow:0 24px 54px -18px rgba(0,0,0,.9),0 10px 30px -10px rgba(0,0,0,.7),0 0 0 1px rgba(255,255,255,.22),inset 0 1px 0 rgba(255,255,255,.12); } }
/* افکت ضربان برای دکمه اجرا */
.ar-play-btn.pulse { animation: arPulse .35s ease; }

/* چیدمان واکنش‌گرا: تلاش برای کنار هم نگه داشتن در عرض‌های کم با کوچک‌سازی بیشتر */
@media (max-width: 480px){
  .ar-reset-btn { min-width: 132px; padding: 12px 18px 13px; font-size: 13px; }
  .ar-play-btn { min-width: 116px; font-size: 12px; left: calc(50% + 165px); bottom: 22px; }
}

/* وقتی دکمه‌ها داخل کانتینر ar-bottom-controls قرار دارند، پوزیشن را از fixed به flow برگردان */
.ar-bottom-controls .ar-reset-btn,
.ar-bottom-controls .ar-play-btn {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
}
/* رفتار active بدون شیفت افقی */
.ar-bottom-controls .ar-reset-btn:active,
.ar-bottom-controls .ar-play-btn:active { transform: scale(.94); }

/* پالس بدون translateX برای حالت داخل کانتینر */
@keyframes arPulseNoShift {
  0% { transform: scale(1); }
  50% { transform: scale(.88); }
  100% { transform: scale(1); }
}
.ar-bottom-controls .ar-reset-btn.pulse,
.ar-bottom-controls .ar-play-btn.pulse { animation: arPulseNoShift .35s ease; }
