/* ===============================================
   هات پایتون — استایل اصلی
   دو تم: تیره‌آتشین (پیش‌فرض) و روشن‌آتشین
   =============================================== */

:root {
  --fire1: #ff3d8a;
  --fire2: #a855f7;
  --ember: #ff5f6d;
  --fire-grad: linear-gradient(135deg, #ff3d8a, #ff2e88 45%, #a855f7);
  --radius: 14px;
  --radius-lg: 20px;
  --font: 'Vazirmatn', Tahoma, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
  --glow: 0 0 0 1px rgba(168,85,247,.15), 0 8px 32px rgba(255,46,136,.14);
}

html[data-theme="dark"] {
  --bg: #110d22;
  --bg2: #161130;
  --surface: #1b1538;
  --raised: #251d4d;
  --text: #f4f0ff;
  --text2: rgba(233,226,255,.62);
  --border: rgba(178,132,255,.16);
  --border-strong: rgba(178,132,255,.35);
  --code-bg: #130e2a;
  --term-bg: #0e0a20;
  --ok: #7fd39a;
  --err: #ff8d80;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #eeeaf6;
  --bg2: #e4dff0;
  --surface: #f5f2fb;
  --raised: #ece7f7;
  --text: #2b2447;
  --text2: #675f88;
  --border: #d6cdea;
  --border-strong: #b3a2dd;
  --code-bg: #1c1636;
  --term-bg: #141021;
  --ok: #27754a;
  --err: #c8443a;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.hp-body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.9;
  background: var(--bg);
  color: var(--text);
  transition: background .35s ease, color .35s ease;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: rgba(255,61,138,.35); }

.hp-container { width: min(1100px, 100% - 40px); margin-inline: auto; }
.hp-page { padding: 48px 0 80px; }

/* ---------- ذرات آتش پس‌زمینه ---------- */
#hp-embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: .5; }
.hp-header, .hp-main, .hp-footer { position: relative; z-index: 1; }

/* ---------- لودر صفحه ---------- */
#hp-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: color-mix(in srgb, var(--bg) 92%, black);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
}
#hp-loader.on { opacity: 1; visibility: visible; }
.hp-loader-term {
  width: min(460px, 88vw); background: var(--term-bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--glow); overflow: hidden;
}
.hp-term-head {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid rgba(178,132,255,.15); background: rgba(168,85,247,.06);
}
.hp-term-head .d { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.hp-term-head .r { background: #ff5f57; } .hp-term-head .y { background: #febc2e; } .hp-term-head .g { background: #28c840; }
.hp-term-head em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 11px; color: rgba(224,214,255,.5); }
#hp-loader-code {
  margin: 0; padding: 16px 18px; min-height: 96px; font-size: 12.5px; line-height: 1.8;
  color: #d9ccff; white-space: pre-wrap;
}
#hp-loader-code .ok { color: #7fd39a; }
#hp-loader-code .cur { display: inline-block; width: 8px; height: 14px; background: var(--fire1); animation: hpBlink .7s steps(1) infinite; vertical-align: middle; }
.hp-loader-bar { height: 4px; background: rgba(178,132,255,.15); }
.hp-loader-bar i { display: block; height: 100%; width: 0; background: var(--fire-grad); animation: hpLoadBar .45s ease forwards; }
@keyframes hpLoadBar { to { width: 100%; } }
@keyframes hpBlink { 50% { opacity: 0; } }

