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

body {
  font-family: Vazirmatn, monospace;
  background: #f5f1e8;
  color: #1a1a1a;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  direction: rtl; /* تنظیم جهت کل صفحه به راست‌چین */
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

/* Vintage stains */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(139,119,101,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139,119,101,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139,119,101,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* ─── INTRO SCREEN ─── */
#intro-screen {
  /* تبدیل از fixed به طرح منعطف برای جلوگیری از گیر کردن اسکرول */
  width: 100%;
  min-height: 100vh;
  background: #f5f1e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem 1rem;
  border: 15px solid #1a1a1a; /* حاشیه کمی نازک‌تر برای باز شدن فضا */
  border-style: double;
  position: relative;
}

.radio-icon {
  font-size: 4.5rem;
  animation: flicker 3s infinite;
  margin-bottom: 1rem;
  filter: grayscale(1) contrast(1.2);
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
  75% { opacity: 0.95; }
}

.intro-title {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 900;
  text-align: center;
  color: #1a1a1a;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0em; /* در فارسی فاصله حروف زیاد جالب نمیشود */
  border-top: 4px solid #1a1a1a;
  border-bottom: 4px solid #1a1a1a;
  padding: 1rem 0;
  font-family: Vazirmatn;
}

.intro-subtitle {
  font-size: 0.95rem;
  color: #4a4a4a;
  text-align: center;
  max-width: 500px;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.start-btn {
  background: #1a1a1a;
  border: 3px solid #1a1a1a;
  color: #f5f1e8;
  font-family: Vazirmatn, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.8rem 2.5rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.start-btn:hover {
  background: #f5f1e8;
  color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: -5px 5px 0 #1a1a1a; /* سایه برای راست‌چین اصلاح شد */
}

/* ─── MAIN GAME ─── */
#game-screen {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem; /* پدینگ کاهش یافت تا فضای بیشتری به متن برسد */
  min-height: 100vh;
  position: relative;
  z-index: 2;
  background: #f5f1e8;
  border-left: 1px solid rgba(0,0,0,0.1);
  border-right: 1px solid rgba(0,0,0,0.1);
}

/* Newspaper masthead */
.game-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 4px double #1a1a1a;
  border-top: 4px double #1a1a1a;
  padding-top: 1rem;
}

.chapter-badge {
  background: #1a1a1a;
  color: #f5f1e8;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.trust-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: #4a4a4a;
  margin-top: 0.8rem;
  font-weight: bold;
}

.trust-bar-container {
  width: 150px;
  height: 10px;
  background: #fff;
  border: 2px solid #1a1a1a;
  overflow: hidden;
  direction: ltr; /* نوار پر شدن بهتر است چپ به راست بماند */
}

.trust-bar-fill {
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #1a1a1a,
    #1a1a1a 5px,
    #2a2a2a 5px,
    #2a2a2a 10px
  );
  transition: width 0.8s ease;
}

/* Story Card - Newspaper Article Style */
.story-card {
  background: #fff;
  border: 3px solid #1a1a1a;
  padding: 1.5rem; /* کاهش پدینگ داخلی برای فشرده‌سازی */
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: -6px 6px 0 rgba(0,0,0,0.1); /* جهت سایه اصلاح شد */
}

.story-card::before {
  content: '★ ★ ★';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: #f5f1e8;
  padding: 0 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.5em;
}

.historical-tag {
  display: inline-block;
  background: #1a1a1a;
  color: #f5f1e8;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.year-tag {
  background: #fff;
  border: 2px solid #1a1a1a;
  color: #1a1a1a;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: inline-block;
  margin-right: 0.5rem; /* به جای margin-left در راست‌چین */
}

.story-title {
  font-size: 1.5rem; /* سایز کمی کوچکتر شد */
  font-weight: 900;
  color: #1a1a1a;
  margin-bottom: 1rem;
  line-height: 1.4;
  font-family: Vazirmatn, monospace;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 0.8rem;
}

.story-text {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #2a2a2a;
  text-align: justify;
}

/* 
  کد استایل حرف اول (first-letter) به طور کامل حذف شد
  چون در زبان فارسی حروف به هم چسبیده را خراب می‌کند.
*/

.story-text .highlight {
  background: #1a1a1a;
  color: #f5f1e8;
  padding: 0 0.3rem;
  font-weight: 700;
}

.story-text .danger {
  border-bottom: 3px solid #1a1a1a;
  font-weight: 700;
}

.story-text .success {
  text-decoration: underline;
  text-decoration-style: double;
  font-weight: 700;
}

