/* Start position picker (spawn-picker.js). Uses the menu's variables from builder.css, with fallbacks so it also
   works on its own. Flat fills and strokes only: no filters, shadows or animations. */

.sp-root {
  --sp-blue: #3b82f6;
  --sp-red: var(--red, #ef4444);
  --sp-invalid: #fbbf24;
  position: relative;
  color: var(--text, #e8edf3);
}

.sp-map {
  display: block;
  width: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sp-empty .sp-map { display: none; }

/* every hit test is done in script, so the shapes never need pointer events */
.sp-map * { pointer-events: none; }

.sp-frame { fill: var(--bg, #0d1014); stroke: var(--border, #2b323c); }
.sp-field { fill: var(--raised, #1d222a); stroke: #3a4452; stroke-width: 1; }
.sp-field.sp-has-image { fill: none; }
.sp-center { stroke: rgba(255, 255, 255, 0.22); stroke-dasharray: 4 4; }

.sp-blue { --sp-color: var(--sp-blue); }
.sp-red { --sp-color: var(--sp-red); }

.sp-zone { fill: var(--sp-color); fill-opacity: 0.08; }
.sp-zone.sp-own {
  fill-opacity: 0.16;
  stroke: var(--sp-color);
  stroke-opacity: 0.75;
  stroke-dasharray: 5 4;
}

.sp-wall { stroke: var(--sp-color); stroke-width: 4; stroke-linecap: round; }

.sp-landmark { fill: rgba(255, 255, 255, 0.05); stroke: var(--muted, #94a2b2); stroke-opacity: 0.55; }

.sp-label, .sp-landmark-label {
  font: 600 11px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-anchor: middle;
  fill: var(--text, #e8edf3);
  /* a halo in the background color keeps labels readable over lines and field pictures */
  paint-order: stroke;
  stroke: var(--bg, #0d1014);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.sp-landmark-label { font-size: 10px; font-weight: 500; fill: var(--muted, #94a2b2); }
.sp-other-label { font-weight: 500; fill: var(--muted, #94a2b2); }

/* other robots: dimmed outlines */
.sp-other .sp-body { fill: var(--sp-color); fill-opacity: 0.18; stroke: var(--sp-color); stroke-opacity: 0.7; stroke-width: 1.5; }
.sp-other .sp-front { fill: var(--sp-color); fill-opacity: 0.65; }

/* the player's robot */
.sp-robot { outline: none; }
.sp-robot .sp-body { fill: var(--sp-color); fill-opacity: 0.9; stroke: #fff; stroke-opacity: 0.9; stroke-width: 1.5; }
.sp-robot .sp-bumper { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.sp-robot .sp-front { fill: #fff; }
.sp-robot .sp-stem { stroke: var(--text, #e8edf3); stroke-opacity: 0.7; stroke-width: 1.5; }
.sp-robot .sp-handle { fill: var(--panel, #161a20); stroke: var(--text, #e8edf3); stroke-width: 2; }
.sp-robot.sp-hot .sp-handle, .sp-robot.sp-dragging .sp-handle { fill: var(--sp-color); }
.sp-robot .sp-focus { fill: none; stroke: var(--text, #e8edf3); stroke-width: 1.5; stroke-dasharray: 3 2; visibility: hidden; }
.sp-robot:focus .sp-focus { visibility: visible; }
.sp-robot.sp-pointer-focus .sp-focus { visibility: hidden; }

/* a spot that isn't allowed: hollow and dashed in a color that is neither alliance */
.sp-robot.sp-invalid .sp-body { fill-opacity: 0.25; stroke: var(--sp-invalid); stroke-opacity: 1; stroke-dasharray: 4 3; }
.sp-robot.sp-invalid .sp-front, .sp-robot.sp-invalid .sp-bumper { fill: var(--sp-invalid); stroke: var(--sp-invalid); }

.sp-disabled .sp-stem, .sp-disabled .sp-handle { display: none; }
.sp-disabled .sp-robot .sp-body { fill-opacity: 0.6; }

/* ---------- under the map ---------- */

.sp-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.sp-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  min-height: 32px;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  color: var(--text, #e8edf3);
  background: var(--raised, #1d222a);
  border: 1px solid var(--border, #2b323c);
  border-radius: 8px;
  cursor: pointer;
}

.sp-toolbar button:hover { border-color: #445064; }
.sp-toolbar button:focus-visible { outline: 2px solid var(--accent, #3b82f6); outline-offset: 2px; }
.sp-toolbar button:disabled { opacity: 0.5; cursor: default; }

.sp-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sp-readout {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
  text-align: right;
  font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted, #94a2b2);
}

.sp-readout.sp-warn {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--sp-invalid);
}

/* for screen readers only */
.sp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* nothing here animates; keep it that way if transitions are ever added */
@media (prefers-reduced-motion: reduce) {
  .sp-root * { transition: none !important; animation: none !important; }
}