/* ---------- هدر ---------- */
.hp-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.hp-header-in { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.hp-logo { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; }
.hp-logo-text b { background: var(--fire-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-logo-flame { display: inline-block; animation: hpFlick 2.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes hpFlick { 0%,100% { transform: scale(1) rotate(-2deg); } 30% { transform: scale(1.12) rotate(3deg); } 60% { transform: scale(.95) rotate(-3deg); } }
.hp-nav { display: flex; gap: 4px; margin-inline-start: 8px; flex-wrap: wrap; }
.hp-nav a { padding: 7px 12px; border-radius: 10px; font-size: 14.5px; color: var(--text2); transition: .2s; }
.hp-nav a:hover, .hp-nav a.active { color: var(--text); background: rgba(168,85,247,.1); }
.hp-header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.hp-xp-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: rgba(168,85,247,.08); transition: .2s;
}
.hp-xp-chip:hover { box-shadow: var(--glow); }
.hp-theme-toggle {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 16px; display: grid; place-items: center; transition: .2s;
}
.hp-theme-toggle:hover { border-color: var(--border-strong); transform: rotate(15deg); }
html[data-theme="dark"] .tt-sun { display: none; }
html[data-theme="light"] .tt-moon { display: none; }
.hp-user-btn {
  padding: 8px 18px; border-radius: 12px; font-weight: 700; font-size: 14px;
  background: var(--fire-grad); color: #fff; box-shadow: 0 4px 16px rgba(255,46,136,.3); transition: .2s;
}
.hp-user-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(255,46,136,.42); }
.hp-burger { display: none; }

/* ---------- دکمه‌ها ---------- */
.hp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 13px; font-family: var(--font); font-size: 15.5px; font-weight: 700;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; transition: .2s;
}
.hp-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hp-btn.primary { background: var(--fire-grad); border: none; color: #fff; box-shadow: 0 4px 18px rgba(255,46,136,.3); }
.hp-btn.primary:hover { box-shadow: 0 8px 26px rgba(255,46,136,.45); }
.hp-btn.small { padding: 8px 16px; font-size: 13.5px; border-radius: 10px; }
.hp-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- کارت‌ها و سکشن‌ها ---------- */
.hp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; transition: .25s;
}
.hp-card.hoverable:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--glow); }
.hp-section { padding: 64px 0; }
.hp-kicker {
  display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .5px;
  color: var(--fire1); background: rgba(255,61,138,.1); border: 1px solid rgba(255,61,138,.25);
  padding: 4px 14px; border-radius: 999px; margin-bottom: 14px;
}
.hp-section-title { font-size: 30px; font-weight: 900; margin: 0 0 10px; line-height: 1.5; }
.hp-section-sub { color: var(--text2); max-width: 640px; margin: 0 0 34px; }
.hp-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hp-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.hp-page-title { font-size: 34px; font-weight: 900; margin: 0 0 8px; }
.hp-page-sub { color: var(--text2); margin: 0 0 32px; max-width: 660px; }

