/* ============================================================
   RAJ Mark Hunt — شکار نشان
   استایل اختصاصی همین بازی. همهٔ سلکتورها با پیشوند .rmh- نام‌فضا
   شده‌اند و هیچ توکن سراسری بازتعریف نمی‌شود؛ توکن‌ها از style.css
   واقعی سایت خوانده می‌شوند.
   ============================================================ */

.rmh-body {
  background: var(--warm);
}

.rmh-play {
  padding-block: clamp(26px, 4vw, 44px);
}

/* ---------- سرصفحه و مسیر ---------- */

.rmh-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.rmh-crumbs a {
  color: var(--blue);
  text-decoration: none;
}
.rmh-crumbs a:hover,
.rmh-crumbs a:focus-visible {
  text-decoration: underline;
}
.rmh-crumbs [aria-current="page"] {
  color: var(--carbon);
}
.rmh-crumbs-sep {
  color: var(--hairline-strong);
}

.rmh-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.05fr;
  gap: clamp(28px, 4vw, 52px);
  align-items: start;
}

.rmh-intro h1 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.25;
}
.rmh-lead {
  margin-top: 14px;
}
.rmh-inline-note {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.95;
}
.rmh-actions {
  margin-top: 22px;
}
.rmh-steps {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.rmh-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--carbon);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 14px;
}
.rmh-step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ocean);
  color: var(--warm);
  font-size: 0.8rem;
  font-weight: 800;
}
.rmh-note {
  margin: 16px 0 0;
  font-size: 0.84rem;
  line-height: 1.95;
  color: var(--muted);
}

/* ---------- نوار وضعیت ---------- */

.rmh-side {
  min-width: 0;
}

.rmh-hud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.rmh-hud-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.86rem;
}
.rmh-hud-label {
  color: var(--muted);
}
.rmh-hud-value {
  font-weight: 800;
  color: var(--ocean);
  font-variant-numeric: tabular-nums;
}
.rmh-hud-item.is-low .rmh-hud-value {
  color: var(--danger);
}
.rmh-sound {
  margin-inline-start: auto;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--carbon);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.rmh-sound:hover {
  border-color: var(--blue);
}
.rmh-sound[aria-pressed="true"] {
  background: var(--ocean);
  border-color: var(--ocean);
  color: var(--warm);
}
.rmh-sound:focus-visible,
.rmh-share:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* نوار زمان؛ تزئینی است و عدد زمان متن مستقل دارد */
.rmh-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--soft);
  border: 1px solid var(--hairline);
  overflow: hidden;
  margin-bottom: 14px;
}
.rmh-bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--blue);
  transform-origin: right center;
  transition: transform 120ms linear, background 240ms ease;
}
.rmh-bar-fill.is-low {
  background: var(--muted);
}

/* ---------- صفحهٔ نشانه‌ها ---------- */

.rmh-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rmh-board {
  display: grid;
  gap: clamp(6px, 1.4vw, 10px);
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* اندازهٔ شبکه از دادهٔ سطح می‌آید (۳ تا ۵) */
.rmh-board[data-size="3"] {
  grid-template-columns: repeat(3, 1fr);
}
.rmh-board[data-size="4"] {
  grid-template-columns: repeat(4, 1fr);
}
.rmh-board[data-size="5"] {
  grid-template-columns: repeat(5, 1fr);
}

.rmh-cell {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 90ms ease;
}
.rmh-cell:hover:not([disabled]) {
  border-color: var(--blue);
  color: var(--carbon);
}
.rmh-cell:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  z-index: 1;
}
.rmh-cell[disabled] {
  cursor: default;
}

/* نشانهٔ هندسی داخل هر خانه — SVG درون‌خطی، رنگ از currentColor */
.rmh-mark {
  display: block;
  width: 62%;
  height: 62%;
  color: inherit;
}
.rmh-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* بازخورد کوتاه روی همان خانه — بدون تأخیر در جریان بازی */
.rmh-cell.is-correct {
  background: var(--blue);
  border-color: var(--blue-deep);
  color: var(--warm);
  transform: scale(0.97);
}
.rmh-cell.is-wrong {
  background: var(--surface);
  border-color: var(--danger);
  color: var(--danger);
}
.rmh-cell.is-wrong::after {
  /* ضربدر کوچک، تا بازخورد فقط به رنگ وابسته نباشد */
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--danger);
  clip-path: polygon(14% 0, 50% 34%, 86% 0, 100% 14%, 66% 50%, 100% 86%, 86% 100%, 50% 66%, 14% 100%, 0 86%, 34% 50%, 0 14%);
  opacity: 0.92;
}

