/* IndieDevTool — Steam Page Score tool
   Lighthouse-style animated gauge + audit breakdown.
   ----------------------------------------------------------- */

.sps-tool { margin-top: 22px; }

/* ---- input card ---- */
.sps-input-card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 22px 24px;
}
.sps-input-card label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 10px;
}
.sps-input-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sps-input-row input {
  flex: 1 1 320px;
  min-width: 0;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: var(--bg-0);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-0);
  font-family: var(--font-sans);
}
.sps-input-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.sps-input-row .btn { flex: 0 0 auto; white-space: nowrap; }
.sps-disclaimer {
  margin: 14px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-3);
  border-left: 2px solid var(--border-2);
  padding-left: 12px;
}
.sps-error {
  margin-top: 12px;
  color: #f3a0a0;
  font-size: 0.9rem;
  display: none;
}
.sps-error.show { display: block; }

/* ---- results ---- */
.sps-results { margin-top: 22px; }
.sps-scorecard {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 26px 28px;
}

/* gauge */
.sps-dial { position: relative; width: 200px; height: 200px; flex: 0 0 auto; }
.sps-dial svg { width: 100%; height: 100%; display: block; }
.sps-dial .track { fill: none; stroke: var(--bg-3); stroke-width: 14; stroke-linecap: round; }
.sps-dial .progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 0 100;           /* empty until JS animates the fill in */
  transition: stroke-dasharray 1.2s cubic-bezier(.16,1,.3,1), stroke 0.4s ease;
}
.sps-dial.tier-low  .progress { stroke: var(--danger); }
.sps-dial.tier-mid  .progress { stroke: var(--warning); }
.sps-dial.tier-good .progress { stroke: var(--success); }
.sps-dial-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sps-dial-num {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}
.sps-dial-num small { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
.sps-dial-label { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-top: 5px; line-height: 1.3; text-align: center; }

/* spinning loader ring (shown while computing; never fully closes) */
.sps-dial.loading .progress { transition: none; stroke-dashoffset: 0; stroke-dasharray: 30 100; transform-origin: 100px 100px; animation: sps-spin 0.9s linear infinite; stroke: url(#sps-spin-grad); }
.sps-dial.loading .track { stroke: var(--bg-3); }
@keyframes sps-spin { to { transform: rotate(360deg); } }
.sps-dial.loading .sps-dial-num { opacity: 0.4; }
@media (prefers-reduced-motion: reduce) {
  .sps-dial .progress { transition: none; }
  .sps-dial.loading .progress { animation: none; stroke-dasharray: 25 100; }
}

/* summary */
.sps-summary { flex: 1 1 280px; min-width: 0; }
.sps-game-name { margin: 0 0 8px; font-size: 1.4rem; }
.sps-state-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-2);
  background: var(--bg-3); color: var(--text-2); margin-bottom: 12px;
}
.sps-state-badge.released { color: #b8f0c2; background: rgba(91,163,43,.15); border-color: rgba(91,163,43,.4); }
.sps-state-badge.unreleased { color: #f4d896; background: rgba(244,185,66,.13); border-color: rgba(244,185,66,.35); }
.sps-headline { color: var(--text-2); font-size: 0.95rem; line-height: 1.6; margin: 0 0 16px; }
.sps-summary .btn { margin-right: 8px; }
.sps-measured { font-size: 0.8rem; color: var(--text-3); margin-top: 10px; }

/* ---- breakdown ---- */
.sps-breakdown { margin-top: 22px; }
.sps-breakdown h3 { font-size: 1.05rem; margin: 0 0 4px; }
.sps-breakdown .sps-sub { font-size: 0.85rem; color: var(--text-3); margin: 0 0 16px; }

.sps-metric {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.sps-metric-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.sps-metric-name { font-weight: 600; color: var(--text-0); font-size: 0.96rem; }
.sps-metric-pts { font-family: var(--font-mono); font-size: 0.86rem; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sps-bar { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; margin-bottom: 10px; }
.sps-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); width: 0; transition: width 0.9s cubic-bezier(.16,1,.3,1); }
.sps-metric.low  .sps-bar > span { background: var(--danger); }
.sps-metric.mid  .sps-bar > span { background: var(--warning); }
.sps-metric.good .sps-bar > span { background: var(--success); }
.sps-metric-info { font-size: 0.88rem; line-height: 1.55; color: var(--text-2); margin: 0; }
.sps-tool-link { display: inline-block; margin-left: 4px; color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.sps-tool-link:hover { color: #9bd5f7; text-decoration: underline; }

.sps-metric.na { opacity: 0.7; }
.sps-metric.na .sps-metric-pts { color: var(--text-3); }

.sps-pass-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-3); font-weight: 600; margin-left: 4px; }
.sps-pass-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
details.sps-pass {
  font-size: 0.82rem; color: #b8f0c2;
  background: rgba(91,163,43,.12); border: 1px solid rgba(91,163,43,.3);
  border-radius: 999px;
}
details.sps-pass > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
}
details.sps-pass > summary::-webkit-details-marker { display: none; }
details.sps-pass .tick { font-weight: 800; }
details.sps-pass .pp { font-family: var(--font-mono); font-size: 0.74rem; opacity: 0.75; }
details.sps-pass[open] {
  flex-basis: 100%; width: 100%;
  border-radius: var(--r-md);
  background: rgba(91,163,43,.07);
}
.sps-pass-detail { margin: 0; padding: 0 14px 12px; font-size: 0.88rem; line-height: 1.55; color: var(--text-1); }

/* ---- responsive ---- */
@media (max-width: 560px) {
  .sps-input-card { padding: 18px; }
  .sps-scorecard { padding: 20px; gap: 18px; justify-content: center; text-align: center; }
  .sps-dial { width: 168px; height: 168px; }
  .sps-dial-num { font-size: 2.5rem; }
  .sps-summary { flex-basis: 100%; }
  .sps-summary .btn { margin: 4px 4px 0 0; }
}