/* Analogy Box - Sidebar style */
.analogy-box {
  background: #fff;
  border: 3px double #1a1a1a;
  padding: 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: #2a2a2a;
  line-height: 1.8;
  position: relative;
}

.analogy-box::before {
  content: '※';
  position: absolute;
  top: -15px;
  left: 20px; /* از right به left تغییر کرد برای راست‌چین */
  background: #f5f1e8;
  padding: 0 0.5rem;
  font-size: 1.5rem;
}

.analogy-box .analogy-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: block;
  filter: grayscale(1);
}

/* Choice Section */
.choice-section {
  margin-top: 1.5rem;
  border-top: 2px dashed #1a1a1a;
  padding-top: 1.5rem;
}

.choice-question {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1rem;
  text-align: center;
  font-family: Vazirmatn, monospace;
}

.choices-grid {
  display: grid;
  gap: 0.8rem; /* فاصله بین دکمه‌ها کمتر شد */
}

.choice-btn {
  background: #fff;
  border: 3px solid #1a1a1a;
  color: #1a1a1a;
  font-family: Vazirmatn, monospace;
  font-size: 0.95rem;
  padding: 1rem 1rem 1rem 2.5rem; /* فضای کافی سمت چپ برای فلش */
  cursor: pointer;
  text-align: right;
  transition: all 0.3s;
  line-height: 1.7;
  position: relative;
}

.choice-btn::before {
  content: '◀'; /* فلش به سمت چپ در زبان فارسی منطقی‌تر است */
  position: absolute;
  left: 1rem; /* در سمت چپ دکمه قرار می‌گیرد */
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all 0.3s;
}

.choice-btn:hover {
  background: #1a1a1a;
  color: #f5f1e8;
  transform: translateX(5px); /* حرکت به سمت چپ در زمان هاور */
  box-shadow: -5px 5px 0 rgba(0,0,0,0.2);
}

.choice-btn:hover::before {
  opacity: 1;
  left: 1.5rem;
}

.choice-btn.selected-good {
  background: #1a1a1a;
  color: #f5f1e8;
  border-style: double;
}

.choice-btn.selected-bad {
  background: #fff;
  color: #1a1a1a;
  border-style: dashed;
  opacity: 0.6;
}

.choice-btn:disabled {
  cursor: default;
}

/* Result Box - Breaking News Style */
.result-box {
  background: #fff;
  border: 4px double #1a1a1a;
  padding: 1.2rem;
  margin-top: 1.5rem;
  display: none;
  animation: slideIn 0.5s ease;
  position: relative;
}

.result-box::before {
  content: '✦ نتیجه ✦';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: #f5f1e8;
  padding: 0 1rem;
  font-size: 0.8rem;
  font-weight: 700;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* جهت بردرها برای حالت راست‌چین اصلاح شد */
.result-box.good { border-right: 8px solid #1a1a1a; }
.result-box.bad { border-left: 8px solid #1a1a1a; }

.result-title {
  font-weight: 900;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.result-text {
  font-size: 0.9rem;
  color: #4a4a4a;
  line-height: 1.8;
}

/* Stats Panel - Newspaper Info Box */
.stats-panel {
  background: #fff;
  border: 3px double #1a1a1a;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}

.stat-item .stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  display: block;
  font-family: Vazirmatn, monospace;
}

.stat-item .stat-label {
  font-size: 0.7rem;
  color: #4a4a4a;
  margin-top: 0.2rem;
  font-weight: bold;
}

/* Next Button */
.next-btn {
  width: 100%;
  background: #1a1a1a;
  border: 3px solid #1a1a1a;
  color: #f5f1e8;
  font-family: Vazirmatn, monospace;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.3s;
  display: none;
}

.next-btn:hover {
  background: #f5f1e8;
  color: #1a1a1a;
  box-shadow: -5px 5px 0 #1a1a1a;
}

/* Progress Dots */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.dot {
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid #1a1a1a;
  transition: all 0.3s;
}

.dot.active { 
  background: #1a1a1a;
  transform: scale(1.3);
}

.dot.done { 
  background: #4a4a4a;
}

/* Vintage print effect */
@keyframes printNoise {
  0%, 100% { opacity: 0.02; }
  50% { opacity: 0.05; }
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  animation: printNoise 4s infinite;
  mix-blend-mode: multiply;
}

/* End Screen */
#end-screen {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.end-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  font-family: Vazirmatn, monospace;
  border-top: 4px double #1a1a1a;
  border-bottom: 4px double #1a1a1a;
  padding: 1rem 0;
}

.final-score-card {
  background: #fff;
  border: 4px double #1a1a1a;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: -8px 8px 0 rgba(0,0,0,0.1);
}

.score-circle {
  width: 120px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2.5rem;
  font-weight: 900;
  border: 5px solid #1a1a1a;
  background: #fff;
  font-family: Vazirmatn, monospace;
}

.lesson-list {
  text-align: right;
  margin-top: 1.5rem;
  border-top: 2px dashed #1a1a1a;
  padding-top: 1.5rem;
}

.lesson-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #2a2a2a;
  line-height: 1.8;
}

.restart-btn {
  background: #1a1a1a;
  border: 3px solid #1a1a1a;
  color: #f5f1e8;
  font-family: Vazirmatn, monospace;
  font-size: 1rem;
  padding: 0.8rem 2rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.3s;
}

.restart-btn:hover { 
  background: #f5f1e8;
  color: #1a1a1a;
  box-shadow: -5px 5px 0 #1a1a1a;
}

/* Radio wave animation - vintage style */
.radio-wave {
  display: inline-block;
  position: relative;
}

.radio-wave::after {
  content: '📻';
  position: absolute;
  left: -35px; /* تنظیم برای حالت راست‌چین */
  top: 0;
  animation: vintageWave 2s infinite;
  filter: grayscale(1);
}

@keyframes vintageWave {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.6; transform: scale(0.9) rotate(-5deg); }
}

/* Mobile */
@media (max-width: 600px) {
  #intro-screen { 
    border-width: 8px; 
    padding: 1.5rem 1rem;
  }
  .story-title { font-size: 1.3rem; }
  .stat-item .stat-value { font-size: 1.3rem; }
  .game-header { padding: 0.8rem; }
  #game-screen { padding: 1rem 0.8rem; }
  .story-card { padding: 1.2rem; }
}



    /* ═══ CREDIT CARD — Vintage Newspaper Style ═══ */