/* ---------- هیرو ---------- */
.hp-hero { padding: 72px 0 56px; position: relative; }
.hp-hero-in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hp-hero-title { font-size: 44px; font-weight: 900; line-height: 1.6; margin: 0 0 16px; }
.hp-hero-title em { font-style: normal; background: var(--fire-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-hero-sub { font-size: 17px; color: var(--text2); margin: 0 0 28px; max-width: 520px; }
.hp-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hp-hero-stats { display: flex; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.hp-stat b { display: block; font-size: 24px; font-weight: 900; color: var(--fire1); }
.hp-stat span { font-size: 13px; color: var(--text2); }

/* ترمینال هیرو */
.hp-hero-term {
  background: var(--term-bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--glow); overflow: hidden;
  animation: hpFloat 5s ease-in-out infinite;
}
@keyframes hpFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hp-hero-term pre {
  margin: 0; padding: 20px; font-size: 13.5px; line-height: 2; color: #ece6ff;
  direction: ltr; text-align: left; white-space: pre-wrap; min-height: 220px;
}
.hp-hero-term .c-kw { color: #d98cff; } .hp-hero-term .c-str { color: #ffd166; }
.hp-hero-term .c-fn { color: #7fd39a; } .hp-hero-term .c-cm { color: rgba(224,214,255,.4); }

/* ---------- کارت دوره ---------- */
.hp-course-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.hp-course-card .hp-course-emoji { font-size: 38px; line-height: 1; }
.hp-course-card h3 { margin: 0; font-size: 20px; font-weight: 800; }
.hp-course-card p { margin: 0; color: var(--text2); font-size: 14px; flex: 1; }
.hp-course-meta { display: flex; gap: 12px; font-size: 12.5px; color: var(--text2); }
.hp-course-card.locked { filter: grayscale(.4); }
.hp-course-card.locked::after {
  content: "🔒 به‌زودی...";
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 20px; font-weight: 900;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.hp-progressbar { height: 8px; border-radius: 99px; background: rgba(168,85,247,.14); overflow: hidden; }
.hp-progressbar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--fire-grad); transition: width .6s ease; }

/* ---------- نقشه‌ی دوره (مسیر بازی) ---------- */
.hp-map { display: flex; flex-direction: column; gap: 0; max-width: 620px; margin-inline: auto; padding: 20px 0; }
.hp-map-row { display: flex; align-items: center; gap: 16px; position: relative; padding: 10px 0; }
.hp-map-row:nth-child(even) { flex-direction: row-reverse; text-align: left; }
.hp-map-row::before {
  content: ""; position: absolute; top: -26px; bottom: -26px; right: 31px; width: 3px;
  background: repeating-linear-gradient(to bottom, var(--border-strong) 0 6px, transparent 6px 13px);
  z-index: -1;
}
.hp-map-row:nth-child(even)::before { right: auto; left: 31px; }
.hp-map-row:first-child::before { top: 40px; }
.hp-map-row:last-child::before { bottom: 40px; }
.hp-map-node {
  flex-shrink: 0; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; font-size: 21px; font-weight: 900;
  background: var(--surface); border: 2px solid var(--border-strong); transition: .2s; position: relative;
}
.hp-map-row a { display: flex; align-items: center; gap: 16px; flex: 1; padding: 8px 12px; border-radius: 14px; transition: .2s; }
.hp-map-row:nth-child(even) a { flex-direction: row-reverse; }
.hp-map-row a:hover { background: rgba(168,85,247,.07); }
.hp-map-row a:hover .hp-map-node { transform: scale(1.1); box-shadow: var(--glow); }
.hp-map-info h4 { margin: 0; font-size: 15.5px; font-weight: 800; }
.hp-map-info span { font-size: 12.5px; color: var(--text2); }
.hp-map-row.done .hp-map-node { background: var(--fire-grad); border-color: transparent; color: #fff; }
.hp-map-row.current .hp-map-node { border-color: var(--fire1); animation: hpPulse 1.8s ease infinite; }
@keyframes hpPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,61,138,.4); } 50% { box-shadow: 0 0 0 12px rgba(255,61,138,0); } }
.hp-map-row.locked { opacity: .45; pointer-events: none; }

/* ---------- درس ---------- */
.hp-lesson-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.hp-lesson-emoji { font-size: 40px; }
.hp-lesson-xp { margin-inline-start: auto; font-weight: 800; font-size: 14px; color: var(--fire1); background: rgba(255,61,138,.1); border-radius: 999px; padding: 5px 14px; }
.hp-story {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: rgba(255,95,150,.06); padding: 16px 20px; margin: 18px 0; font-size: 15px;
}
.hp-story::before { content: "📖 قصه‌ی این مرحله"; display: block; font-size: 12px; font-weight: 800; color: var(--fire1); margin-bottom: 4px; }
.hp-prose { font-size: 15.5px; }
.hp-prose h2 { font-size: 22px; margin: 34px 0 10px; font-weight: 800; }
.hp-prose h3 { font-size: 18px; margin: 26px 0 8px; font-weight: 800; }
.hp-prose p { margin: 10px 0; }
.hp-prose code { background: rgba(168,85,247,.12); padding: 2px 7px; border-radius: 6px; font-size: .88em; direction: ltr; unicode-bidi: embed; }
.hp-code {
  background: var(--code-bg); color: #ece6ff; border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 16px 18px; direction: ltr; text-align: left;
  font-size: 13.5px; line-height: 2; overflow-x: auto; margin: 14px 0; white-space: pre;
}
.hp-tip, .hp-warn {
  display: flex; gap: 10px; padding: 14px 18px; border-radius: var(--radius); margin: 14px 0; font-size: 14.5px;
}
.hp-tip { background: rgba(127,211,154,.1); border: 1px solid rgba(127,211,154,.3); }
.hp-warn { background: rgba(255,141,128,.1); border: 1px solid rgba(255,141,128,.3); }

/* ---------- ادیتور و ترمینال ---------- */
.hp-editor-wrap { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); overflow: hidden; margin: 18px 0; box-shadow: var(--shadow); }
.hp-editor-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: rgba(168,85,247,.07); border-bottom: 1px solid var(--border);
}
.hp-editor-toolbar .t { font-size: 13px; font-weight: 800; }
.hp-editor-toolbar .sp { flex: 1; }
.hp-editor {
  width: 100%; min-height: 190px; resize: vertical; border: 0; outline: none;
  background: var(--code-bg); color: #ece6ff; font-family: var(--mono);
  font-size: 14px; line-height: 2; padding: 16px 18px; direction: ltr; text-align: left;
  tab-size: 4; display: block;
}
.hp-run-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 20px; border: 0; border-radius: 10px;
  background: var(--fire-grad); color: #fff; font-family: var(--font); font-weight: 800; font-size: 13.5px;
  cursor: pointer; transition: .2s; box-shadow: 0 3px 12px rgba(255,46,136,.3);
}
.hp-run-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(255,46,136,.45); }
.hp-run-btn[disabled] { opacity: .55; cursor: wait; }
.hp-term {
  background: var(--term-bg); border-top: 1px solid var(--border);
}
.hp-term-out {
  margin: 0; padding: 14px 18px; min-height: 72px; max-height: 320px; overflow-y: auto;
  direction: ltr; text-align: left; font-family: var(--mono); font-size: 13.5px; line-height: 1.9;
  color: #d9ffe3; white-space: pre-wrap; word-break: break-word;
}
.hp-term-out .err { color: var(--err); }
.hp-term-out .sys { color: rgba(224,214,255,.45); }

