/* Styles for Game 008: Spot the Mistake (أين الخطأ؟) */

.sm-page {
  padding: 24px 0 48px;
}

.sm-hero {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 20px 24px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sm-hero__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sm-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sm-hero__title {
  margin: 0;
  font-size: 1.55rem;
  color: var(--pl-navy);
  line-height: 1.3;
}

.sm-hero__subtitle {
  margin: 0;
  color: var(--pl-text-secondary);
  font-size: 0.96rem;
}

.sm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* HUD Strip */
.sm-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.sm-hud__card {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sm-hud__label {
  font-size: 0.78rem;
  color: var(--pl-text-muted);
  font-weight: 600;
}

.sm-hud__value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--pl-navy);
}

.sm-hud__value--danger {
  color: var(--pl-danger);
}

/* Scene Stepper */
.sm-stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.sm-step {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--pl-text-muted);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.sm-step__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pl-surface-alt);
  color: var(--pl-text-secondary);
  font-weight: 800;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sm-step__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.sm-step--current {
  border-color: var(--pl-gold);
  background: var(--pl-gold-tint);
  color: var(--pl-navy);
}

.sm-step--current .sm-step__num {
  background: var(--pl-gold);
  color: var(--pl-navy);
}

.sm-step--done {
  border-color: var(--pl-success);
  background: #f0fdf4;
  color: #166534;
}

.sm-step--done .sm-step__num {
  background: var(--pl-success);
  color: #ffffff;
}

/* Main Workspace */
.sm-workspace {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.sm-scene-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sm-scene-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  color: var(--pl-navy);
}

.sm-scene-prompt {
  margin: 0;
  color: var(--pl-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.sm-scene-meta {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* SVG Stage */
.sm-stage-wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto 18px;
  border-radius: var(--pl-radius);
  overflow: hidden;
  border: 2px solid var(--pl-border-strong);
  background: #f8fafc;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.sm-scene-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 540 / 340;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sm-svg-hotspot {
  cursor: pointer;
  outline: none;
}

.sm-svg-hotspot .sm-hotspot-ring {
  fill: transparent;
  stroke: transparent;
  stroke-width: 3;
  stroke-dasharray: 6 4;
  transition: stroke 0.18s ease, fill 0.18s ease;
}

.sm-svg-hotspot:hover .sm-hotspot-ring,
.sm-svg-hotspot:focus-visible .sm-hotspot-ring {
  stroke: rgba(245, 158, 11, 0.75);
  fill: rgba(245, 158, 11, 0.08);
}

.sm-svg-hotspot--selected .sm-hotspot-ring {
  stroke: #d97706 !important;
  stroke-dasharray: none !important;
  fill: rgba(245, 158, 11, 0.14) !important;
}

.sm-svg-hotspot--solved .sm-hotspot-ring {
  stroke: #16a34a !important;
  stroke-dasharray: none !important;
  fill: rgba(22, 163, 74, 0.15) !important;
}

.sm-svg-hotspot--wrong .sm-hotspot-ring {
  stroke: #dc2626 !important;
  stroke-dasharray: none !important;
  fill: rgba(220, 38, 38, 0.15) !important;
}

/* Item Chips Grid */
.sm-items-section {
  max-width: 720px;
  margin: 0 auto 16px;
}

.sm-items-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--pl-text-secondary);
  margin-bottom: 10px;
}

.sm-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.sm-item-chip {
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--pl-border-strong);
  border-radius: var(--pl-radius);
  background: var(--pl-surface-alt);
  color: var(--pl-navy);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.sm-item-chip:hover:not(:disabled) {
  border-color: var(--pl-gold);
  background: var(--pl-gold-tint);
  transform: translateY(-1px);
}

.sm-item-chip--selected {
  border-color: var(--pl-gold);
  background: var(--pl-gold-tint);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.sm-item-chip--wrong {
  border-color: var(--pl-danger);
  background: #fef2f2;
  color: #991b1b;
}

.sm-item-chip--solved {
  border-color: var(--pl-success);
  background: #f0fdf4;
  color: #166534;
}

.sm-item-chip:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Controls & Feedback */
.sm-controls {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sm-controls__group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sm-feedback {
  max-width: 720px;
  margin: 14px auto 0;
  padding: 12px 16px;
  border-radius: var(--pl-radius);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  display: none;
}

.sm-feedback--visible {
  display: block;
}

.sm-feedback--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.sm-feedback--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.sm-feedback--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Proof Box between scenes */
.sm-proof-box {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 18px 20px;
  border-radius: var(--pl-radius);
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  display: none;
}

.sm-proof-box--visible {
  display: block;
}

.sm-proof-box__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: #166534;
}

.sm-proof-box__text {
  margin: 0 0 14px;
  color: #14532d;
  line-height: 1.65;
  font-size: 0.95rem;
}

/* Hints Box */
.sm-hints-panel {
  margin-top: 18px;
}

.sm-result-wrap {
  margin-top: 20px;
}

/* SEO / Info Card */
.sm-about {
  background: var(--pl-surface);
  border: 1px solid var(--pl-border);
  border-radius: var(--pl-radius-lg);
  padding: 22px 24px;
}

.sm-about h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--pl-navy);
}

.sm-about p {
  margin: 0 0 10px;
  color: var(--pl-text-secondary);
  line-height: 1.75;
}

.sm-about ul {
  margin: 0;
  padding-inline-start: 20px;
  color: var(--pl-text-secondary);
  line-height: 1.8;
}

@media (max-width: 768px) {
  .sm-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm-stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .sm-hero {
    padding: 16px;
  }

  .sm-workspace {
    padding: 14px;
  }

  .sm-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sm-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .sm-controls__group {
    width: 100%;
  }

  .sm-controls .pl-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
