/* MetaPuls Hardware & Performance Analyzer — panel styles.
   Scoped entirely under .mpa so nothing here can reach the rest of the page.
   Written against the site's own palette (layouts/app.blade.php: mp-hero,
   mp-card) rather than a new design language. */

.mpa {
  --mpa-bg: #0b1020;
  --mpa-panel: rgba(255, 255, 255, .045);
  --mpa-panel-2: rgba(255, 255, 255, .028);
  --mpa-line: rgba(255, 255, 255, .1);
  --mpa-line-soft: rgba(255, 255, 255, .06);
  --mpa-text: #e8eaf2;
  --mpa-dim: #97a0b8;
  --mpa-accent: #a78bfa;
  --mpa-accent-2: #60a5fa;
  --mpa-ok: #34d399;
  --mpa-warn: #fbbf24;
  --mpa-bad: #f87171;
  --mpa-radius: 18px;

  position: relative;
  color: var(--mpa-text);
  font-variant-numeric: tabular-nums;
  border-radius: var(--mpa-radius);
  border: 1px solid var(--mpa-line);
  background:
    radial-gradient(820px 300px at 12% -20%, rgba(124, 58, 237, .30), transparent 60%),
    radial-gradient(760px 300px at 88% -10%, rgba(37, 99, 235, .26), transparent 60%),
    linear-gradient(160deg, #0b1020, #141a33 55%, #1b1338);
  padding: clamp(20px, 3.4vw, 40px);
  overflow: hidden;
}

.mpa::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 78%);
  mask-image: radial-gradient(70% 60% at 50% 0%, #000, transparent 78%);
  pointer-events: none;
}

.mpa > * { position: relative; }

/* ── head ─────────────────────────────────────────────────────────────── */

.mpa-head { text-align: center; max-width: 62ch; margin: 0 auto 22px; }

.mpa-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 999px;
  background: rgba(167, 139, 250, .14);
  border: 1px solid rgba(167, 139, 250, .32);
  color: #ddd0ff;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}

.mpa-title {
  margin: 14px 0 10px;
  font-size: clamp(23px, 3vw, 36px); font-weight: 700; line-height: 1.18;
  background: linear-gradient(100deg, #ffffff, #cfd7ff 45%, #e9d5ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.mpa-sub { margin: 0; color: var(--mpa-dim); font-size: 15px; line-height: 1.6; }

.mpa-status {
  margin: 0 0 14px; text-align: center;
  font-size: 12.5px; color: var(--mpa-dim); min-height: 1em;
}

/* ── chips ────────────────────────────────────────────────────────────── */

.mpa-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }

.mpa-chip {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%;
  padding: 8px 13px; border-radius: 12px;
  background: var(--mpa-panel); border: 1px solid var(--mpa-line);
  font-size: 12.5px;
}

.mpa-chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.mpa-ic { flex: 0 0 auto; opacity: .85; }

/* the honesty tags — Detected / Estimated / Measured / Unknown */
.mpa-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 2.5px 7px; border-radius: 6px; white-space: nowrap;
  border: 1px solid transparent;
}
.mpa-tag-measured    { background: rgba(52, 211, 153, .15); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); }
.mpa-tag-detected    { background: rgba(96, 165, 250, .15); color: #93c5fd; border-color: rgba(96, 165, 250, .3); }
.mpa-tag-estimated   { background: rgba(251, 191, 36, .14); color: #fcd34d; border-color: rgba(251, 191, 36, .28); }
.mpa-tag-unknown     { background: rgba(148, 163, 184, .14); color: #cbd5e1; border-color: rgba(148, 163, 184, .28); }
.mpa-tag-unsupported { background: rgba(248, 113, 113, .13); color: #fca5a5; border-color: rgba(248, 113, 113, .28); }

/* ── buttons ──────────────────────────────────────────────────────────── */

.mpa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 14px;
  font-size: 14.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.mpa-btn:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; }

.mpa-btn-primary {
  color: #fff;
  background: linear-gradient(100deg, #7c3aed, #2563eb);
  box-shadow: 0 10px 30px rgba(88, 50, 200, .38);
}
.mpa-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(88, 50, 200, .5); }

.mpa-btn-ghost {
  color: var(--mpa-text); background: var(--mpa-panel); border-color: var(--mpa-line);
}
.mpa-btn-ghost:hover { background: rgba(255, 255, 255, .09); }
.mpa-btn-sm { padding: 9px 18px; font-size: 13px; }

/* ── idle / detecting skeleton ────────────────────────────────────────── */

.mpa-detecting { display: grid; gap: 18px; justify-items: center; }
.mpa-skel-chips { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }
.mpa-skel {
  display: block; height: 36px; width: 150px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05));
  background-size: 200% 100%;
  animation: mpa-shimmer 1.5s linear infinite;
}
.mpa-skel-cta { width: 210px; height: 48px; border-radius: 14px; }
@keyframes mpa-shimmer { to { background-position: -200% 0; } }

.mpa-ready { display: grid; gap: 22px; justify-items: center; }
.mpa-ready-cta { display: grid; gap: 12px; justify-items: center; }

.mpa-privacy {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 0; max-width: 56ch; text-align: start;
  font-size: 11.5px; line-height: 1.55; color: var(--mpa-dim);
}

/* ── running ──────────────────────────────────────────────────────────── */

.mpa-running {
  display: grid; gap: 22px; align-items: start;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
@media (max-width: 720px) { .mpa-running { grid-template-columns: 1fr; } }

.mpa-preview {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--mpa-line);
  background: #05070f; aspect-ratio: 16 / 9;
}
.mpa-canvas { display: block; width: 100%; height: 100%; }

.mpa-stages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 9px; }
.mpa-stage {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--mpa-dim); opacity: .55;
  transition: opacity .2s ease, color .2s ease;
}
.mpa-stage-dot {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--mpa-line); background: var(--mpa-panel-2);
}
.mpa-stage-dot .mpa-ic { opacity: 0; }
.mpa-stage.is-active { opacity: 1; color: var(--mpa-text); }
.mpa-stage.is-active .mpa-stage-dot { border-color: var(--mpa-accent); box-shadow: 0 0 0 4px rgba(167,139,250,.14); }
.mpa-stage.is-done { opacity: .85; color: var(--mpa-text); }
.mpa-stage.is-done .mpa-stage-dot { background: rgba(52,211,153,.18); border-color: rgba(52,211,153,.5); color: #6ee7b7; }
.mpa-stage.is-done .mpa-stage-dot .mpa-ic { opacity: 1; }

.mpa-progress {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, .08); margin-bottom: 16px;
}
.mpa-progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #60a5fa);
  transition: width .35s ease;
}