/* ---------- آزمون ---------- */
.hp-quiz { margin: 26px 0; }
.hp-quiz-q { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; background: var(--surface); }
.hp-quiz-q h4 { margin: 0 0 12px; font-size: 15.5px; }
.hp-quiz-opt {
  display: block; width: 100%; text-align: right; font-family: var(--font); font-size: 14.5px;
  background: var(--bg2); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 11px; padding: 10px 16px; margin: 8px 0; cursor: pointer; transition: .18s;
}
.hp-quiz-opt:hover { border-color: var(--border-strong); transform: translateX(-3px); }
.hp-quiz-opt.correct { border-color: var(--ok); background: rgba(127,211,154,.14); }
.hp-quiz-opt.wrong { border-color: var(--err); background: rgba(255,141,128,.12); animation: hpShake .3s; }
.hp-quiz-opt[disabled] { cursor: default; opacity: .8; }
@keyframes hpShake { 25% { transform: translateX(-4px);} 75% { transform: translateX(4px);} }
.hp-quiz-why { font-size: 13px; color: var(--text2); margin-top: 8px; display: none; }
.hp-quiz-q.answered .hp-quiz-why { display: block; }

/* ---------- چالش ---------- */
.hp-challenge {
  border: 2px solid var(--border-strong); border-radius: var(--radius-lg);
  padding: 22px 24px; margin: 30px 0; background: linear-gradient(160deg, rgba(255,61,138,.08), transparent 60%);
}
.hp-challenge > h3 { margin: 0 0 8px; font-size: 18px; }
.hp-hint { margin-top: 10px; }
.hp-hint summary { cursor: pointer; font-size: 13.5px; color: var(--fire1); font-weight: 700; }
.hp-hint p { font-size: 13.5px; color: var(--text2); }

/* ---------- ناوبری درس ---------- */
.hp-lesson-nav { display: flex; gap: 12px; justify-content: space-between; margin-top: 40px; flex-wrap: wrap; }

