/* ═══════════════════════════════════════════
   Spec Sheet — RPG-style Skill Section
   ═══════════════════════════════════════════ */

.spec-sheet {
  position: relative;
  overflow: hidden;
}

/* ── Video background ─────────────────────── */
.spec-sheet-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.spec-sheet-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(12px) saturate(0.5);
  transform: scale(1.15);
  opacity: 0.4;
}

.spec-sheet-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 14, 0.88) 0%,
    rgba(10, 10, 14, 0.82) 40%,
    rgba(10, 10, 14, 0.88) 100%
  );
}

.spec-sheet > .container {
  position: relative;
  z-index: 2;
}

/* ── Category ─────────────────────────────── */
.stat-category {
  margin-bottom: 2.25rem;
}

.stat-cat-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-cat-title .stat-icon {
  font-size: 1.1rem;
}

/* ── Stat grid ────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.5rem;
}

/* ── Individual stat row ──────────────────── */
.stat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.stat-row:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.1);
}

.stat-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Segmented pip bar ────────────────────── */
.stat-pips {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.pip {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pip.empty {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.pip.filled.c-vibe {
  background: #8b5cf6;
  border: 1px solid #a78bfa;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.35);
}

.pip.filled.c-familiar {
  background: #3b82f6;
  border: 1px solid #60a5fa;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
}

.pip.filled.c-proficient {
  background: #22c55e;
  border: 1px solid #4ade80;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

.pip.filled.c-advanced {
  background: #eab308;
  border: 1px solid #facc15;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.35);
}

.pip.filled.c-master {
  background: var(--accent-bright);
  border: 1px solid var(--accent-bright);
  box-shadow: 0 0 10px rgba(199, 91, 18, 0.45);
}

/* Hover glow boost */
.stat-row:hover .pip.filled {
  filter: brightness(1.15);
}

/* ── Tier label ───────────────────────────── */
.stat-tier {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-width: 62px;
  text-align: right;
  flex-shrink: 0;
}

.stat-tier.vibe        { color: #a78bfa; }
.stat-tier.familiar    { color: #60a5fa; }
.stat-tier.proficient  { color: #4ade80; }
.stat-tier.advanced    { color: #facc15; }
.stat-tier.master      { color: var(--accent-bright); }

/* ── Legend (sticky bottom of section) ─────── */
.spec-legend {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 2rem;
  padding: 1rem 0 0.5rem;
  background: linear-gradient(0deg, rgba(10,10,14,0.97) 50%, rgba(10,10,14,0) 100%);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.spec-legend.visible {
  opacity: 1;
  transform: translateY(0);
}

.spec-legend-content {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.2rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.legend-tier {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.legend-pip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.legend-pip.vibe       { background: #8b5cf6; box-shadow: 0 0 4px rgba(139,92,246,0.3); }
.legend-pip.familiar   { background: #3b82f6; box-shadow: 0 0 4px rgba(59,130,246,0.3); }
.legend-pip.proficient { background: #22c55e; box-shadow: 0 0 4px rgba(34,197,94,0.3); }
.legend-pip.advanced   { background: #eab308; box-shadow: 0 0 4px rgba(234,179,8,0.3); }
.legend-pip.master     { background: var(--accent-bright); box-shadow: 0 0 4px rgba(199,91,18,0.3); }

/* ── Scroll animation: pips start empty ───── */
.pip.animate-pending {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.07) !important;
  box-shadow: none !important;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 600px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .stat-row {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
  }
  .stat-name {
    font-size: 0.78rem;
    white-space: normal;
  }
  .pip {
    width: 13px;
    height: 13px;
  }
  .stat-tier {
    min-width: 50px;
    font-size: 0.55rem;
  }
  .spec-legend-content {
    gap: 0.8rem;
  }
}