/* ── alerts ───────────────────────────────────────────────────────────── */

.mpa-alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 15px 17px; border-radius: 14px; margin-bottom: 16px;
  font-size: 13.5px; line-height: 1.55;
}
.mpa-alert p { margin: 5px 0 0; color: var(--mpa-dim); }
.mpa-alert-bad  { background: rgba(248,113,113,.1);  border: 1px solid rgba(248,113,113,.32); color: #fecaca; }
.mpa-alert-warn { background: rgba(251,191,36,.09);  border: 1px solid rgba(251,191,36,.3);  color: #fde68a; }

/* ── result: score card ───────────────────────────────────────────────── */

.mpa-result { display: grid; gap: 26px; }

.mpa-scorecard {
  display: grid; gap: 26px; align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 22px; border-radius: var(--mpa-radius);
  background: var(--mpa-panel); border: 1px solid var(--mpa-line);
}
@media (max-width: 620px) { .mpa-scorecard { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

.mpa-score-ring { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }
.mpa-ring { width: 100%; height: 100%; }
.mpa-ring-bg { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 11; }
.mpa-ring-fg {
  fill: none; stroke-width: 11; stroke-linecap: round;
  transition: stroke-dasharray .9s cubic-bezier(.22,.8,.3,1);
}
.mpa-score-num {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 0; text-align: center;
}
.mpa-score-num b { font-size: 42px; font-weight: 800; line-height: 1; }
.mpa-score-num span { font-size: 11.5px; color: var(--mpa-dim); margin-top: 4px; }

.mpa-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
}
@supports not (color: color-mix(in srgb, red 10%, blue)) {
  .mpa-badge { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
}

.mpa-verdict { margin: 11px 0 8px; font-size: 16.5px; line-height: 1.55; }

.mpa-accel {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0; font-size: 12.5px; color: var(--mpa-dim);
}
.mpa-accel-active, .mpa-accel-likely-active { color: #6ee7b7; }
.mpa-accel-possibly-disabled { color: #fcd34d; }
.mpa-accel-disabled, .mpa-accel-unavailable { color: #fca5a5; }

.mpa-compare {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 13px 0 0; padding: 9px 13px; border-radius: 11px;
  background: var(--mpa-panel-2); border: 1px solid var(--mpa-line-soft);
  font-size: 12.5px; color: var(--mpa-dim);
}
.mpa-compare b { color: var(--mpa-text); font-size: 14px; }
.mpa-compare.is-up i { color: var(--mpa-ok); font-style: normal; }
.mpa-compare.is-down i { color: var(--mpa-warn); font-style: normal; }

/* ── metric cards ─────────────────────────────────────────────────────── */

.mpa-metrics {
  display: grid; gap: 11px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}

.mpa-metric {
  padding: 14px 16px; border-radius: 14px;
  background: var(--mpa-panel); border: 1px solid var(--mpa-line);
  transition: border-color .2s ease, background .2s ease;
}
.mpa-metric:hover { border-color: rgba(255,255,255,.2); }
.mpa-metric > summary {
  display: grid; align-items: center; gap: 4px 10px; cursor: pointer; list-style: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.mpa-metric > summary::-webkit-details-marker { display: none; }
.mpa-metric > summary:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; border-radius: 8px; }
.mpa-metric-name { font-size: 13px; color: var(--mpa-dim); }
.mpa-metric-score { font-size: 25px; font-weight: 800; line-height: 1; justify-self: end; }
.mpa-metric-word { font-size: 12px; font-weight: 700; text-align: end; max-width: 15ch; line-height: 1.3; }
.mpa-metric-bar {
  grid-column: 1 / -1; height: 5px; border-radius: 999px; margin-top: 9px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.mpa-metric-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.22,.8,.3,1); }
.mpa-metric-exp { margin: 12px 0 9px; font-size: 12.5px; line-height: 1.6; color: var(--mpa-dim); }

/* ── charts ───────────────────────────────────────────────────────────── */

.mpa-charts {
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
}
@media (max-width: 760px) { .mpa-charts { grid-template-columns: 1fr; } }

.mpa-chart {
  margin: 0; padding: 15px 17px; border-radius: 14px;
  background: var(--mpa-panel); border: 1px solid var(--mpa-line);
  display: flex; flex-direction: column; gap: 9px;
}
.mpa-chart figcaption {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mpa-dim);
}
.mpa-chart svg { width: 100%; height: auto; overflow: visible; }
.mpa-chart-note { font-size: 11px; color: var(--mpa-dim); }

.mpa-radar-grid { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 1; }
.mpa-radar-fill { fill: rgba(167,139,250,.26); stroke: #a78bfa; stroke-width: 1.8; stroke-linejoin: round; }
.mpa-radar-dot { fill: #c4b5fd; }
.mpa-radar-label { fill: #a8b0c6; font-size: 9.5px; font-family: inherit; }
.mpa-radar-label.mpa-dim { fill: #6b7490; }

.mpa-fchart-area { fill: rgba(96,165,250,.16); stroke: none; }
.mpa-fchart-line { fill: none; stroke: #60a5fa; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.mpa-fchart-target { stroke: #34d399; stroke-width: 1.2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }

/* ── recommended settings ─────────────────────────────────────────────── */

.mpa-settings, .mpa-insights, .mpa-recs {
  padding: 18px 20px; border-radius: var(--mpa-radius);
  background: var(--mpa-panel-2); border: 1px solid var(--mpa-line-soft);
}
.mpa-settings h3, .mpa-insights h3 {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  margin: 0 0 14px; font-size: 13px; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase; color: var(--mpa-dim);
}
.mpa-tier {
  padding: 4px 12px; border-radius: 999px; font-size: 11px; letter-spacing: .06em;
  background: rgba(167,139,250,.16); border: 1px solid rgba(167,139,250,.35); color: #ddd0ff;
}
.mpa-tier[data-tier="mobile"] { background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.33); color: #fde68a; }

.mpa-setgrid {
  display: grid; gap: 10px; margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.mpa-setgrid > div {
  padding: 11px 13px; border-radius: 11px;
  background: var(--mpa-panel); border: 1px solid var(--mpa-line-soft);
}
.mpa-setgrid dt { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--mpa-dim); }
.mpa-setgrid dd { margin: 5px 0 0; font-size: 14.5px; font-weight: 700; }

/* ── insights ─────────────────────────────────────────────────────────── */

.mpa-insights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mpa-insights li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; line-height: 1.55; color: var(--mpa-text);
}
.mpa-insights li .mpa-ic { margin-top: 2px; }
.mpa-ins-ok .mpa-ic { color: var(--mpa-ok); }
.mpa-ins-no .mpa-ic { color: var(--mpa-warn); }
.mpa-ins-neutral { color: var(--mpa-dim); }
.mpa-ins-neutral .mpa-ic { color: var(--mpa-accent-2); }

/* ── recommendations ──────────────────────────────────────────────────── */

.mpa-bottleneck {
  display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap;
  padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--mpa-line-soft);
}
.mpa-bn-label { font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--mpa-dim); }
.mpa-bottleneck b { font-size: 15px; }
.mpa-bottleneck[data-sev="critical"] b { color: var(--mpa-bad); }
.mpa-bottleneck[data-sev="high"] b { color: var(--mpa-warn); }
.mpa-bottleneck[data-sev="none"] b { color: var(--mpa-ok); }

.mpa-rec-label { font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--mpa-dim); }
.mpa-rec-main p { margin: 7px 0 0; font-size: 14.5px; line-height: 1.65; }

/* ── disclosures ──────────────────────────────────────────────────────── */

.mpa-disclose { margin-top: 14px; }
.mpa-disclose > summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 9px 15px; border-radius: 11px;
  background: var(--mpa-panel); border: 1px solid var(--mpa-line);
  font-size: 12.5px; font-weight: 600; color: var(--mpa-text);
}
.mpa-disclose > summary::-webkit-details-marker { display: none; }
.mpa-disclose > summary:hover { background: rgba(255,255,255,.09); }
.mpa-disclose > summary:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; }
.mpa-disclose[open] > summary { border-color: rgba(167,139,250,.4); }

.mpa-steps { margin: 13px 0 0; padding-inline-start: 22px; display: grid; gap: 10px; }
.mpa-steps li { font-size: 13px; line-height: 1.65; color: var(--mpa-dim); }

.mpa-tech { margin-top: 2px; }
.mpa-techgrid {
  display: grid; gap: 1px; margin: 14px 0 0;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: var(--mpa-line-soft); border: 1px solid var(--mpa-line-soft);
  border-radius: 13px; overflow: hidden;
}
.mpa-techgrid > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 10px 14px; background: #10152a;
}
.mpa-techgrid dt { font-size: 11.5px; color: var(--mpa-dim); flex: 0 0 auto; }
.mpa-techgrid dd {
  margin: 0; font-size: 12px; text-align: end;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end;
  overflow-wrap: anywhere;
}
.mpa-dim { color: var(--mpa-dim); }

/* ── actions ──────────────────────────────────────────────────────────── */

.mpa-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── reduced motion: nothing moves that does not have to ──────────────── */

@media (prefers-reduced-motion: reduce) {
  .mpa-skel { animation: none; }
  .mpa-ring-fg, .mpa-metric-bar > i, .mpa-progress > i,
  .mpa-btn, .mpa-metric { transition: none !important; }
  .mpa-btn-primary:hover { transform: none; }
}

/* ── a light-theme fallback, in case the site ever stops forcing dark ─── */

@media (prefers-color-scheme: light) {
  html:not(.dark) .mpa {
    --mpa-text: #0f172a;
    --mpa-dim: #475569;
    --mpa-panel: rgba(15, 23, 42, .04);
    --mpa-panel-2: rgba(15, 23, 42, .025);
    --mpa-line: rgba(15, 23, 42, .1);
    --mpa-line-soft: rgba(15, 23, 42, .07);
    background: linear-gradient(160deg, #f8fafc, #eef2ff 55%, #faf5ff);
  }
  html:not(.dark) .mpa-title {
    background: linear-gradient(100deg, #1e1b4b, #4338ca 50%, #7c3aed);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  html:not(.dark) .mpa-techgrid > div { background: #ffffff; }
  html:not(.dark) .mpa::before { opacity: .5; }
}

/* ── the headline answer: what MetaPuls itself would run at here ──────── */

.mpa-fps {
  display: inline-flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  margin: 12px 0 0; padding: 9px 15px; border-radius: 12px;
  background: rgba(96, 165, 250, .1); border: 1px solid rgba(96, 165, 250, .26);
}
.mpa-fps-label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--mpa-dim); }
.mpa-fps b { font-size: 26px; font-weight: 800; color: #bfdbfe; line-height: 1; }
.mpa-fps-unit { font-size: 12px; color: var(--mpa-dim); }
.mpa-fps-note { margin: 7px 0 0; font-size: 11.5px; color: var(--mpa-dim); }

/* ── RTL: keep technical values left-to-right ─────────────────────────────
   In a right-to-left paragraph the bidi algorithm reorders a run like
   "1920 × 1080 · 1×" into "×1 · 1080 × 1920", because the × and · are neutral
   characters that take the paragraph's direction. Resolutions, GPU names,
   versions and frame rates are LTR technical text wherever they appear, so each
   one is isolated rather than left to inherit the surrounding direction. */

.mpa[dir="rtl"] .mpa-chip-txt,
.mpa[dir="rtl"] .mpa-techgrid dd,
.mpa[dir="rtl"] .mpa-setgrid dd,
.mpa[dir="rtl"] .mpa-metric-score,
.mpa[dir="rtl"] .mpa-score-num,
.mpa[dir="rtl"] .mpa-fps b,
.mpa[dir="rtl"] .mpa-compare b,
.mpa[dir="rtl"] .mpa-chart-note {
  direction: ltr;
  unicode-bidi: isolate;
}

/* the technical grid's value column reads from the left once isolated */
.mpa[dir="rtl"] .mpa-techgrid dd { justify-content: flex-start; text-align: start; }
.mpa[dir="rtl"] .mpa-metric-word { direction: rtl; }

/* the stage list's tick column belongs on the reading side */
.mpa[dir="rtl"] .mpa-steps { padding-inline-start: 22px; }