/* ---------- راهنما و بازخورد ---------- */

.rmh-hint {
  margin: 0;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-inline-start: 3px solid var(--hairline-strong);
  border-start-end-radius: 12px;
  border-end-end-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.95;
  color: var(--carbon);
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}
.rmh-hint.is-live {
  border-inline-start-color: var(--blue);
}
.rmh-feedback {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--muted);
  min-height: 1.7em;
}
.rmh-feedback.is-good {
  color: var(--blue);
  font-weight: 700;
}
.rmh-feedback.is-bad {
  color: var(--danger);
  font-weight: 700;
}

/* ---------- پنل نتیجه ---------- */

.rmh-result {
  margin-top: 18px;
  background: var(--ocean);
  border-color: var(--ocean);
  scroll-margin-top: 84px;
}
.rmh-result .frame-title {
  color: var(--warm);
}
.rmh-result-line {
  margin: 0 0 16px;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--warm);
  line-height: 1.8;
}
.rmh-result-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0 0 16px;
  padding: 0;
}
.rmh-result-facts > div {
  display: grid;
  gap: 6px;
  align-content: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--hairline-dark);
  border-radius: var(--radius-sm);
  background: rgba(247, 245, 240, 0.05);
}
.rmh-result-facts dt {
  font-size: 0.78rem;
  color: var(--muted-on-dark);
}
.rmh-result-facts dd {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--warm);
}
.rmh-failed {
  margin: 0 0 14px;
  color: var(--muted-on-dark);
  font-size: 0.88rem;
  line-height: 1.9;
}
.rmh-record {
  margin: 0 0 14px;
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--warm);
  font-size: 0.86rem;
  font-weight: 800;
}
.rmh-storage-note {
  margin: 0 0 14px;
  color: var(--muted-on-dark);
  font-size: 0.84rem;
  line-height: 1.9;
}
.rmh-result .cta-row {
  margin-top: 4px;
}
/* وقتی پنل نتیجه تا انتها اسکرول می‌شود، داک تماس ثابت روی دکمه‌ها نیفتد */
.rmh-result .rmh-actions {
  scroll-margin-bottom: 96px;
}
.rmh-share {
  border: 1px solid var(--hairline-dark);
  background: transparent;
  color: var(--warm);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}
.rmh-share:hover {
  background: rgba(247, 245, 240, 0.08);
}
.rmh-share-status {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: var(--blue-on-dark);
  min-height: 1.4em;
}
.rmh-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* رفع کنتراست در نوار خاکستری (همان راه‌حل پالس راژ؛ توکن سراسری دست‌نخورده) */
.rmh-help-section .eyebrow {
  color: var(--blue-deep);
}
.rmh-help-section .eyebrow::before {
  background: var(--blue-deep);
}
.rmh-help-section .process-step h3 {
  font-size: 1.02rem;
}
.rmh-help-section .process-step p {
  font-size: 0.9rem;
  line-height: 1.95;
}

/* ---------- واکنش‌گرایی ---------- */

@media (max-width: 960px) {
  .rmh-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .rmh-steps {
    margin-top: 18px;
  }
}

@media (max-width: 620px) {
  .rmh-play {
    padding-block: 20px 26px;
  }
  .rmh-hud-item {
    padding: 5px 10px;
    font-size: 0.8rem;
  }
  .rmh-sound {
    padding: 5px 12px;
    font-size: 0.8rem;
  }
  .rmh-board {
    max-width: 360px;
  }
  /* در عرض کم هم دو ستون می‌ماند تا پنل نتیجه در یک صفحه جا شود */
  .rmh-result-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }
  .rmh-result-facts > div {
    padding: 8px 10px;
    gap: 4px;
  }
  /* آخرین قلم (بهترین رکورد) تمام‌عرض می‌شود، پس پنج قلم در سه سطر می‌نشیند */
  .rmh-result-facts > div:last-child {
    grid-column: 1 / -1;
  }
  .rmh-result-facts dt {
    font-size: 0.76rem;
  }
  .rmh-result-facts dd {
    font-size: 0.94rem;
  }
  .rmh-result-line {
    font-size: 1rem;
    margin-bottom: 12px;
  }
  .rmh-result .cta-row {
    gap: 10px;
  }
  .rmh-hint,
  .rmh-feedback {
    font-size: 0.88rem;
  }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
  .rmh-cell,
  .rmh-cell::after,
  .rmh-bar-fill,
  .rmh-hint,
  .rmh-sound,
  .rmh-share {
    transition: none;
  }
  .rmh-cell.is-correct {
    transform: none;
  }
}
