/* ============================================
   منظومه — استایل تجربه‌ی فضایی
   ============================================ */
:root {
  --cy: #7de7ff;
  --cy-strong: #38bdf8;
  --amber: #ffc46b;
  --ink: #dff3ff;
  --dim: #8fb3c9;
  --glass: rgba(8, 17, 34, .62);
  --line: rgba(125, 231, 255, .28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #01030a;
  color: var(--ink);
  font-family: 'Vazirmatn', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(56, 189, 248, .35); }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- جلوه‌های روی تصویر ---------- */
.fx { position: fixed; inset: 0; pointer-events: none; }
.vignette {
  z-index: 10;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(1, 3, 10, .38) 82%, rgba(1, 3, 10, .78) 100%);
}
.scan {
  z-index: 11;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .026) 0 1px, transparent 1px 4px);
  opacity: .5;
  animation: scanMove 9s linear infinite;
}
@keyframes scanMove { to { transform: translateY(24px); } }

#frame {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 12; pointer-events: none;
  animation: frameSway 7s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
}
@keyframes frameSway {
  from { transform: rotate(-.35deg) translateY(0); }
  to   { transform: rotate(.35deg) translateY(4px); }
}

/* ---------- دکمه‌ها ---------- */
.btn {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--cy);
  background: rgba(10, 22, 44, .55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: .18s ease;
  white-space: nowrap;
}
.btn:hover {
  border-color: rgba(125, 231, 255, .75);
  box-shadow: 0 0 18px rgba(56, 189, 248, .35);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(120deg, #67e8f9, #38bdf8);
  color: #04202f;
  font-weight: 800;
  border: none;
  box-shadow: 0 4px 26px rgba(56, 189, 248, .45);
}
.btn.primary:hover { box-shadow: 0 6px 34px rgba(56, 189, 248, .7); }
.btn.ghost { background: rgba(255, 255, 255, .04); color: #cfe7f5; }
.btn.icon { padding: 9px 12px; }

/* ---------- نوار بالا ---------- */
.topbar {
  position: fixed; top: 0; right: 0; left: 0;
  z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px 22px;
  background: linear-gradient(180deg, rgba(1, 4, 12, .72), transparent);
}
.brand { display: flex; align-items: center; gap: 12px; }
.badge {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 24px; color: var(--cy);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  text-shadow: 0 0 14px var(--cy);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 22px rgba(56, 189, 248, .4); } }
.brand-t h1 { font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.brand-t p { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.topnav { display: flex; gap: 8px; }

/* ---------- برچسب سیاره‌ها ---------- */
#tags { position: fixed; inset: 0; z-index: 15; pointer-events: none; }
.tag {
  position: absolute;
  transform: translate(-50%, -135%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  pointer-events: auto;
  cursor: pointer;
  font-family: inherit;
  color: #eaffff;
  background: rgba(5, 13, 27, .78);
  border: 1px solid color-mix(in srgb, var(--c, #7de7ff) 55%, transparent);
  border-radius: 12px;
  padding: 7px 13px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .55);
  transition: scale .15s ease;
  white-space: nowrap;
}
.tag:hover { scale: 1.08; }
.tag .t-name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.tag .t-name::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c, #7de7ff);
  box-shadow: 0 0 10px var(--c, #7de7ff);
}
.tag .t-dist { font-size: 10.5px; color: var(--dim); }

/* ---------- اعلان ---------- */
#alert {
  position: fixed; top: 86px; right: 50%;
  transform: translate(50%, -8px);
  z-index: 40;
  padding: 10px 24px;
  font-size: 13.5px; font-weight: 600;
  color: var(--cy);
  background: rgba(6, 15, 30, .85);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(56, 189, 248, .25);
  opacity: 0; pointer-events: none;
  transition: .3s ease;
}
#alert.show { opacity: 1; transform: translate(50%, 0); }

/* ---------- نقشهٔ منظومه ---------- */
#mapPanel {
  position: fixed; top: 0; bottom: 0; right: 0;
  width: 330px; max-width: 88vw;
  z-index: 50;
  background: rgba(3, 8, 18, .92);
  border-inline-start: 1px solid var(--line);
  backdrop-filter: blur(16px);
  padding: 20px;
  transform: translateX(110%);
  transition: transform .35s cubic-bezier(.2, .9, .25, 1);
  display: flex; flex-direction: column;
}
#mapPanel.open { transform: translateX(0); }
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mp-head h2 { font-size: 16px; }
#mapList { list-style: none; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
#mapList li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(125, 231, 255, .12);
  border-radius: 14px;
  cursor: pointer;
  transition: .18s;
}
#mapList li:hover { border-color: rgba(125, 231, 255, .6); background: rgba(56, 189, 248, .08); }
#mapList .ml-dot {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 62%, #020610 145%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--c) 70%, transparent);
}
#mapList .ml-t { flex: 1; min-width: 0; }
#mapList .ml-t b { display: block; font-size: 14px; }
#mapList .ml-t small { font-size: 11px; color: var(--dim); direction: ltr; unicode-bidi: embed; }
#mapList .ml-d { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.mp-note { margin-top: 12px; font-size: 11px; color: var(--dim); text-align: center; }

/* ---------- کارت سیاره ---------- */
#planetCard {
  position: fixed; bottom: 108px; right: 50%;
  transform: translate(50%, 26px);
  width: min(580px, 92vw);
  z-index: 35;
  opacity: 0; pointer-events: none;
  transition: .35s cubic-bezier(.2, .9, .25, 1);
}
#planetCard.show { opacity: 1; transform: translate(50%, 0); pointer-events: auto; }
.pc-shell {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 20px;
  background: rgba(4, 10, 22, .82);
  border: 1px solid color-mix(in srgb, var(--c, #7de7ff) 45%, transparent);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 44px rgba(0, 0, 0, .6), 0 0 30px color-mix(in srgb, var(--c, #7de7ff) 18%, transparent);
}
#pcDot {
  width: 58px; height: 58px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, color-mix(in srgb, var(--c) 60%, #fff), var(--c) 62%, #020610 145%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 75%, transparent);
  margin-top: 4px;
}
.pc-body { min-width: 0; }
#pcEyebrow {
  font-size: 10.5px; letter-spacing: 1px;
  color: var(--c, var(--cy));
  font-weight: 600;
}
#pcName { font-size: 23px; font-weight: 800; margin: 2px 0; }
#pcDomain { font-size: 11.5px; color: var(--dim); text-align: right; }
#pcDesc { font-size: 13px; line-height: 1.95; color: #cfe7f5; margin: 8px 0 14px; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- داشبورد پایین ---------- */
#dash {
  position: fixed; bottom: 0; right: 0; left: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end; gap: 12px;
  padding: 26px 28px 12px;
  background: linear-gradient(0deg, rgba(1, 4, 12, .85) 20%, rgba(1, 4, 12, .3) 72%, transparent);
  pointer-events: none;
}
.gauge { width: 220px; justify-self: start; }
.gauge.alt { justify-self: end; text-align: left; }
.g-label {
  font-family: 'Orbitron', monospace;
  font-size: 9.5px; letter-spacing: 3.5px;
  color: rgba(125, 231, 255, .55);
}
.g-value { display: flex; align-items: baseline; gap: 8px; margin: 3px 0 6px; }
.gauge.alt .g-value { flex-direction: row-reverse; }
.g-value b { font-size: 26px; font-weight: 800; line-height: 1; }
.g-value small { font-size: 10.5px; color: var(--dim); }
.g-bar { height: 4px; border-radius: 4px; background: rgba(125, 231, 255, .12); overflow: hidden; }
.g-bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--cy-strong), var(--cy));
  box-shadow: 0 0 12px rgba(56, 189, 248, .8);
  transition: width .18s ease-out;
}
.gauge.alt .g-bar i { background: linear-gradient(90deg, #f59e0b, var(--amber)); box-shadow: 0 0 12px rgba(255, 196, 107, .8); }

.dash-mid { text-align: center; padding-bottom: 2px; }
#hudStatus {
  font-size: 13.5px; font-weight: 600; color: #bfe9ff;
  text-shadow: 0 0 14px rgba(56, 189, 248, .45);
}
.keys { display: flex; gap: 12px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.keys span {
  font-size: 10px; color: var(--dim);
  border: 1px solid rgba(125, 231, 255, .14);
  background: rgba(255, 255, 255, .03);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---------- اینترو ---------- */
#intro {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 115%, rgba(56, 189, 248, .14), transparent 60%),
    rgba(1, 3, 10, .72);
  backdrop-filter: blur(10px);
  transition: opacity .6s ease;
}
#intro.hide { opacity: 0; pointer-events: none; }
.intro-card {
  max-width: 540px;
  text-align: center;
  padding: 46px 40px;
  background: rgba(5, 12, 26, .66);
  border: 1px solid rgba(125, 231, 255, .2);
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), inset 0 0 60px rgba(56, 189, 248, .05);
}
.intro-eyebrow {
  font-family: 'Orbitron', monospace;
  font-size: 10.5px; letter-spacing: 4px;
  color: var(--cy); opacity: .8;
}
.intro-card h2 { font-size: 33px; font-weight: 800; margin: 14px 0 4px; }
.intro-card h2 b {
  background: linear-gradient(100deg, #a5f3fc, #38bdf8 60%, #818cf8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro-sub { font-size: 14px; line-height: 2.1; color: #b8d6e8; margin: 16px 0 28px; }
#btnStart {
  font-family: inherit;
  font-size: 16px; font-weight: 800;
  color: #04202f;
  background: linear-gradient(120deg, #67e8f9, #38bdf8);
  border: none; border-radius: 16px;
  padding: 15px 36px;
  cursor: pointer;
  box-shadow: 0 6px 34px rgba(56, 189, 248, .5);
  transition: .2s;
  animation: startPulse 2.4s ease-in-out infinite;
}
#btnStart:hover { transform: translateY(-2px) scale(1.03); }
@keyframes startPulse { 50% { box-shadow: 0 6px 48px rgba(56, 189, 248, .85); } }
.intro-hint { font-size: 11.5px; color: var(--dim); margin-top: 16px; }

/* ---------- لودینگ ---------- */
#loading {
  position: fixed; bottom: 130px; right: 50%;
  transform: translateX(50%);
  z-index: 70;
  font-size: 12px; color: var(--cy);
  background: rgba(6, 15, 30, .85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 20px;
}

/* ---------- موبایل ---------- */
@media (max-width: 760px) {
  .brand-t p { display: none; }
  .brand-t h1 { font-size: 18px; }
  .badge { width: 38px; height: 38px; font-size: 20px; }
  .topbar { padding: 12px 14px 18px; }
  .btn { font-size: 12px; padding: 8px 12px; }
  .gauge { width: 130px; }
  .g-value b { font-size: 19px; }
  .keys { display: none; }
  #dash { padding: 20px 14px 10px; }
  #planetCard { bottom: 92px; }
  .pc-shell { flex-direction: column; gap: 10px; padding: 14px 16px; }
  #pcDot { width: 44px; height: 44px; }
  #pcName { font-size: 19px; }
  .intro-card { padding: 34px 24px; }
  .intro-card h2 { font-size: 26px; }
}

/* ---------- دکمه‌های شتاب لمسی ---------- */
#touchCtl {
  position: fixed; bottom: 132px; left: 18px; z-index: 45;
  display: none; flex-direction: column; gap: 10px;
}
#touchCtl .thr {
  width: 58px; height: 58px; border-radius: 16px;
  font-size: 20px; color: var(--cy);
  background: rgba(10, 22, 44, .6);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  touch-action: none; cursor: pointer;
}
#touchCtl .thr:active { background: rgba(56, 189, 248, .28); }
@media (hover: none), (pointer: coarse) {
  #touchCtl { display: flex; }
}
