@font-face { font-family: "Vazirmatn"; src: url("../vendor/fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../vendor/fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0e0f12;
  --glass: rgba(18, 19, 24, .62);
  --glass-strong: rgba(18, 19, 24, .86);
  --line: rgba(255, 255, 255, .12);
  --text: #f4f2ee;
  --muted: rgba(244, 242, 238, .66);
  --accent: #f0b24a;
  --accent-ink: #1b1406;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-family: "Vazirmatn", Tahoma, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; flex: none; }

/* ---------- صفحه شروع ---------- */
.intro { position: fixed; inset: 0; overflow: hidden; z-index: 30; transition: opacity .7s ease, visibility .7s; }
/* فقط محتوا اسکرول می‌شود؛ پس‌زمینه متحرک بیرون از لایه اسکرول است تا اسکرول روان بماند */
.intro-scroll { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: calc(72px + var(--safe-t)) 16px calc(18px + var(--safe-b)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
.intro-scroll::-webkit-scrollbar { width: 8px; }
.intro-scroll::-webkit-scrollbar-track { background: transparent; }
.intro-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 8px; }
.intro.out { opacity: 0; visibility: hidden; }
.intro-bg { position: absolute; inset: -4% -8%; background: #222 center / cover no-repeat; transform: scale(1.08); animation: pan 60s linear infinite alternate; will-change: transform; }
@keyframes pan { from { transform: scale(1.08) translateX(-4%); } to { transform: scale(1.08) translateX(4%); } }
.intro-shade { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, rgba(14,15,18,.35), rgba(14,15,18,.92) 75%), linear-gradient(to bottom, rgba(14,15,18,.2), rgba(14,15,18,.85)); }
.intro-card { position: relative; width: min(680px, 100%); margin-block: auto; text-align: center; animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.badge { display: inline-block; padding: 4px 14px; border-radius: 99px; border: 1px solid rgba(240,178,74,.55); color: var(--accent); font-weight: 700; letter-spacing: .5px; background: rgba(240,178,74,.08); }
.intro h1 { font-size: clamp(30px, 6vw, 52px); line-height: 1.25; margin: 18px 0 6px; font-weight: 700; text-wrap: balance; }
.intro .sub { margin: 0; font-size: clamp(16px, 2.4vw, 20px); color: var(--accent); }
.intro .desc { margin: 16px auto 0; max-width: 560px; line-height: 2; color: var(--muted); font-size: 15px; }
.intro .meta { margin-top: 14px; color: var(--muted); font-size: 13px; }

.guide { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.guide li { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.guide li svg { width: 40px; height: 40px; color: var(--accent); }
.guide li b { color: var(--text); font-size: 14px; }

.start-row { margin-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn-start { position: relative; border: 0; border-radius: 99px; padding: 16px 46px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 18px; box-shadow: 0 10px 40px rgba(240,178,74,.35); transition: transform .2s, box-shadow .2s, opacity .2s; }
.btn-start:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 14px 50px rgba(240,178,74,.5); }
.btn-start:disabled { opacity: .55; cursor: progress; }
.btn-start.small { padding: 12px 30px; font-size: 15px; }
.btn-ghost { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 11px 22px; }
.chk { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.chk input { accent-color: var(--accent); width: 17px; height: 17px; }

/* ---------- نمایشگر ---------- */
.app { position: fixed; inset: 0; }
#pano { position: absolute; inset: 0; background: #000; }
.pnlm-load-box, .pnlm-about-msg { display: none !important; }
.pnlm-container { font-family: inherit !important; background: #000 !important; direction: ltr; }
.pnlm-hotspot-base { left: 0; }

.topbar { position: absolute; top: calc(12px + var(--safe-t)); inset-inline: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; pointer-events: none; z-index: 5; }
.topbar > * { pointer-events: auto; }
.where { display: flex; align-items: center; gap: 10px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 99px; padding-block: 6px; padding-inline: 6px 18px; min-width: 0; }
.where .count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.where h2 { margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools { display: flex; gap: 6px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 99px; padding: 5px; }
.ic { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; transition: background .2s, color .2s; }
.ic:hover { background: rgba(255,255,255,.1); }
.ic.on { color: var(--accent); }
.ic.accent { background: var(--accent); color: var(--accent-ink); }

.navbar { position: absolute; bottom: calc(14px + var(--safe-b)); inset-inline: 12px; display: flex; align-items: center; gap: 12px; z-index: 5; }
.nav { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 99px; padding: 8px 12px; min-width: 0; max-width: 40%; transition: background .2s, opacity .2s; }
.nav:hover:not(:disabled) { background: var(--glass-strong); }
.nav.next { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.nav.next:hover { background: #f5bf62; }
.nav:disabled { opacity: .35; cursor: default; }
.nav span { display: flex; flex-direction: column; text-align: start; min-width: 0; line-height: 1.4; }
.nav small { font-size: 11px; opacity: .75; }
.nav b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav svg { width: 26px; height: 26px; }
.progress { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .6s ease; margin-inline-start: 0; }

.drag-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 24px; border-radius: var(--radius); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: none; opacity: 0; transition: opacity .5s; z-index: 4; font-size: 14px; }
.drag-hint.show { opacity: 1; }
.drag-hint svg { width: 54px; height: 54px; color: var(--accent); animation: sway 1.6s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: translateX(-12px); } 50% { transform: translateX(12px); } }

.loader { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .3s; z-index: 3; }
.loader.show { opacity: 1; }
.loader i { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: absolute; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 10px); background: var(--glass-strong); border: 1px solid var(--line); padding: 10px 18px; border-radius: 99px; font-size: 14px; opacity: 0; transition: .3s; pointer-events: none; z-index: 6; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- هات‌اسپات‌ها ---------- */
.hs { width: 54px; height: 54px; cursor: pointer; }
.hs .ring { position: absolute; inset: 0; border-radius: 50%; background: rgba(14,15,18,.55); border: 2px solid rgba(255,255,255,.92); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.4); transition: transform .2s, background .2s; }
.hs .ring svg { width: 26px; height: 26px; }
.hs::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(240,178,74,.75); animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.75); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.hs:hover .ring { transform: scale(1.1); background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hs .lbl { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 200px; text-align: center; line-height: 1.6; background: var(--glass-strong); border: 1px solid var(--line); padding: 5px 12px; border-radius: 99px; font-size: 13px; font-family: "Vazirmatn", Tahoma, sans-serif; color: var(--text); pointer-events: none; }
.hs.info { width: 40px; height: 40px; }
.hs.info::before { display: none; }
.hs.info .ring { font-weight: 700; font-family: Georgia, serif; font-size: 20px; }
.hs.info .lbl { opacity: 0; transition: opacity .2s; white-space: normal; width: max-content; max-width: 240px; text-align: center; line-height: 1.8; border-radius: 12px; }
.hs.info:hover .lbl, .hs.info.open .lbl { opacity: 1; }

/* ---------- فهرست و مودال ---------- */
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(380px, 92vw); background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-inline-end: 1px solid var(--line); z-index: 40; transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; padding-top: var(--safe-t); }
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.drawer-head h3 { margin: 0; font-size: 17px; }
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scene-item { position: relative; border: 2px solid transparent; border-radius: 12px; padding: 0; overflow: hidden; background: #1b1c22; aspect-ratio: 3 / 2; text-align: start; }
.scene-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.scene-item:hover img { transform: scale(1.06); }
.scene-item span { position: absolute; inset-inline: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.85)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-item em { position: absolute; top: 6px; inset-inline-start: 6px; font-style: normal; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.6); border-radius: 99px; padding: 1px 8px; }
.scene-item.current { border-color: var(--accent); }
.scene-item.current em { background: var(--accent); color: var(--accent-ink); }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: .3s; }
.modal.open { opacity: 1; visibility: visible; }
.modal-card { position: relative; width: min(640px, 100%); max-height: 90vh; overflow-y: auto; background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px; text-align: center; transform: translateY(12px); transition: transform .3s; }
.modal.open .modal-card { transform: none; }
.modal-card h3 { margin: 0 0 4px; font-size: 20px; }
.modal-card.center h3 { margin-top: 14px; }
.modal-card p { color: var(--muted); }
.modal-card .close { position: absolute; top: 12px; inset-inline-end: 12px; }
.modal-card .guide { margin: 18px 0 18px; }
.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px; margin-inline-end: 3px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: rgba(255,255,255,.06); font-family: inherit; color: var(--text); }
.end-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.error-box { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); line-height: 2; }

/* ---------- موبایل ---------- */
@media (max-width: 720px) {
  .guide { grid-template-columns: 1fr 1fr; }
  /* موبایل: دکمه شروع بدون اسکرول دیده شود؛ راهنما بعد از آن (و داخل تور با دکمه ؟) */
  .intro-card { display: flex; flex-direction: column; align-items: center; }
  .intro-card > * { max-width: 100%; }
  .intro-card .start-row { order: 1; margin-top: 22px; }
  .intro-card .sections { order: 2; }
  .intro-card .guide { order: 3; width: 100%; }
  .intro .guide li { padding: 12px 8px 10px; font-size: 12px; }
  .guide li svg { width: 32px; height: 32px; }
  .tools .ic { width: 36px; height: 36px; }
  .tools { gap: 2px; padding: 3px; }
  .where { padding-inline-end: 12px; }
  .nav { max-width: none; flex: 1; }
  .nav.prev b, .nav.prev small { display: none; }
  .nav.prev { flex: 0 0 auto; padding: 10px; }
  .progress { display: none; }
  .topbar { flex-wrap: wrap; }
  .hs .lbl { font-size: 12px; }
}
@media (max-width: 420px) {
  .where h2 { max-width: 34vw; }
  /* جا برای دکمه‌های اصلی در گوشی‌های باریک */
  #btnRotate, #btnFull { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-bg, .hs::before, .drag-hint svg { animation: none; }
}

/* ---------- بخش‌ها و امضا ---------- */
.where .names { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.where .names small { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.where .names small:empty { display: none; }
.sections { margin-top: 26px; }
.sections p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 99px; padding: 8px 16px; font-size: 14px; transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--accent); background: rgba(240,178,74,.12); }
.chip small { color: var(--muted); margin-inline-start: 6px; font-size: 12px; }

.credit { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; font-size: 13px; transition: color .2s; }
.credit img { width: 44px; height: 44px; object-fit: contain; margin-block: -6px; }
.credit b { color: var(--text); font-weight: 700; }
.credit:hover, .credit:hover b { color: var(--accent); }
.intro-credit { position: relative; flex: none; margin-top: 28px; max-width: 100%; text-align: center; padding: 8px 16px; border-radius: 99px; background: rgba(14,15,18,.55); border: 1px solid var(--line); }
.drawer-credit { margin: auto 16px calc(16px + var(--safe-b)); padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; justify-content: center; }

.scene-groups { overflow-y: auto; padding: 4px 16px 20px; }
.scene-groups h4 { margin: 14px 0 8px; font-size: 13px; color: var(--accent); display: flex; justify-content: space-between; }
.scene-groups h4 small { color: var(--muted); font-weight: 400; }
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.end-sections { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.end-sections .chip { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: start; }

/* ---------- زبان ---------- */
.lang-switch { position: fixed; top: calc(14px + var(--safe-t)); inset-inline-end: 14px; z-index: 3; display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); }
.lang-switch button { border: 0; background: transparent; border-radius: 99px; padding: 6px 14px; font-size: 13px; color: var(--muted); }
.lang-switch button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.lang-btn { font-weight: 700; font-size: 13px; }
.lang-menu { position: fixed; top: calc(64px + var(--safe-t)); inset-inline-end: 12px; z-index: 45; min-width: 160px; padding: 6px; border-radius: 14px; background: var(--glass-strong); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); display: flex; flex-direction: column; }
.lang-menu button { border: 0; background: transparent; text-align: start; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.lang-menu button:hover { background: rgba(255,255,255,.08); }
.lang-menu button.on { color: var(--accent); font-weight: 700; }
[dir="ltr"] .drawer { transform: translateX(-100%); }
[dir="ltr"] .drawer.open { transform: none; }
[dir="ltr"] .nav svg { transform: scaleX(-1); }
[dir="ltr"] body { letter-spacing: 0; }
.drawer:not(.open) { visibility: hidden; transition: transform .35s cubic-bezier(.2,.7,.2,1), visibility 0s .35s; }
.client-logo { display: block; margin: 0 auto 16px; max-width: 180px; max-height: 96px; object-fit: contain; filter: drop-shadow(0 4px 18px rgba(0,0,0,.45)); }

.start-from { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.start-from b { color: var(--text); }
.sec-menu { min-width: 220px; }
.sec-menu button { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.sec-menu button small { color: var(--muted); font-weight: 400; font-size: 12px; }
.sec-menu button.restart { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; color: var(--accent); }
.app-ver { margin: 14px 0 0; font-size: 11px; color: var(--muted); opacity: .7; direction: ltr; }
/* ---------- بازگشت به سایت ---------- */
.back-link { position: fixed; top: calc(14px + var(--safe-t)); inset-inline-start: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 14px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; transition: border-color .2s, background .2s; }
.back-link:hover { border-color: var(--accent); background: rgba(240,178,74,.12); }
.back-link svg { width: 18px; height: 18px; }
[dir="ltr"] .back-link svg { transform: scaleX(-1); }
a.ic { color: inherit; }
@media (max-width: 520px) { .back-link span { display: none; } .back-link { padding: 10px; } }

/* صفحه شروع: کارت‌ها بدون blur پشت‌زمینه (blur روی پس‌زمینه متحرک، اسکرول را کند می‌کند) */
.intro .guide li, .intro .chip { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(18, 19, 24, .78); }
.intro .chip:hover { background: rgba(60, 46, 22, .85); }