.credit-card {
  background: #fff;
  border: 4px double #1a1a1a;
  padding: 2rem 1.5rem;
  margin: 2rem auto;
  max-width: 520px;
  text-align: center;
  position: relative;
  box-shadow: -8px 8px 0 rgba(0,0,0,0.1);
}

/* ستاره‌های بالای کارت مثل story-card */
.credit-card::before {
  content: '✦ سازنده ✦';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #f5f1e8;
  padding: 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1a1a1a;
}

/* خط زینتی پایین عنوان */
.credit-card::after {
  content: '— ✦ —';
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: #4a4a4a;
  margin-top: 1.2rem;
  letter-spacing: 0.3em;
}

.credit-avatar {
  font-size: 3rem;
  margin-bottom: 0.6rem;
  display: block;
  filter: grayscale(1) contrast(1.2);
  animation: flicker 3s infinite;
}

/* همان flicker پرولوگ */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.82; }
  75%       { opacity: 0.95; }
}

.credit-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: #1a1a1a;
  font-family: Vazirmatn, monospace;
  margin: 0 0 0.6rem 0;

  /* زیر عنوان مثل story-title */
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 0.6rem;
}

.credit-role-tag {
  display: inline-block;
  background: #1a1a1a;
  color: #f5f1e8;
  padding: 0.2rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  font-family: Vazirmatn, monospace;
}

.credit-bio {
  font-size: 0.9rem;
  color: #2a2a2a;
  line-height: 1.95;
  text-align: justify;
  margin: 0.6rem 0 0 0;
}

/* هایلایت‌های داخل بیو — هماهنگ با .highlight و .danger متن داستان */
.credit-bio .hi {
  background: #1a1a1a;
  color: #f5f1e8;
  padding: 0 0.25rem;
  font-weight: 700;
}

.credit-bio .em {
  border-bottom: 3px solid #1a1a1a;
  font-weight: 700;
}

/* جداکننده خط‌چین بین بخش‌های بیو */
.credit-divider {
  border: none;
  border-top: 2px dashed #1a1a1a;
  margin: 1rem 0;
}

/* دکمه حمایت — مثل start-btn */
.credit-support-btn {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.75rem 2.2rem;
  background: #1a1a1a;
  border: 3px solid #1a1a1a;
  color: #f5f1e8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: Vazirmatn, monospace;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.credit-support-btn:hover {
  background: #f5f1e8;
  color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: -5px 5px 0 #1a1a1a;
}

.credit-thanks {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: #4a4a4a;
  font-style: italic;
  border-top: 1px solid rgba(0,0,0,0.12);
  padding-top: 0.8rem;
}

.success {
  text-decoration: underline;
  text-decoration-style: double;
  font-weight: 700;
}