/* === Rug Wash === */

main { max-width: 720px; }

/* --- Tools --- */
.rw-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.rw-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.rw-tool:hover { border-color: var(--primary); transform: translateY(-1px); }
.rw-tool.picked { background: var(--pick-bg); border-color: var(--pick-border); color: var(--primary-dark); font-weight: 700; }
.rw-tool-dot { display: inline-block; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.rw-tool-dot.big { width: 18px; height: 18px; }
.rw-tool-dot.mid { width: 13px; height: 13px; }
.rw-tool-dot.sm  { width: 8px;  height: 8px; }
.rw-tool-dot.jet { width: 14px; height: 14px; background: linear-gradient(90deg, var(--accent), transparent); border-radius: 4px; }
.rw-tool-sep { width: 2px; height: 26px; background: var(--border); border-radius: 2px; align-self: center; margin: 0 0.15rem; }
.rw-soap.picked { background: #eafaf0; border-color: #8fd6ad; color: #2f7d52; }

/* --- Progress --- */
.rw-progress {
  height: 12px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--border);
  overflow: hidden;
  margin-bottom: 1rem;
}
.rw-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 0.2s ease;
}

.rw-hint {
  margin: 0 0 0.8rem;
  padding: 0.55rem 0.85rem;
  background: var(--card);
  border: 2px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.rw-hint b { color: var(--ink); font-weight: 700; }

/* --- Stage --- */
.rw-stage {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #2a2118;
  box-shadow: var(--shadow);
  min-height: 220px;
  touch-action: none;
}
.rw-rug {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rw-dirt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.rw-dirt:active { cursor: grabbing; }
.rw-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.rw-cursor {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.4);
}
/* Scrubber — small chunky pad with a hatched scrub face */
.rw-cursor.scrub {
  border-radius: 3px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.25) 0 2px, transparent 2px 5px),
    rgba(120, 110, 130, 0.25);
}
/* Brush — wide head with bristles along the bottom edge */
.rw-cursor.brush {
  border-radius: 5px 5px 2px 2px;
  background: rgba(180, 130, 80, 0.22);
}
.rw-cursor.brush::after {
  content: "";
  position: absolute;
  left: 1px; right: 1px; bottom: -6px;
  height: 7px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.95) 0 2px, transparent 2px 5px);
}
/* Power washer — narrow nozzle with a spray tip */
.rw-cursor.washer {
  border-radius: 3px;
  background: rgba(120, 200, 255, 0.22);
  border-color: rgba(180, 225, 255, 0.95);
}
.rw-cursor.washer::before {
  content: "";
  position: absolute;
  top: -7px; left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid rgba(180, 225, 255, 0.95);
}
/* Sponge — big soft rounded block, warm tint */
.rw-cursor.sponge {
  border-radius: 28% / 36%;
  background: rgba(255, 232, 130, 0.2);
  border-color: rgba(255, 240, 165, 0.95);
  border-width: 3px;
}
/* Soap applicators — bubbly suds and a degreaser bottle */
.rw-cursor.suds {
  border-radius: 42%;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.95);
}
.rw-cursor.degrease {
  border-radius: 16% 16% 45% 45%;
  background: rgba(150, 230, 185, 0.26);
  border-color: rgba(175, 235, 200, 0.95);
}

/* Little tool icon floating up-and-right of the pointer, like 2000s cursors */
.rw-cursor-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(6px, -34px);
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.rw-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8c8b4;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* --- Done overlay --- */
.rw-done[hidden] { display: none; }
.rw-done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 45%);
  animation: rw-fade 0.6s ease;
}
@keyframes rw-fade { from { opacity: 0; } to { opacity: 1; } }
.rw-done-card {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}
.rw-sparkle { font-size: 1.4rem; }
.rw-title {
  margin: 0.2rem 0 0.3rem;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
}
.rw-meta { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.rw-link { color: var(--primary-dark); font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.rw-link:hover { text-decoration: underline; }

/* --- Actions --- */
.rw-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
#rw-new { background: #fff; font-weight: 700; }
#rw-new:hover { border-color: var(--primary); color: var(--primary-dark); }
.rw-credit { color: var(--muted); font-size: 0.85rem; }
.rw-credit a { color: var(--muted); }