/* ---------- فرم‌ها ---------- */
.hp-auth-wrap { max-width: 440px; margin-inline: auto; }
.hp-field { margin-bottom: 16px; }
.hp-field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.hp-field input {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--bg2); color: var(--text); font-family: var(--font); font-size: 15px; outline: none; transition: .2s;
}
.hp-field input:focus { border-color: var(--fire1); box-shadow: 0 0 0 4px rgba(255,61,138,.12); }
.hp-auth-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.hp-auth-tabs button {
  flex: 1; padding: 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg2);
  color: var(--text2); font-family: var(--font); font-weight: 800; font-size: 14.5px; cursor: pointer; transition: .2s;
}
.hp-auth-tabs button.on { background: var(--fire-grad); color: #fff; border-color: transparent; }
.hp-form-msg { font-size: 13.5px; margin-top: 12px; min-height: 20px; }
.hp-form-msg.ok { color: var(--ok); } .hp-form-msg.err { color: var(--err); }

/* ---------- کارنامه و مدال‌ها ---------- */
.hp-report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.hp-report-stat { text-align: center; padding: 22px 10px; }
.hp-report-stat b { display: block; font-size: 30px; font-weight: 900; color: var(--fire1); }
.hp-report-stat span { font-size: 13px; color: var(--text2); }
.hp-medals { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.hp-medal {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--border-strong); background: rgba(192,132,252,.08); font-size: 14px; font-weight: 700;
}
.hp-medal .ic { font-size: 19px; }
.hp-medal.off { opacity: .35; filter: grayscale(1); }

/* ---------- توست‌ها ---------- */
#hp-toasts { position: fixed; bottom: 24px; left: 24px; z-index: 9000; display: flex; flex-direction: column; gap: 10px; }
.hp-toast {
  background: var(--raised); border: 1px solid var(--border-strong); border-radius: 14px;
  padding: 13px 20px; font-size: 14.5px; font-weight: 700; box-shadow: var(--glow);
  display: flex; align-items: center; gap: 10px; animation: hpToastIn .35s cubic-bezier(.2,.9,.3,1.3);
}
.hp-toast .big { font-size: 22px; }
@keyframes hpToastIn { from { opacity: 0; transform: translateY(16px) scale(.9); } }
.hp-toast.out { opacity: 0; transform: translateY(10px); transition: .3s; }

/* ---------- فوتر ---------- */
.hp-footer { border-top: 1px solid var(--border); background: var(--bg2); margin-top: 40px; }
.hp-footer-in { display: flex; gap: 32px; align-items: center; padding: 36px 0; flex-wrap: wrap; }
.hp-footer-brand { display: flex; gap: 12px; align-items: flex-start; max-width: 380px; }
.hp-footer-brand .hp-logo-flame { font-size: 26px; }
.hp-footer-title { font-weight: 900; font-size: 18px; }
.hp-footer-title b { background: var(--fire-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hp-footer-brand p { margin: 4px 0 0; font-size: 13.5px; color: var(--text2); }
.hp-footer-nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--text2); }
.hp-footer-nav a:hover { color: var(--fire1); }
.hp-footer-meta { margin-inline-start: auto; font-size: 12.5px; color: var(--text2); }

/* ---------- ریویل اسکرول ---------- */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.rv.rv-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 980px) {
  .hp-hero-in { grid-template-columns: 1fr; gap: 32px; }
  .hp-hero-title { font-size: 34px; }
  .hp-grid3 { grid-template-columns: 1fr 1fr; }
  .hp-report-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hp-nav {
    display: none; position: absolute; top: 66px; right: 0; left: 0; flex-direction: column;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 20px 18px; gap: 2px;
  }
  .hp-nav.open { display: flex; }
  .hp-nav a { padding: 12px 14px; font-size: 15.5px; }
  .hp-burger {
    display: inline-flex; flex-direction: column; gap: 4.5px; background: none; border: 0; cursor: pointer; padding: 8px;
  }
  .hp-burger span { width: 21px; height: 2.5px; border-radius: 3px; background: var(--text); transition: .2s; }
  .hp-grid3, .hp-grid2 { grid-template-columns: 1fr; }
  .hp-hero { padding: 40px 0 28px; }
  .hp-hero-title { font-size: 29px; }
  .hp-section { padding: 44px 0; }
  .hp-section-title { font-size: 24px; }
  .hp-page-title { font-size: 27px; }
  .hp-card { padding: 20px; }
  .hp-map-row:nth-child(even) { flex-direction: row; }
  .hp-map-row:nth-child(even)::before { left: auto; right: 31px; }
  .hp-map-row:nth-child(even) a { flex-direction: row; }
  #hp-toasts { left: 12px; right: 12px; bottom: 12px; }
}

/* ---------- ورودی (input) داخل خود ترمینال ---------- */
.hp-term-input {
  background: transparent; border: none; outline: none;
  border-bottom: 1px dashed rgba(178,132,255,.55);
  color: #7fd39a; font-family: var(--mono); font-size: inherit;
  width: min(240px, 58%); padding: 0 4px; margin-inline-start: 6px;
  caret-color: #ff3d8a;
}
.hp-term-input:focus { border-bottom-color: #ff3d8a; }
.hp-term-input::placeholder { color: rgba(224,214,255,.35); font-family: var(--font); font-size: 12px; }
[data-hp-out] .echo { color: #7fd39a; }
[data-hp-out] .inline-input-line .prompt { color: #d9ccff; }

/* ---------- لینک فعال منو: قرص بنفش نئونی ---------- */
.hp-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255,61,138,.8), rgba(168,85,247,.9));
  box-shadow: 0 4px 14px rgba(168,85,247,.35);
}
html[data-theme="light"] .hp-nav a.active { color: #fff; }

/* ---------- لودر شعله‌ای: آتشی که پر می‌شود ---------- */
.hp-loader-flame { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hp-flame-shell { position: relative; font-size: 104px; line-height: 1; animation: hpFlamePulse 1.1s ease-in-out infinite; filter: drop-shadow(0 0 36px rgba(255,61,138,.5)); }
.hp-flame-bg { opacity: .15; filter: grayscale(1); }
.hp-flame-fill { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); }
@keyframes hpFlamePulse { 50% { transform: scale(1.07) rotate(-2deg); } }
.hp-loader-label { font-weight: 700; font-size: 15px; color: var(--text2); }
.hp-loader-pct { font-family: var(--mono); font-weight: 800; font-size: 21px; background: var(--fire-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- نشان‌های شناور دور ترمینال هیرو ---------- */
.hp-hero-visual { position: relative; }
.hp-float {
  position: absolute; z-index: 2; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; font-size: 27px;
  background: var(--raised); border: 1px solid var(--border-strong);
  box-shadow: 0 12px 30px rgba(0,0,0,.35), 0 0 20px rgba(168,85,247,.3);
  animation: hpFloat 4.2s ease-in-out infinite;
}
.hp-float.f1 { top: -22px; left: -16px; }
.hp-float.f2 { top: 40%; right: -24px; animation-delay: 1.4s; }
.hp-float.f3 { bottom: -18px; left: 20%; animation-delay: 2.4s; }
@keyframes hpFloat { 50% { transform: translateY(-11px); } }
@media (max-width: 700px) { .hp-float { width: 44px; height: 44px; font-size: 20px; } }

/* ---------- دکمه‌های قرصی پرانرژی ---------- */
.hp-btn, .hp-user-btn { border-radius: 999px; }
.hp-btn.primary:hover, .hp-user-btn:hover { transform: translateY(-2px) scale(1.03); }

/* ---------- ترمینال و ادیتور خوشگل‌تر ---------- */
.hp-hero-term { border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 44px rgba(168,85,247,.16); }
.hp-hero-term .c-out { color: #7fd39a; text-shadow: 0 0 12px rgba(127,211,154,.4); }
.hp-editor, .hp-term-out, #hp-hero-code { font-family: var(--mono); font-feature-settings: "liga" 1, "calt" 1; }
.hp-editor { font-size: 14.5px; line-height: 2.05; letter-spacing: .2px; }
.hp-term-out { font-size: 13.5px; line-height: 2.05; }
.hp-term-out .sys { text-shadow: 0 0 10px rgba(168,85,247,.35); }
.hp-editor-toolbar { background: linear-gradient(90deg, rgba(255,61,138,.1), rgba(168,85,247,.12)); border-bottom: 1px solid var(--border); }
.hp-editor::-webkit-scrollbar, .hp-term-out::-webkit-scrollbar { width: 9px; height: 9px; }
.hp-editor::-webkit-scrollbar-thumb, .hp-term-out::-webkit-scrollbar-thumb { background: rgba(168,85,247,.35); border-radius: 99px; }
.hp-editor::-webkit-scrollbar-thumb:hover, .hp-term-out::-webkit-scrollbar-thumb:hover { background: rgba(255,61,138,.45); }

/* ---------- انتقال نرم بین صفحه‌ها ---------- */
.hp-main { animation: hpPageIn .45s ease both; transition: opacity .16s ease, transform .16s ease; }
@keyframes hpPageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body.hp-page-out .hp-main { opacity: 0; transform: translateY(-8px); }

/* ---------- لودینگ سریع اجرای کد داخل ترمینال ---------- */
[data-hp-out] .hp-run-wait { display: block; animation: hpBlink 1s ease-in-out infinite; }
@keyframes hpBlink { 50% { opacity: .4; } }
.hp-btn.running { opacity: .85; cursor: progress; }
